Organization and trying to do things

master
Kyle Belanger 2019-04-07 02:12:47 -04:00
parent de3c1092ad
commit 7b12d9388c
5 changed files with 37 additions and 40 deletions

View File

@ -5,7 +5,7 @@ flat SLIME01 pic 1 tics 1 pic 1 tics 1
flat FWATER1 pic 1 tics 1 pic 1 tics 1
flat BLOOD1 pic 1 tics 1 pic 1 tics 1
// warping Flats
// Warping Flats
warp2 flat NUKAGE1
warp flat LAVA1
warp2 flat SLIME01

View File

@ -1,44 +1,12 @@
version "3.7.2"
version "3.8"
// Base
#include "ZScript/Util.zs"
#include "ZScript/Player.zs"
#include "ZScript/Weapon.zs"
#include "ZScript/Structs.zs"
#include "ZScript/StatusBar.zs"
// Structs
#include "ZScript/Structs.zs"
// Base
#include "ZScript/Base/Player.zs"
#include "ZScript/Base/Weapon.zs"
class RLHUDHandler : StaticEventHandler
{
RLBasePlayer RLPlayer;
Vector2 Size;
override void OnRegister()
{
Super.OnRegister();
RLPlayer = RLBasePlayer(Players[0].MO);
Size = (320, 240);
}
override void RenderOverlay(RenderEvent e)
{
Super.RenderOverlay(e);
// DrawTexture("MEDIA0", 0, 20);
// DrawBigText("" .. RLPlayer.Medikit, "Brick", 16, 16);
}
ui void DrawBigText(string text, Color color, float x, float y) const
{
Screen.DrawText(Font.FindFont("BIGFONT"), color, x, y, text, DTA_VirtualWidth, int(Size.X), DTA_VirtualHeight, int(Size.Y));
}
ui void DrawTexture(string texture, float x, float y) const
{
Screen.DrawTexture(TexMan.CheckForTexture(texture, TexMan.Type_Any), true, x, y, DTA_VirtualWidth, int(Size.X), DTA_VirtualHeight, int(Size.Y), DTA_CenterOffset, true);
}
}
// Events
#include "ZScript/Events/HUDHandler.zs"

View File

@ -0,0 +1,29 @@
class RLHUDHandler : StaticEventHandler;
ui Vector2 Size;
override void RenderOverlay(RenderEvent e)
{
RLBasePlayer cam = RLBasePlayer(e.Camera);
Size = (320, 240);
if (cam)
DrawMedikit(RLBasePlayer(Players[ConsolePlayer].MO));
}
ui void DrawMedikit(RLBasePlayer player)
{
DrawTexture("MEDIA0", 0, 20);
DrawBigText(string.Format("%d", player.Medikit), "Brick", 16, 16);
}
ui void DrawBigText(string text, Color color, float x, float y) const
{
Screen.DrawText(Font.FindFont("BIGFONT"), color, x, y, text, DTA_VirtualWidth, int(Size.X), DTA_VirtualHeight, int(Size.Y));
}
ui void DrawTexture(string texture, float x, float y) const
{
Screen.DrawTexture(TexMan.CheckForTexture(texture, TexMan.Type_Any), true, x, y, DTA_VirtualWidth, int(Size.X), DTA_VirtualHeight, int(Size.Y), DTA_CenterOffset, true);
}