stinger_m/zscript/unrealmenus.zsc
Marisa Kirisame 3a8925f3c0 Additional model progress.
Bump required version to 4.2.0.
Added Hexen style loading screen and other gameinfo stuff.
Small changes to fullscreen HUD.
Added 0.83 style status bar (incomplete).
Added player models.
Old file cleanup.
Ran all models through texnumsq, for convenience (skin indices are all over the place on some models).
PNG optimization pass.
2019-08-13 02:32:37 +02:00

135 lines
4.4 KiB
Text

// draws unreal-style main menu
Class ListMenuItemUnrealBg : ListMenuItem
{
TextureID tex[3];
void Init( ListMenuDescriptor desc, String dummy )
{
Super.Init(0,0);
tex[0] = TexMan.CheckForTexture("graphics/rmetal.png",TexMan.Type_Any);
tex[1] = TexMan.CheckForTexture("graphics/menubarr.png",TexMan.Type_Any);
tex[2] = TexMan.CheckForTexture("graphics/unlogo.png",TexMan.Type_Any);
}
override void Drawer( bool selected )
{
double StartX = 0.5*CleanWidth_1-128;
int num = (CleanHeight_1/512)+1;
for ( int i=0; i<=num; i++ )
Screen.DrawTexture(tex[0],false,StartX*CleanXFac_1,512*CleanYFac_1*i,DTA_CleanNoMove_1,true);
Screen.DrawTexture(tex[1],false,StartX*CleanXFac_1,(CleanHeight_1-58)*CleanYFac_1,DTA_CleanNoMove_1,true,DTA_LegacyRenderStyle,STYLE_Add);
Screen.DrawTexture(tex[2],false,StartX*CleanXFac_1,(CleanHeight_1-52)*CleanYFac_1,DTA_CleanNoMove_1,true);
}
}
Class ListMenuItemUnrealTextItem : ListMenuItemSelectable
{
String mText;
Font mFont;
int mColor;
int mSpacing;
void Init( ListMenuDescriptor desc, String text, String hotkey, Name child, int param = 0 )
{
Super.Init(desc.mXpos,desc.mYpos,desc.mLinespacing,child,param);
mText = text;
mFont = Font.GetFont('ULargeFont');
mColor = Font.CR_UNTRANSLATED;
mSpacing = desc.mLineSpacing;
mHotkey = hotkey.GetNextCodePoint(0);
}
void InitDirect( double x, double y, int height, String hotkey, String text, Font font, int color, int color2, Name child, int param = 0 )
{
Super.Init(x,y,height,child,param);
mText = text;
mFont = Font.GetFont('ULargeFont');
mColor = Font.CR_UNTRANSLATED;
int pos = 0;
mHotkey = hotkey.GetNextCodePoint(0);
}
override void Drawer( bool selected )
{
let tFont = generic_ui?NewSmallFont:mFont;
double basex = floor(0.5*(CleanWidth_1-tFont.StringWidth(StringTable.Localize(mText))));
double basey = floor(0.25*(CleanHeight_1-mSpacing*5));
Screen.DrawText(tFont,mColor,(basex+mXPos)*CleanXFac_1,(basey+mYpos)*CleanYFac_1,mText,DTA_CleanNoMove_1,true,DTA_Alpha,selected?1.0:0.5);
}
override int GetWidth()
{
let tFont = generic_ui?NewSmallFont:mFont;
return max(1,tFont.StringWidth(StringTable.Localize(mText)));
}
override void DrawSelector( double xofs, double yofs, TextureID tex )
{
// nothing
}
}
// for hud config
Class OptionMenuItemHudType : OptionMenuItem
{
TextureID tex[6];
CVar mCVar;
OptionMenuItemHudType Init( String label )
{
Super.Init(label,"",true);
mCVar = CVar.FindCVar('stinger_hudmode');
tex[0] = TexMan.CheckForTexture("graphics/Hud1.png",TexMan.Type_Any);
tex[1] = TexMan.CheckForTexture("graphics/Hud2.png",TexMan.Type_Any);
tex[2] = TexMan.CheckForTexture("graphics/Hud3.png",TexMan.Type_Any);
tex[3] = TexMan.CheckForTexture("graphics/Hud4.png",TexMan.Type_Any);
tex[4] = TexMan.CheckForTexture("graphics/Hud5.png",TexMan.Type_Any);
tex[5] = TexMan.CheckForTexture("graphics/Hud6.png",TexMan.Type_Any);
return self;
}
override bool Selectable()
{
return false;
}
override int Draw( OptionMenuDescriptor desc, int y, int indent, bool selected )
{
int xpos = indent + CursorSpace();
int ypos = y + OptionMenuSettings.mLinespacing*CleanYfac_1;
Screen.DrawTexture(tex[mCVar.GetInt()],false,xpos,ypos,DTA_CleanNoMove_1,true);
return -1;
}
}
// because I can't change the font color in mapinfo
Class GreenMessageBox : MessageBoxMenu
{
override void Drawer ()
{
int i, y;
int fontheight = textFont.GetHeight();
y = destHeight/2;
int c = mMessage.Count();
y -= c*fontHeight/2;
for ( i=0; i<c; i++ )
{
screen.DrawText (textFont,Font.CR_GREEN,(destWidth/2)-mMessage.StringWidth(i)/2,y,mMessage.StringAt(i),DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true);
y += fontheight;
}
if ( mMessageMode == 0 )
{
y += fontheight;
mMouseY = y;
screen.DrawText(textFont,(messageSelection==0)?Font.CR_WHITE:Font.CR_DARKGREEN,destWidth/2,y,Stringtable.Localize("$TXT_YES"),DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true);
screen.DrawText(textFont,(messageSelection==1)?Font.CR_WHITE:Font.CR_DARKGREEN,destWidth/2,y+fontheight,Stringtable.Localize("$TXT_NO"),DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true);
if ( messageSelection >= 0 )
{
if ( (MenuTime()%8) < 6 )
{
screen.DrawText(arrowFont,OptionMenuSettings.mFontColorSelection,(destWidth/2)-11,y+fontheight*messageSelection,selector,DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true);
}
}
}
}
}