Additional menu tweakery.

Attempt to hotfix cases where STILL the lore library will get deleted.
This commit is contained in:
Mari the Deer 2020-10-24 15:43:20 +02:00
commit 0588fd6dab
14 changed files with 256 additions and 39 deletions

View file

@ -23,6 +23,11 @@ HardwareShader Texture "graphics/SWWMGZLogo.png"
Shader "shaders/glsl/LogoAnimated.fp"
Texture "LogoTex" "graphics/SWWMGZLogo_Layers.png"
}
HardwareShader Texture "graphics/M_SWWM.png"
{
Shader "shaders/glsl/LogoAnimated.fp"
Texture "LogoTex" "graphics/M_SWWM_Layers.png"
}
HardwareShader Sprite "BBRNB0"
{
Shader "shaders/glsl/Whew.fp"

BIN
graphics/M_SWWM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
graphics/M_SWWM_Layers.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View file

@ -15,11 +15,11 @@ SWWM_GESTURE3 = "Victory";
SWWM_GESTURE4 = "Blow Kiss";
SWWM_KBASE = "Demolitionist Menu";
// skills
SWWM_SKCHILL = "Just Chillin'";
SWWM_SKEASY = "Taking It Easy~";
SWWM_SKNORMAL = "Adequate Adventure";
SWWM_SKHARD = "I'm A Masochist";
SWWM_SKLUNATIC = " ";
SWWM_SKCHILL = "\cdJust Chillin'\c-";
SWWM_SKEASY = "\ckTaking It Easy~\c-";
SWWM_SKNORMAL = "\ciAdequate Adventure\c-";
SWWM_SKHARD = "\cgI'm A Masochist\c-";
SWWM_SKLUNATIC = "\cr \c-";
SWWM_SKLUNATICCONFIRM = "You will die, you will suffer.\nThat, I can guarantee.";
// mod menu
SWWM_MTITLE = "SWWM GZ Options";

View file

@ -15,11 +15,11 @@ SWWM_GESTURE3 = "Victoria";
SWWM_GESTURE4 = "Soplar Beso";
SWWM_KBASE = "Menú de Demolicionista";
// skills
SWWM_SKCHILL = "De Relax";
SWWM_SKEASY = "Con Calmita~";
SWWM_SKNORMAL = "Aventura Adecuada";
SWWM_SKHARD = "Soy Masoca";
SWWM_SKLUNATIC = "INTENTA MUERTE";
SWWM_SKCHILL = "\cdDe Relax\c-";
SWWM_SKEASY = "\ckCon Calmita~\c-";
SWWM_SKNORMAL = "\ciAventura Adecuada\c-";
SWWM_SKHARD = "\cgSoy Masoca\c-";
SWWM_SKLUNATIC = "\crINTENTA MUERTE\c-";
SWWM_SKLUNATICCONFIRM = "Vas a morir, vas a sufrir.\nEso te lo puedo garantizar.";
// mod menu
SWWM_MTITLE = "Opciones de SWWM GZ";

View file

@ -1,5 +1,6 @@
[fr]
// keybinds
// skills
// mod menu
// knowledge base
// mission entries

View file

@ -1,5 +1,6 @@
[it]
// keybinds
// skills
// mod menu
// knowledge base
// mission entries

View file

@ -1,5 +1,6 @@
[jp]
// keybinds
// skills
// mod menu
// knowledge base
// mission entries

View file

@ -1,5 +1,6 @@
[pl]
// keybinds
// skills
// mod menu
// knowledge base
// mission entries

View file

@ -1,2 +1,2 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r574 \cu(Sat 24 Oct 13:01:43 CEST 2020)";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r576 \cu(Sat 24 Oct 15:45:53 CEST 2020)";

View file

@ -243,9 +243,9 @@ ListMenu "MainMenu"
{
Class "SWWMMainMenu"
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 10
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
SWWMLogo "M_SWWM"
SWWMLogo "graphics/M_SWWM.png"
Position 0, 56
SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu"
SWWMTextItemM "$MNU_OPTIONS", "o", "OptionsMenu"
@ -257,9 +257,9 @@ ListMenu "MainMenuTextOnly"
{
Class "SWWMMainMenu"
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 10
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
SWWMLogo "M_SWWM"
SWWMLogo "graphics/M_SWWM.png"
Position 0, 56
SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu"
SWWMTextItemM "$MNU_OPTIONS", "o", "OptionsMenu"
@ -269,6 +269,7 @@ ListMenu "MainMenuTextOnly"
}
ListMenu "EpisodeMenu"
{
Class "SWWMBigMenuHack"
IfGame(Doom, Heretic, Hexen, Strife)
{
NetgameMessage "$NEWGAME"
@ -278,20 +279,18 @@ ListMenu "EpisodeMenu"
NetgameMessage "$CNEWGAME"
}
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -32, 10
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
StaticText 56, 24, "$MNU_EPISODE"
Position 90, 64
SWWMStaticTextM 0, 0, "$MNU_EPISODE", "Blue"
Position 0, 48
}
ListMenu "SkillMenu"
{
Class "SWWMBigMenuHack"
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -32, 10
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
StaticText 24, 4, "$MNU_CHOOSESKILL"
Position 0, 40
CenterMenu
// the menu building code for this does not give a single goddamn fuck about positioning so it looks completely off-center
// thanks to whoever decided that, hope you step on a LEGO
SWWMStaticTextM 0, 0, "$MNU_CHOOSESKILL", "Blue"
Position 0, 48
}

View file

@ -1,6 +0,0 @@
graphic "M_SWWM", 2048, 1024
{
XScale 8
YScale 8
Graphic "graphics/SWWMGZLogo.png", 0, 0
}

View file

@ -603,6 +603,34 @@ Class SWWMHandler : EventHandler
l.ChangeStatNum(Thinker.STAT_STATIC);
l.myplayer = p;
}
// horrendous piece of shit bandaid fix because gzdoom gets on my fucking nerves with its inconsistency bullshit when traveling between levels
let ti = ThinkerIterator.Create("SWWMLoreLibrary",Thinker.STAT_STATIC);
SWWMLoreLibrary l2;
bool bmesg = false;
while ( l2 = SWWMLoreLibrary(ti.Next()) )
{
if ( (l2 == l) || (l2.myplayer != p) ) continue;
if ( !bmesg )
{
Console.Printf("If this message appears, something broke the mod really badly and should be reported.");
bmesg = true;
}
// merge excess libraries (if it ever happens)
Console.Printf("Merging existing lore library with %d entries.",l2.ent.Size());
for ( int i=0; i<l2.ent.Size(); i++ )
{
bool dontadd = false;
for ( int j=0; j<l.ent.Size(); j++ )
{
if ( l.ent[j].tag != l2.ent[i].tag ) continue;
l.ent[j].read |= l2.ent[i].read;
dontadd = true;
}
if ( dontadd ) continue;
l.ent.Push(l2.ent[i]);
}
l2.Destroy();
}
// pre-add some entries to start with
l.DirectAdd("Demolitionist");
l.DirectAdd("KnowledgeBase");
@ -1200,7 +1228,8 @@ Class SWWMHandler : EventHandler
{
if ( e.Type == InputEvent.TYPE_KeyDown )
{
if ( sv_cheats )
// need a reliable way to check for cheats
//if ( sv_cheats )
{
static const int lods[] = {38,24,32,31,24,33,18,50,24,49,18};
// what's that spell?

View file

@ -202,6 +202,92 @@ Class SWWMMainMenu : ListMenu
}
}
// skill/episode menu hack
Class SWWMBigMenuHack : ListMenu
{
override void Init( Menu parent, ListMenuDescriptor desc )
{
Super.Init(parent,desc);
// replace text/patch items with our own
for ( int i=0; i<mDesc.mItems.Size(); i++ )
{
let itm = mDesc.mItems[i];
if ( itm.GetClass() == 'ListMenuItemTextItem' )
{
let ti = ListMenuItemTextItem(itm);
let rep = new("ListMenuItemSWWMTextItemM");
Name c;
int p;
[c, p] = ti.GetAction();
rep.InitDirect(ti.GetX(),ti.GetY(),mDesc.mLinespacing,ti.mHotkey,ti.mText,ti.mFont,ti.mColor,ti.mColorSelected,c,p);
mDesc.mItems[i] = rep;
ti.Destroy();
}
else if ( itm.GetClass() == 'ListMenuItemPatchItem' )
{
let pi = ListMenuItemPatchItem(itm);
let rep = new("ListMenuItemSWWMPatchItemM");
Name c;
int p;
[c, p] = pi.GetAction();
rep.InitDirect(pi.GetX(),pi.GetY(),mDesc.mLinespacing,pi.mHotkey,pi.mTexture,c,p);
mDesc.mItems[i] = rep;
pi.Destroy();
}
}
}
}
Class ListMenuItemSWWMStaticTextM : ListMenuItem
{
String mText;
Font mFont;
int mColor;
void Init( ListMenuDescriptor desc, double x, double y, String text, int color = -1 )
{
Super.Init(x,y);
mText = text;
mFont = desc.mFont;
mColor = (color>=0)?color:desc.mFontColor;
}
void InitDirect( double x, double y, String text, Font font, int color = Font.CR_UNTRANSLATED )
{
Super.Init(x,y);
mText = text;
mFont = font;
mColor = color;
}
override void Drawer( bool selected )
{
if ( mText.Length() == 0 ) return;
String text = Stringtable.Localize(mText);
double x = (320-mFont.StringWidth(text))/2;
Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_Clean,true);
}
// FIXME The 4.5+ way - swap out for this once it's done
/*override void Draw( bool selected, ListMenuDescriptor desc )
{
if ( mText.Length() == 0 ) return;
String text = Stringtable.Localize(mText);
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
if ( w == ListMenuDescriptor.CleanScale )
{
double x = (320-mFont.StringWidth(text))/2;
Screen.DrawText(mFont,mColor,x,abs(mYpos),text,(mYpos<0)?DTA_CleanTop:DTA_Clean,true);
}
else
{
double x = (w-mFont.StringWidth(text))/2;
Screen.DrawText(mFont,mColor,x,abs(mYpos),text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
}
}*/
}
// scaled SWWM GZ logo
class ListMenuItemSWWMLogo : ListMenuItem
{
@ -323,15 +409,29 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
{
String mText;
Font mFont;
int mColor;
int mColorSelected;
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 = desc.mFont;
mColor = desc.mFontColor;
mColorSelected = desc.mFontcolor2;
mHotkey = hotkey.GetNextCodePoint(0);
}
void InitDirect( double x, double y, int height, int 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;
mColor = color;
mColorSelected = color2;
mHotkey = hotkey;
}
override int GetWidth()
{
return max(1,mFont.StringWidth(StringTable.Localize(mText)));
@ -345,6 +445,7 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
double y = mYPos-12; // text needs to be offset up for some reason, otherwise doesn't match mouse selection bounds
if ( selected )
{
SWWMUtility.StripColor(text);
double xx = x;
int tlen = text.CodePointCount();
for ( int i=0, pos=0; i<tlen; i++ )
@ -352,20 +453,21 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
int ch;
[ch, pos] = text.GetNextCodePoint(pos);
double yy = y+4*sin(32*i+8*Menu.MenuTime());
Screen.DrawChar(mFont,Font.CR_SAPPHIRE,xx,yy,ch,DTA_Clean,true);
Screen.DrawChar(mFont,mColorSelected,xx,yy,ch,DTA_Clean,true);
xx += mFont.GetCharWidth(ch)-2; // account for menu font kerning
}
}
else Screen.DrawText(mFont,Font.CR_WHITE,x,y,text,DTA_Clean,true);
else Screen.DrawText(mFont,mColor,x,y,text,DTA_Clean,true);
}
override void DrawSelector( double xofs, double yofs, TextureID tex )
{
if ( tex.isNull() ) return;
double x = (320-GetWidth())/2;
Screen.DrawTexture(tex,true,x+xofs,mYpos+yofs,DTA_Clean,true,DTA_CenterOffset,true);
double y = (mYpos+mFont.GetHeight()/2)-10;
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true);
x = (320+GetWidth())/2;
Screen.DrawTexture(tex,true,x-xofs,mYpos+yofs,DTA_Clean,true,DTA_CenterOffset,true);
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true);
}
// FIXME The 4.5+ way - swap out for this once it's done
@ -420,24 +522,108 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
if ( tex.isNull() ) return;
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
double y = (mYpos+mFont.GetHeight()/2)-10;
if ( w == ListMenuDescriptor.CleanScale )
{
double x = (320-GetWidth())/2;
Screen.DrawTexture(tex,true,x+xofs,mYpos+yofs,DTA_Clean,true,DTA_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
x = (320+GetWidth())/2;
Screen.DrawTexture(tex,true,x-xofs,mYpos+yofs,DTA_Clean,true,DTA_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
else
{
double x = (w-GetWidth())/2;
Screen.DrawTexture(tex,true,x+xofs,mYpos+yofs,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
x = (w+GetWidth())/2;
Screen.DrawTexture(tex,true,x-xofs,mYpos+yofs,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
}*/
}
// for compat with non-text episodes
Class ListMenuItemSWWMPatchItemM : ListMenuItemSelectable
{
TextureID mTexture;
void Init( ListMenuDescriptor desc, TextureID patch, String hotkey, Name child, int param = 0 )
{
Super.Init(desc.mXpos,desc.mYpos,desc.mLinespacing,child,param);
mHotkey = hotkey.GetNextCodePoint(0);
mTexture = patch;
}
void InitDirect( double x, double y, int height, int hotkey, TextureID patch, Name child, int param = 0 )
{
Super.Init(x,y,height,child,param);
mHotkey = hotkey;
mTexture = patch;
}
override int GetWidth()
{
Vector2 vs = TexMan.GetScaledSize(mTexture);
return int(vs.x);
}
override void Drawer( bool selected )
{
double x = (320-GetWidth())/2;
Screen.DrawTexture(mTexture,true,x,mYpos,DTA_Clean,true);
}
override void DrawSelector( double xofs, double yofs, TextureID tex )
{
if ( tex.isNull() ) return;
Vector2 vs = TexMan.GetScaledSize(mTexture);
double x = (320-vs.x)/2;
double y = mYpos+(vs.y/2);
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true);
x = (320+vs.x)/2;
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true);
}
// FIXME The 4.5+ way - swap out for this once it's done
/*override void Draw( bool selected, ListMenuDescriptor desc )
{
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
if ( w == ListMenuDescriptor.CleanScale )
{
double x = (320-GetWidth())/2;
Screen.DrawTexture(mTexture,true,x,mYpos,DTA_Clean,true);
}
else
{
double x = (w-GetWidth())/2;
screen.DrawTexture(mTexture,true,x,mYpos,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
}
}
override void DrawSelector( double xofs, double yofs, TextureID tex, ListMenuDescriptor desc )
{
if ( tex.isNull() ) return;
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
Vector2 vs = TexMan.GetScaledSize(mTexture);
double y = mYpos+vs.y/2;
if ( w == ListMenuDescriptor.CleanScale )
{
double x = (320-vs.x)/2;
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
x = (320+vs.x)/2;
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_Clean,true,DTA_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
else
{
double x = (w-vs.x)/2;
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
x = (w+vs.x)/2;
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
}*/
}
// FIXME uncomment this once it's supported
/*Class SWWMMenuDelegate : DoomMenuDelegate
{