Revert font system overhaul.
This commit is contained in:
parent
c3f57b41fa
commit
89042b7b49
39 changed files with 532 additions and 693 deletions
BIN
acs/swwmcomp.o
BIN
acs/swwmcomp.o
Binary file not shown.
BIN
fonts.wad
BIN
fonts.wad
Binary file not shown.
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.7 \cu(Mon 4 Apr 15:15:42 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.2.7 \cu(2022-04-04 15:15:42)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.8 \cu(Tue 5 Apr 16:44:45 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.2.8 \cu(2022-04-05 16:44:45)\c-";
|
||||
|
|
|
|||
10
menudef.txt
10
menudef.txt
|
|
@ -310,7 +310,7 @@ ListMenu "MainMenu"
|
|||
{
|
||||
Class "SWWMMainMenu"
|
||||
Size Clean
|
||||
Font "BigFont", "White", "Sapphire"
|
||||
Font "TewiFontOutline", "White", "Sapphire"
|
||||
Selector "graphics/DemoIcon.png", -24, 0
|
||||
LineSpacing 32
|
||||
SWWMLogo
|
||||
|
|
@ -325,7 +325,7 @@ ListMenu "MainMenuTextOnly"
|
|||
{
|
||||
Class "SWWMMainMenu"
|
||||
Size Clean
|
||||
Font "BigFont", "White", "Sapphire"
|
||||
Font "TewiFontOutline", "White", "Sapphire"
|
||||
Selector "graphics/DemoIcon.png", -24, 0
|
||||
LineSpacing 32
|
||||
SWWMLogo
|
||||
|
|
@ -340,7 +340,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
|
||||
|
|
@ -359,7 +359,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"
|
||||
|
|
@ -370,7 +370,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"
|
||||
|
|
|
|||
214
swwmcomp.acs
214
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<GetThingCount(); i++ )
|
||||
{
|
||||
if ( ((GetThingSpecial(i) != 226) && (GetThingSpecial(i) != 80)) || (GetThingArgument(i,0) != 12) )
|
||||
continue;
|
||||
SetThingArgument(i,0,-Int('DUMP3_DISPLAY'));
|
||||
}
|
||||
break;
|
||||
// Doom 2 MAP07
|
||||
case '291F24417FB3DD411339AE82EF9B3597':
|
||||
// remove excess backpacks (there's 10 of them for fuck's sake)
|
||||
|
|
|
|||
|
|
@ -291,9 +291,10 @@ extend Class SWWMHandler
|
|||
String alldlg_pack = "SWWM_SAYAPHOBOS1:SWWM_SAYAPHOBOS2:SWWM_SAYAPHOBOS3:SWWM_SAYAPHOBOS4:SWWM_SAYADEIMOS1:SWWM_SAYADEIMOS2:SWWM_SAYADEIMOS3:SWWM_SAYADEIMOS4:SWWM_SAYADIS1:SWWM_SAYADIS2:SWWM_SAYADIS3:SWWM_SAYADIS4:SWWM_SAYATHY1:SWWM_SAYATHY2:SWWM_SAYATHY3:SWWM_SAYATHY4:SWWM_CYTHOSIGIL1:SWWM_CYTHOSIGIL2:SWWM_CYTHOSIGIL3:SWWM_CYTHOSIGIL4:SWWM_SAYADIMPLE1:SWWM_SAYADIMPLE2:SWWM_SAYADIMPLE3:SWWM_SAYADIMPLE4:SWWM_SAYADIMPLE5:SWWM_SAYACIRCLE1:SWWM_SAYACIRCLE2:SWWM_SAYACIRCLE3:SWWM_SAYACIRCLE4:SWWM_SAYACIRCLE5:SWWM_SAYAGOTCHA1:SWWM_SAYAGOTCHA2:SWWM_SAYAGOTCHA3:SWWM_SAYAGOTCHA4:SWWM_SAYAGOTCHA5:SWWM_SAYAGOTCHAEND1:SWWM_SAYAGOTCHAEND2:SWWM_SAYAGOTCHAEND3:SWWM_SAYAGOTCHAEND4:SWWM_SAYAGOTCHAEND5:SWWM_SAYAIOS1:SWWM_SAYAIOS2:SWWM_SAYAIOS3:SWWM_SAYAIOS4:SWWM_SAYAIOS5:SWWM_SAYARAMPANCY1:SWWM_SAYARAMPANCY2:SWWM_SAYARAMPANCY3:SWWM_SAYARAMPANCY4:SWWM_CYTHONERVE1:SWWM_CYTHONERVE2:SWWM_CYTHONERVE3:SWWM_CYTHONERVE4:SWWM_CYTHONERVE5:SWWM_SAYAEVIA1:SWWM_SAYAEVIA2:SWWM_SAYAEVIA3:SWWM_SAYAEVIA4:SWWM_SAYAEVIB1:SWWM_SAYAEVIB2:SWWM_SAYAMAW1:SWWM_SAYAMAW2:SWWM_SAYAMAW3:SWWM_SAYAMAW4:SWWM_SAYAMAW5:SWWM_SAYAMASTERS1:SWWM_SAYAMASTERS2:SWWM_SAYAMASTERS3:SWWM_SAYAMASTERS4:SWWM_SAYAMASTERS5:SWWM_SAYADSPARIL1:SWWM_SAYADSPARIL2:SWWM_SAYADSPARIL3:SWWM_SAYADSPARIL4:SWWM_SAYADSPARIL5:SWWM_SAYAHEADS1:SWWM_SAYAHEADS2:SWWM_SAYAHEADS3:SWWM_SAYAHEADS4:SWWM_SAYAHEADS5:SWWM_SAYAHEADS6:SWWM_SAYABULLS1:SWWM_SAYABULLS2:SWWM_SAYABULLS3:SWWM_SAYABULLS4:SWWM_SAYABULLS5:SWWM_SAYAGREETA1:SWWM_SAYAGREETA2:SWWM_SAYAGREETA3:SWWM_SAYAGREETB1:SWWM_SAYAGREETC1:SWWM_SAYAGREETD1:SWWM_SAYAGREETE1:SWWM_SAYAGREETF1:SWWM_SAYABLOODA1:SWWM_SAYABLOODA2:SWWM_SAYABLOODB1:SWWM_SAYABLOODC1:SWWM_SAYABLOODD1:SWWM_SAYAHYPO1:SWWM_SAYAHYPO2:SWWM_SAYAHYPO3:SWWM_SAYAHYPO4:SWWM_KIRINWORSHIPA1:SWWM_KIRINWORSHIPB1:SWWM_KIRINWORSHIPC1:SWWM_KIRINWORSHIPD1:SWWM_KIRINWORSHIPD2:SWWM_SAYAGAMEA1:SWWM_SAYAGAMEA2:SWWM_SAYAGAMEB1:SWWM_SAYAGAMEC1:SWWM_SAYAMASTERSA1:SWWM_SAYAMASTERSA2:SWWM_SAYAMASTERSB1:SWWM_SAYAMASTERSC1:SWWM_SAYAMASTERSD1:SWWM_SAYAMASTERSE1:SWWM_SAYAMASTERSF1:SWWM_SAYAFIGHTER1:SWWM_SAYAFIGHTER2:SWWM_SAYACLERICA1:SWWM_SAYACLERICA2:SWWM_SAYACLERICB1:SWWM_SAYACLERICC1:SWWM_SAYACLERICC2:SWWM_SAYAMAGE1:SWWM_SAYAMAGE2:SWWM_SAYAMAGE3:SWWM_SAYAMAGE4:SWWM_SAYAKORAXA1:SWWM_SAYAKORAXB1:SWWM_SAYAKORAXC1:SWWM_SAYAKORAXD1:SWWM_SAYAKORAXE1:SWWM_SAYABLIGHTA1:SWWM_SAYABLIGHTB1:SWWM_SAYABLIGHTC1:SWWM_SAYABLIGHTC2:SWWM_SAYACONSTABLEA1:SWWM_SAYACONSTABLEA2:SWWM_SAYACONSTABLEB1:SWWM_SAYACONSTABLEC1:SWWM_SAYACONSTABLED1:SWWM_SAYANAVEA1:SWWM_SAYANAVEA2:SWWM_SAYANAVEB1:SWWM_SAYANAVEC1:SWWM_SAYANAVED1:SWWM_SAYANAVEE1:SWWM_SAYANAVEF1:SWWM_SAYADEATHKINGS1:SWWM_KIRINPUZZLEA1:SWWM_KIRINPUZZLEA2:SWWM_KIRINPUZZLEB1:SWWM_KIRINPUZZLEC1:SWWM_KIRINPUZZLEC2:SWWM_KIRINPUZZLED1:SWWM_KIRINPUZZLED2:SWWM_KIRINPUZZLEE1:SWWM_KIRINPUZZLEE2:SWWM_KIRINPUZZLEF1:SWWM_KIRINPUZZLEF2:SWWM_KIRINPUZZLEF3:SWWM_KIRINPUZZLEG1:SWWM_KIRINPUZZLEH1:SWWM_KIRINPUZZLEI1:SWWM_KIRINPUZZLEI2:SWWM_KIRINPUZZLEJ1:SWWM_KIRINPUZZLEJ2:SWWM_KIRINPUZZLEK1:SWWM_KIRINPUZZLEL1:SWWM_KIRINPUZZLEM1:SWWM_KIRINPUZZLEN1:SWWM_KIRINPUZZLEO1:SWWM_KIRINPUZZLEP1:SWWM_KIRINPUZZLEQ1:SWWM_KIRINPUZZLER1:SWWM_KIRINPUZZLER2:SWWM_KIRINPUZZLER3:SWWM_KIRINPUZZLES1:SWWM_KIRINPUZZLET1:SWWM_KIRINPUZZLEU1:SWWM_ZNVTXT1:SWWM_ZNVTXT2:SWWM_ZNVTXT3:SWWM_ZNVTXT4:SWWM_ZNVTXT5";
|
||||
Array<String> alldlg;
|
||||
alldlg_pack.Split(alldlg,":");
|
||||
let mSmallFont = Font.GetFont('TewiFont');
|
||||
for ( int i=0; i<alldlg.Size(); i++ )
|
||||
{
|
||||
let l = smallfont.BreakLines(StringTable.Localize(alldlg[i],false),220);
|
||||
let l = mSmallFont.BreakLines(StringTable.Localize(alldlg[i],false),220);
|
||||
if ( l.Count() > 3 ) Console.Printf("\cg%s exceeds line limit (%d > 3)\c-",alldlg[i],l.Count());
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<MsgLine> 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<snum.xstr.Size(); i++ )
|
||||
{
|
||||
tag = snum.xstr[i];
|
||||
if ( snum.xscore[i] == int.max ) tag.AppendFormat(" MAX");
|
||||
else if ( snum.xscore[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<min(3,playercount); i++ )
|
||||
{
|
||||
if ( sortplayers[i].fragcount < 0 ) str = String.Format("\cx#%d: \c-%s\c- \cr(\cg%d\cr)\c-",i+1,sortplayers[i].GetUserName(),sortplayers[i].fragcount);
|
||||
else str = String.Format("\cx%s: \c-%s\c- \cu(\cj%d\cu)\c-",OrdinalStr(i+1,sortplayers[i].GetGender()),sortplayers[i].GetUserName(),sortplayers[i].fragcount);
|
||||
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();
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
@ -2368,24 +2374,24 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
{
|
||||
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,Powerup(i).IsBlinking()?alpha*.5:alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
|
||||
String nstr = String.Format("%ds",Powerup(i).EffectTics/GameTicRate);
|
||||
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,Powerup(i).IsBlinking()?alpha*.5: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,Powerup(i).IsBlinking()?alpha*.5:alpha);
|
||||
return true;
|
||||
}
|
||||
if ( (i is 'SWWMLamp') && aspowerup )
|
||||
{
|
||||
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,SWWMLamp(i).isBlinking()?alpha*.5:alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
|
||||
String nstr = String.Format("%d%%",SWWMLamp(i).Charge);
|
||||
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,SWWMLamp(i).isBlinking()?alpha*.5: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,SWWMLamp(i).isBlinking()?alpha*.5:alpha);
|
||||
return true;
|
||||
}
|
||||
if ( (i is 'DivineSpriteEffect') && aspowerup )
|
||||
{
|
||||
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,DivineSpriteEffect(i).isBlinking()?alpha*.5:alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
|
||||
String nstr = String.Format("%ds",DivineSpriteEffect(i).healtim/GameTicRate);
|
||||
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,DivineSpriteEffect(i).isBlinking()?alpha*.5: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,DivineSpriteEffect(i).isBlinking()?alpha*.5:alpha);
|
||||
return true;
|
||||
}
|
||||
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
|
||||
|
|
@ -2394,8 +2400,8 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
String nstr;
|
||||
if ( (i.Amount > 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<l.Count(); j++ )
|
||||
{
|
||||
int len = smallfont.StringWidth(l.StringAt(j));
|
||||
int len = mSmallFont.StringWidth(l.StringAt(j));
|
||||
if ( len > 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<midl.Count(); i++ ) maxlen = max(maxlen,smallfont.StringWidth(midl.StringAt(i)));
|
||||
for ( int i=0; i<midl.Count(); i++ ) maxlen = max(maxlen,mSmallFont.StringWidth(midl.StringAt(i)));
|
||||
xx = int((ss.x*ssp-maxlen)/2.);
|
||||
yy = ss.y*ssp*.375;
|
||||
yy -= (h*midl.Count()+4)/2; // center
|
||||
Screen.Dim("Black",.8*alph,int((xx-6)*hs*hsp),int(yy*hs*hsp),int((maxlen+12)*hs*hsp),int((h*midl.Count()+4)*hs*hsp));
|
||||
for ( int i=0; i<midl.Count(); i++ )
|
||||
{
|
||||
int len = smallfont.StringWidth(midl.StringAt(i));
|
||||
int len = mSmallFont.StringWidth(midl.StringAt(i));
|
||||
xx = int((ss.x*ssp-len)/2.);
|
||||
Screen.DrawText(smallfont,col,int(xx),yy+2,midl.StringAt(i),DTA_VirtualWidthF,ss.x*ssp,DTA_VirtualHeightF,ss.y*ssp,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
Screen.DrawText(mSmallFont,col,int(xx),yy+2,midl.StringAt(i),DTA_VirtualWidthF,ss.x*ssp,DTA_VirtualHeightF,ss.y*ssp,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
yy += h;
|
||||
}
|
||||
}
|
||||
|
|
@ -2717,7 +2723,7 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
for ( int j=0; j<l.Count(); j++ )
|
||||
{
|
||||
Screen.DrawTexture(ChatTex[smol?4:1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,boxalph);
|
||||
Screen.DrawText(smallfont,col,xx+4,yy,l.StringAt(j),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
Screen.DrawText(mSmallFont,col,xx+4,yy,l.StringAt(j),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
yy += 13;
|
||||
}
|
||||
}
|
||||
|
|
@ -2737,22 +2743,24 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
SWWMUtility.StripColor(pname);
|
||||
String fullstr = String.Format("\cq%s\cd@\cqdemolitionist%d\cn ~ \c-wall %s_",pname,consoleplayer+1,txt);
|
||||
// cut out to fit
|
||||
int w = smallfont.StringWidth(fullstr);
|
||||
int w = mSmallFont.StringWidth(fullstr);
|
||||
if ( w > 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(mSmallFont,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(mSmallFont,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(mSmallFont,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 +2780,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<tlen; i++ )
|
||||
{
|
||||
int ch;
|
||||
[ch, pos] = str.GetNextCodePoint(pos);
|
||||
Screen.DrawChar(bigfont,Font.CR_BLUE,xx,yy+4*sin(32*i+8*gametic)*CleanYFac,ch,DTA_CleanNoMove,true);
|
||||
xx += (bigfont.GetCharWidth(ch)+bigfont.GetDefaultKerning())*CleanXFac;
|
||||
Screen.DrawChar(fnt,Font.CR_BLUE,xx,yy+4*sin(32*i+8*gametic)*CleanYFac,ch,DTA_ScaleX,CleanXFac*3,DTA_ScaleY,CleanYFac*3);
|
||||
xx += (fnt.GetCharWidth(ch)+fnt.GetDefaultKerning())*3*CleanXFac;
|
||||
}
|
||||
yy += bigfont.GetHeight()*CleanYFac;
|
||||
yy += fnt.GetHeight()*3*CleanYFac;
|
||||
if ( multiplayer && (player != -1) )
|
||||
{
|
||||
str = String.Format(StringTable.Localize("$TXT_BY"),players[player].GetUserName());
|
||||
xx = pausepos.x-smallfont.StringWidth(str)*CleanXFac/2;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,str,DTA_CleanNoMove,true);
|
||||
xx = pausepos.x-fnt2.StringWidth(str)*CleanXFac/2;
|
||||
Screen.DrawText(fnt2,Font.CR_WHITE,xx,yy,str,DTA_CleanNoMove,true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2825,51 +2833,51 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
{
|
||||
Screen.Dim("Red",clamp((demo.revivefail-(level.maptime+fractic))/60.,0.,.2),0,0,Screen.GetWidth(),Screen.GetHeight());
|
||||
str = StringTable.Localize("$SWWM_REFAIL");
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
xx = int((ss.x-len)/2.);
|
||||
yy = ss.y-48;
|
||||
if ( ((demo.revivefail-level.maptime)%16) < 8 )
|
||||
Screen.DrawText(smallfont,Font.CR_RED,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_RED,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
alph = clamp((deadtimer-60)/60.,0.,1.);
|
||||
String nam = CPlayer.GetUserName();
|
||||
if ( nam == "Player" ) str = StringTable.Localize("$SWWM_URDED_GEN");
|
||||
else str = String.Format(StringTable.Localize("$SWWM_URDED"),nam);
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
xx = int((ss.x-len)/2.);
|
||||
yy = (ss.y-smallfont.GetHeight()*4)/2.;
|
||||
yy = (ss.y-mSmallFont.GetHeight()*4)/2.;
|
||||
// shift down if scoreboard is shown
|
||||
if ( (deathmatch && sb_deathmatch_enable && (!teamplay || sb_teamdeathmatch_enable)) || (multiplayer && sb_cooperative_enable) )
|
||||
yy += ss.y/3.+smallfont.GetHeight();
|
||||
Screen.DrawText(smallfont,Font.CR_RED,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
yy += ss.y/3.+mSmallFont.GetHeight();
|
||||
Screen.DrawText(mSmallFont,Font.CR_RED,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
if ( multiplayer || level.AllowRespawn || sv_singleplayerrespawn || G_SkillPropertyInt(SKILLP_PlayerRespawn) )
|
||||
{
|
||||
if ( sv_norespawn ) return (1.-dimalph);
|
||||
alph = clamp((deadtimer-90)/60.,0.,1.);
|
||||
str = String.Format(StringTable.Localize("$SWWM_URDEDMP"));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
xx = int((ss.x-len)/2.);
|
||||
yy = ss.y/2.;
|
||||
// shift down if scoreboard is shown
|
||||
if ( (deathmatch && sb_deathmatch_enable && (!teamplay || sb_teamdeathmatch_enable)) || (multiplayer && sb_cooperative_enable) )
|
||||
yy += ss.y/3.;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
return (1.-dimalph);
|
||||
}
|
||||
alph = clamp((deadtimer-140)/60.,0.,1.);
|
||||
str = String.Format(StringTable.Localize("$SWWM_URDED2"));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
xx = int((ss.x-len)/2.);
|
||||
yy = ss.y/2.;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
if ( goner || !swwm_revive )
|
||||
return (1.-dimalph);
|
||||
alph = clamp((deadtimer-160)/60.,0.,1.);
|
||||
str = String.Format(StringTable.Localize("$SWWM_URDED3"));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
xx = int((ss.x-len)/2.);
|
||||
yy = (ss.y+smallfont.GetHeight()*2)/2.;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
yy = (ss.y+mSmallFont.GetHeight()*2)/2.;
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
return (1.-dimalph);
|
||||
}
|
||||
return 1.;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Class PayRespects : HUDMessageBase
|
|||
double hs;
|
||||
Vector2 ss;
|
||||
int seed, seed2;
|
||||
Font mSmallFont;
|
||||
|
||||
static PayRespects PressF()
|
||||
{
|
||||
|
|
@ -20,6 +21,7 @@ Class PayRespects : HUDMessageBase
|
|||
f.seed = Random[FInTheChat]();
|
||||
f.seed2 = Random[FInTheChat]();
|
||||
f.ScreenSizeChanged();
|
||||
f.mSmallFont = Font.GetFont('TewiFont');
|
||||
return f;
|
||||
}
|
||||
|
||||
|
|
@ -38,7 +40,7 @@ Class PayRespects : HUDMessageBase
|
|||
override void Draw( int bottom, int visibility )
|
||||
{
|
||||
Vector2 realpos = (basepos.x*ss.x,basepos.y*ss.y);
|
||||
Vector2 fo = (smallfont.StringWidth("F")/2.,-smallfont.GetHeight());
|
||||
Vector2 fo = (mSmallFont.StringWidth("F")/2.,-mSmallFont.GetHeight());
|
||||
// F rise up
|
||||
int initspd = (128-seed);
|
||||
if ( (initspd >= 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<l.Count(); i++ )
|
||||
{
|
||||
int len = smallfont.StringWidth(l.StringAt(i));
|
||||
int len = mSmallFont.StringWidth(l.StringAt(i));
|
||||
if ( len > 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<l.Count(); i++ )
|
||||
{
|
||||
int len = smallfont.StringWidth(l.StringAt(i));
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,int((ss.x-len)/2.),(bottom/hs)-yy,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
int len = mSmallFont.StringWidth(l.StringAt(i));
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,int((ss.x-len)/2.),(bottom/hs)-yy,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
|
||||
yy -= h;
|
||||
}
|
||||
}
|
||||
|
|
@ -159,6 +163,7 @@ Class SWWMAchievementNotification : HUDMessageBase
|
|||
transient BrokenLines l;
|
||||
TextureID icon, frame;
|
||||
double tics, holdtics, fadeintics, fadeouttics;
|
||||
Font mSmallFont, mTinyFont;
|
||||
|
||||
SWWMAchievementNotification Init( String bname, TextureID icon, int num = 0 )
|
||||
{
|
||||
|
|
@ -171,6 +176,8 @@ Class SWWMAchievementNotification : HUDMessageBase
|
|||
fadeintics = 20;
|
||||
fadeouttics = 30;
|
||||
tics = 0;
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
mTinyFont = Font.GetFont('MiniwiFont');
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -190,16 +197,16 @@ Class SWWMAchievementNotification : HUDMessageBase
|
|||
double ftics = tics+fractic;
|
||||
double alpha = (ftics<fadeintics)?(ftics/fadeintics):(ftics<(fadeintics+holdtics))?1.:(1.-(ftics-(fadeintics+holdtics))/fadeouttics);
|
||||
Vector2 pos = (int(ss.x-256)/2,(ss.y-(margin+36))+int(margin+40)*(1.-alpha));
|
||||
if ( !l ) l = smallfont2.BreakLines(txt,200);
|
||||
if ( !l ) l = mTinyFont.BreakLines(txt,200);
|
||||
int th = 14+(9*l.Count());
|
||||
Screen.DrawTexture(frame,false,pos.x,pos.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
if ( icon.IsValid() ) Screen.DrawTexture(icon,false,pos.x+2,pos.y+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
int yy = 2+(32-th)/2;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,pos.x+40,pos.y+yy,tag,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,pos.x+40,pos.y+yy,tag,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
yy += 14;
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont2,Font.CR_WHITE,pos.x+44,pos.y+yy,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
Screen.DrawText(mTinyFont,Font.CR_WHITE,pos.x+44,pos.y+yy,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
yy += 9;
|
||||
}
|
||||
}
|
||||
|
|
@ -242,6 +249,7 @@ Class SWWMWeaponTooltip : HUDMessageBase
|
|||
double tics, holdtics, fadeintics, fadeouttics;
|
||||
transient BrokenLines l;
|
||||
SWWMWeaponTooltip next;
|
||||
Font mSmallFont, mTinyFont;
|
||||
|
||||
SWWMWeaponTooltip Init( Class<SWWMWeapon> 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<fadeintics)?(ftics/fadeintics):(ftics<(fadeintics+holdtics))?1.:(1.-(ftics-(fadeintics+holdtics))/fadeouttics);
|
||||
int w = smallfont.StringWidth(wpn);
|
||||
if ( !l ) l = smallfont2.BreakLines(txt,600);
|
||||
int w = mSmallFont.StringWidth(wpn);
|
||||
if ( !l ) l = mTinyFont.BreakLines(txt,600);
|
||||
int w1 = w;
|
||||
w = 0;
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
let lw = smallfont2.StringWidth(l.StringAt(i));
|
||||
let lw = mTinyFont.StringWidth(l.StringAt(i));
|
||||
if ( lw > 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<cw; i+=6 )
|
||||
Screen.DrawChar(smallfont,Font.CR_FIRE,(pos.x-cw/2)+i,pos.y+6,0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
pos.y += smallfont.GetHeight()+8;
|
||||
Screen.DrawChar(mSmallFont,Font.CR_FIRE,(pos.x-cw/2)+i,pos.y+6,0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
pos.y += mSmallFont.GetHeight()+8;
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont2,Font.CR_WHITE,pos.x-w/2,pos.y,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
pos.y += smallfont2.GetHeight();
|
||||
Screen.DrawText(mTinyFont,Font.CR_WHITE,pos.x-w/2,pos.y,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
pos.y += mTinyFont.GetHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -312,6 +322,7 @@ Class SWWMDirectMessage : HUDMessageBase
|
|||
Vector2 ss, origin;
|
||||
SWWMDirectMessage nextmsg; // for chaining messages together from different characters
|
||||
bool nextdirect; // skips directly to next message without delays or fades
|
||||
Font mSmallFont;
|
||||
|
||||
private int GetRandom()
|
||||
{
|
||||
|
|
@ -340,6 +351,7 @@ Class SWWMDirectMessage : HUDMessageBase
|
|||
enddelay = 40;
|
||||
pausedelay = 30;
|
||||
rss = 1232;
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -354,7 +366,7 @@ Class SWWMDirectMessage : HUDMessageBase
|
|||
}
|
||||
else txt = StringTable.Localize("$SWWM_"..seqname..seqnum);
|
||||
if ( l ) l.Destroy();
|
||||
l = smallfont.BreakLines(txt,220);
|
||||
l = mSmallFont.BreakLines(txt,220);
|
||||
// append to the player's chat log (if it's valid)
|
||||
if ( (seqnum < 1) || (seqnum > 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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ Class DemolitionistMenu : GenericMenu
|
|||
Array<DemolitionistMenuTab> 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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<l.Count(); i++ )
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+pos.x+margin,master.origin.y+pos.y+i*14,l.StringAt(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.mSmallFont,Font.CR_WHITE,master.origin.x+pos.x+margin,master.origin.y+pos.y+i*14,l.StringAt(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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,9 +454,9 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab
|
|||
if ( !invlist || (invlist.items.Size() <= 0) )
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_NOINV");
|
||||
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 = 9;
|
||||
|
|
@ -471,7 +471,7 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab
|
|||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -521,7 +521,7 @@ Class DemolitionistMenuInvItem : DemolitionistMenuListItem
|
|||
override void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright )
|
||||
{
|
||||
// the simplest drawer
|
||||
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(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));
|
||||
}
|
||||
|
||||
void UseItem()
|
||||
|
|
|
|||
|
|
@ -297,9 +297,9 @@ Class DemolitionistKeychainTab : DemolitionistMenuTab
|
|||
if ( !invlist || (invlist.items.Size() <= 0) )
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_NOKEYS");
|
||||
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 = 9;
|
||||
|
|
@ -314,6 +314,6 @@ Class DemolitionistKeychainTab : DemolitionistMenuTab
|
|||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
sname[i] = StringTable.Localize("$SWWM_LORETAB"..i);
|
||||
lwidth = max(lwidth,smallfont.StringWidth("<‼ "..sname[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<section; i++ )
|
||||
|
|
@ -389,13 +389,13 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
}
|
||||
}
|
||||
if ( hasprev )
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+3,master.origin.y+yy,"<",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+3,master.origin.y+yy,"<",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
if ( hasunreadprev )
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+9,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+9,master.origin.y+yy,"‼",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
if ( hasnext )
|
||||
Screen.DrawText(smallfont,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);
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<l.Count()-1)?350:(350+mxlen-l.StringWidth(i));
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+xx,master.origin.y+yy+4+i*14,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_GOLD,master.origin.x+xx,master.origin.y+yy+4+i*14,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
}
|
||||
yy += 306;
|
||||
xx = int(master.ws.x-smallfont.StringWidth(sub))/2;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sub,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
xx = int(master.ws.x-master.mSmallFont.StringWidth(sub))/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sub,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
if ( maxofs <= 0 ) return;
|
||||
xx = master.ws.x-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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
sname[i] = StringTable.Localize("$SWWM_STATTAB"..i);
|
||||
lwidth = max(lwidth,smallfont.StringWidth(sname[i]));
|
||||
lwidth = max(lwidth,master.mSmallFont.StringWidth(sname[i]));
|
||||
lists[i] = new("DemolitionistMenuList");
|
||||
lists[i].master = master;
|
||||
lists[i].selected = -1;
|
||||
|
|
@ -360,24 +360,24 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
// and calculate "max lengths"
|
||||
int sec = Thinker.Tics2Seconds(l.s.time);
|
||||
str = String.Format("T %02d:%02d:%02d",sec/3600,(sec%3600)/60,sec%60);
|
||||
len[0] = smallfont2.StringWidth(str);
|
||||
len[0] = master.mTinyFont.StringWidth(str);
|
||||
if ( len[0] > 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<l.Count(); i++ )
|
||||
{
|
||||
str = l.StringAt(i);
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(gametic/3)+ypos*2+2+i);
|
||||
Screen.DrawText(smallfont2,completed?Font.CR_WHITE:Font.CR_BLACK,xx+40,yy+oy+14+i*9,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,completed?Font.CR_WHITE:Font.CR_BLACK,xx+40,yy+oy+14+i*9,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -377,9 +377,9 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
|
|||
if ( !invlist[bSell] || (invlist[bSell].items.Size() <= 0) )
|
||||
{
|
||||
String str = StringTable.Localize(bSell?"$SWWM_NOSTORESELL":"$SWWM_NOSTORE");
|
||||
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 = 9;
|
||||
|
|
@ -394,7 +394,7 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
|
|||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
|
|||
// used for the store display calculation
|
||||
int GetFullWidth()
|
||||
{
|
||||
return smallfont.StringWidth(label)+96+smallfont.StringWidth(pricelabel);
|
||||
return master.mSmallFont.StringWidth(label)+96+master.mSmallFont.StringWidth(pricelabel);
|
||||
}
|
||||
|
||||
// so the prices don't get cut off
|
||||
|
|
@ -441,7 +441,7 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
|
|||
override bool CheckBounds( double x, double y )
|
||||
{
|
||||
if ( Super.CheckBounds(x,y) ) return true;
|
||||
int ofs = (width-16)-smallfont.StringWidth(pricelabel);
|
||||
int ofs = (width-16)-master.mSmallFont.StringWidth(pricelabel);
|
||||
if ( x < xpos+ofs ) return false;
|
||||
if ( y < ypos ) return false;
|
||||
if ( x > 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()
|
||||
|
|
|
|||
|
|
@ -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<btext.Count(); i++ )
|
||||
{
|
||||
|
|
@ -57,10 +59,10 @@ Class SWWMCreditsEntry ui
|
|||
{
|
||||
int h = 0;
|
||||
if ( MariHack ) h = 148;
|
||||
h += smallfont.GetHeight();
|
||||
h += mSmallFont.GetHeight();
|
||||
if ( !btext ) return h;
|
||||
h += 6;
|
||||
h += smallfont.GetHeight()*btext.Count();
|
||||
h += mSmallFont.GetHeight()*btext.Count();
|
||||
return h;
|
||||
}
|
||||
|
||||
|
|
@ -85,21 +87,21 @@ Class SWWMCreditsEntry ui
|
|||
yy += 148;
|
||||
Screen.DrawTexture(MariSprite[cur],false,x,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
int w = smallfont.StringWidth(title);
|
||||
int w = mSmallFont.StringWidth(title);
|
||||
double xx = x-w/2;
|
||||
Screen.DrawText(smallfont,titlecol,xx,yy,title,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,titlecol,xx,yy,title,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
if ( !btext ) return height;
|
||||
// underline
|
||||
int cw = int(ceil((w+8)/6.))*6;
|
||||
xx = x-cw/2;
|
||||
for ( int i=0; i<cw; i+=6 )
|
||||
Screen.DrawChar(smallfont,titlecol,xx+i,yy+6,0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += smallfont.GetHeight()+6;
|
||||
Screen.DrawChar(mSmallFont,titlecol,xx+i,yy+6,0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += mSmallFont.GetHeight()+6;
|
||||
for ( int i=0; i<btext.Count(); i++ )
|
||||
{
|
||||
xx = x-(btext.StringWidth(i))/2;
|
||||
Screen.DrawText(smallfont,btextcol,xx,yy,btext.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += smallfont.GetHeight();
|
||||
Screen.DrawText(mSmallFont,btextcol,xx,yy,btext.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += mSmallFont.GetHeight();
|
||||
}
|
||||
return height;
|
||||
}
|
||||
|
|
@ -117,6 +119,7 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
double hs;
|
||||
Vector2 logosz;
|
||||
double logow, logoh;
|
||||
Font mSmallFont, mBigFont;
|
||||
|
||||
String oldmus;
|
||||
int oldorder;
|
||||
|
|
@ -138,6 +141,8 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
override void Init( Menu parent )
|
||||
{
|
||||
Super.Init(parent);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
mBigFont = Font.GetFont('TewiFontOutline');
|
||||
bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
|
||||
UpdateSize();
|
||||
logo = TexMan.CheckForTexture(swwm_oldlogo?"graphics/M_SWWM.png":"graphics/M_DEMOLITIONIST.png",TexMan.Type_Any);
|
||||
|
|
@ -221,7 +226,7 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
spos = ss.y-logosz.y;
|
||||
// calc total height
|
||||
theight = int(logosz.y);
|
||||
theight += 8*(SECTION_PAD+bigfont.GetHeight());
|
||||
theight += 8*(SECTION_PAD+mBigFont.GetHeight()*2);
|
||||
for ( int i=0; i<cdev.Size(); i++ )
|
||||
{
|
||||
theight += ENTRY_PAD;
|
||||
|
|
@ -274,23 +279,23 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
if ( (y+logosz.y < 0) || (y > 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<cw; i+=6 )
|
||||
Screen.DrawChar(smallfont,Font.CR_SAPPHIRE,xx+i,y+(logosz.y-22),0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,x-smallfont.StringWidth(stitle2)/2,y+(logosz.y-9),stitle2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawChar(mSmallFont,Font.CR_SAPPHIRE,xx+i,y+(logosz.y-22),0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,x-mSmallFont.StringWidth(stitle2)/2,y+(logosz.y-9),stitle2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
return logosz.y;
|
||||
}
|
||||
double DrawSection( double x, double y, String txt )
|
||||
{
|
||||
// don't draw if we're offscreen, saves time
|
||||
y += SECTION_SHIFT;
|
||||
if ( (y+bigfont.GetHeight() < 0) || (y > 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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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; i++ )
|
||||
{
|
||||
switch ( i )
|
||||
{
|
||||
case PAGE_STORY:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_STORY");
|
||||
if ( gameinfo.gametype&GAME_Heretic ) pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHERETIC"),600);
|
||||
else if ( gameinfo.gametype&GAME_Hexen ) pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHEXEN"),600);
|
||||
else if ( SWWMUtility.IsEviternity() ) pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYEVITERNITY"),600);
|
||||
else pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYDOOM"),600);
|
||||
if ( gameinfo.gametype&GAME_Heretic ) pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHERETIC"),600);
|
||||
else if ( gameinfo.gametype&GAME_Hexen ) pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHEXEN"),600);
|
||||
else if ( SWWMUtility.IsEviternity() ) pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYEVITERNITY"),600);
|
||||
else pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYDOOM"),600);
|
||||
break;
|
||||
case PAGE_DEMO:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_DEMO");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_DEMOTXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_DEMOTXT"),600);
|
||||
break;
|
||||
case PAGE_ARSENAL1:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_ARSE1");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE1TXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE1TXT"),600);
|
||||
break;
|
||||
case PAGE_ARSENAL2:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_ARSE2");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE2TXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE2TXT"),600);
|
||||
break;
|
||||
case PAGE_ARSENAL3:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_ARSE3");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE3TXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE3TXT"),600);
|
||||
break;
|
||||
case PAGE_KBASE:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_KBASE");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_KBASETXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_KBASETXT"),600);
|
||||
break;
|
||||
case PAGE_TECH:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_TECH");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TECHTXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TECHTXT"),600);
|
||||
break;
|
||||
case PAGE_TIPS:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_TIPS");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TIPSTXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TIPSTXT"),600);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -164,7 +167,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
// big bulk of code
|
||||
private void DrawPage( int page, double xofs = 0., double alpha = 1. )
|
||||
{
|
||||
int h = smallfont.GetHeight();
|
||||
int h = mSmallFont.GetHeight();
|
||||
int maxlen = 0, lh;
|
||||
double y = 0;
|
||||
if ( (page < 0) || (page >= 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<l.Count(); i++ )
|
||||
{
|
||||
int len = l.StringWidth(i);
|
||||
|
|
@ -180,7 +183,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
}
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xofs+(Screen.GetWidth()-maxlen*CleanXFac_1)/2,(Screen.GetHeight()-lh*CleanYFac_1)/2+y,l.StringAt(i),DTA_CleanNoMove_1,true,DTA_Alpha,alpha);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xofs+(Screen.GetWidth()-maxlen*CleanXFac_1)/2,(Screen.GetHeight()-lh*CleanYFac_1)/2+y,l.StringAt(i),DTA_CleanNoMove_1,true,DTA_Alpha,alpha);
|
||||
y += h*CleanYFac_1;
|
||||
}
|
||||
}
|
||||
|
|
@ -202,14 +205,14 @@ Class SWWMHelpMenu : GenericMenu
|
|||
DrawPage(prevpage,-(pagedir*alph*32)*CleanXFac_1,(1.-alph)**3);
|
||||
DrawPage(curpage,(pagedir*(1.-alph)*32)*CleanXFac_1,alph**3);
|
||||
}
|
||||
int h = smallfont.GetHeight();
|
||||
int h = mSmallFont.GetHeight();
|
||||
double y = Screen.GetHeight()/2-(h*2)*CleanYFac_1;
|
||||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
if ( curpage > 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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -151,42 +153,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<tipl.Count(); i++ )
|
||||
if ( tipl.StringWidth(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; i<tipl.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,tipl.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += smallfont.GetHeight();
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx,yy,tipl.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += mSmallFont.GetHeight();
|
||||
xx = 12;
|
||||
}
|
||||
}
|
||||
override int DrawLF()
|
||||
{
|
||||
int len[2];
|
||||
len[0] = smallfont.StringWidth(lnametexts[0]);
|
||||
len[1] = smallfont.StringWidth(authortexts[0]);
|
||||
len[0] = mSmallFont.StringWidth(lnametexts[0]);
|
||||
len[1] = mSmallFont.StringWidth(authortexts[0]);
|
||||
int dimlen = max(int((len[0]+8)*hs2),int((len[1]+8)*hs));
|
||||
bool auth = (authortexts[0].Length()>0);
|
||||
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;
|
||||
}
|
||||
|
|
@ -196,21 +198,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 )
|
||||
|
|
@ -467,70 +469,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) )
|
||||
{
|
||||
|
|
@ -542,20 +544,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 )
|
||||
|
|
@ -563,22 +565,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;
|
||||
}
|
||||
|
|
@ -587,30 +589,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 )
|
||||
|
|
@ -618,16 +620,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -774,12 +776,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<MAXPLAYERS; i++ )
|
||||
{
|
||||
if ( !playeringame[i] ) continue;
|
||||
namelen = max(namelen,smallfont.StringWidth(players[i].GetUserName()));
|
||||
namelen = max(namelen,mSmallFont.StringWidth(players[i].GetUserName()));
|
||||
nplayers++;
|
||||
}
|
||||
int misseditems = wbs.maxitems;
|
||||
|
|
@ -788,29 +790,29 @@ Class SWWMStatScreen_Coop : SWWMStatScreen
|
|||
String itemstotal = String.Format("%d",misseditems);
|
||||
String secrettotal = String.Format("%d",missedsecret);
|
||||
String killstotal = String.Format("%d",missedkills);
|
||||
int itemslen = max(smallfont.StringWidth("100%"),max(smallfont.StringWidth(itemstotal),smallfont.StringWidth(itemsstr)));
|
||||
int secretlen = max(smallfont.StringWidth("100%"),max(smallfont.StringWidth(secrettotal),smallfont.StringWidth(secretstr)));
|
||||
int killslen = max(smallfont.StringWidth("100%"),max(smallfont.StringWidth(killstotal),smallfont.StringWidth(killsstr)));
|
||||
int itemslen = max(mSmallFont.StringWidth("100%"),max(mSmallFont.StringWidth(itemstotal),mSmallFont.StringWidth(itemsstr)));
|
||||
int secretlen = max(mSmallFont.StringWidth("100%"),max(mSmallFont.StringWidth(secrettotal),mSmallFont.StringWidth(secretstr)));
|
||||
int killslen = max(mSmallFont.StringWidth("100%"),max(mSmallFont.StringWidth(killstotal),mSmallFont.StringWidth(killsstr)));
|
||||
int pad = 2;
|
||||
int spc = 12;
|
||||
int hspc = 6;
|
||||
int lspc = 2;
|
||||
int rwidth = smallfont.GetCharWidth(checkmark)+4;
|
||||
int rwidth = mSmallFont.GetCharWidth(checkmark)+4;
|
||||
int linew = pad+rwidth+namelen+spc+itemslen+spc+secretlen+spc+killslen+pad;
|
||||
int boxwidth = pad+linew+pad;
|
||||
int lineh = smallfont.GetHeight();
|
||||
int lineh = mSmallFont.GetHeight();
|
||||
int boxheight = pad+lineh+hspc+(lineh+lspc)*nplayers+hspc+lineh+lspc+lineh+pad;
|
||||
Screen.Dim("Black",.8,int((ss.x-boxwidth)*hs)/2,int((ss.y-boxheight)*hs)/2,int(boxwidth*hs),int(boxheight*hs));
|
||||
// header
|
||||
int xx = int((ss.x-boxwidth)/2+pad+pad+rwidth);
|
||||
int yy = int((ss.y-boxheight)/2+pad);
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,itemsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,itemsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += itemslen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,secretstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,secretstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += secretlen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,killsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,killsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += lineh+hspc;
|
||||
String str;
|
||||
for ( int i=0; i<MAXPLAYERS; i++ )
|
||||
|
|
@ -819,65 +821,65 @@ Class SWWMStatScreen_Coop : 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 >= 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -993,36 +995,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<MAXPLAYERS; i++ )
|
||||
{
|
||||
if ( !playeringame[i] ) continue;
|
||||
namelen = max(namelen,smallfont.StringWidth(players[i].GetUserName()));
|
||||
namelen = max(namelen,mSmallFont.StringWidth(players[i].GetUserName()));
|
||||
nplayers++;
|
||||
}
|
||||
String deathstotal = String.Format("%d",total_deaths);
|
||||
String fragstotal = String.Format("%d",total_frags);
|
||||
int deathslen = max(smallfont.StringWidth(deathstotal),smallfont.StringWidth(deathsstr));
|
||||
int fragslen = max(smallfont.StringWidth(fragstotal),smallfont.StringWidth(fragsstr));
|
||||
int deathslen = max(mSmallFont.StringWidth(deathstotal),mSmallFont.StringWidth(deathsstr));
|
||||
int fragslen = max(mSmallFont.StringWidth(fragstotal),mSmallFont.StringWidth(fragsstr));
|
||||
int pad = 2;
|
||||
int spc = 12;
|
||||
int hspc = 6;
|
||||
int lspc = 2;
|
||||
int rwidth = smallfont.GetCharWidth(checkmark)+4;
|
||||
int rwidth = mSmallFont.GetCharWidth(checkmark)+4;
|
||||
int linew = pad+rwidth+namelen+spc+deathslen+spc+fragslen+pad;
|
||||
int boxwidth = pad+linew+pad;
|
||||
int lineh = smallfont.GetHeight();
|
||||
int lineh = mSmallFont.GetHeight();
|
||||
int boxheight = pad+lineh+hspc+(lineh+lspc)*nplayers+hspc+lineh+pad;
|
||||
Screen.Dim("Black",.8,int((ss.x-boxwidth)*hs)/2,int((ss.y-boxheight)*hs)/2,int(boxwidth*hs),int(boxheight*hs));
|
||||
// header
|
||||
int xx = int((ss.x-boxwidth)/2+pad+pad+rwidth);
|
||||
int yy = int((ss.y-boxheight)/2+pad);
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,deathsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,deathsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += deathslen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,fragsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,fragsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += lineh+hspc;
|
||||
String str;
|
||||
Array<Int> sorted;
|
||||
|
|
@ -1034,31 +1036,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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,15 @@ Class OptionMenuItemSWWMPlayTime : OptionMenuItem
|
|||
// option menu /w tooltips
|
||||
Class SWWMOptionMenu : OptionMenu
|
||||
{
|
||||
private String ttip;
|
||||
private String ttip, olttip;
|
||||
private Font mTipFont;
|
||||
private BrokenLines ttlines;
|
||||
|
||||
override void Init( Menu parent, OptionMenuDescriptor desc )
|
||||
{
|
||||
Super.Init(parent,desc);
|
||||
mTipFont = Font.GetFont('TewiFont');
|
||||
}
|
||||
|
||||
override void Ticker()
|
||||
{
|
||||
|
|
@ -185,13 +193,16 @@ Class SWWMOptionMenu : OptionMenu
|
|||
String mcvar = mDesc.mItems[mDesc.mSelectedItem].GetAction();
|
||||
mcvar.Replace(" ","_"); // need to strip whitespace for command actions
|
||||
String locstr = String.Format("TOOLTIP_%s",mcvar);
|
||||
olttip = ttip;
|
||||
ttip = StringTable.Localize(locstr,false);
|
||||
if ( ttip == locstr ) ttip = "";
|
||||
if ( (ttip != olttip) && ttlines ) ttlines.Destroy();
|
||||
if ( !ttlines ) ttlines = mTipFont.BreakLines(ttip,CleanWidth_1-8);
|
||||
}
|
||||
override void Drawer()
|
||||
{
|
||||
Super.Drawer();
|
||||
if ( ttip == "" ) return;
|
||||
if ( (ttip == "") || !ttlines ) return;
|
||||
// re-evaluate y to check where the cursor is
|
||||
int cy = 0;
|
||||
int y = mDesc.mPosition;
|
||||
|
|
@ -220,22 +231,20 @@ Class SWWMOptionMenu : OptionMenu
|
|||
break;
|
||||
}
|
||||
}
|
||||
let lines = smallfont.BreakLines(ttip,CleanWidth_1-8);
|
||||
int height = (4+smallfont.GetHeight()*lines.Count())*CleanYFac_1;
|
||||
int height = (4+mTipFont.GetHeight()*ttlines.Count())*CleanYFac_1;
|
||||
// draw at the bottom unless the selected option could be covered by the tooltip
|
||||
int ypos = Screen.GetHeight()-height;
|
||||
if ( cy > ypos ) ypos = 0;
|
||||
Screen.Dim("Black",.75,0,ypos,Screen.GetWidth(),height);
|
||||
ypos += 2*CleanYFac_1;
|
||||
for ( int i=0; i<lines.Count(); i++ )
|
||||
for ( int i=0; i<ttlines.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,4*CleanXFac_1,ypos,lines.StringAt(i),DTA_CleanNoMove_1,true);
|
||||
ypos += smallfont.GetHeight()*CleanYFac_1;
|
||||
Screen.DrawText(mTipFont,Font.CR_WHITE,4*CleanXFac_1,ypos,ttlines.StringAt(i),DTA_CleanNoMove_1,true);
|
||||
ypos += mTipFont.GetHeight()*CleanYFac_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// main menu w/ version info
|
||||
Class SWWMCleanMenu : ListMenu
|
||||
{
|
||||
override bool MouseEvent( int type, int x, int y )
|
||||
|
|
@ -268,11 +277,13 @@ Class SWWMCleanMenu : ListMenu
|
|||
}
|
||||
}
|
||||
|
||||
// main menu w/ version info
|
||||
Class SWWMMainMenu : SWWMCleanMenu
|
||||
{
|
||||
TextureID demotex, gradtex;
|
||||
double demopos;
|
||||
transient uint prevms;
|
||||
Font mSmallFont;
|
||||
|
||||
private TextureID GetDemoTex()
|
||||
{
|
||||
|
|
@ -307,6 +318,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 +365,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();
|
||||
}
|
||||
|
||||
|
|
@ -381,9 +393,12 @@ Class SWWMBigMenuHack : SWWMCleanMenu
|
|||
bool longlist; // more than 10 entries, scrolls
|
||||
int ofs;
|
||||
|
||||
Font mSmallFont;
|
||||
|
||||
override void Init( Menu parent, ListMenuDescriptor desc )
|
||||
{
|
||||
Super.Init(parent,desc);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
for ( int i=0; i<mDesc.mItems.Size(); i++ )
|
||||
{
|
||||
let itm = mDesc.mItems[i];
|
||||
|
|
@ -473,19 +488,19 @@ Class SWWMBigMenuHack : SWWMCleanMenu
|
|||
isclean = true;
|
||||
}
|
||||
String str = "⌃ ⌃ ⌃";
|
||||
double x = (w-smallfont.StringWidth(str))/2;
|
||||
double x = (w-mSmallFont.StringWidth(str))/2;
|
||||
double y = (h-224)/2;
|
||||
if ( isclean ) SWWMUtility.AdjustClean_1(x,y);
|
||||
if ( ofs > 0 )
|
||||
{
|
||||
if ( isclean ) Screen.DrawText(smallfont,Font.CR_FIRE,x,y+16*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(smallfont,Font.CR_FIRE,x,y+16,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
if ( isclean ) Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+16*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+16,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
}
|
||||
if ( ofs < (mDesc.mItems.Size()-8) )
|
||||
{
|
||||
str = "⌄ ⌄ ⌄";
|
||||
if ( isclean ) Screen.DrawText(smallfont,Font.CR_FIRE,x,y+256*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(smallfont,Font.CR_FIRE,x,y+256,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
if ( isclean ) Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+256*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+256,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
}
|
||||
for ( int i=0; i<mDesc.mItems.Size(); i++ )
|
||||
{
|
||||
|
|
@ -569,17 +584,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 +661,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 +720,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 +819,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 +830,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 +854,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 +865,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 +996,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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<String> 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<stitle.Count(); i++ )
|
||||
{
|
||||
xx = int(Screen.GetWidth()-tscl2*BigFont.StringWidth(stitle.StringAt(i)))/2;
|
||||
Screen.DrawText(BigFont,Font.CR_SAPPHIRE,xx,yy,stitle.StringAt(i),DTA_ScaleX,tscl2,DTA_ScaleY,tscl2,DTA_Alpha,alf);
|
||||
yy += int(tscl2*BigFont.GetHeight());
|
||||
xx = int(Screen.GetWidth()-tscl2*mBigFont.StringWidth(stitle.StringAt(i)))/2;
|
||||
Screen.DrawText(mBigFont,Font.CR_SAPPHIRE,xx,yy,stitle.StringAt(i),DTA_ScaleX,tscl2,DTA_ScaleY,tscl2,DTA_Alpha,alf);
|
||||
yy += int(tscl2*mBigFont.GetHeight());
|
||||
}
|
||||
if ( (((titletimer+e.FracTic)/GameTicRate) >= 23.) && (((titletimer+e.FracTic)/GameTicRate) < 25.6) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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; i<keyl.Count(); i++ )
|
||||
|
|
@ -340,7 +344,7 @@ Class WallbusterReloadMenu : GenericMenu
|
|||
Screen.Dim("Black",.8,int((x-2)*hs),int((y-2)*hs),int((boxw+4)*hs),int((9*keyl.Count()+2)*hs));
|
||||
for ( int i=0; i<keyl.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont2,Font.CR_WHITE,x,y,keyl.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mTinyFont,Font.CR_WHITE,x,y,keyl.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
y += 9;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ Class Eviscerator : SWWMWeapon
|
|||
if ( !AmmoIcon ) AmmoIcon = TexMan.CheckForTexture("graphics/HUD/EvisceratorShell.png",TexMan.Type_Any);
|
||||
Screen.DrawTexture(WeaponBox,false,bx-46,by-16,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
String astr = String.Format("%d",Ammo1.Amount);
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,bx-14-(smallfont.StringWidth(astr)+1),by-14,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-14-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-14,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawTexture(AmmoIcon,false,bx-14,by-14,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,chambered?Color(0,0,0,0):Color(128,0,0,0));
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,bx-44,by-14,extended?"►":"",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_WHITE,bx-44,by-14,extended?"►":"",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
|
||||
override bool ReportHUDAmmo()
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ Class Ynykron : SWWMWeapon
|
|||
Screen.DrawTexture(WeaponBox,false,bx-33,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
int chg = clamp(ChargeInter?ChargeInter.GetValue():int(chargelevel*10),0,400);
|
||||
int ct = int(((by-2)-chg/10.)*hs);
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,bx-30,by-15,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-30,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawTexture(BoxSide[inverted],false,bx-23,by-31,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,clipcount?Color(0,0,0,0):Color(128,0,0,0));
|
||||
Screen.DrawTexture(ChargeBar[inverted],false,bx-6,by-42,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(chargestate==CS_READY)?Color(int(clamp(sin((level.maptime+TicFrac)*8)*40+24,0.,64.)),255,255,255):Color(0,0,0,0),DTA_ClipTop,ct);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ Class DeepImpact : SWWMWeapon
|
|||
int ct = int(((by-2)-(chg*50./100.))*hs);
|
||||
bool blinking = (failtime>gametic)&&((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()
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue