BIG LORE changes, may contain slight Doom Eternal spoilers, though not really big stuff or anything. - New entry: ARC (Doom Eternal). - Adjusted Ashley's entry to mention she grew up in Cornwall. - Shortened CuteEmotion entry so it doesn't get cut off. - Added small extra details about Doomslayer. - Adjusted Samuel Hayden's entry so after Doom it mentions his involvements with the ARC. - Adjusted Hell entry to mention their relation with the Maykrs, revealed after Doom. - New entry: Maykrs (Doom Eternal). - New entry: Sentinels (Doom Eternal). - New entry: SUSAN (Empty Episodes). - Adjusted post-Doom UAC entry to better detail how it all went to shit. - Adjusted timeline accordingly with all these changes. Removed leftover mockup XCFs. Fix Hexen still having the vanilla chat sound. Separate option menu code from the bigass Demolitionist Menu file, so it's easier to handle. Fix scrolling behaviour in various menu tabs. Special mousewheel handling for Library tab (scroll through entries only when mouse is on left side). Fix Invinciball still flashing with damage types the player is immune to.
182 lines
4.8 KiB
Text
182 lines
4.8 KiB
Text
|
|
// voice selector
|
|
Class OptionMenuItemSWWMVoiceOption : OptionMenuItemOptionBase
|
|
{
|
|
CVar mCVar;
|
|
Array<String> types;
|
|
|
|
OptionMenuItemSWWMVoiceOption Init( String label, Name command, CVar graycheck = null, int center = 0 )
|
|
{
|
|
Super.Init(label,command,'',graycheck,center);
|
|
mCVar = CVar.FindCVar(mAction);
|
|
int lmp;
|
|
for ( lmp = Wads.FindLump("swwmvoicepack.txt"); lmp > 0; lmp = Wads.FindLump("swwmvoicepack.txt",lmp+1) )
|
|
{
|
|
Array<String> lst;
|
|
lst.Clear();
|
|
String dat = Wads.ReadLump(lmp);
|
|
dat.Split(lst,"\n",0);
|
|
for ( int i=0; i<lst.Size(); i++ )
|
|
{
|
|
if ( (lst[i].Length() <= 0) || (lst[i].GetNextCodePoint(0) == 0) || (lst[i].Left(1) == "\n") || (lst[i].Left(1) == "#") ) continue;
|
|
types.Push(lst[i]);
|
|
}
|
|
}
|
|
return self;
|
|
}
|
|
|
|
override bool SetString( int i, String newtext )
|
|
{
|
|
if ( i == OP_VALUES )
|
|
{
|
|
int cnt = types.Size();
|
|
if ( cnt >= 0 )
|
|
{
|
|
mValues = newtext;
|
|
int s = GetSelection();
|
|
if ( (s >= cnt) || (s < 0) ) s = 0;
|
|
SetSelection(s);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
override int GetSelection()
|
|
{
|
|
int Selection = -1;
|
|
int cnt = types.Size();
|
|
if ( (cnt > 0) && mCVar )
|
|
{
|
|
String cv = mCVar.GetString();
|
|
for( int i=0; i<cnt; i++ )
|
|
{
|
|
if ( cv ~== types[i] )
|
|
{
|
|
Selection = i;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return Selection;
|
|
}
|
|
|
|
override void SetSelection( int Selection )
|
|
{
|
|
int cnt = types.Size();
|
|
if ( (cnt > 0) && mCVar )
|
|
mCVar.SetString(types[Selection]);
|
|
}
|
|
|
|
override int Draw( OptionMenuDescriptor desc, int y, int indent, bool selected )
|
|
{
|
|
if ( mCenter ) indent = (screen.GetWidth()/2);
|
|
drawLabel(indent,y,selected?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,isGrayed());
|
|
int Selection = GetSelection();
|
|
String loc;
|
|
if ( Selection == -1 ) loc = "Unknown";
|
|
else
|
|
{
|
|
String uptxt = types[Selection];
|
|
uptxt.MakeUpper();
|
|
String str = String.Format("SWWM_VOICENAME_%s",uptxt);
|
|
loc = StringTable.Localize(str,false);
|
|
if ( str == loc ) loc = types[Selection];
|
|
}
|
|
drawValue(indent,y,OptionMenuSettings.mFontColorValue,loc,isGrayed());
|
|
return indent;
|
|
}
|
|
|
|
override bool MenuEvent( int mkey, bool fromcontroller )
|
|
{
|
|
int cnt = types.Size();
|
|
if ( cnt > 0 )
|
|
{
|
|
int Selection = GetSelection();
|
|
if ( mkey == Menu.MKEY_Left )
|
|
{
|
|
if ( Selection == -1 ) Selection = 0;
|
|
else if ( --Selection < 0 ) Selection = cnt-1;
|
|
}
|
|
else if ( (mkey == Menu.MKEY_Right) || (mkey == Menu.MKEY_Enter) )
|
|
{
|
|
if ( ++Selection >= cnt ) Selection = 0;
|
|
}
|
|
else return OptionMenuItem.MenuEvent(mkey,fromcontroller);
|
|
SetSelection(Selection);
|
|
Menu.MenuSound("menu/change");
|
|
}
|
|
else return OptionMenuItem.MenuEvent(mkey,fromcontroller);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// option menu /w tooltips
|
|
Class SWWMOptionMenu : OptionMenu
|
|
{
|
|
private String ttip;
|
|
transient CVar lang;
|
|
transient Font TewiFont, MPlusFont;
|
|
|
|
override void Ticker()
|
|
{
|
|
Super.Ticker();
|
|
// fetch the tooltip for whatever's selected (if any)
|
|
if ( mDesc.mSelectedItem == -1 ) return;
|
|
String mcvar = mDesc.mItems[mDesc.mSelectedItem].GetAction();
|
|
mcvar.Replace(" ","_"); // need to strip whitespace for command actions
|
|
String locstr = String.Format("TOOLTIP_%s",mcvar);
|
|
ttip = StringTable.Localize(locstr,false);
|
|
if ( ttip == locstr ) ttip = "";
|
|
}
|
|
override void Drawer()
|
|
{
|
|
Super.Drawer();
|
|
if ( ttip == "" ) return;
|
|
// re-evaluate y to check where the cursor is
|
|
int cy = 0;
|
|
int y = mDesc.mPosition;
|
|
if ( y <= 0 )
|
|
{
|
|
let font = generic_ui||!mDesc.mFont?NewSmallFont:mDesc.mFont;
|
|
if ( font && (mDesc.mTitle.Length() > 0) )
|
|
y = -y+font.GetHeight();
|
|
else y = -y;
|
|
}
|
|
int fontheight = OptionMenuSettings.mLinespacing*CleanYfac_1;
|
|
y *= CleanYfac_1;
|
|
int lastrow = Screen.GetHeight()-OptionHeight()*CleanYfac_1;
|
|
for ( int i=0; ((i < mDesc.mItems.Size()) && (y <= lastrow)); i++ )
|
|
{
|
|
// Don't scroll the uppermost items
|
|
if ( i == mDesc.mScrollTop )
|
|
{
|
|
i += mDesc.mScrollPos;
|
|
if ( i >= mDesc.mItems.Size() ) break; // skipped beyond end of menu
|
|
}
|
|
y += fontheight;
|
|
if ( mDesc.mSelectedItem == i )
|
|
{
|
|
cy = y;
|
|
break;
|
|
}
|
|
}
|
|
if ( !TewiFont ) TewiFont = Font.GetFont('Tewi');
|
|
if ( !MPlusFont ) MPlusFont = Font.GetFont('MPlus');
|
|
if ( !lang ) lang = CVar.GetCVar('language',players[consoleplayer]);
|
|
Font fnt = TewiFont;
|
|
if ( lang.GetString() ~== "jp" ) fnt = MPlusFont;
|
|
let lines = fnt.BreakLines(ttip,CleanWidth_1-8);
|
|
int height = (8+fnt.GetHeight()*lines.Count())*CleanYFac_1;
|
|
// draw at the bottom unless the selected option could is covered by the tooltip
|
|
int ypos = Screen.GetHeight()-height;
|
|
if ( cy >= ypos ) ypos = 0;
|
|
Screen.Dim("Black",.75,0,ypos,Screen.GetWidth(),height);
|
|
ypos += 4*CleanYFac_1;
|
|
for ( int i=0; i<lines.Count(); i++ )
|
|
{
|
|
Screen.DrawText(fnt,Font.CR_WHITE,4*CleanXFac_1,ypos,lines.StringAt(i),DTA_CleanNoMove_1,true);
|
|
ypos += fnt.GetHeight()*CleanYFac_1;
|
|
}
|
|
}
|
|
}
|