diff --git a/acs/swwmcomp.o b/acs/swwmcomp.o index 0814342af..e7af79370 100644 Binary files a/acs/swwmcomp.o and b/acs/swwmcomp.o differ diff --git a/fonts.wad b/fonts.wad index fc317e2bc..9f867095e 100644 Binary files a/fonts.wad and b/fonts.wad differ diff --git a/language.version b/language.version index 51093123e..14229f463 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r16 \cu(Mon 4 Apr 14:56:57 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r16 \cu(2022-04-04 14:56:57)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r17 \cu(Tue 5 Apr 12:29:16 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r17 \cu(2022-04-05 12:29:16)\c-"; diff --git a/menudef.txt b/menudef.txt index 0569f4adb..36e81e7ea 100644 --- a/menudef.txt +++ b/menudef.txt @@ -326,7 +326,7 @@ ListMenu "MainMenu" { Class "SWWMMainMenu" Size Clean - Font "BigFont", "White", "Sapphire" + Font "TewiFontOutline", "White", "Sapphire" Selector "graphics/DemoIcon.png", -24, 0 LineSpacing 32 SWWMLogo @@ -341,7 +341,7 @@ ListMenu "MainMenuTextOnly" { Class "SWWMMainMenu" Size Clean - Font "BigFont", "White", "Sapphire" + Font "TewiFontOutline", "White", "Sapphire" Selector "graphics/DemoIcon.png", -24, 0 LineSpacing 32 SWWMLogo @@ -356,7 +356,7 @@ ListMenu "GameFilesMenu" { Class "SWWMCleanMenu" Size Clean - Font "BigFont", "White", "Sapphire" + Font "TewiFontOutline", "White", "Sapphire" Selector "graphics/DemoIcon.png", -24, 0 LineSpacing 32 Position 0, 88 @@ -375,7 +375,7 @@ ListMenu "EpisodeMenu" { NetgameMessage "$CNEWGAME" } - Font "BigFont", "White", "Sapphire" + Font "TewiFontOutline", "White", "Sapphire" Selector "graphics/DemoIcon.png", -24, 0 LineSpacing 0 SWWMStaticTextM 0, 0, "$MNU_EPISODE", "Blue" @@ -386,7 +386,7 @@ ListMenu "SkillMenu" { Class "SWWMBigMenuHack" Size Clean - Font "BigFont", "White", "Sapphire" + Font "TewiFontOutline", "White", "Sapphire" Selector "graphics/DemoIcon.png", -24, 0 LineSpacing 0 SWWMStaticTextM 0, 0, "$MNU_CHOOSESKILL", "Blue" diff --git a/swwmcomp.acs b/swwmcomp.acs index 0862d2fc4..2e7e67242 100644 --- a/swwmcomp.acs +++ b/swwmcomp.acs @@ -97,217 +97,3 @@ SCRIPT "E1M8_KNOCKOUT" ( void ) Delay(100); Exit_Normal(0); } - -// DUMP 2 and 3 rewritten hub progress scripts -// Because the way these use BigFont makes them unreadable otherwise - -SCRIPT "DUMP2_HUB" ( void ) -{ - Delay(35); - ACS_Terminate(2,0); - int mapstodo; - switch( GameSkill() ) - { - case 0: - mapstodo = 8; - break; - case 1: - mapstodo = 16; - break; - case 2: - mapstodo = 32; - break; - case 3: - mapstodo = 48; - break; - default: - mapstodo = 64; - break; - } - bool unlockedfinal = false; - while ( true ) - { - int lvent = ScriptCall("BaseStatusBar","GetGlobalACSValue",59); - bool unlockfinal = false; - switch( GameSkill() ) - { - case 0: - if ( lvent >= 8 ) unlockfinal = true; - break; - case 1: - if ( lvent >= 16 ) unlockfinal = true; - break; - case 2: - if ( lvent >= 32 ) unlockfinal = true; - break; - case 3: - if ( lvent >= 48 ) unlockfinal = true; - break; - default: - if ( lvent >= 64 ) unlockfinal = true; - break; - } - if ( unlockfinal && !unlockedfinal ) - { - unlockedfinal = true; - Ceiling_LowerByValue(10,96,96); - } - SetFont("BigFont"); - int progress = mapstodo-lvent; - SetHudSize(480,360,0); - if ( progress > 0 ) HudMessageBold(d:progress,s:" more maps to go...";HUDMSG_PLAIN,1,CR_GOLD,240.0,30.0,0); - else HudMessageBold(s:"The final room is open...";HUDMSG_PLAIN,1,CR_GOLD,240.0,30.0,0); - Delay(1); - } -} - -SCRIPT "DUMP3_HUB" ( void ) -{ - Delay(1); - ACS_Terminate(1,0); - int mapstodo; - switch( GameSkill() ) - { - case 0: - mapstodo = 8; - break; - case 1: - mapstodo = 16; - break; - case 2: - mapstodo = 32; - break; - case 3: - mapstodo = 48; - break; - default: - mapstodo = 64; - break; - } - bool unlockedfinal = false; - while ( true ) - { - int lvent = ScriptCall("BaseStatusBar","GetGlobalACSValue",59); - bool unlockfinal = false; - switch( GameSkill() ) - { - case 0: - if ( lvent >= 8 ) unlockfinal = true; - break; - case 1: - if ( lvent >= 16 ) unlockfinal = true; - break; - case 2: - if ( lvent >= 32 ) unlockfinal = true; - break; - case 3: - if ( lvent >= 48 ) unlockfinal = true; - break; - default: - if ( lvent >= 64 ) unlockfinal = true; - break; - } - if ( unlockfinal && !unlockedfinal ) - { - unlockedfinal = true; - Floor_LowerByValue(11,96,256); - } - SetFont("BigFont"); - int progress = mapstodo-lvent; - SetHudSize(480,360,0); - if ( progress > 1 ) HudMessageBold(d:progress,s:" more maps to go...";HUDMSG_PLAIN,1,CR_GOLD,240.0,30.0,0); - else if ( progress > 0 ) HudMessageBold(d:progress,s:" more map to go...";HUDMSG_PLAIN,1,CR_GOLD,240.0,30.0,0); - else HudMessageBold(s:"The final room is open...";HUDMSG_PLAIN,1,CR_GOLD,240.0,30.0,0); - Delay(1); - } -} - -// same here, just TOO BIG -str DUMP3MapNames[74][2] = -{ - { "", "" }, // 0 - { "Check-In", "undeadRyker" }, - { "Pissboy", "Anonymous" }, - { "Simplicity is Golden", "demo_the_man" }, - { "Invitation to Destruction", "Gardevoir" }, - { "SOLITARY", "CJacobs" }, - { "Ruins & Lava", "VBob" }, - { "Bloodsport Canyon", "Hoodoo456" }, - { "Nuclear Control Facilities", "Titan314" }, - { "Mountain Temple", "Project_ILE" }, - { "Overflow", "SpudTheRubbish" }, // 10 - { "'Venture into the Bouncy Castle", "Beed28" }, - { "The Crater", "combatxtreme & Plutonic Overkill" }, - { "The Fun Lab", "TerminusEst13" }, - { "Durex Waste Disposal", "Minimum Payne" }, - { "The Corporate Ladder", "Kinsie" }, - { "Regressive Experience", "Dukka" }, - { "Baby's First Map", "Bobman23" }, - { "Research Facility", "deathgod5309" }, - { "AMONG US", "HumansAmongUs" }, - { "The Darkness Beyond", "KarolineDianne" }, // 20 - { "Base Stimpack", "charcola" }, - { "Crunk Refinery", "BobBarker" }, - { "0-Pipe Gear", "Toooooasty" }, - { "Escape from Argent Prison", "Lance Charleson" }, - { "Live Fire Exorcise", "Sgt. Shivers" }, - { "Attack First", "simpletonn" }, - { "Hitler's Prison", "Luigi2600" }, - { "Tomb of Hetickhamen", "Action Max" }, - { "The Weed Number", "Abysswalker" }, - { "This Is Serious Mum", "deathz0r" }, // 30 - { "Not Another Tech Base", "ArchXeno" }, - { "Hydraulic Plant", "SpiritOfDecay" }, - { "Janus", "SoundOfDoomDoors" }, - { "Gamma Station Entrance", "SMG_Marine" }, - { "Realm of the Sempiternal Archvile", "Darsycho" }, - { "Judgement Day", "Stale_meat" }, - { "Complex Alive", "Roxas" }, - { "DUMP TD", "Arctangent" }, - { "Dumping Ground", "TotalInjury" }, - { "Mercury Rain", "Jimmy" }, // 40 - { "mapsterpiece", "idiotbitz" }, - { "Tunnel Crates Rule!", "Stale_Meat" }, - { "CLOVERHOUSE", "Icept" }, - { "Generic UAC Outpost", "Anonymous" }, - { "Felt", "FloatRand" }, - { "Panic Room", "comet1338" }, - { "Simple Chaos", "willykuo123" }, - { "EVISCERATED", "NAG" }, - { "The Mine to Hell", "InsanityBringer" }, - { "Sandcastley Sandcastling Sandcastles", "PinchySkree" }, // 50 - { "Dead", "Already Dead" }, - { "Broken Shit", "ZachBrowder" }, - { "Weapons Research Lab", "Vennobennu" }, - { "Winter in Summer", "TehRealSalt" }, - { "The UAC Ocean Base", "leodoom85" }, - { "Hot Water Music", "Protester" }, - { "Lambda Base", "floatRand" }, - { "inferno odyssey", "Anonymous" }, - { "Infested Installation", "Flipy" }, - { "The Duality", "NeuralStunner" }, // 60 - { "Municipal Well", "Flotilla" }, - { "Dropoff", "CharlieTheGnarly" }, - { "Dimensional Accelerator", "Untitled" }, - { "Urban Hell", "ChrisR91" }, - { "Electron", "floatRand" }, - { "Caco-lover", "everennui" }, - { "Brown Mesa", "Cheeki" }, - { "Bloody Hell", "Wivicer" }, - { "A Night at the Opera", "Temin_Dump" }, - { "An Online Virtual Reality Used By Hackers", "Shadow Hog" }, // 70 - { "BtFS", "Gageat" }, - { "The Runaround", "LogicalFallacy" }, - { "Attack From Within", "mumblemumble" } -}; - -SCRIPT "DUMP3_DISPLAY" ( int f1, int f2 ) -{ - int fuck = (f1*10)+f2; - SetHudSize(480,360,0); - SetFont("BigFont"); - HudMessage(s:DUMP3MapNames[fuck][0];HUDMSG_FADEINOUT,2,CR_WHITE,240.4,285.2,2.5,0.15,0.65); - SetHudSize(320,240,0); - SetFont("SmallFont"); - HudMessage(s:DUMP3MapNames[fuck][1];HUDMSG_FADEINOUT,3,CR_GOLD,160.4,200.0,2.5,0.15,0.65); -} diff --git a/zscript/compat/swwm_compat.zsc b/zscript/compat/swwm_compat.zsc index 6c59109a3..b64c708d6 100644 --- a/zscript/compat/swwm_compat.zsc +++ b/zscript/compat/swwm_compat.zsc @@ -197,17 +197,6 @@ Class SWWMLevelCompatibility : LevelPostProcessor // unfortunately the line special wrangling has to be done one tic after map load // because fuck absolutely everything about how ACS works break; - // DUMP 3 HUBMAP - case '7E77AA43AF7ACDBC52171E9EE2BF98D0': - // swap all the calls to script 12 with calls to 'DUMP3_DISPLAY' - // to fix the bigfont being too large - for ( int i=0; i alldlg; alldlg_pack.Split(alldlg,":"); + let mSmallFont = Font.GetFont('TewiFont'); for ( int i=0; i 3 ) Console.Printf("\cg%s exceeds line limit (%d > 3)\c-",alldlg[i],l.Count()); else { diff --git a/zscript/handler/swwm_handler_vanillaboss.zsc b/zscript/handler/swwm_handler_vanillaboss.zsc index 596b2ac56..b2c0d419c 100644 --- a/zscript/handler/swwm_handler_vanillaboss.zsc +++ b/zscript/handler/swwm_handler_vanillaboss.zsc @@ -59,6 +59,7 @@ extend Class SWWMHandler ui int thealth, hmax; ui int oldhealth[30]; ui int cummdamage, lastcummtic; // please do not misread + ui Font mSmallFont; enum EVanillaMap { @@ -487,6 +488,7 @@ extend Class SWWMHandler { if ( !ui_initialized || (bossalpha <= 0.) ) return; if ( !swwm_bosshealthbars ) return; + if ( !mSmallFont ) mSmallFont = Font.GetFont('TewiFont'); if ( !bbar_f ) bbar_f = TexMan.CheckForTexture("graphics/HUD/BossHealthBarBox.png",TexMan.Type_Any); if ( !bbar_r ) bbar_r = TexMan.CheckForTexture("graphics/HUD/BossHealthBar.png",TexMan.Type_Any); if ( !bbar_d ) bbar_d = TexMan.CheckForTexture("graphics/HUD/BossHealthBarDecay.png",TexMan.Type_Any); @@ -503,9 +505,9 @@ extend Class SWWMHandler { double calph = clamp(((lastcummtic+150)-gametic)/50.,0.,1.); string dnum = String.Format("%d",cummdamage); - Screen.DrawText(smallfont,Font.CR_RED,vpos.x+300-smallfont.StringWidth(dnum),vpos.y-(smallfont.GetHeight()+2),dnum,DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha*calph); + Screen.DrawText(mSmallFont,Font.CR_RED,vpos.x+300-mSmallFont.StringWidth(dnum),vpos.y-(mSmallFont.GetHeight()+2),dnum,DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha*calph); } - Screen.DrawText(smallfont,Font.CR_WHITE,vpos.x,vpos.y-(smallfont.GetHeight()+2),StringTable.Localize(swwm_funtags?(bosstag.."_FUN"):bosstag),DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha); + Screen.DrawText(mSmallFont,Font.CR_WHITE,vpos.x,vpos.y-(mSmallFont.GetHeight()+2),StringTable.Localize(swwm_funtags?(bosstag.."_FUN"):bosstag),DTA_VirtualWidthF,bar.ss.x,DTA_VirtualHeightF,bar.ss.y,DTA_KeepRatio,true,DTA_Alpha,bossalpha); } // can't use this until I actually figure out how to make those walls damageable diff --git a/zscript/handler/swwm_handler_worldload.zsc b/zscript/handler/swwm_handler_worldload.zsc index 6eca72a1c..c0116389f 100644 --- a/zscript/handler/swwm_handler_worldload.zsc +++ b/zscript/handler/swwm_handler_worldload.zsc @@ -240,11 +240,6 @@ extend Class SWWMHandler if ( (level.GetChecksum() ~== "F286BABF0D152259CD6B996E8920CA70") || (level.GetChecksum() ~== "A52BD2038CF814101AAB7D9C78F9ACE2") ) level.ExecuteSpecial(ACS_Execute,null,null,false,-Int('DVACATION_UNFUCK')); - // DUMP 2 and 3 hackaround for the "X maps to go" text being actually readable - else if ( level.GetChecksum() ~== "BC2878CDB82712598A2196807D099C40" ) - level.ExecuteSpecial(ACS_Execute,null,null,false,-Int('DUMP2_HUB')); - else if ( level.GetChecksum() ~== "7E77AA43AF7ACDBC52171E9EE2BF98D0" ) - level.ExecuteSpecial(ACS_Execute,null,null,false,-Int('DUMP3_HUB')); // rampancy boss brain fix (repeatedly triggering "map clear") let ti = ThinkerIterator.Create("Actor"); Actor a, brain; diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index 7844d1afc..d94fb8d10 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -22,8 +22,9 @@ Class MsgLine lastrep = rep; String nstr = str; if ( rep > 1 ) nstr.AppendFormat(" (x%d)",rep); - l = SmallFont.BreakLines(nstr,(type==PRINT_LOW)?sz:361); - if ( type != PRINT_LOW ) ls = SmallFont.BreakLines(nstr,211); + let fnt = Font.GetFont('TewiFont'); + l = fnt.BreakLines(nstr,(type==PRINT_LOW)?sz:361); + if ( type != PRINT_LOW ) ls = fnt.BreakLines(nstr,211); } } @@ -33,6 +34,8 @@ Class SWWMStatusBar : BaseStatusBar HealthTex[6], FuelTex[2], DashTex, EnemyBTex, EnemyHTex[6], GenericAmmoTex[3], MiniBox, AutoPage, bgtex; + Font mSmallFont, mBigFont, mTinyFont; + Array MainQueue, PickupQueue; // sorted arrays of various elements @@ -1236,6 +1239,9 @@ Class SWWMStatusBar : BaseStatusBar MiniBox = TexMan.CheckForTexture("graphics/HUD/MinimapBox.png",TexMan.Type_Any); AutoPage = TexMan.CheckForTexture("AUTOPAGE",TexMan.Type_Autopage); bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any); + mSmallFont = Font.GetFont('TewiFont'); + mBigFont = Font.GetFont('TewiFontOutline'); + mTinyFont = Font.GetFont('MiniwiFont'); minimapzoom = oldminimapzoom = 1.; HealthInter = DynamicValueInterpolator.Create(100,.1,1,100); ScoreInter = DynamicValueInterpolator.Create(0,.1,1,999999999); @@ -1304,9 +1310,9 @@ Class SWWMStatusBar : BaseStatusBar else tag = String.Format("\cy%s\c-",StringTable.Localize("$SWWM_NEXIT")); } } - Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsi*smallfont2.StringWidth(tag)/2.)/hsi,(vpos.y-hsi*smallfont2.GetHeight()/2.)/hsi,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(mTinyFont,Font.CR_WHITE,(vpos.x-hsi*mTinyFont.StringWidth(tag)/2.)/hsi,(vpos.y-hsi*mTinyFont.GetHeight()/2.)/hsi,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); tag = String.Format("\cu(%s\cu)\c-",FormatDist(tdir.length())); - Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsi*smallfont2.StringWidth(tag)/2.)/hsi,(vpos.y+hsi*smallfont2.GetHeight()/2.)/hsi,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(mTinyFont,Font.CR_WHITE,(vpos.x-hsi*mTinyFont.StringWidth(tag)/2.)/hsi,(vpos.y+hsi*mTinyFont.GetHeight()/2.)/hsi,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } } // sensed items @@ -1325,13 +1331,13 @@ Class SWWMStatusBar : BaseStatusBar double alph = clamp(((s.updated+mtime)-(level.maptime+fractic))/35.,0.,1.); alph *= clamp(1.5-1.5*(tdir.length()/(level.allmap?1200.:800.)),0.,1.); tag = s.tag; - Screen.DrawText(smallfont2,s.vipitem?Font.CR_PURPLE:s.scoreitem?Font.CR_GOLD:Font.CR_GREEN,(vpos.x-hsd*smallfont2.StringWidth(tag)/2.)/hsd,(vpos.y-hsd*smallfont2.GetHeight()/2.)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(mTinyFont,s.vipitem?Font.CR_PURPLE:s.scoreitem?Font.CR_GOLD:Font.CR_GREEN,(vpos.x-hsd*mTinyFont.StringWidth(tag)/2.)/hsd,(vpos.y-hsd*mTinyFont.GetHeight()/2.)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); tag = String.Format("\cu(%s\cu)\c-",FormatDist(tdir.length())); - Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsd*smallfont2.StringWidth(tag)/2.)/hsd,(vpos.y+hsd*smallfont2.GetHeight()/2.)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(mTinyFont,Font.CR_WHITE,(vpos.x-hsd*mTinyFont.StringWidth(tag)/2.)/hsd,(vpos.y+hsd*mTinyFont.GetHeight()/2.)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); if ( s.item is 'SWWMRespawnTimer' ) { tag = String.Format(StringTable.Localize("$SWWM_TRESPAWN"),s.item.special2/GameTicRate); - Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsd*smallfont2.StringWidth(tag)/2.)/hsd,(vpos.y+hsd*smallfont2.GetHeight()*2)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(mTinyFont,Font.CR_WHITE,(vpos.x-hsd*mTinyFont.StringWidth(tag)/2.)/hsd,(vpos.y+hsd*mTinyFont.GetHeight()*2)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } } } @@ -1366,7 +1372,7 @@ Class SWWMStatusBar : BaseStatusBar barsiz.y *= hsb; Vector2 barpos = vpos-(barsiz/2.); barpos.y -= 16.; - Font fnt = swwm_bigtags?smallfont:smallfont2; + Font fnt = swwm_bigtags?mSmallFont:mTinyFont; int col = Font.CR_WHITE; if ( teamplay ) { @@ -1447,17 +1453,17 @@ Class SWWMStatusBar : BaseStatusBar } double hs0 = isscore?hss:hsn; Vector2 ss0 = isscore?sss:ssn; - Screen.DrawText(smallfont2,snum.tcolor,(vpos.x-hs0*(fo.x+smallfont2.StringWidth(tag)/2.))/hs0,(vpos.y-hs0*(fo.y+(smallfont2.GetHeight()/2.)))/hs0,tag,DTA_VirtualWidthF,ss0.x,DTA_VirtualHeightF,ss0.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(mTinyFont,snum.tcolor,(vpos.x-hs0*(fo.x+mTinyFont.StringWidth(tag)/2.))/hs0,(vpos.y-hs0*(fo.y+(mTinyFont.GetHeight()/2.)))/hs0,tag,DTA_VirtualWidthF,ss0.x,DTA_VirtualHeightF,ss0.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); // extra strings (if available) if ( !swwm_scorebonus ) continue; - fo.y += smallfont2.GetHeight(); + fo.y += mTinyFont.GetHeight(); for ( int i=0; i 0 ) tag.AppendFormat(" x%d",snum.xscore[i]); - Screen.DrawText(smallfont2,snum.xtcolor[i],(vpos.x-hss*(fo.x+smallfont2.StringWidth(tag)/2.))/hss,(vpos.y-hss*(fo.y+(smallfont2.GetHeight()/2.)))/hss,tag,DTA_VirtualWidthF,sss.x,DTA_VirtualHeightF,sss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); - fo.y += smallfont2.GetHeight(); + Screen.DrawText(mTinyFont,snum.xtcolor[i],(vpos.x-hss*(fo.x+mTinyFont.StringWidth(tag)/2.))/hss,(vpos.y-hss*(fo.y+(mTinyFont.GetHeight()/2.)))/hss,tag,DTA_VirtualWidthF,sss.x,DTA_VirtualHeightF,sss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + fo.y += mTinyFont.GetHeight(); } } } @@ -1465,7 +1471,7 @@ Class SWWMStatusBar : BaseStatusBar override void DrawMyPos() { String str = String.Format("(%d,%d,%d)",CPlayer.mo.pos.X,CPlayer.mo.pos.Y,CPlayer.mo.pos.Z); - Screen.DrawText(smallfont2,Font.CR_GREEN,(ss.x-smallfont2.StringWidth(str))/2,4,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mTinyFont,Font.CR_GREEN,(ss.x-mTinyFont.StringWidth(str))/2,4,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } override void DrawAutomapHUD( double ticFrac ) @@ -2208,7 +2214,7 @@ Class SWWMStatusBar : BaseStatusBar xx -= 6; } Screen.DrawTexture(ScoreTex[2],false,ss.x-(margin+xx),margin,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - Screen.DrawText(smallfont,Font.CR_FIRE,ss.x-(margin+4+6*digits),margin+2,sstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_FIRE,ss.x-(margin+4+6*digits),margin+2,sstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); int yy = margin+19; // obviously, don't draw the minimap if the automap is open if ( !automapactive && swwm_mm_enable ) @@ -2248,42 +2254,42 @@ Class SWWMStatusBar : BaseStatusBar if ( iof != -1 ) ln.Truncate(iof); if ( !label || ((level.clusterflags&level.CLUSTER_HUB) && (label == 2)) ) str = ln; else str = String.Format("%s - %s",level.mapname.MakeUpper(),ln); - Screen.DrawText(smallfont,Font.CR_FIRE,xx-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont.GetHeight(); + Screen.DrawText(mSmallFont,Font.CR_FIRE,xx-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mSmallFont.GetHeight(); } if ( (level.total_monsters > 0) && am_showmonsters && !deathmatch ) { str = String.Format("\cxK \c-%d\cu/\c-%d",level.killed_monsters,level.total_monsters); - Screen.DrawText(smallfont2,(level.killed_monsters>=level.total_monsters)?Font.CR_GOLD:Font.CR_WHITE,xx-smallfont2.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont2.GetHeight(); + Screen.DrawText(mTinyFont,(level.killed_monsters>=level.total_monsters)?Font.CR_GOLD:Font.CR_WHITE,xx-mTinyFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mTinyFont.GetHeight(); } if ( (level.total_items > 0) && am_showitems && !deathmatch ) { str = String.Format("\cxI \c-%d\cu/\c-%d",level.found_items,level.total_items); - Screen.DrawText(smallfont2,(level.found_items>=level.total_items)?Font.CR_GOLD:Font.CR_WHITE,xx-smallfont2.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont2.GetHeight(); + Screen.DrawText(mTinyFont,(level.found_items>=level.total_items)?Font.CR_GOLD:Font.CR_WHITE,xx-mTinyFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mTinyFont.GetHeight(); } if ( (level.total_secrets > 0) && am_showsecrets && !deathmatch ) { str = String.Format("\cxS \c-%d\cu/\c-%d",level.found_secrets,level.total_secrets); - Screen.DrawText(smallfont2,(level.found_secrets>=level.total_secrets)?Font.CR_GOLD:Font.CR_WHITE,xx-smallfont2.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont2.GetHeight(); + Screen.DrawText(mTinyFont,(level.found_secrets>=level.total_secrets)?Font.CR_GOLD:Font.CR_WHITE,xx-mTinyFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mTinyFont.GetHeight(); } int sec; if ( am_showtime ) { sec = Thinker.Tics2Seconds(level.maptime); str = String.Format("\cxT \c-%02d\cu:\c-%02d\cu:\c-%02d",sec/3600,(sec%3600)/60,sec%60); - Screen.DrawText(smallfont2,((level.sucktime>0)&&(sec>=(level.sucktime*3600)))?Font.CR_RED:(sec<=level.partime)?Font.CR_GOLD:Font.CR_WHITE,xx-smallfont2.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont2.GetHeight(); + Screen.DrawText(mTinyFont,((level.sucktime>0)&&(sec>=(level.sucktime*3600)))?Font.CR_RED:(sec<=level.partime)?Font.CR_GOLD:Font.CR_WHITE,xx-mTinyFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mTinyFont.GetHeight(); } // don't show total time if it's equal to map time if ( am_showtotaltime && (level.totaltime != level.maptime) ) { sec = Thinker.Tics2Seconds(level.totaltime); str = String.Format("\cxTT \c-%02d\cu:\c-%02d\cu:\c-%02d",sec/3600,(sec%3600)/60,sec%60); - Screen.DrawText(smallfont2,Font.CR_WHITE,xx-smallfont2.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont2.GetHeight(); + Screen.DrawText(mTinyFont,Font.CR_WHITE,xx-mTinyFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mTinyFont.GetHeight(); } yy += 3; } @@ -2300,8 +2306,8 @@ Class SWWMStatusBar : BaseStatusBar { if ( !teamactive[i] ) continue; str = String.Format("\cx%s \c-%d",Teams[i].mName,teamscore[i]); - Screen.DrawText(smallfont,Font.CR_WHITE,xx-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont.GetHeight(); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mSmallFont.GetHeight(); } } else @@ -2309,19 +2315,19 @@ Class SWWMStatusBar : BaseStatusBar // draw rank and spread like in UT if ( tiedscore ) str = String.Format("\cx%s \cg%d\cr/\cg%d\c-",StringTable.Localize("$SWWM_DMRANK"),rank,playercount); else str = String.Format("\cx%s \cj%d\cu/\cj%d\c-",StringTable.Localize("$SWWM_DMRANK"),rank,playercount); - Screen.DrawText(smallfont,Font.CR_WHITE,xx-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont.GetHeight(); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mSmallFont.GetHeight(); if ( lead > 0 ) str = String.Format("\cx%s \cj+%d\c-",StringTable.Localize("$SWWM_DMSPREAD"),lead); else str = String.Format("\cx%s \cj%d\c-",StringTable.Localize("$SWWM_DMSPREAD"),lead); - Screen.DrawText(smallfont,Font.CR_WHITE,xx-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - yy += smallfont.GetHeight()+3; + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + yy += mSmallFont.GetHeight()+3; // draw top 3 players for ( int i=0; i 99999) && !forceamt ) nstr = "99999"; else nstr = String.Format("%d",i.Amount); - int len = smallfont.StringWidth(nstr); - Screen.DrawText(smallfont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha); + int len = mSmallFont.StringWidth(nstr); + Screen.DrawText(mSmallFont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha); } return true; } @@ -2494,7 +2500,7 @@ Class SWWMStatusBar : BaseStatusBar Screen.DrawTexture(GenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } Screen.DrawTexture(GenericAmmoTex[0],false,xx-3,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - Screen.DrawText(smallfont,Font.CR_FIRE,xx,yy+1,astr2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_FIRE,xx,yy+1,astr2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); yy += 14; } xx = ss.x-(margin+13); @@ -2507,7 +2513,7 @@ Class SWWMStatusBar : BaseStatusBar Screen.DrawTexture(GenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } Screen.DrawTexture(GenericAmmoTex[0],false,xx-3,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - Screen.DrawText(smallfont,Font.CR_FIRE,xx,yy+1,astr1,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_FIRE,xx,yy+1,astr1,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } } Screen.DrawTexture(WeaponTex,false,ss.x-(margin+60),ss.y-(margin+28),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); @@ -2545,7 +2551,7 @@ Class SWWMStatusBar : BaseStatusBar } if ( !hasammo ) ncolor = Font.CR_RED; } - Screen.DrawText(smallfont,ncolor,xx,yy,String.Format("%d",(i%10)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,ncolor,xx,yy,String.Format("%d",(i%10)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx += 12; if ( i == 5 ) { @@ -2607,16 +2613,16 @@ Class SWWMStatusBar : BaseStatusBar tst = "AAA"; SWWMUtility.ObscureText(tst,(gametic-trl)/3); trl--; - Screen.DrawText(smallfont,Font.CR_WHITE,margin+108,ss.y-(margin+14),tst,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,falph*alph,DTA_LegacyRenderStyle,STYLE_Add); + Screen.DrawText(mSmallFont,Font.CR_WHITE,margin+108,ss.y-(margin+14),tst,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,falph*alph,DTA_LegacyRenderStyle,STYLE_Add); } - Screen.DrawText(smallfont,hcolor,margin+108,ss.y-(margin+14),String.Format("%3d",clamp(ht,0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,1.-falph); + Screen.DrawText(mSmallFont,hcolor,margin+108,ss.y-(margin+14),String.Format("%3d",clamp(ht,0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,1.-falph); } - else Screen.DrawText(smallfont,hcolor,margin+108,ss.y-(margin+14),String.Format("%3d",clamp(ht,0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + else Screen.DrawText(mSmallFont,hcolor,margin+108,ss.y-(margin+14),String.Format("%3d",clamp(ht,0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } private void DrawPickups() { - int h = smallfont.GetHeight(); + int h = mSmallFont.GetHeight(); // draw nametags below them double yy; double nalph = 0.; @@ -2627,10 +2633,10 @@ Class SWWMStatusBar : BaseStatusBar yy = ss.y-(margin+50); // shift up if boss healthbar is present if ( hnd && (hnd.bossalpha > 0.) ) yy -= int(25*clamp(hnd.bossalpha*2.,0.,1.)); - int len = smallfont.StringWidth(ntagstr); + int len = mSmallFont.StringWidth(ntagstr); double xx = (ss.x-len)/2.; Screen.Dim("Black",.8*nalph,int((xx-6)*hs),int(yy*hs),int((len+12)*hs),int((h+4)*hs)); - Screen.DrawText(smallfont,ntagcol,int(xx),yy+2,ntagstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,nalph); + Screen.DrawText(mSmallFont,ntagcol,int(xx),yy+2,ntagstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,nalph); } if ( PickupQueue.Size() <= 0 ) return; // reverse order since they're drawn bottom to top @@ -2639,7 +2645,7 @@ Class SWWMStatusBar : BaseStatusBar // shift up if boss healthbar is present if ( hnd && (hnd.bossalpha > 0.) ) yy -= int(25*clamp(hnd.bossalpha*2.,0.,1.)); // shift up again if nametag is present - if ( nalph > 0. ) yy -= int((smallfont.GetHeight()+6)*clamp(nalph*2.,0.,1.)); + if ( nalph > 0. ) yy -= int((mSmallFont.GetHeight()+6)*clamp(nalph*2.,0.,1.)); for ( int i=PickupQueue.Size()-1; i>=mend; i-- ) { PickupQueue[i].UpdateText(int(ss.x*.75)); @@ -2649,16 +2655,16 @@ Class SWWMStatusBar : BaseStatusBar int maxlen = 0; for ( int j=0; j maxlen ) maxlen = len; } double xx = (ss.x-maxlen)/2.; Screen.Dim("Black",.8*alph,int((xx-6)*hs),int((yy-h*(l.Count()-1))*hs),int((maxlen+12)*hs),int((h*l.Count()+4)*hs)); for ( int j=l.Count()-1; j>=0; j-- ) { - int len = smallfont.StringWidth(l.StringAt(j)); + int len = mSmallFont.StringWidth(l.StringAt(j)); xx = int((ss.x-len)/2.); - Screen.DrawText(smallfont,msg0color,xx,yy+2,l.StringAt(j),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph); + Screen.DrawText(mSmallFont,msg0color,xx,yy+2,l.StringAt(j),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph); yy -= h; } yy -= 6; @@ -2678,20 +2684,20 @@ Class SWWMStatusBar : BaseStatusBar if ( !midl || (midsz != int(ss.x*ssp)) ) { if ( midl ) midl.Destroy(); - midl = SmallFont.BreakLines(midstr,int(ss.x*ssp)); + midl = mSmallFont.BreakLines(midstr,int(ss.x*ssp)); } - int h = smallfont.GetHeight(); + int h = mSmallFont.GetHeight(); int maxlen = 0; - for ( int i=0; i ss.x-4 ) { // draw trailing dots - Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,"...",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(fnt,Font.CR_WHITE,xx,yy,"...",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); // shift back xx -= w-(ss.x-4); // draw trimmed - Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,fullstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipLeft,int(26*hs)); + Screen.DrawText(fnt,Font.CR_WHITE,xx,yy,fullstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipLeft,int(26*hs)); } - else Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,fullstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + else Screen.DrawText(fnt,Font.CR_WHITE,xx,yy,fullstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); return true; } override bool DrawPaused( int player ) { + let fnt = mBigFont?mBigFont:NewSmallFont; + let fnt2 = mSmallFont?mSmallFont:NewConsoleFont; if ( swwm_fuzz ) { Vector2 tsize = TexMan.GetScaledSize(bgtex); @@ -2772,31 +2781,31 @@ Class SWWMStatusBar : BaseStatusBar { pausepos.x += pausedir.x*CleanXFac; pausepos.y += pausedir.y*CleanYFac; - if ( pausepos.x >= Screen.GetWidth()-((bigfont.StringWidth(str)+8)*CleanXFac/2) ) + if ( pausepos.x >= Screen.GetWidth()-((fnt.StringWidth(str)*3+8)*CleanXFac/2) ) pausedir.x = -1; - if ( pausepos.x < ((bigfont.StringWidth(str)+8)*CleanXFac/2) ) + if ( pausepos.x < ((fnt.StringWidth(str)*3+8)*CleanXFac/2) ) pausedir.x = 1; - if ( pausepos.y >= Screen.GetHeight()-((bigfont.GetHeight()+8)*CleanYFac/2) ) + if ( pausepos.y >= Screen.GetHeight()-((fnt.GetHeight()*3+8)*CleanYFac/2) ) pausedir.y = -1; - if ( pausepos.y < ((bigfont.GetHeight()+8)*CleanYFac/2) ) + if ( pausepos.y < ((fnt.GetHeight()*3+8)*CleanYFac/2) ) pausedir.y = 1; } - double xx = pausepos.x-bigfont.StringWidth(str)*CleanXFac/2; - double yy = pausepos.y-bigfont.GetHeight()*CleanYFac/2; + double xx = pausepos.x-(fnt.StringWidth(str)*3*CleanXFac)/2; + double yy = pausepos.y-(fnt.GetHeight()*3*CleanYFac)/2; int tlen = str.CodePointCount(); for ( int i=0, pos=0; i= 0) && (initspd < 32) ) initspd = 32; @@ -48,7 +50,7 @@ Class PayRespects : HUDMessageBase fo.x += (.15*initspd)*((initialspan-(lifespan-fractic))**.6); fo.y += ((initialspan-(lifespan-fractic))**1.6)-boostup*sin((90./initialspan)*(level.maptime+fractic-starttic)); double alph = clamp((lifespan+fractic)/double(initialspan),0.,1.); - Screen.DrawText(smallfont,Font.CR_GREEN,realpos.x-fo.x,realpos.y-fo.y,"F",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph); + Screen.DrawText(mSmallFont,Font.CR_GREEN,realpos.x-fo.x,realpos.y-fo.y,"F",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph); } } @@ -58,6 +60,7 @@ Class SWWMOneLiner : HUDMessageBase String whichline; transient BrokenLines l; int lifespan, curtime; + Font mSmallFont; static SWWMOneLiner Make( String whichline, int lifespan ) { @@ -65,6 +68,7 @@ Class SWWMOneLiner : HUDMessageBase if ( StringTable.Localize(whichline) == "" ) l.whichline = ""; else l.whichline = StringTable.Localize("$SWWM_LQUOTE")..StringTable.Localize(whichline)..StringTable.Localize("$SWWM_RQUOTE"); l.curtime = l.lifespan = lifespan; + l.mSmallFont = Font.GetFont('TewiFont'); return l; } @@ -89,14 +93,14 @@ Class SWWMOneLiner : HUDMessageBase Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs); if ( whichline == "" ) return; // don't draw empty strings // split so it can fit - if ( !l ) l = smallfont.BreakLines(whichline,int(ss.x*.5)); + if ( !l ) l = mSmallFont.BreakLines(whichline,int(ss.x*.5)); int maxlen = 0; for ( int i=0; i maxlen ) maxlen = len; } - int h = smallfont.GetHeight(); + int h = mSmallFont.GetHeight(); int fh = h*l.Count(); double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0; double fcurtime = curtime-fractic; @@ -106,8 +110,8 @@ Class SWWMOneLiner : HUDMessageBase int yy = margin+fh; for ( int i=0; i weapon ) { @@ -252,6 +260,8 @@ Class SWWMWeaponTooltip : HUDMessageBase fadeintics = 5; fadeouttics = 15; tics = -10; + mSmallFont = Font.GetFont('TewiFont'); + mTinyFont = Font.GetFont('MiniwiFont'); return self; } @@ -272,27 +282,27 @@ Class SWWMWeaponTooltip : HUDMessageBase double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0; double ftics = tics+fractic; double alpha = (ftics w ) w = lw; } int cw = int(ceil((max(w1,w)+8)/6.))*6; - int h = smallfont.GetHeight()+8+smallfont2.GetHeight()*l.Count(); + int h = mSmallFont.GetHeight()+8+mTinyFont.GetHeight()*l.Count(); Vector2 pos = (int(ss.x/2),ss.y-(swwm_hudmargin+80+h)); Screen.Dim("Black",.5*alpha,int((pos.x-(cw+4)/2)*hs),int((pos.y-2)*hs),int((cw+4)*hs),int((h+4)*hs)); - Screen.DrawText(smallfont,Font.CR_FIRE,pos.x-w1/2,pos.y,wpn,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha); + Screen.DrawText(mSmallFont,Font.CR_FIRE,pos.x-w1/2,pos.y,wpn,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha); for ( int i=0; i seqcnt) ) return; EventHandler.SendNetworkEvent("swwmstoremessage."..chrname..": "..txt,level.totaltime,PRINT_CHAT,consoleplayer); @@ -369,7 +381,7 @@ Class SWWMDirectMessage : HUDMessageBase { if ( cur <= 0 ) break; String part = l.StringAt(i).Left(cur); - Screen.DrawText(smallfont,Font.CR_WHITE,pos.x,pos.y,part,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,pos.x,pos.y,part,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); pos.y += 13; cur -= l.StringAt(i).Length(); } diff --git a/zscript/kbase/swwm_kbase.zsc b/zscript/kbase/swwm_kbase.zsc index edb33b5a3..a9c96368a 100644 --- a/zscript/kbase/swwm_kbase.zsc +++ b/zscript/kbase/swwm_kbase.zsc @@ -67,6 +67,8 @@ Class DemolitionistMenu : GenericMenu Array tabs; int curtab; int oldtab; // used for returning from help tab + // fonts + Font mSmallFont, mTinyFont; int GenTUID() { @@ -158,6 +160,8 @@ Class DemolitionistMenu : GenericMenu FrameTex = TexMan.CheckForTexture("graphics/KBase/FrameTex.png",TexMan.Type_MiscPatch); VSepTex = TexMan.CheckForTexture("graphics/KBase/VSepTex.png",TexMan.Type_MiscPatch); HSepTex = TexMan.CheckForTexture("graphics/KBase/HSepTex.png",TexMan.Type_MiscPatch); + mSmallFont = Font.GetFont('TewiFont'); + mTinyFont = Font.GetFont('MiniwiFont'); // note that we can assume 640x400 will always be the smallest resolution allowed by gzdoom, but we still need to handle widescreen hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/266.)),1.); ss = (Screen.GetWidth(),Screen.GetHeight())/hs; @@ -348,7 +352,7 @@ Class DemolitionistMenu : GenericMenu { if ( tabs[i].bHidden ) continue; str = tabs[i].title; - len = smallfont.StringWidth(str)+10; + len = mSmallFont.StringWidth(str)+10; if ( (mpos.x >= xx) && (mpos.x < xx+len) ) { if ( curtab == i ) break; @@ -521,23 +525,23 @@ Class DemolitionistMenu : GenericMenu { if ( tabs[i].bHidden ) continue; str = tabs[i].title; - Screen.DrawText(smallfont,(curtab==i)?Font.CR_FIRE:Font.CR_DARKGRAY,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - xx += smallfont.StringWidth(str)+10; + Screen.DrawText(mSmallFont,(curtab==i)?Font.CR_FIRE:Font.CR_DARKGRAY,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + xx += mSmallFont.StringWidth(str)+10; DrawVSeparator(xx-5,0,14); } // draw money - xx = 637-smallfont.StringWidth(munstr); - Screen.DrawText(smallfont,Font.CR_FIRE,origin.x+xx,origin.y+yy,munstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + xx = 637-mSmallFont.StringWidth(munstr); + Screen.DrawText(mSmallFont,Font.CR_FIRE,origin.x+xx,origin.y+yy,munstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); yy = ws.y-13; // draw clock / messages if ( gametic < tmsgtic ) str = tmsg; else str = clockstr; xx = 4; - Screen.DrawText(smallfont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); // draw os version str = "DemolitionOS v1.0"; - xx = 637-smallfont.StringWidth(str); - Screen.DrawText(smallfont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + xx = 637-mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); // draw tab contents if ( (tabs.Size() <= 0) || (curtab == -1) || !tabs[curtab] ) return; tabs[curtab].Drawer(); diff --git a/zscript/kbase/swwm_kbase_list.zsc b/zscript/kbase/swwm_kbase_list.zsc index 2b2c1f172..47820f1b1 100644 --- a/zscript/kbase/swwm_kbase_list.zsc +++ b/zscript/kbase/swwm_kbase_list.zsc @@ -71,12 +71,12 @@ Class DemolitionistMenuListItem ui virtual int GetWidth() { - return smallfont.StringWidth(label); + return master.mSmallFont.StringWidth(label); } virtual int GetHeight() { - return smallfont.GetHeight(); + return master.mSmallFont.GetHeight(); } virtual Vector2 GetDrawBounds() @@ -102,6 +102,6 @@ Class DemolitionistMenuListItem ui virtual void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright ) { - Screen.DrawText(smallfont,selected?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mSmallFont,selected?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } } diff --git a/zscript/kbase/swwm_kbase_tab.zsc b/zscript/kbase/swwm_kbase_tab.zsc index 3a86fb91a..57317baa4 100644 --- a/zscript/kbase/swwm_kbase_tab.zsc +++ b/zscript/kbase/swwm_kbase_tab.zsc @@ -43,9 +43,9 @@ Class DemolitionistMenuTab ui abstract { // placeholder (so don't call super) String str = StringTable.Localize("$SWWM_COMINGSOON"); - double xx = int(master.ws.x-smallfont.StringWidth(str))/2; - double yy = int(master.ws.y-smallfont.GetHeight())/2; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2; + double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2; + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); } } diff --git a/zscript/kbase/swwm_kbase_textbox.zsc b/zscript/kbase/swwm_kbase_textbox.zsc index d831367f2..906714bfa 100644 --- a/zscript/kbase/swwm_kbase_textbox.zsc +++ b/zscript/kbase/swwm_kbase_textbox.zsc @@ -22,12 +22,12 @@ Class DemolitionistMenuTextBox ui else self.txt = txt; ofs = 0; // break lines - l = smallfont.BreakLines(self.txt,self.w-12); + l = master.mSmallFont.BreakLines(self.txt,self.w-12); int h = l.Count()*13; if ( h > (master.ws.y-34) ) { l.Destroy(); - l = smallfont.BreakLines(self.txt,self.w-20); + l = master.mSmallFont.BreakLines(self.txt,self.w-20); scrollbar = true; maxofs = int((l.Count()*13)-(master.ws.y-34)); } @@ -45,14 +45,14 @@ Class DemolitionistMenuTextBox ui // break lines again (if changed) if ( (self.w == oldw) && (self.txt == oldtxt) ) return; if ( l ) l.Destroy(); - l = smallfont.BreakLines(self.txt,self.w-12); + l = master.mSmallFont.BreakLines(self.txt,self.w-12); int h = l.Count()*13; scrollbar = false; maxofs = 0; if ( h > (master.ws.y-34) ) { l.Destroy(); - l = smallfont.BreakLines(self.txt,self.w-20); + l = master.mSmallFont.BreakLines(self.txt,self.w-20); scrollbar = true; maxofs = int((l.Count()*13)-(master.ws.y-34)); } @@ -111,13 +111,13 @@ Class DemolitionistMenuTextBox ui // to save time, we skip lines that aren't visible if ( yy < 4 ) continue; if ( yy >= master.ws.y-19 ) continue; - Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,dark?Color(96,0,0,0):Color(0,0,0,0),DTA_ClipTop,miny,DTA_ClipBottom,maxy); + Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,dark?Color(96,0,0,0):Color(0,0,0,0),DTA_ClipTop,miny,DTA_ClipBottom,maxy); } if ( !scrollbar ) return; xx = x+(w-8); master.DrawVSeparator(xx,14,master.ws.y-28); xx += 2; yy = floor(smofs*((master.ws.y-39)/maxofs))+14; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); } } diff --git a/zscript/kbase/swwm_kbasetab_chat.zsc b/zscript/kbase/swwm_kbasetab_chat.zsc index a34b7a4bf..21dcf1451 100644 --- a/zscript/kbase/swwm_kbasetab_chat.zsc +++ b/zscript/kbase/swwm_kbasetab_chat.zsc @@ -142,9 +142,9 @@ Class DemolitionistChatTab : DemolitionistMenuTab if ( !hist || (msglist.items.Size() <= 0) ) { String str = StringTable.Localize("$SWWM_NOCHAT"); - double xx = int(master.ws.x-smallfont.StringWidth(str))/2; - double yy = int(master.ws.y-smallfont.GetHeight())/2; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2; + double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2; + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); return; } double xx = 3; @@ -159,7 +159,7 @@ Class DemolitionistChatTab : DemolitionistMenuTab master.DrawVSeparator(xx,14,master.ws.y-28); xx += 2; yy = floor(smofs*((master.ws.y-39)/maxofs))+14; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); } } @@ -185,8 +185,8 @@ Class DemolitionistMenuChatItem : DemolitionistMenuListItem int tmin = (rtime/60)%60; int tsec = rtime%60; tstamp = String.Format("\cm[\c-%02d\cm:\c-%02d\cm:\c-%02d\cm]\c- ",thour,tmin,tsec); - margin = smallfont.StringWidth(tstamp); - l = smallfont.BreakLines(m.str,int(master.ws.x-14)-margin); + margin = master.mSmallFont.StringWidth(tstamp); + l = master.mSmallFont.BreakLines(m.str,int(master.ws.x-14)-margin); return self; } @@ -212,12 +212,12 @@ Class DemolitionistMenuChatItem : DemolitionistMenuListItem if ( !l ) { // we'll assume this is a level change label - double xx = int((master.ws.x-14)-smallfont.StringWidth(label))/2; - Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+pos.x+xx,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + double xx = int((master.ws.x-14)-master.mSmallFont.StringWidth(label))/2; + Screen.DrawText(master.mSmallFont,Font.CR_GOLD,master.origin.x+pos.x+xx,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); return; } - Screen.DrawText(smallfont,Font.CR_DARKGRAY,master.origin.x+pos.x,master.origin.y+pos.y,tstamp,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mSmallFont,Font.CR_DARKGRAY,master.origin.x+pos.x,master.origin.y+pos.y,tstamp,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); for ( int i=0; i")+6); + lwidth = max(lwidth,master.mSmallFont.StringWidth("<‼ "..sname[i].." ‼>")+6); lists[i] = new("DemolitionistMenuList"); lists[i].master = master; } @@ -62,7 +62,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab let ent = lore.ent[i]; let le = new("DemolitionistMenuLoreItem").Init(master,ent); lists[ent.tab].items.Push(le); - lwidth = max(lwidth,smallfont.StringWidth("‼"..le.label)+6); + lwidth = max(lwidth,master.mSmallFont.StringWidth("‼"..le.label)+6); } for ( int i=0; i<4; i++ ) { @@ -105,7 +105,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab let ent = lore.ent[i]; let le = new("DemolitionistMenuLoreItem").Init(master,ent); lists[ent.tab].items.Push(le); - lwidth = max(lwidth,smallfont.StringWidth("‼"..le.label)+6); + lwidth = max(lwidth,master.mSmallFont.StringWidth("‼"..le.label)+6); } // re-sort the lists, ensuring we are still selecting the same entry for ( int i=0; i<4; i++ ) @@ -359,7 +359,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab String str = sname[section]; master.DrawVSeparator(lwidth,14,master.ws.y-28); master.DrawHSeparator(0,28,lwidth); - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+(lwidth-smallfont.StringWidth(str))/2,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+(lwidth-master.mSmallFont.StringWidth(str))/2,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); bool hasprev = false; bool hasunreadprev = false; for ( int i=0; i",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+lwidth-9,master.origin.y+yy,">",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); if ( hasunreadnext ) - Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+lwidth-15,master.origin.y+yy,"‼",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,Font.CR_GOLD,master.origin.x+lwidth-15,master.origin.y+yy,"‼",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); xx = 3; yy = 32; int cliptop = int((master.origin.y+32)*master.hs); @@ -409,16 +409,16 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab master.DrawVSeparator(xx+8,14,master.ws.y-28); xx += 2; yy = floor(smofs[section]*((master.ws.y-39)/maxofs[section]))+14; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); } if ( clore && ltext ) ltext.Drawer(); else { str = StringTable.Localize("$SWWM_LOREUNSEL"); int lwx = lwidth+((maxofs[section]>0)?8:0); - xx = lwx+int((master.ws.x-lwx)-smallfont.StringWidth(str))/2; - yy = int(master.ws.y-smallfont.GetHeight())/2; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + xx = lwx+int((master.ws.x-lwx)-master.mSmallFont.StringWidth(str))/2; + yy = int(master.ws.y-master.mSmallFont.GetHeight())/2; + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); } } } @@ -439,8 +439,8 @@ Class DemolitionistMenuLoreItem : DemolitionistMenuListItem override int GetWidth() { - if ( !ent.read ) return smallfont.StringWidth("‼"..label); - return smallfont.StringWidth(label); + if ( !ent.read ) return master.mSmallFont.StringWidth("‼"..label); + return master.mSmallFont.StringWidth(label); } // marks this entry as read @@ -454,6 +454,6 @@ Class DemolitionistMenuLoreItem : DemolitionistMenuListItem { String str = label; if ( !ent.read ) str = "\cf‼\c-"..label; - Screen.DrawText(smallfont,bActive?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0)); + Screen.DrawText(master.mSmallFont,bActive?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0)); } } diff --git a/zscript/kbase/swwm_kbasetab_mission.zsc b/zscript/kbase/swwm_kbasetab_mission.zsc index 982cf3683..19ef331e5 100644 --- a/zscript/kbase/swwm_kbasetab_mission.zsc +++ b/zscript/kbase/swwm_kbasetab_mission.zsc @@ -277,16 +277,16 @@ Class DemolitionistMissionTab : DemolitionistMenuTab else { String str = StringTable.Localize("$SWWM_MISSION_NONE"); - double xx = int(master.ws.x-smallfont.StringWidth(str))/2; - double yy = int(master.ws.y-smallfont.GetHeight())/2; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2; + double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2; + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); return; } if ( mtext.Size() <= 1 ) return; double xx = master.ws.x-(mtext[sel].scrollbar?11:3); double yy = master.ws.y-25; String str = String.Format("%d \cf/\c- %d",sel+1,mtext.Size()); - Screen.DrawText(smallfont2,Font.CR_FIRE,(master.origin.x+xx)-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mTinyFont,Font.CR_FIRE,(master.origin.x+xx)-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); } } diff --git a/zscript/kbase/swwm_kbasetab_secret.zsc b/zscript/kbase/swwm_kbasetab_secret.zsc index a9d98970a..1f57eb321 100644 --- a/zscript/kbase/swwm_kbasetab_secret.zsc +++ b/zscript/kbase/swwm_kbasetab_secret.zsc @@ -18,7 +18,7 @@ Class DemolitionistSecretTab : DemolitionistMenuTab img = TexMan.CheckForTexture("graphics/KBase/Drawing_Kirin.png",TexMan.Type_Any); sub = StringTable.Localize("$SWWM_FROMKIRIN"); String str = StringTable.Localize("$SWWM_KIRINPOEM"); - l = smallfont.BreakLines(str,600); + l = master.mSmallFont.BreakLines(str,600); } else if ( (gameinfo.gametype&GAME_Heretic) || SWWMUtility.IsEviternity() ) { @@ -134,16 +134,16 @@ Class DemolitionistSecretTab : DemolitionistMenuTab { if ( l.StringWidth(i) > mxlen ) mxlen = l.StringWidth(i); xx = (i maxlen[0] ) maxlen[0] = len[0]; if ( l.s.stotal > 0 ) { str = String.Format("S %d/%d",l.s.scount,l.s.stotal); - len[1] = smallfont2.StringWidth(str); + len[1] = master.mTinyFont.StringWidth(str); if ( len[1] > maxlen[1] ) maxlen[1] = len[1]; } if ( l.s.itotal > 0 ) { str = String.Format("I %d/%d",l.s.icount,l.s.itotal); - len[2] = smallfont2.StringWidth(str); + len[2] = master.mTinyFont.StringWidth(str); if ( len[2] > maxlen[2] ) maxlen[2] = len[2]; } if ( l.s.ktotal > 0 ) { str = String.Format("K %d/%d",l.s.kcount,l.s.ktotal); - len[3] = smallfont2.StringWidth(str); + len[3] = master.mTinyFont.StringWidth(str); if ( len[3] > maxlen[3] ) maxlen[3] = len[3]; } } @@ -493,7 +493,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab for ( int i=0; i<4; i++ ) { if ( pos.x < 9 ) continue; - if ( pos.x > 9+smallfont.StringWidth(sname[i]) ) continue; + if ( pos.x > 9+master.mSmallFont.StringWidth(sname[i]) ) continue; if ( pos.y < 23+16*i ) continue; if ( pos.y > 36+16*i ) continue; if ( section != i ) @@ -541,16 +541,16 @@ Class DemolitionistStatsTab : DemolitionistMenuTab double yy = 23; for ( int i=0; i<4; i++ ) { - Screen.DrawText(smallfont,(i==section)?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sname[i],DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,(i==section)?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sname[i],DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); yy += 16; } master.DrawVSeparator(lwidth,14,master.ws.y-28); if ( lists[section].items.Size() == 0 ) { String str = StringTable.Localize("$SWWM_NOSTAT"); - xx = lwidth+int((master.ws.x-lwidth)-smallfont.StringWidth(str))/2; - yy = int(master.ws.y-smallfont.GetHeight())/2; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + xx = lwidth+int((master.ws.x-lwidth)-master.mSmallFont.StringWidth(str))/2; + yy = int(master.ws.y-master.mSmallFont.GetHeight())/2; + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); return; } if ( section == 3 ) @@ -580,7 +580,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab master.DrawVSeparator(xx,14,master.ws.y-28); xx += 2; yy = floor(smofs[section]*((master.ws.y-39)/maxofs[section]))+14; - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true); } } } @@ -613,9 +613,9 @@ Class DemolitionistMenuKillItem : DemolitionistMenuListItem override void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright ) { - Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); String str = String.Format("%d",s.kills); - Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+pos.x+width-smallfont.StringWidth(str),master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+pos.x+width-master.mSmallFont.StringWidth(str),master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } } @@ -644,34 +644,34 @@ Class DemolitionistMenuMapStatItem : DemolitionistMenuListItem { String str = label; if ( selected ) str = "\cd▸\c- "..str; - bool smallname = smallfont.StringWidth(str)>(width-(maxlen[3]+maxlen[2]+maxlen[1]+maxlen[0]+24)); - Screen.DrawText(smallname?smallfont2:smallfont,Font.CR_FIRE,master.origin.x+pos.x,master.origin.y+pos.y+smallname*2,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + bool smallname = master.mSmallFont.StringWidth(str)>(width-(maxlen[3]+maxlen[2]+maxlen[1]+maxlen[0]+24)); + Screen.DrawText(smallname?master.mTinyFont:master.mSmallFont,Font.CR_FIRE,master.origin.x+pos.x,master.origin.y+pos.y+smallname*2,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); double xx = pos.x+width; double yy = pos.y+2; int sec = Thinker.Tics2Seconds(s.time); str = String.Format("%02d\cu:\c-%02d\cu:\c-%02d",sec/3600,(sec%3600)/60,sec%60); - Screen.DrawText(smallfont2,((s.suck>0)&&(sec>=(s.suck*3600)))?Font.CR_RED:(sec<=s.par)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); - Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[0],master.origin.y+yy,"T",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,((s.suck>0)&&(sec>=(s.suck*3600)))?Font.CR_RED:(sec<=s.par)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[0],master.origin.y+yy,"T",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); if ( maxlen[0] > 0 ) xx -= maxlen[0]+8; if ( s.stotal > 0 ) { str = String.Format("%d\cu/\c-%d",s.scount,s.stotal); - Screen.DrawText(smallfont2,(s.scount>=s.stotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); - Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[1],master.origin.y+yy,"S",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,(s.scount>=s.stotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[1],master.origin.y+yy,"S",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } if ( maxlen[1] > 0 ) xx -= maxlen[1]+8; if ( s.itotal > 0 ) { str = String.Format("%d\cu/\c-%d",s.icount,s.itotal); - Screen.DrawText(smallfont2,(s.icount>=s.itotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); - Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[2],master.origin.y+yy,"I",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,(s.icount>=s.itotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[2],master.origin.y+yy,"I",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } if ( maxlen[2] > 0 ) xx -= maxlen[2]+8; if ( s.ktotal > 0 ) { str = String.Format("%d\cu/\c-%d",s.kcount,s.ktotal); - Screen.DrawText(smallfont2,(s.kcount>=s.ktotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); - Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[3],master.origin.y+yy,"K",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,(s.kcount>=s.ktotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[3],master.origin.y+yy,"K",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } } } @@ -743,26 +743,26 @@ Class DemolitionistMenuAchievementItem : DemolitionistMenuListItem Screen.DrawTexture(BarTex[completed?2:1],false,xx,yy+35,DTA_DestWidthF,width*(val/double(a.maxval)),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); if ( completed ) str = String.Format("%s / %s",SWWMUtility.ThousandsNum(a.maxval),SWWMUtility.ThousandsNum(a.maxval)); else str = String.Format("%s / %s",SWWMUtility.ThousandsNum(val),SWWMUtility.ThousandsNum(a.maxval)); - int ox = (width-smallfont2.StringWidth(str))/2; - Screen.DrawText(smallfont2,completed?Font.CR_GREEN:Font.CR_WHITE,xx+ox,yy+37,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + int ox = (width-master.mTinyFont.StringWidth(str))/2; + Screen.DrawText(master.mTinyFont,completed?Font.CR_GREEN:Font.CR_WHITE,xx+ox,yy+37,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); } else Screen.DrawTexture(BarTex[completed?2:0],false,xx,yy+35,DTA_DestWidthF,width,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); str = a.hasformat?String.Format(StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TXT"),a.maxval):StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TXT"); if ( str != oldstr ) { if ( l ) l.Destroy(); - l = smallfont2.BreakLines(str,width-40); + l = master.mTinyFont.BreakLines(str,width-40); oldstr = str; } str = StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TAG"); if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(gametic/3)+ypos*2+1); int oy = (32-(14+(9*l.Count())))/2; - Screen.DrawText(smallfont,completed?Font.CR_GREEN:Font.CR_DARKGRAY,xx+36,yy+oy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); + Screen.DrawText(master.mSmallFont,completed?Font.CR_GREEN:Font.CR_DARKGRAY,xx+36,yy+oy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright); for ( int i=0; i xpos+width ) return false; @@ -568,8 +568,8 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem override void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright ) { - Screen.DrawText(smallfont,col,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0)); - Screen.DrawText(smallfont,Font.CR_UNTRANSLATED,master.origin.x+pos.x+(width-16)-smallfont.StringWidth(pricelabel),master.origin.y+pos.y,pricelabel,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0)); + Screen.DrawText(master.mSmallFont,col,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0)); + Screen.DrawText(master.mSmallFont,Font.CR_UNTRANSLATED,master.origin.x+pos.x+(width-16)-master.mSmallFont.StringWidth(pricelabel),master.origin.y+pos.y,pricelabel,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0)); } void BuySellItem() diff --git a/zscript/menu/swwm_credits.zsc b/zscript/menu/swwm_credits.zsc index 640dcbbdc..43ef7903b 100644 --- a/zscript/menu/swwm_credits.zsc +++ b/zscript/menu/swwm_credits.zsc @@ -8,9 +8,11 @@ Class SWWMCreditsEntry ui BrokenLines btext; int width, height; int titlecol, btextcol; + Font mSmallFont; SWWMCreditsEntry Init( String t, String b = "", int c1 = Font.CR_SAPPHIRE, int c2 = Font.CR_WHITE, bool mari = false ) { + mSmallFont = Font.GetFont('TewiFont'); if ( mari ) { MariHack = true; @@ -29,7 +31,7 @@ Class SWWMCreditsEntry ui return self; } String b2 = StringTable.Localize(b); - btext = smallfont.BreakLines(b2,320); + btext = mSmallFont.BreakLines(b2,320); width = CalcWidth(); height = CalcHeight(); return self; @@ -43,7 +45,7 @@ Class SWWMCreditsEntry ui private int CalcWidth() { - int len = smallfont.StringWidth(title); + int len = mSmallFont.StringWidth(title); if ( !btext ) return len; for ( int i=0; i ss.y) ) return logosz.y; if ( swwm_oldlogo ) Screen.DrawTexture(logo,true,x-logosz.x/2,y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); else Screen.DrawTexture(logo,true,x-logosz.x/2,y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ScaleX,(2./3.),DTA_ScaleY,(2./3.)); - Screen.DrawText(smallfont,Font.CR_SAPPHIRE,x-smallfont.StringWidth(stitle)/2,y+(logosz.y-28),stitle,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_SAPPHIRE,x-mSmallFont.StringWidth(stitle)/2,y+(logosz.y-28),stitle,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); // underline - int w = max(smallfont.StringWidth(stitle),smallfont.StringWidth(stitle2)); + int w = max(mSmallFont.StringWidth(stitle),mSmallFont.StringWidth(stitle2)); int cw = int(ceil((w+8)/6.))*6; double xx = x-cw/2; for ( int i=0; i ss.y) ) return bigfont.GetHeight(); - Screen.DrawText(bigfont,Font.CR_BLUE,x-bigfont.StringWidth(txt)/2,y,txt,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - return bigfont.GetHeight(); + if ( (y+mBigFont.GetHeight()*2 < 0) || (y > ss.y) ) return mBigFont.GetHeight()*2; + Screen.DrawText(mBigFont,Font.CR_BLUE,x-mBigFont.StringWidth(txt),y,txt,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ScaleX,2,DTA_ScaleY,2); + return mBigFont.GetHeight()*2; } override void Drawer() { diff --git a/zscript/menu/swwm_help.zsc b/zscript/menu/swwm_help.zsc index 87b185da5..e45c91edd 100644 --- a/zscript/menu/swwm_help.zsc +++ b/zscript/menu/swwm_help.zsc @@ -7,6 +7,7 @@ Class SWWMHelpMenu : GenericMenu TextureID bgtex; bool isrclick; int pagedir; + Font mSmallFont, mSmallFont2; enum EHelpPage { @@ -32,44 +33,46 @@ Class SWWMHelpMenu : GenericMenu fadetic = gametic; pagedir = 0; bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any); + mSmallFont = Font.GetFont('TewiFont'); + mSmallFont2 = Font.GetFont('TewiFontOutline'); for ( int i=0; i= NUM_HELP_PAGES) ) @@ -172,7 +175,7 @@ Class SWWMHelpMenu : GenericMenu let hdr = pagehdr[page]; let l = pagetxt[page]; lh = l.Count()*h; - Screen.DrawText(smallfont,Font.CR_FIRE,xofs+(Screen.GetWidth()-smallfont.StringWidth(hdr)*CleanXFac_1)/2,(Screen.GetHeight()-(h*3+lh)*CleanYFac_1)/2,hdr,DTA_CleanNoMove_1,true,DTA_Alpha,alpha); + Screen.DrawText(mSmallFont2,Font.CR_FIRE,xofs+(Screen.GetWidth()-mSmallFont2.StringWidth(hdr)*CleanXFac_1)/2,(Screen.GetHeight()-(h*3+lh)*CleanYFac_1)/2,hdr,DTA_CleanNoMove_1,true,DTA_Alpha,alpha); for ( int i=0; i 0 ) - Screen.DrawText(smallfont,Font.CR_GOLD,12*CleanXFac_1,y,"<",DTA_CleanNoMove_1,true); + Screen.DrawText(mSmallFont,Font.CR_GOLD,12*CleanXFac_1,y,"<",DTA_CleanNoMove_1,true); if ( curpage < NUM_HELP_PAGES-1 ) - Screen.DrawText(smallfont,Font.CR_GOLD,Screen.GetWidth()-18*CleanXFac_1,y,">",DTA_CleanNoMove_1,true); + Screen.DrawText(mSmallFont,Font.CR_GOLD,Screen.GetWidth()-18*CleanXFac_1,y,">",DTA_CleanNoMove_1,true); y += h*CleanYFac_1; } Super.Drawer(); diff --git a/zscript/menu/swwm_inter.zsc b/zscript/menu/swwm_inter.zsc index b760a61b3..b6d3bbafd 100644 --- a/zscript/menu/swwm_inter.zsc +++ b/zscript/menu/swwm_inter.zsc @@ -12,12 +12,14 @@ Class SWWMStatScreen : StatusScreen abstract double hs, hs2; Vector2 ss, ss2, origin, origin2; double bgfade; + Font mSmallFont; String tipstr; transient BrokenLines tipl; override void Start( wbstartstruct wbstartstruct ) { Super.Start(wbstartstruct); + mSmallFont = Font.GetFont('TewiFont'); // support for old author text style int iof = lnametexts[0].IndexOf(" - by: "); if ( iof != -1 ) @@ -108,10 +110,10 @@ Class SWWMStatScreen : StatusScreen abstract if ( semic != -1 ) { String bstr = String.Format("\cx%s\c- %s",StringTable.Localize("$SWWM_FANART"),artstr.Mid(semic+1)); - int len = smallfont.StringWidth(bstr); - int bw = int((len+8)*hs), bh = int((smallfont.GetHeight()+4)*hs); + int len = mSmallFont.StringWidth(bstr); + int bw = int((len+8)*hs), bh = int((mSmallFont.GetHeight()+4)*hs); Screen.Dim("Black",.8,Screen.GetWidth()-bw,Screen.GetHeight()-bh,bw,bh); - Screen.DrawText(smallfont,Font.CR_GOLD,ss.x-(len+4),ss.y-(smallfont.GetHeight()+2),bstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_GOLD,ss.x-(len+4),ss.y-(mSmallFont.GetHeight()+2),bstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } } // intermission tips at the bottom @@ -144,42 +146,42 @@ Class SWWMStatScreen : StatusScreen abstract } if ( swwm_nointertips ) return; int lw = 0; - if ( !tipl ) tipl = smallfont.BreakLines(tipstr,400); + if ( !tipl ) tipl = mSmallFont.BreakLines(tipstr,400); for ( int i=0; i lw ) lw = tipl.StringWidth(i); - int bw = int((lw+12)*hs), bh = int((smallfont.GetHeight()*tipl.Count()+8)*hs); - double xx = 8, yy = (ss.y-8)-(smallfont.GetHeight()*tipl.Count()); + int bw = int((lw+12)*hs), bh = int((mSmallFont.GetHeight()*tipl.Count()+8)*hs); + double xx = 8, yy = (ss.y-8)-(mSmallFont.GetHeight()*tipl.Count()); Screen.Dim("Black",.8,int((xx-4)*hs),int((yy-4)*hs),bw,bh); for ( int i=0; i0); - Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(4*hs2),dimlen,int((smallfont.GetHeight()+(auth?2:4))*hs2)); - Screen.DrawText(smallfont,Font.CR_GREEN,int((ss2.x-len[0])/2.),6,lnametexts[0],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); - double foy = smallfont.GetHeight()+(auth?6:8); + Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(4*hs2),dimlen,int((mSmallFont.GetHeight()+(auth?2:4))*hs2)); + Screen.DrawText(mSmallFont,Font.CR_GREEN,int((ss2.x-len[0])/2.),6,lnametexts[0],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + double foy = mSmallFont.GetHeight()+(auth?6:8); if ( auth ) { double oy = foy*(hs2/hs); - Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((smallfont.GetHeight()+2)*hs)); - Screen.DrawText(smallfont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[0],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - foy += (smallfont.GetHeight()+2)*(hs/hs2); + Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((mSmallFont.GetHeight()+2)*hs)); + Screen.DrawText(mSmallFont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[0],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + foy += (mSmallFont.GetHeight()+2)*(hs/hs2); } foy += 4.; String str = StringTable.Localize("$WI_FINISHED"); - len[0] = smallfont.StringWidth(str); - Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(foy*hs2),int((len[0]+8)*hs2),int((smallfont.GetHeight()+4)*hs2)); - Screen.DrawText(smallfont,Font.CR_FIRE,int((ss2.x-len[0])/2.),foy+2,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len[0] = mSmallFont.StringWidth(str); + Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(foy*hs2),int((len[0]+8)*hs2),int((mSmallFont.GetHeight()+4)*hs2)); + Screen.DrawText(mSmallFont,Font.CR_FIRE,int((ss2.x-len[0])/2.),foy+2,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); // return not used return 0; } @@ -189,21 +191,21 @@ Class SWWMStatScreen : StatusScreen abstract // remove trailing colon (usually appearing on Heretic) if ( str.RightIndexOf(":") == (str.length()-1) ) str.Truncate(str.length()-1); int len[2]; - len[0] = smallfont.StringWidth(str); - Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(4*hs2),int((len[0]+8)*hs2),int((smallfont.GetHeight()+4)*hs2)); - Screen.DrawText(smallfont,Font.CR_FIRE,int((ss2.x-len[0])/2.),6,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); - double foy = smallfont.GetHeight()+12; - len[0] = smallfont.StringWidth(lnametexts[1]); - len[1] = smallfont.StringWidth(authortexts[1]); + len[0] = mSmallFont.StringWidth(str); + Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(4*hs2),int((len[0]+8)*hs2),int((mSmallFont.GetHeight()+4)*hs2)); + Screen.DrawText(mSmallFont,Font.CR_FIRE,int((ss2.x-len[0])/2.),6,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + double foy = mSmallFont.GetHeight()+12; + len[0] = mSmallFont.StringWidth(lnametexts[1]); + len[1] = mSmallFont.StringWidth(authortexts[1]); int dimlen = max(int((len[0]+8)*hs2),int((len[1]+8)*hs)); bool auth = (authortexts[1].Length()>0); - Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(foy*hs2),dimlen,int((smallfont.GetHeight()+(auth?2:4))*hs2)); - Screen.DrawText(smallfont,Font.CR_GREEN,int((ss2.x-len[0])/2.),foy+2,lnametexts[1],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(foy*hs2),dimlen,int((mSmallFont.GetHeight()+(auth?2:4))*hs2)); + Screen.DrawText(mSmallFont,Font.CR_GREEN,int((ss2.x-len[0])/2.),foy+2,lnametexts[1],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); if ( auth ) { - double oy = (foy+smallfont.GetHeight()+2)*(hs2/hs); - Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((smallfont.GetHeight()+2)*hs)); - Screen.DrawText(smallfont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[1],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + double oy = (foy+mSmallFont.GetHeight()+2)*(hs2/hs); + Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((mSmallFont.GetHeight()+2)*hs)); + Screen.DrawText(mSmallFont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[1],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } } override void drawShowNextLoc( void ) @@ -460,70 +462,70 @@ Class SWWMStatScreen_SP : SWWMStatScreen int maxlen, maxlenl = 0, maxlenr = 0; // left strings String str = StringTable.Localize("$TXT_IMKILLS")..":"; - int len = smallfont.StringWidth(str); + int len = mSmallFont.StringWidth(str); maxlenl = len; str = StringTable.Localize("$TXT_IMITEMS")..":"; - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenl ) maxlenl = len; str = StringTable.Localize("$TXT_IMSECRETS")..":"; - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenl ) maxlenl = len; str = StringTable.Localize("$TXT_IMTIME")..":"; - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenl ) maxlenl = len; if ( wi_showtotaltime ) { str = StringTable.Localize("$SCORE_TOTAL")..":"; // hey, as long as it works - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenl ) maxlenl = len; } if ( wbs.partime ) { str = StringTable.Localize("$TXT_IMPAR")..":"; - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenl ) maxlenl = len; } // right strings if ( wi_percents ) { str = String.Format("%d%%",GetPct(Plrs[me].skills,wbs.maxkills)); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); maxlenr = len; str = String.Format("%d%%",GetPct(Plrs[me].sitems,wbs.maxitems)); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenr ) maxlenr = len; str = String.Format("%d%%",GetPct(Plrs[me].ssecret,wbs.maxsecret)); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenr ) maxlenr = len; } else { str = String.Format("%d / %d",Plrs[me].skills,wbs.maxkills); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); maxlenr = len; str = String.Format("%d / %d",Plrs[me].sitems,wbs.maxitems); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenr ) maxlenr = len; str = String.Format("%d / %d",Plrs[me].ssecret,wbs.maxsecret); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenr ) maxlenr = len; } str = TimeStr(Thinker.Tics2Seconds(Plrs[me].stime)); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenr ) maxlenr = len; if ( wi_showtotaltime ) { str = TimeStr(Thinker.Tics2Seconds(wbs.totaltime)); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenr ) maxlenr = len; } if ( wbs.partime ) { str = TimeStr(wbs.partime/GameTicRate); - len = smallfont.StringWidth(str); + len = mSmallFont.StringWidth(str); if ( len > maxlenr ) maxlenr = len; } - int step = smallfont.GetHeight()+1; + int step = mSmallFont.GetHeight()+1; int nl = clamp(sp_state/2,0,4); if ( (nl == 4) ) { @@ -535,20 +537,20 @@ Class SWWMStatScreen_SP : SWWMStatScreen // draw the whole damn thing if ( sp_state >= 2 ) Screen.Dim("Black",.8,int((ss2.x-maxlen-8)*.5*hs2),int((ss2.y-nl-8)*.5*hs2),int((maxlen+8)*hs2),int((nl+8)*hs2)); int xx = int((ss2.x-maxlen)/2), yy = int((ss2.y-nl)/2); - if ( sp_state >= 2 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMKILLS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + if ( sp_state >= 2 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMKILLS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); yy += step; - if ( sp_state >= 4 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMITEMS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + if ( sp_state >= 4 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMITEMS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); yy += step; - if ( sp_state >= 6 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMSECRETS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + if ( sp_state >= 6 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMSECRETS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); yy += step; - if ( sp_state >= 8 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMTIME")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + if ( sp_state >= 8 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMTIME")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); yy += step; if ( wi_showtotaltime ) { - if ( sp_state >= 8 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$SCORE_TOTAL")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + if ( sp_state >= 8 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$SCORE_TOTAL")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); yy += step; } - if ( wbs.partime && (sp_state >= 8) ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMPAR")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + if ( wbs.partime && (sp_state >= 8) ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMPAR")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); xx = int((ss2.x+maxlen)/2); yy = int((ss2.y-nl)/2); if ( wi_percents ) @@ -556,22 +558,22 @@ Class SWWMStatScreen_SP : SWWMStatScreen if ( cnt_kills[0] >= 0 ) { str = String.Format("%d\cu%%\c-",GetPct(cnt_kills[0],wbs.maxkills)); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,(!wbs.maxkills||(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,(!wbs.maxkills||(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; if ( cnt_items[0] >= 0 ) { str = String.Format("%d\cu%%\c-",GetPct(cnt_items[0],wbs.maxitems)); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,(!wbs.maxitems||(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,(!wbs.maxitems||(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; if ( cnt_secret[0] >= 0 ) { str = String.Format("%d\cu%%\c-",GetPct(cnt_secret[0],wbs.maxsecret)); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,(!wbs.maxsecret||(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,(!wbs.maxsecret||(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; } @@ -580,30 +582,30 @@ Class SWWMStatScreen_SP : SWWMStatScreen if ( cnt_kills[0] >= 0 ) { str = String.Format("%d \cu/\c- \cj%d\c-",max(cnt_kills[0],0),wbs.maxkills); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,(wbs.maxkills&&(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,(wbs.maxkills&&(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; if ( cnt_items[0] >= 0 ) { str = String.Format("%d \cu/\c- \cj%d\c-",max(cnt_items[0],0),wbs.maxitems); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,(wbs.maxitems&&(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,(wbs.maxitems&&(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; if ( cnt_secret[0] >= 0 ) { str = String.Format("%d \cu/\c- \cj%d\c-",max(cnt_secret[0],0),wbs.maxsecret); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,(wbs.maxsecret&&(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,(wbs.maxsecret&&(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; } if ( cnt_time >= 0 ) { str = TimeStr(cnt_time); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,(wbs.partime&&(cnt_time<=(wbs.partime/GameTicRate)))?Font.CR_GOLD:((wbs.sucktime>0)&&(cnt_time>(wbs.sucktime*3600)))?Font.CR_RED:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,(wbs.partime&&(cnt_time<=(wbs.partime/GameTicRate)))?Font.CR_GOLD:((wbs.sucktime>0)&&(cnt_time>(wbs.sucktime*3600)))?Font.CR_RED:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; if ( wi_showtotaltime ) @@ -611,16 +613,16 @@ Class SWWMStatScreen_SP : SWWMStatScreen if ( cnt_total_time >= 0 ) { str = TimeStr(cnt_total_time); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } yy += step; } if ( wbs.partime && (cnt_par >= 0) ) { str = TimeStr(cnt_par); - len = smallfont.StringWidth(str); - Screen.DrawText(smallfont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); + len = mSmallFont.StringWidth(str); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true); } } } @@ -767,12 +769,12 @@ Class SWWMStatScreen_Coop : SWWMStatScreen String killsstr = StringTable.Localize("$SCORE_KILLS"); String missedstr = StringTable.Localize("$SCORE_MISSED"); String totalstr = StringTable.Localize("$SCORE_TOTAL"); - int namelen = max(max(smallfont.StringWidth(namestr),smallfont.StringWidth("XXXXXXXXXX")),max(smallfont.StringWidth(missedstr),smallfont.StringWidth(totalstr))); + int namelen = max(max(mSmallFont.StringWidth(namestr),mSmallFont.StringWidth("XXXXXXXXXX")),max(mSmallFont.StringWidth(missedstr),mSmallFont.StringWidth(totalstr))); int nplayers = 0; for ( int i=0; i= 4 ) { str = String.Format("%3d\cu%%\c-",GetPct(cnt_items[i],wbs.maxitems)); - Screen.DrawText(smallfont,(!wbs.maxitems||(cnt_items[i]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx+itemslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,(!wbs.maxitems||(cnt_items[i]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx+itemslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); misseditems -= cnt_items[i]; } xx += itemslen+spc; if ( ng_state >= 6 ) { str = String.Format("%3d\cu%%\c-",GetPct(cnt_secret[i],wbs.maxsecret)); - Screen.DrawText(smallfont,(!wbs.maxsecret||(cnt_secret[i]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx+secretlen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,(!wbs.maxsecret||(cnt_secret[i]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx+secretlen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); missedsecret -= cnt_secret[i]; } xx += secretlen+spc; str = String.Format("%3d\cu%%\c-",GetPct(cnt_kills[i],wbs.maxkills)); - Screen.DrawText(smallfont,(!wbs.maxkills||(cnt_kills[i]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx+killslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,(!wbs.maxkills||(cnt_kills[i]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx+killslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); missedkills -= cnt_kills[i]; yy += lineh+lspc; } xx = int((ss.x-boxwidth)/2+pad+pad+rwidth); yy += hspc; - Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,missedstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,missedstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx += namelen+spc; if ( ng_state >= 4 ) { str = String.Format("%3d\cu%%\c-",GetPct(misseditems,wbs.maxitems,true)); - Screen.DrawText(smallfont,(wbs.maxitems&&(misseditems>0))?Font.CR_WHITE:Font.CR_GOLD,xx+itemslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,(wbs.maxitems&&(misseditems>0))?Font.CR_WHITE:Font.CR_GOLD,xx+itemslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } xx += itemslen+spc; if ( ng_state >= 6 ) { str = String.Format("%3d\cu%%\c-",GetPct(missedsecret,wbs.maxsecret,true)); - Screen.DrawText(smallfont,(wbs.maxsecret&&(missedsecret>0))?Font.CR_WHITE:Font.CR_GOLD,xx+secretlen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,(wbs.maxsecret&&(missedsecret>0))?Font.CR_WHITE:Font.CR_GOLD,xx+secretlen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } xx += secretlen+spc; str = String.Format("%3d\cu%%\c-",GetPct(missedkills,wbs.maxkills,true)); - Screen.DrawText(smallfont,(wbs.maxkills&&(missedkills>0))?Font.CR_WHITE:Font.CR_GOLD,xx+killslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,(wbs.maxkills&&(missedkills>0))?Font.CR_WHITE:Font.CR_GOLD,xx+killslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); yy += lineh+lspc; xx = int((ss.x-boxwidth)/2+pad+pad+rwidth); - Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx += namelen+spc; if ( ng_state >= 4 ) { str = String.Format("%d",wbs.maxitems); - Screen.DrawText(smallfont,Font.CR_WHITE,xx+itemslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+itemslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } xx += itemslen+spc; if ( ng_state >= 6 ) { str = String.Format("%d",wbs.maxsecret); - Screen.DrawText(smallfont,Font.CR_WHITE,xx+secretlen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+secretlen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } xx += secretlen+spc; str = String.Format("%d",wbs.maxkills); - Screen.DrawText(smallfont,Font.CR_WHITE,xx+killslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+killslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } } @@ -986,36 +988,36 @@ Class SWWMStatScreen_DM : SWWMStatScreen String deathsstr = StringTable.Localize("$SCORE_DEATHS"); String fragsstr = StringTable.Localize("$SCORE_FRAGS"); String totalstr = StringTable.Localize("$SCORE_TOTAL"); - int namelen = max(max(smallfont.StringWidth(namestr),smallfont.StringWidth("XXXXXXXXXX")),smallfont.StringWidth(totalstr)); + int namelen = max(max(mSmallFont.StringWidth(namestr),mSmallFont.StringWidth("XXXXXXXXXX")),mSmallFont.StringWidth(totalstr)); int nplayers = 0; for ( int i=0; i sorted; @@ -1027,31 +1029,31 @@ Class SWWMStatScreen_DM : SWWMStatScreen xx = int((ss.x-boxwidth)/2+pad); Screen.Dim(players[i].GetDisplayColor(),.4,int(xx*hs),int(yy*hs),int(linew*hs),int(lineh*hs)); xx += pad; - if ( playerready[i] || players[i].Bot ) Screen.DrawChar(smallfont,Font.CR_GREEN,xx,yy,checkmark,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + if ( playerready[i] || players[i].Bot ) Screen.DrawChar(mSmallFont,Font.CR_GREEN,xx,yy,checkmark,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx += rwidth; - Screen.DrawText(smallfont,GetRowColor(players[i],i==me),xx,yy,players[i].GetUserName(),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,GetRowColor(players[i],i==me),xx,yy,players[i].GetUserName(),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx += namelen+spc; if ( ng_state >= 2 ) { str = String.Format("%d",cnt_deaths[i]); - Screen.DrawText(smallfont,Font.CR_WHITE,xx+deathslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+deathslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } xx += deathslen+spc; str = String.Format("%d",cnt_frags[i]); - Screen.DrawText(smallfont,Font.CR_WHITE,xx+fragslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+fragslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); yy += lineh+lspc; } xx = int((ss.x-boxwidth)/2+pad+pad+rwidth); yy += hspc; - Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx += namelen+spc; if ( ng_state >= 4 ) { str = String.Format("%d",total_deaths); - Screen.DrawText(smallfont,Font.CR_WHITE,xx+deathslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+deathslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } xx += deathslen+spc; str = String.Format("%d",total_frags); - Screen.DrawText(smallfont,Font.CR_WHITE,xx+fragslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+fragslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } } diff --git a/zscript/menu/swwm_menus.zsc b/zscript/menu/swwm_menus.zsc index 5fd34543c..cfbe55b77 100644 --- a/zscript/menu/swwm_menus.zsc +++ b/zscript/menu/swwm_menus.zsc @@ -273,6 +273,7 @@ Class SWWMMainMenu : SWWMCleanMenu TextureID demotex, gradtex; double demopos; transient uint prevms; + Font mSmallFont; private TextureID GetDemoTex() { @@ -307,6 +308,7 @@ Class SWWMMainMenu : SWWMCleanMenu override void Init( Menu parent, ListMenuDescriptor desc ) { Super.Init(parent,desc); + mSmallFont = Font.GetFont('TewiFont'); demotex = GetDemoTex(); demopos = 120; prevms = MSTime(); @@ -353,12 +355,12 @@ Class SWWMMainMenu : SWWMCleanMenu mDesc.mItems[i].OffsetPositionY(-GetMenuYOffset()); int xx, yy; String str = StringTable.Localize("$SWWM_MODVER"); - int width = smallfont.StringWidth(str)+8; - int height = smallfont.GetHeight()+4; + int width = mSmallFont.StringWidth(str)+8; + int height = mSmallFont.GetHeight()+4; xx = CleanWidth_1-width; yy = CleanHeight_1-height; Screen.Dim("Black",.75,int(xx*CleanXFac_1),int(yy*CleanYFac_1),int(width*CleanXFac_1),int(height*CleanYFac_1)); - Screen.DrawText(smallfont,Font.CR_GOLD,(xx+4)*CleanXFac_1,(yy+2)*CleanYFac_1,str,DTA_CleanNoMove_1,true); + Screen.DrawText(mSmallFont,Font.CR_GOLD,(xx+4)*CleanXFac_1,(yy+2)*CleanYFac_1,str,DTA_CleanNoMove_1,true); prevms = MSTime(); } @@ -569,17 +571,21 @@ Class ListMenuItemSWWMStaticTextM : ListMenuItem String text = Stringtable.Localize(mText); int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale; int h = desc?desc.DisplayHeight():-1; + let font = menuDelegate.PickFont(mFont); + int scl; + if ( font != NewSmallFont ) scl = 3; + else scl = 2; if ( w == ListMenuDescriptor.CleanScale ) { - double x = int(320-mFont.StringWidth(text)*1.5)/2; + double x = (320-mFont.StringWidth(text)*scl)/2; double y = mYpos; SWWMUtility.AdjustClean_1(x,y); - Screen.DrawText(mFont,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*1.5,DTA_ScaleY,CleanYFac_1*1.5); + Screen.DrawText(mFont,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl); } else { - double x = int(w-mFont.StringWidth(text)*1.5)/2; - Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,1.5,DTA_ScaleY,1.5); + double x = (w-mFont.StringWidth(text)*scl)/2; + Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl); } } } @@ -642,9 +648,9 @@ Class SWWMMessageBox : MessageBoxMenu } else { - destWidth = CleanWidth_1*2; - destHeight = CleanHeight_1*2; - textfont = bigfont; + destWidth = CleanWidth_1; + destHeight = CleanHeight_1; + textfont = Font.GetFont('TewiFontOutline'); mMessage = textfont.BreakLines(Stringtable.Localize(message),480); } } @@ -701,8 +707,8 @@ Class SWWMMessageBox : MessageBoxMenu Screen.DrawText(textfont,messageSelection==0?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,(destWidth-2*textfont.StringWidth(stryes))/2,y,stryes, DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.); Screen.DrawText(textfont,messageSelection==1?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,(destWidth-2*textfont.StringWidth(strno))/2,y+fontheight*2,strno,DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.); if ( (messageSelection < 0) || ((MenuTime()%8) >= 4) ) return; - Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth-2*textfont.StringWidth(messageSelection?strno:stryes))/2-46,y+fontheight*2*messageSelection,"►",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.); - Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth+2*textfont.StringWidth(messageSelection?strno:stryes))/2+16,y+fontheight*2*messageSelection,"◄",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.); + Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth-2*textfont.StringWidth(messageSelection?strno:stryes))/2-26,y+fontheight*2*messageSelection,"►",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.); + Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth+2*textfont.StringWidth(messageSelection?strno:stryes))/2+12,y+fontheight*2*messageSelection,"◄",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.); } } @@ -800,7 +806,9 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable override int GetWidth() { let font = menuDelegate.PickFont(mFont); - return max(1,font.StringWidth(StringTable.Localize(mText))); + int w = font.StringWidth(StringTable.Localize(mText)); + if ( font != NewSmallFont ) w *= 2; + return max(1,w); } override void Draw( bool selected, ListMenuDescriptor desc ) @@ -809,13 +817,16 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable int h = desc?desc.DisplayHeight():-1; String text = StringTable.Localize(mText); let font = menuDelegate.PickFont(mFont); + int scl; + if ( font != NewSmallFont ) scl = 2; + else scl = 1; double x; // centered - if ( w == ListMenuDescriptor.CleanScale ) x = (320-font.StringWidth(text))/2; - else x = (w-font.StringWidth(text))/2; + if ( w == ListMenuDescriptor.CleanScale ) x = (320-font.StringWidth(text)*scl)/2; + else x = (w-font.StringWidth(text)*scl)/2; double y = mYpos; // offset text so it's centered - y += (mHeight-font.GetHeight())/2; + y += (mHeight-font.GetHeight()*scl)/2; if ( selected ) { double xx = x; @@ -830,8 +841,8 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable int ch; [ch, pos] = text.GetNextCodePoint(pos); double yy = y+4*sin(32*i+8*Menu.MenuTime())*CleanYFac_1; - Screen.DrawChar(font,mColorSelected,xx,yy,ch,DTA_CleanNoMove_1,true); - xx += (font.GetCharWidth(ch)+kern)*CleanXFac_1; + Screen.DrawChar(font,mColorSelected,xx,yy,ch,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl); + xx += (font.GetCharWidth(ch)+kern)*CleanXFac_1*scl; } } else @@ -841,17 +852,17 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable int ch; [ch, pos] = text.GetNextCodePoint(pos); double yy = y+4*sin(32*i+8*Menu.MenuTime()); - Screen.DrawChar(mFont,mColorSelected,xx,yy,ch,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43); - xx += (font.GetCharWidth(ch)+kern); + Screen.DrawChar(mFont,mColorSelected,xx,yy,ch,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl); + xx += (font.GetCharWidth(ch)+kern)*scl; } } } else if ( w == ListMenuDescriptor.CleanScale ) { SWWMUtility.AdjustClean_1(x,y); - Screen.DrawText(font,mColor,x,y,text,DTA_CleanNoMove_1,true); + Screen.DrawText(font,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl); } - else Screen.DrawText(font,mColor,x,y,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43); + else Screen.DrawText(font,mColor,x,y,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl); } } @@ -972,15 +983,16 @@ Class OptionMenuItemScaleSliderFix : OptionMenuItemScaleSlider } } +// draw captions using our own font Class SWWMMenuDelegate : DoomMenuDelegate { - // we've got our own fonts 'round here - override Font PickFont( Font fnt ) + Font mBigFont; + + override int DrawCaption( String title, Font fnt, int y, bool drawit ) { - if ( generic_ui ) return NewSmallFont; - if ( !fnt ) return SmallFont; - if ( (fnt == AlternativeBigFont) || (fnt == OriginalBigFont) || (fnt == IntermissionFont) ) return BigFont; - if ( (fnt == AlternativeSmallFont) || (fnt == NewSmallFont) ) return SmallFont; - return fnt; + if ( !mBigFont ) mBigFont = Font.GetFont('TewiFontOutline'); + fnt = mBigFont; + if ( drawit ) Screen.DrawText(fnt,OptionMenuSettings.mTitleColor,(Screen.GetWidth()-fnt.StringWidth(title)*CleanXFac_1*2)/2,8*CleanYFac_1,title,DTA_ScaleX,CleanXFac_1*2,DTA_ScaleY,CleanYFac_1*2); + return (y+fnt.GetHeight()*2)*CleanYFac_1; } } diff --git a/zscript/menu/swwm_title.zsc b/zscript/menu/swwm_title.zsc index 09faac160..3b4c1750e 100644 --- a/zscript/menu/swwm_title.zsc +++ b/zscript/menu/swwm_title.zsc @@ -27,6 +27,7 @@ Class SWWMTitleStuff : EventHandler ui int rss; ui int stopinit_t; bool bFadeIn; + ui Font mSmallFont, mBigFont; private ui int GetUIRandom() { @@ -137,6 +138,8 @@ Class SWWMTitleStuff : EventHandler override void RenderUnderlay( RenderEvent e ) { + if ( !mSmallFont ) mSmallFont = Font.GetFont('TewiFont'); + if ( !mBigFont ) mBigFont = Font.GetFont('TewiFontOutline'); if ( !camtex ) camtex = TexMan.CheckForTexture("LOGOFADE",TexMan.Type_Any); Screen.DrawTexture(camtex,false,0,0); if ( !tex[2] ) tex[2] = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any); @@ -189,7 +192,7 @@ Class SWWMTitleStuff : EventHandler lastlang = language; lastlogo = swwm_oldlogo; // estimate scroll length - double llen = smallfont.StringWidth(scrolls[sline]); + double llen = mSmallFont.StringWidth(scrolls[sline]); double soffset = 40*((titletimer+e.FracTic)/GameTicRate-sbase); if ( soffset > llen+ss.x ) { @@ -213,15 +216,15 @@ Class SWWMTitleStuff : EventHandler alf = max(0,1.-abs((ss.x/2)-xx)/(ss.x/2))**.5; alf *= .2*trl; double xxofs = 5*sin(15*i+120*(titletimer+e.FracTic)/GameTicRate-90.*(1.-trl))-16*(1.-trl); - Screen.DrawChar(smallfont,Font.CR_BLUE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf,DTA_LegacyRenderStyle,STYLE_Add); + Screen.DrawChar(mSmallFont,Font.CR_BLUE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf,DTA_LegacyRenderStyle,STYLE_Add); } double yy = (ss.y-35)+10*sin(15*i+160*(titletimer+e.FracTic)/GameTicRate); alf = max(0,1.-abs((ss.x/2)-xx)/(ss.x/2))**.5; double xxofs = 5*sin(15*i+120*(titletimer+e.FracTic)/GameTicRate); Color c = Color(int(127.5+127.5*sin(10*i+80*(titletimer+e.FracTic)/GameTicRate)),0,0); - Screen.DrawChar(smallfont,Font.CR_SAPPHIRE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf); + Screen.DrawChar(mSmallFont,Font.CR_SAPPHIRE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf); } - xx += smallfont.GetCharWidth(ch)+smallfont.GetDefaultKerning(); + xx += mSmallFont.GetCharWidth(ch)+mSmallFont.GetDefaultKerning(); } } @@ -242,14 +245,14 @@ Class SWWMTitleStuff : EventHandler String str = StringTable.Localize("$SWWM_TITLEPRESENTS"); alf = clamp(((titletimer+e.FracTic)/GameTicRate)-10,0.,1.); alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-16,0.,1.); - Screen.DrawText(smallfont,Font.CR_WHITE,(ss.x-smallfont.StringWidth(str))/2,(ss.y-smallfont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_WHITE,(ss.x-mSmallFont.StringWidth(str))/2,(ss.y-mSmallFont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf); if ( bFadeIn ) Screen.Dim("Black",1.-clamp(((titletimer+e.FracTic)/GameTicRate)-22,0.,1.),0,0,Screen.GetWidth(),Screen.GetHeight()); else { str = StringTable.Localize("$SWWM_TITLEMODBY"); alf = clamp(((titletimer+e.FracTic)/GameTicRate)-18,0.,1.); alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-24,0.,1.); - Screen.DrawText(smallfont,Font.CR_WHITE,(ss.x-smallfont.StringWidth(str))/2,(ss.y-smallfont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_WHITE,(ss.x-mSmallFont.StringWidth(str))/2,(ss.y-mSmallFont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf); } tsize = TexMan.GetScaledSize(tex[1]); sar = tsize.x/tsize.y; @@ -270,23 +273,23 @@ Class SWWMTitleStuff : EventHandler double alf = clamp(((titletimer+e.FracTic)/GameTicRate)-1,0.,1.); alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-4,0.,1.); String str = StringTable.Localize("$SWWM_TITLEPRESENTSA"); - Screen.DrawText(smallfont,Font.CR_FIRE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_FIRE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf); str = StringTable.Localize("$SWWM_TITLEPRESENTSB"); - Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf); alf = clamp(((titletimer+e.FracTic)/GameTicRate)-5,0.,1.); alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-8,0.,1.); str = StringTable.Localize("$SWWM_TITLEMODBYA"); - Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf); str = StringTable.Localize("$SWWM_TITLEMODBYB"); - Screen.DrawText(smallfont,Font.CR_FIRE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_FIRE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf); alf = clamp(((titletimer+e.FracTic)/GameTicRate)-10,0.,1.); alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-21,0.,1.); str = StringTable.Localize("$SWWM_TITLEINTROA"); - Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac*3)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac*3)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf); str = StringTable.Localize("$SWWM_TITLEINTROB"); - Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf); str = StringTable.Localize("$SWWM_TITLEINTROC"); - Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)+(smallfont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf); + Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)+(mSmallFont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf); double ar = Screen.GetAspectRatio(); Vector2 tsize = TexMan.GetScaledSize(tex[4]); double sar = tsize.x/tsize.y; @@ -318,11 +321,11 @@ Class SWWMTitleStuff : EventHandler Screen.DrawTexture(tex[4],false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true,DTA_Alpha,alf); } double scl = Screen.GetHeight()/vsize.y; - double tscl1 = max(.5,(floor((Screen.GetHeight()*4.)/vsize.y)+3.)/2.); + double tscl1 = max(1.,floor((Screen.GetHeight()*4.)/vsize.y)+3.); str = "CODENAME"; alf = clamp(((titletimer+e.FracTic)/GameTicRate)-22,0.,1.); - Screen.DrawText(BigFont,Font.CR_SAPPHIRE,int(Screen.GetWidth()-tscl1*BigFont.StringWidth(str))/2,int(Screen.GetHeight()-(scl*400+BigFont.GetHeight()*tscl1))/2,str,DTA_ScaleX,tscl1,DTA_ScaleY,tscl1,DTA_Alpha,alf); - double tscl2 = max(.5,floor((Screen.GetHeight()*4.)/vsize.y)/2.); + Screen.DrawText(mBigFont,Font.CR_SAPPHIRE,int(Screen.GetWidth()-tscl1*mBigFont.StringWidth(str))/2,int(Screen.GetHeight()-(scl*400+mBigFont.GetHeight()*tscl1))/2,str,DTA_ScaleX,tscl1,DTA_ScaleY,tscl1,DTA_Alpha,alf); + double tscl2 = max(1.,floor((Screen.GetHeight()*4.)/vsize.y)); if ( !stitle || (lastlang2 != language) ) { Array done; @@ -349,7 +352,7 @@ Class SWWMTitleStuff : EventHandler } else c.SetString("1"); if ( stitle ) stitle.Destroy(); - stitle = BigFont.BreakLines(StringTable.Localize("$SWWM_TITLESUB"..which),int.max); + stitle = mBigFont.BreakLines(StringTable.Localize("$SWWM_TITLESUB"..which),int.max); } lastlang2 = language; alf = clamp(((titletimer+e.FracTic)/GameTicRate)-27,0.,1.); @@ -357,9 +360,9 @@ Class SWWMTitleStuff : EventHandler double yy = int(Screen.GetHeight()+(scl*360+(1.-alf)*80*tscl2))/2; for ( int i=0; i= 23.) && (((titletimer+e.FracTic)/GameTicRate) < 25.6) ) { diff --git a/zscript/weapons/swwm_blazeit.zsc b/zscript/weapons/swwm_blazeit.zsc index 4b5e52766..0d5d45ca4 100644 --- a/zscript/weapons/swwm_blazeit.zsc +++ b/zscript/weapons/swwm_blazeit.zsc @@ -171,7 +171,7 @@ Class Hellblazer : SWWMWeapon { int amt = Owner.CountInv(types[i]); String amtstr = String.Format("%3d",amt); - Screen.DrawText(smallfont,Font.CR_FIRE,bx+xx,by+yy,amtstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0)); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx+xx,by+yy,amtstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0)); Screen.DrawTexture(AmmoIcon[i],false,bx+xx+19,by+yy+1,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0)); yy += 13; if ( i%2 ) diff --git a/zscript/weapons/swwm_cbt.zsc b/zscript/weapons/swwm_cbt.zsc index 3a271c000..60c91f264 100644 --- a/zscript/weapons/swwm_cbt.zsc +++ b/zscript/weapons/swwm_cbt.zsc @@ -87,7 +87,7 @@ Class Wallbuster : SWWMWeapon { Screen.DrawTexture(AmmoIcon[i],false,bx-ox,by-oy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); String astr = String.Format("%3d",Owner.CountInv(types[i])); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-ox-(smallfont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-ox-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); oy += 10; if ( i == 1 ) { diff --git a/zscript/weapons/swwm_cbt_ui.zsc b/zscript/weapons/swwm_cbt_ui.zsc index 40c470073..f9aa56bf3 100644 --- a/zscript/weapons/swwm_cbt_ui.zsc +++ b/zscript/weapons/swwm_cbt_ui.zsc @@ -11,6 +11,8 @@ Class WallbusterReloadMenu : GenericMenu String ttl; BrokenLines keyl; + Font mSmallFont, mTinyFont; + override void Init( Menu parent ) { Super.Init(parent); @@ -25,11 +27,13 @@ Class WallbusterReloadMenu : GenericMenu AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/GreenShell.png",TexMan.Type_Any); AmmoIcon[2] = TexMan.CheckForTexture("graphics/HUD/BlueShell.png",TexMan.Type_Any); AmmoIcon[3] = TexMan.CheckForTexture("graphics/HUD/PurpleShell.png",TexMan.Type_Any); + mSmallFont = Font.GetFont('TewiFont'); + mTinyFont = Font.GetFont('MiniwiFont'); MenuSound("menu/demotab"); queue.Clear(); sel0 = swwm_cbtlast; ttl = StringTable.Localize("$SWWM_BUSTERTITLE"); - keyl = smallfont2.BreakLines(StringTable.Localize("$SWWM_BUSTERKEYS"),300); + keyl = mTinyFont.BreakLines(StringTable.Localize("$SWWM_BUSTERKEYS"),300); } override void Ticker() @@ -293,11 +297,11 @@ Class WallbusterReloadMenu : GenericMenu { Screen.DrawTexture(AmmoIcon[i],false,origin.x+ox,origin.y+oy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(i==sel0)?Color(0,0,0,0):Color(128,0,0,0)); String astr = String.Format("%3d",players[consoleplayer].mo.CountInv(types[i])-AmmoSets[i]); - Screen.DrawText(smallfont,Font.CR_FIRE,origin.x+ox-(smallfont.StringWidth(astr)+1),origin.y+oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(i==sel0)?Color(0,0,0,0):Color(128,0,0,0)); + Screen.DrawText(mSmallFont,Font.CR_FIRE,origin.x+ox-(mSmallFont.StringWidth(astr)+1),origin.y+oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(i==sel0)?Color(0,0,0,0):Color(128,0,0,0)); ox += 33; } // pointer (▸) - Screen.DrawChar(smallfont,Font.CR_GREEN,origin.x+2+33*sel0,origin.y+1,0x25B8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawChar(mSmallFont,Font.CR_GREEN,origin.x+2+33*sel0,origin.y+1,0x25B8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); int siz = queue.Size()-1; ox = 2+siz*5+(siz/5); oy = 15; @@ -312,23 +316,23 @@ Class WallbusterReloadMenu : GenericMenu int boxw, sw; double x, y; str = ttl; - sw = smallfont.StringWidth(str); + sw = mSmallFont.StringWidth(str); boxw = sw; str = "(C)2148 Akari Labs"; - sw = smallfont2.StringWidth(str); + sw = mTinyFont.StringWidth(str); if ( sw > boxw ) boxw = sw; x = floor((ss.x-boxw)/2.); y = origin.y-30; Screen.Dim("Black",.8,int((x-2)*hs),int((y-1)*hs),int((boxw+4)*hs),int(25*hs)); str = ttl; - sw = smallfont.StringWidth(str); + sw = mSmallFont.StringWidth(str); x = floor((ss.x-sw)/2.); - Screen.DrawText(smallfont,Font.CR_FIRE,x,y,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); y += 14; str = "(C)2148 Akari Labs"; - sw = smallfont2.StringWidth(str); + sw = mTinyFont.StringWidth(str); x = floor((ss.x-sw)/2.); - Screen.DrawText(smallfont2,Font.CR_GOLD,x,y,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(mTinyFont,Font.CR_GOLD,x,y,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); y = origin.y+36; boxw = 0; for ( int i=0; igametic)&&((failtime-gametic)%8>=4); Screen.DrawTexture(AmmoBar,false,bx-7,by-52,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipTop,ct,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0)); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-35,by-12,String.Format("%3d%%",chg),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0)); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-35,by-12,String.Format("%3d%%",chg),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0)); } override void HudTick() diff --git a/zscript/weapons/swwm_shot.zsc b/zscript/weapons/swwm_shot.zsc index d21d9602f..a89c88749 100644 --- a/zscript/weapons/swwm_shot.zsc +++ b/zscript/weapons/swwm_shot.zsc @@ -184,7 +184,7 @@ Class Spreadgun : SWWMWeapon { Screen.DrawTexture(AmmoIcon[i],false,bx-ox,by-oy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0)); String astr = String.Format("%3d",Owner.CountInv(types[i])); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-ox-(smallfont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0)); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-ox-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0)); oy += 10; if ( i == 3 ) { diff --git a/zscript/weapons/swwm_sparkyboi.zsc b/zscript/weapons/swwm_sparkyboi.zsc index 58d2d201d..2d3d7b60c 100644 --- a/zscript/weapons/swwm_sparkyboi.zsc +++ b/zscript/weapons/swwm_sparkyboi.zsc @@ -26,7 +26,7 @@ Class Sparkster : SWWMWeapon AmmoBar[5] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarSlimGray.png",TexMan.Type_Any); } Screen.DrawTexture(WeaponBox,false,bx-28,by-28,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-26,by-25,String.Format("%2d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-26,by-25,String.Format("%2d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); if ( nomag ) return; bool blinking = (failtime>gametic)&&((failtime-gametic)%16>=8); if ( doublestacc ) diff --git a/zscript/weapons/swwm_splode.zsc b/zscript/weapons/swwm_splode.zsc index 955ce98b8..da315d69e 100644 --- a/zscript/weapons/swwm_splode.zsc +++ b/zscript/weapons/swwm_splode.zsc @@ -17,8 +17,8 @@ Class ExplodiumGun : SWWMWeapon { if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/ExplodiumDisplay.png",TexMan.Type_Any); Screen.DrawTexture(WeaponBox,false,bx-24,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - if ( chambered ) Screen.DrawText(smallfont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } override void HudTick() @@ -590,10 +590,10 @@ Class DualExplodiumGun : SWWMWeapon { if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DualExplodiumDisplay.png",TexMan.Type_Any); Screen.DrawTexture(WeaponBox,false,bx-48,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - if ( ExplodiumGun(SisterWeapon).chambered ) Screen.DrawText(smallfont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(ExplodiumGun(SisterWeapon).clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - if ( chambered ) Screen.DrawText(smallfont,Font.CR_FIRE,bx-46,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-43,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + if ( ExplodiumGun(SisterWeapon).chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(ExplodiumGun(SisterWeapon).clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-46,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-43,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } override void RenderUnderlay( RenderEvent e ) diff --git a/zscript/weapons/swwm_tastytreat.zsc b/zscript/weapons/swwm_tastytreat.zsc index 08ed7677c..db69db7f8 100644 --- a/zscript/weapons/swwm_tastytreat.zsc +++ b/zscript/weapons/swwm_tastytreat.zsc @@ -88,18 +88,18 @@ Class CandyGun : SWWMWeapon if ( Amount <= 0 ) return; if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/CandygunDisplay.png",TexMan.Type_Any); Screen.DrawTexture(WeaponBox,false,bx-51,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - if ( chambered ) Screen.DrawText(smallfont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); int cx = (Ammo1.Amount>9)?48:45; int sb = Owner.CountInv("CandyGunBullets"); if ( sb > 0 ) { int cbx = (sb>9)?50:47; - Screen.DrawText(smallfont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } - else Screen.DrawText(smallfont,Font.CR_FIRE,bx-cx,by-17,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-37,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-17,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-37,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } override Vector3 GetTraceOffset() diff --git a/zscript/weapons/swwm_thiccboolet.zsc b/zscript/weapons/swwm_thiccboolet.zsc index 23f212ac1..d43ed2420 100644 --- a/zscript/weapons/swwm_thiccboolet.zsc +++ b/zscript/weapons/swwm_thiccboolet.zsc @@ -272,19 +272,19 @@ Class SilverBullet : SWWMWeapon if ( sb > 0 ) { int cbx = (sb>9)?34:30; - Screen.DrawText(smallfont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0)); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0)); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0)); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0)); } - else Screen.DrawText(smallfont,Font.CR_FIRE,bx-cx,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0)); + else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0)); cx = (Ammo2.Amount>9)?32:29; sb = Owner.CountInv("SilverBullets2"); if ( sb > 0 ) { int cbx = (sb>9)?34:30; - Screen.DrawText(smallfont,Font.CR_FIRE,bx-cbx,by-42,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0)); - Screen.DrawText(smallfont,Font.CR_FIRE,bx-cx,by-35,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0)); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-42,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0)); + Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-35,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0)); } - else Screen.DrawText(smallfont,Font.CR_FIRE,bx-cx,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0)); + else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0)); } override void HudTick() {