Skip to content

Commit 0d1c29e

Browse files
committed
[ZH] Add ui messages for more debug commands
1 parent 5534e27 commit 0d1c29e

File tree

1 file changed

+60
-2
lines changed

1 file changed

+60
-2
lines changed

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3307,6 +3307,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
33073307
AsciiString scriptName;
33083308
scriptName.format("KEY_F%d", script);
33093309
TheScriptEngine->runScript(scriptName);
3310+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugRunScript", L"Run script %d", script) );
33103311
}
33113312
disp = DESTROY_MESSAGE;
33123313
}
@@ -3394,6 +3395,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
33943395
// Doesn't make a valid network message
33953396
Player *localPlayer = ThePlayerList->getLocalPlayer();
33963397
localPlayer->toggleInstantBuild();
3398+
3399+
if (localPlayer->buildsInstantly())
3400+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugInstantBuildOn", L"Instant Build is ON") );
3401+
else
3402+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugInstantBuildOff", L"Instant Build is OFF") );
3403+
33973404
disp = DESTROY_MESSAGE;
33983405
}
33993406
break;
@@ -3405,6 +3412,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
34053412
Player *localPlayer = ThePlayerList->getLocalPlayer();
34063413
Money *money = localPlayer->getMoney();
34073414
money->deposit( 10000 );
3415+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugAddCash", L"Add Cash") );
34083416
}
34093417
break;
34103418
}
@@ -3947,6 +3955,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
39473955
case GameMessage::MSG_META_DEMO_LOD_DECREASE:
39483956
{
39493957
TheGameClient->adjustLOD(-1);
3958+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugDecreaseLOD", L"Decrease LOD") );
39503959
disp = DESTROY_MESSAGE;
39513960
break;
39523961
}
@@ -3956,6 +3965,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
39563965
case GameMessage::MSG_META_DEMO_LOD_INCREASE:
39573966
{
39583967
TheGameClient->adjustLOD(1);
3968+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugIncreaseLOD", L"Increase LOD") );
39593969
disp = DESTROY_MESSAGE;
39603970
break;
39613971
}
@@ -4203,6 +4213,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
42034213
{
42044214
TheWritableGlobalData->m_useShadowVolumes = !TheGlobalData->m_useShadowVolumes;
42054215
TheWritableGlobalData->m_useShadowDecals = !TheGlobalData->m_useShadowDecals;
4216+
4217+
if (TheWritableGlobalData->m_useShadowVolumes)
4218+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugShadowVolumesOn", L"Shadow Volumes is ON") );
4219+
else
4220+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugShadowVolumesOff", L"Shadow Volumes is OFF") );
4221+
42064222
disp = DESTROY_MESSAGE;
42074223
break;
42084224
}
@@ -4212,6 +4228,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
42124228
case GameMessage::MSG_META_DEMO_TOGGLE_FOGOFWAR:
42134229
{
42144230
TheWritableGlobalData->m_fogOfWarOn = !TheGlobalData->m_fogOfWarOn;
4231+
4232+
if (TheWritableGlobalData->m_fogOfWarOn)
4233+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugFogOfWarOn", L"Fog of War is ON") );
4234+
else
4235+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugFogOfWarOff", L"Fog of War is OFF") );
4236+
42154237
disp = DESTROY_MESSAGE;
42164238
break;
42174239
}
@@ -4431,10 +4453,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
44314453
TheDisplay->stopMovie();
44324454
TheInGameUI->stopMovie();
44334455
TheAudio->setOn(false, AudioAffect_All);
4456+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugSoundOff", L"Sound is OFF") );
44344457
}
44354458
else
44364459
{
44374460
TheAudio->setOn(true, AudioAffect_All);
4461+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugSoundOn", L"Sound is ON") );
44384462
}
44394463
disp = DESTROY_MESSAGE;
44404464
break;
@@ -4445,6 +4469,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
44454469
case GameMessage::MSG_META_DEMO_TOGGLE_TRACKMARKS:
44464470
{
44474471
TheWritableGlobalData->m_makeTrackMarks = !TheGlobalData->m_makeTrackMarks;
4472+
4473+
if (TheGlobalData->m_makeTrackMarks)
4474+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugTrackMarksOn", L"Track Marks is ON") );
4475+
else
4476+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugTrackMarksOff", L"Track Marks is OFF") );
4477+
44484478
disp = DESTROY_MESSAGE;
44494479
break;
44504480
}
@@ -4454,6 +4484,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
44544484
case GameMessage::MSG_META_DEMO_TOGGLE_WATERPLANE:
44554485
{
44564486
TheWritableGlobalData->m_useWaterPlane = !TheGlobalData->m_useWaterPlane;
4487+
4488+
if (TheGlobalData->m_useWaterPlane)
4489+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugWaterPlaneOn", L"Water Plane is ON") );
4490+
else
4491+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugWaterPlaneOff", L"Water Plane is OFF") );
4492+
44574493
disp = DESTROY_MESSAGE;
44584494
break;
44594495
}
@@ -4463,7 +4499,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
44634499
case GameMessage::MSG_META_DEMO_TIME_OF_DAY:
44644500
{
44654501
TimeOfDay tod = TimeOfDay((Int) TheGlobalData->m_timeOfDay + 1);
4466-
if (tod >= TIME_OF_DAY_COUNT)
4502+
if (tod < TIME_OF_DAY_FIRST || tod >= TIME_OF_DAY_COUNT)
44674503
tod = TIME_OF_DAY_FIRST;
44684504
if (TheWritableGlobalData->setTimeOfDay(tod))
44694505
{
@@ -4480,7 +4516,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
44804516
d->clearAndSetModelConditionFlags(empty, empty);
44814517
}
44824518
}
4483-
}
4519+
}
4520+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugTimeOfDay", L"Time of Day set to %hs", TimeOfDayNames[tod]) );
44844521
}
44854522
disp = DESTROY_MESSAGE;
44864523
break;
@@ -4493,6 +4530,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
44934530
// Doesn't make a valid network message
44944531
Player *localPlayer = ThePlayerList->getLocalPlayer();
44954532
localPlayer->toggleIgnorePrereqs();
4533+
4534+
if (localPlayer->ignoresPrereqs())
4535+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugIgnorePrereqOn", L"Ignore Prerequisites is ON") );
4536+
else
4537+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugIgnorePrereqOff", L"Ignore Prerequisites is OFF") );
4538+
44964539
disp = DESTROY_MESSAGE;
44974540
break;
44984541
}
@@ -4504,6 +4547,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
45044547
// Doesn't make a valid network message
45054548
Player *localPlayer = ThePlayerList->getLocalPlayer();
45064549
localPlayer->toggleInstantBuild();
4550+
4551+
if (localPlayer->buildsInstantly())
4552+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugInstantBuildOn", L"Instant Build is ON") );
4553+
else
4554+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugInstantBuildOff", L"Instant Build is OFF") );
4555+
45074556
disp = DESTROY_MESSAGE;
45084557
break;
45094558
}
@@ -4515,6 +4564,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
45154564
// Doesn't make a valid network message
45164565
Player *localPlayer = ThePlayerList->getLocalPlayer();
45174566
localPlayer->toggleFreeBuild();
4567+
4568+
if (localPlayer->buildsForFree())
4569+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugFreeBuildOn", L"Free Build is ON") );
4570+
else
4571+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugFreeBuildOff", L"Free Build is OFF") );
4572+
45184573
disp = DESTROY_MESSAGE;
45194574
break;
45204575
}
@@ -4536,6 +4591,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
45364591
Player *localPlayer = ThePlayerList->getLocalPlayer();
45374592
Money *money = localPlayer->getMoney();
45384593
money->deposit( 10000 );
4594+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugAddCash", L"Add Cash") );
45394595
}
45404596
break;
45414597
}
@@ -4558,6 +4614,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
45584614
AsciiString scriptName;
45594615
scriptName.format("KEY_F%d", script);
45604616
TheScriptEngine->runScript(scriptName);
4617+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugRunScript", L"Run script %d", script) );
45614618
}
45624619
disp = DESTROY_MESSAGE;
45634620
break;
@@ -4603,6 +4660,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
46034660
AsciiString name;
46044661
name.format("DemoObjective%02d", m_objective);
46054662
TheInGameUI->playMovie(name);
4663+
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugObjectiveMove", L"Objective Movie %d", m_objective) );
46064664
}
46074665
disp = DESTROY_MESSAGE;
46084666
break;

0 commit comments

Comments
 (0)