Skip to content

Commit 0717ac7

Browse files
committed
Replaces a lot of NAMEKEY strings with defines
1 parent 0a05454 commit 0717ac7

File tree

115 files changed

+405
-282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+405
-282
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// TheSuperHackers @refactor @ShizCalev 04/05/2025 Switching a lot of strings to defines, first up: namekeys.
2+
3+
/*
4+
** Command & Conquer Generals(tm)
5+
** Copyright 2025 Electronic Arts Inc.
6+
**
7+
** This program is free software: you can redistribute it and/or modify
8+
** it under the terms of the GNU General Public License as published by
9+
** the Free Software Foundation, either version 3 of the License, or
10+
** (at your option) any later version.
11+
**
12+
** This program is distributed in the hope that it will be useful,
13+
** but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
** GNU General Public License for more details.
16+
**
17+
** You should have received a copy of the GNU General Public License
18+
** along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
////////////////////////////////////////////////////////////////////////////////
22+
// //
23+
// (c) 2001-2003 Electronic Arts Inc. //
24+
// //
25+
////////////////////////////////////////////////////////////////////////////////
26+
27+
// This file contains all the header files that shouldn't change frequently.
28+
// Be careful what you stick in here, because putting files that change often in here will
29+
// tend to cheese people's goats.
30+
31+
// Factions
32+
#define NAMEKEY_FactionAmerica "FactionAmerica"
33+
#define NAMEKEY_FactionAmericaAirForce "FactionAmericaAirForce"
34+
#define NAMEKEY_FactionAmericaChooseAGeneral "FactionAmericaChooseAGeneral"
35+
#define NAMEKEY_FactionAmericaSpecialForces "FactionAmericaSpecialForces"
36+
#define NAMEKEY_FactionAmericaTankCommand "FactionAmericaTankCommand"
37+
#define NAMEKEY_FactionChina "FactionChina"
38+
#define NAMEKEY_FactionChinaChooseAGeneral "FactionChinaChooseAGeneral"
39+
#define NAMEKEY_FactionChinaRedArmy "FactionChinaRedArmy"
40+
#define NAMEKEY_FactionChinaSecretPolice "FactionChinaSecretPolice"
41+
#define NAMEKEY_FactionChinaSpecialWeapons "FactionChinaSpecialWeapons"
42+
#define NAMEKEY_FactionCivilian "FactionCivilian"
43+
#define NAMEKEY_FactionFundamentalist "FactionFundamentalist" //GLA's placeholder name during initial development.
44+
#define NAMEKEY_FactionGLA "FactionGLA"
45+
#define NAMEKEY_FactionGLABiowarCommand "FactionGLABiowarCommand"
46+
#define NAMEKEY_FactionGLAChooseAGeneral "FactionGLAChooseAGeneral"
47+
#define NAMEKEY_FactionGLATerrorCell "FactionGLATerrorCell"
48+
#define NAMEKEY_FactionGLAWarlordCommand "FactionGLAWarlordCommand"
49+
#define NAMEKEY_FactionObserver "FactionObserver"
50+
#define NAMEKEY_ThePlayer "ThePlayer"
51+
52+
53+
// Misc
54+
#define NAMEKEY_Bogus "Bogus"
55+
#define NAMEKEY_BoneFXDamage "BoneFXDamage"
56+
#define NAMEKEY_ControlBar.wnd:ButtonPlaceBeacon "ControlBar.wnd:ButtonPlaceBeacon"
57+
#define NAMEKEY_OverchargeBehavior "OverchargeBehavior"
58+
#define NAMEKEY_PlyrCivilian "PlyrCivilian"
59+
#define NAMEKEY_RailroadBehavior "RailroadBehavior"
60+
#define NAMEKEY_SupplyCenterCreate "SupplyCenterCreate"
61+
62+
63+
// Upgrades
64+
#define NAMEKEY_AutoDepositUpdate "AutoDepositUpdate"
65+
#define NAMEKEY_BeaconClientUpdate "BeaconClientUpdate"
66+
#define NAMEKEY_DeliverPayloadAIUpdate "DeliverPayloadAIUpdate"
67+
#define NAMEKEY_DemoTrapUpdate "DemoTrapUpdate"
68+
#define NAMEKEY_FireSpreadUpdate "FireSpreadUpdate"
69+
#define NAMEKEY_FlammableUpdate "FlammableUpdate"
70+
#define NAMEKEY_HackInternetAIUpdate "HackInternetAIUpdate"
71+
#define NAMEKEY_PowerPlantUpdate "PowerPlantUpdate"
72+
#define NAMEKEY_PowerPlantUpgrade "PowerPlantUpgrade"
73+
#define NAMEKEY_RadarUpgrade "RadarUpgrade"
74+
#define NAMEKEY_StealthUpdate "StealthUpdate"
75+
#define NAMEKEY_SupplyCenterDockUpdate "SupplyCenterDockUpdate"
76+
#define NAMEKEY_SupplyWarehouseDockUpdate "SupplyWarehouseDockUpdate"
77+
#define NAMEKEY_SwayClientUpdate "SwayClientUpdate"
78+
79+
// Menus
80+
#define NAMEKEY_PopupLadderSelect.wnd:StaticTextLadderName "PopupLadderSelect.wnd:StaticTextLadderName"
81+
#define NAMEKEY_PopupLadderSelect.wnd:PasswordParent "PopupLadderSelect.wnd:PasswordParent"
82+
#define NAMEKEY_PopupLadderSelect.wnd:PasswordEntry "PopupLadderSelect.wnd:PasswordEntry"
83+
#define NAMEKEY_PopupLadderSelect.wnd:Parent "PopupLadderSelect.wnd:Parent"
84+
#define NAMEKEY_PopupLadderSelect.wnd:ListBoxLadderSelect "PopupLadderSelect.wnd:ListBoxLadderSelect"
85+
#define NAMEKEY_PopupLadderSelect.wnd:ListBoxLadderDetails "PopupLadderSelect.wnd:ListBoxLadderDetails"
86+
#define NAMEKEY_PopupLadderSelect.wnd:ButtonPasswordOk "PopupLadderSelect.wnd:ButtonPasswordOk"
87+
#define NAMEKEY_PopupLadderSelect.wnd:ButtonPasswordCancel "PopupLadderSelect.wnd:ButtonPasswordCancel"
88+
#define NAMEKEY_PopupLadderSelect.wnd:ButtonOk "PopupLadderSelect.wnd:ButtonOk"
89+
#define NAMEKEY_PopupLadderSelect.wnd:ButtonCancel "PopupLadderSelect.wnd:ButtonCancel"
90+
#define NAMEKEY_PopupLadderSelect.wnd:ButtonBadPasswordOk "PopupLadderSelect.wnd:ButtonBadPasswordOk"
91+
#define NAMEKEY_PopupLadderSelect.wnd:BadPasswordParent "PopupLadderSelect.wnd:BadPasswordParent"
92+
93+
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextWinsValue "SkirmishGameOptionsMenu.wnd:StaticTextWinsValue"
94+
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextStreakValue "SkirmishGameOptionsMenu.wnd:StaticTextStreakValue"
95+
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextLossesValue "SkirmishGameOptionsMenu.wnd:StaticTextLossesValue"
96+
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextBestStreakValue "SkirmishGameOptionsMenu.wnd:StaticTextBestStreakValue"
97+
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:ListboxInfo "SkirmishGameOptionsMenu.wnd:ListboxInfo"
98+
99+
#define NAMEKEY_WOLWelcomeMenu.wnd:WOLWelcomeMenuParent "WOLWelcomeMenu.wnd:WOLWelcomeMenuParent"
100+
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextUSAToday "WOLWelcomeMenu.wnd:StaticTextUSAToday"
101+
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextUSALastWeek "WOLWelcomeMenu.wnd:StaticTextUSALastWeek"
102+
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextGLAToday "WOLWelcomeMenu.wnd:StaticTextGLAToday"
103+
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextGLALastWeek "WOLWelcomeMenu.wnd:StaticTextGLALastWeek"
104+
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextChinaToday "WOLWelcomeMenu.wnd:StaticTextChinaToday"
105+
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextChinaLastWeek "WOLWelcomeMenu.wnd:StaticTextChinaLastWeek"
106+
107+
#define NAMEKEY_ControlBar.wnd:BackgroundMarker "ControlBar.wnd:BackgroundMarker"
108+
#define NAMEKEY_ControlBar.wnd:ButtonGeneral "ControlBar.wnd:ButtonGeneral"
109+
#define NAMEKEY_ControlBar.wnd:ButtonIdleWorker "ControlBar.wnd:ButtonIdleWorker"
110+
#define NAMEKEY_ControlBar.wnd:ButtonLarge "ControlBar.wnd:ButtonLarge"
111+
#define NAMEKEY_ControlBar.wnd:ButtonOptions "ControlBar.wnd:ButtonOptions"
112+
#define NAMEKEY_ControlBar.wnd:ButtonPlaceBeacon "ControlBar.wnd:ButtonPlaceBeacon"
113+
#define NAMEKEY_ControlBar.wnd:GeneralsExp "ControlBar.wnd:GeneralsExp"
114+
#define NAMEKEY_ControlBar.wnd:MoneyDisplay "ControlBar.wnd:MoneyDisplay"
115+
#define NAMEKEY_ControlBar.wnd:PowerWindow "ControlBar.wnd:PowerWindow"
116+
#define NAMEKEY_ControlBar.wnd:WinUAttack "ControlBar.wnd:WinUAttack"
117+
118+
#define NAMEKEY_NonCommand_UpDown "NonCommand_UpDown"
119+
#define NAMEKEY_NonCommand_Options "NonCommand_Options"
120+
#define NAMEKEY_NonCommand_IdleWorker "NonCommand_IdleWorker"
121+
#define NAMEKEY_NonCommand_GeneralsExperience "NonCommand_GeneralsExperience"
122+
#define NAMEKEY_NonCommand_Beacon "NonCommand_Beacon"

Generals/Code/GameEngine/Include/GameClient/Module/BeaconClientUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class BeaconClientUpdateModuleData : public ClientUpdateModuleData
5757
class BeaconClientUpdate : public ClientUpdateModule
5858
{
5959

60-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BeaconClientUpdate, "BeaconClientUpdate" )
60+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BeaconClientUpdate, NAMEKEY_BeaconClientUpdate )
6161
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( BeaconClientUpdate, BeaconClientUpdateModuleData );
6262

6363
public:

Generals/Code/GameEngine/Include/GameClient/Module/SwayClientUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Thing;
4444
class SwayClientUpdate : public ClientUpdateModule
4545
{
4646

47-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SwayClientUpdate, "SwayClientUpdate" )
47+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SwayClientUpdate, NAMEKEY_SwayClientUpdate )
4848
MAKE_STANDARD_MODULE_MACRO( SwayClientUpdate );
4949

5050
public:

Generals/Code/GameEngine/Include/GameLogic/Module/AutoDepositUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class AutoDepositUpdateModuleData : public UpdateModuleData
9797
class AutoDepositUpdate : public UpdateModule
9898
{
9999

100-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( AutoDepositUpdate, "AutoDepositUpdate" )
100+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( AutoDepositUpdate, NAMEKEY_AutoDepositUpdate )
101101
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( AutoDepositUpdate, AutoDepositUpdateModuleData )
102102

103103
public:

Generals/Code/GameEngine/Include/GameLogic/Module/BoneFXDamage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class BoneFXDamage : public DamageModule
4747
{
4848

4949
MAKE_STANDARD_MODULE_MACRO( BoneFXDamage );
50-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BoneFXDamage, "BoneFXDamage" )
50+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BoneFXDamage, NAMEKEY_BoneFXDamage )
5151

5252
public:
5353

Generals/Code/GameEngine/Include/GameLogic/Module/DeliverPayloadAIUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class DeliverPayloadData
312312
//-------------------------------------------------------------------------------------------------
313313
class DeliverPayloadAIUpdate : public AIUpdateInterface
314314
{
315-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DeliverPayloadAIUpdate, "DeliverPayloadAIUpdate" )
315+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DeliverPayloadAIUpdate, NAMEKEY_DeliverPayloadAIUpdate )
316316
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( DeliverPayloadAIUpdate, DeliverPayloadAIUpdateModuleData )
317317

318318
private:

Generals/Code/GameEngine/Include/GameLogic/Module/DemoTrapUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class DemoTrapUpdateModuleData : public ModuleData
6868
class DemoTrapUpdate : public UpdateModule
6969
{
7070

71-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DemoTrapUpdate, "DemoTrapUpdate" )
71+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DemoTrapUpdate, NAMEKEY_DemoTrapUpdate )
7272
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( DemoTrapUpdate, DemoTrapUpdateModuleData );
7373

7474
public:

Generals/Code/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class FireSpreadUpdateModuleData : public UpdateModuleData
5959
class FireSpreadUpdate : public UpdateModule
6060
{
6161

62-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FireSpreadUpdate, "FireSpreadUpdate" )
62+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FireSpreadUpdate, NAMEKEY_FireSpreadUpdate )
6363
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FireSpreadUpdate, FireSpreadUpdateModuleData )
6464

6565
public:

Generals/Code/GameEngine/Include/GameLogic/Module/FlammableUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class FlammableUpdateModuleData : public UpdateModuleData
7676
class FlammableUpdate : public UpdateModule, public DamageModuleInterface
7777
{
7878

79-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FlammableUpdate, "FlammableUpdate" )
79+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FlammableUpdate, NAMEKEY_FlammableUpdate )
8080
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FlammableUpdate, FlammableUpdateModuleData )
8181

8282
public:

Generals/Code/GameEngine/Include/GameLogic/Module/HackInternetAIUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class HackInternetAIInterface
186186
//-------------------------------------------------------------------------------------------------
187187
class HackInternetAIUpdate : public AIUpdateInterface, public HackInternetAIInterface
188188
{
189-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HackInternetAIUpdate, "HackInternetAIUpdate" )
189+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HackInternetAIUpdate, NAMEKEY_HackInternetAIUpdate )
190190
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( HackInternetAIUpdate, HackInternetAIUpdateModuleData )
191191

192192
private:

Generals/Code/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class OverchargeBehavior : public UpdateModule,
7575
public OverchargeBehaviorInterface
7676
{
7777

78-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( OverchargeBehavior, "OverchargeBehavior" )
78+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( OverchargeBehavior, NAMEKEY_OverchargeBehavior )
7979
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( OverchargeBehavior, OverchargeBehaviorModuleData )
8080

8181
public:

Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class PowerPlantUpdate : public UpdateModule,
8080
public PowerPlantUpdateInterface
8181
{
8282

83-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpdate, "PowerPlantUpdate" )
83+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpdate, NAMEKEY_PowerPlantUpdate )
8484
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( PowerPlantUpdate, PowerPlantUpdateModuleData );
8585

8686
public:

Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Player;
4545
class PowerPlantUpgrade : public UpgradeModule
4646
{
4747

48-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpgrade, "PowerPlantUpgrade" )
48+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpgrade, NAMEKEY_PowerPlantUpgrade )
4949
MAKE_STANDARD_MODULE_MACRO( PowerPlantUpgrade );
5050

5151
public:

Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpgrade.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class RadarUpgradeModuleData : public UpgradeModuleData
5959
class RadarUpgrade : public UpgradeModule
6060
{
6161

62-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadarUpgrade, "RadarUpgrade" )
62+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadarUpgrade, NAMEKEY_RadarUpgrade )
6363
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RadarUpgrade, RadarUpgradeModuleData );
6464

6565
public:

Generals/Code/GameEngine/Include/GameLogic/Module/RailroadGuideAIUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct TrainTrack
189189
class RailroadBehavior : public PhysicsBehavior
190190
{
191191

192-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RailroadBehavior, "RailroadBehavior" )
192+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RailroadBehavior, NAMEKEY_RailroadBehavior )
193193
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RailroadBehavior, RailroadBehaviorModuleData )
194194

195195
public:

Generals/Code/GameEngine/Include/GameLogic/Module/StealthUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class StealthUpdateModuleData : public UpdateModuleData
116116
class StealthUpdate : public UpdateModule
117117
{
118118

119-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( StealthUpdate, "StealthUpdate" )
119+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( StealthUpdate, NAMEKEY_StealthUpdate )
120120
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( StealthUpdate, StealthUpdateModuleData );
121121

122122
public:

Generals/Code/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Thing;
4343
class SupplyCenterCreate : public CreateModule
4444
{
4545

46-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterCreate, "SupplyCenterCreate" )
46+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterCreate, NAMEKEY_SupplyCenterCreate )
4747
MAKE_STANDARD_MODULE_MACRO( SupplyCenterCreate )
4848

4949
public:

Generals/Code/GameEngine/Include/GameLogic/Module/SupplyCenterDockUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SupplyCenterDockUpdateModuleData : public DockUpdateModuleData
5454
class SupplyCenterDockUpdate : public DockUpdate
5555
{
5656

57-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterDockUpdate, "SupplyCenterDockUpdate" )
57+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterDockUpdate, NAMEKEY_SupplyCenterDockUpdate )
5858
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SupplyCenterDockUpdate, SupplyCenterDockUpdateModuleData )
5959

6060
public:

Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class SupplyWarehouseDockUpdateModuleData : public DockUpdateModuleData
5555
class SupplyWarehouseDockUpdate : public DockUpdate
5656
{
5757

58-
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyWarehouseDockUpdate, "SupplyWarehouseDockUpdate" )
58+
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyWarehouseDockUpdate, NAMEKEY_SupplyWarehouseDockUpdate )
5959
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SupplyWarehouseDockUpdate, SupplyWarehouseDockUpdateModuleData )
6060

6161
public:

Generals/Code/GameEngine/Include/Precompiled/PreRTS.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class STLSpecialAlloc;
102102
//------------------------------------------------------------------------------------ RTS Includes
103103
// Icky. These have to be in this order.
104104
#include "Lib/Basetype.h"
105+
#include "Common/_DEFINES/NameKeys.h" // TheSuperHackers @refactor @ShizCalev 04/05/2025 Switching a lot of strings to defines, first up: namekeys.
105106
#include "Common/STLTypedefs.h"
106107
#include "Common/Errors.h"
107108
#include "Common/Debug.h"

Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ Bool ActionManager::canTransferSuppliesAt( const Object *obj, const Object *tran
235235
return FALSE;
236236

237237
// If it is a warehouse, it must have boxes left and not be an enemy
238-
static const NameKeyType key_warehouseUpdate = NAMEKEY("SupplyWarehouseDockUpdate");
238+
static const NameKeyType key_warehouseUpdate = NAMEKEY(NAMEKEY_SupplyWarehouseDockUpdate);
239239
SupplyWarehouseDockUpdate *warehouseModule = (SupplyWarehouseDockUpdate*)transferDest->findUpdateModule( key_warehouseUpdate );
240240
if( warehouseModule )
241241
if( warehouseModule->getBoxesStored() == 0 || transferDest->getRelationship( obj ) == ENEMIES )
242242
return FALSE;
243243

244244
// if it is a supply center, I must have boxes, and must be controlled by the same player
245245
// (not merely an ally... otherwise you may find yourself funding your allies. ick.)
246-
static const NameKeyType key_centerUpdate = NAMEKEY("SupplyCenterDockUpdate");
246+
static const NameKeyType key_centerUpdate = NAMEKEY(NAMEKEY_SupplyCenterDockUpdate);
247247
SupplyCenterDockUpdate *centerModule = (SupplyCenterDockUpdate*)transferDest->findUpdateModule( key_centerUpdate );
248248
if( centerModule )
249249
if( supplyTruck->getNumberBoxes() == 0 || transferDest->getControllingPlayer() != obj->getControllingPlayer() )
@@ -1548,7 +1548,7 @@ Bool ActionManager::canDoSpecialPowerAtObject( const Object *obj, const Object *
15481548
{
15491549
//Don't allow it to disguise as a train -- they don't have KINDOF_TRAIN yet, but
15501550
//if added, please change this code so it'll be faster!
1551-
static const NameKeyType key = NAMEKEY( "RailroadBehavior" );
1551+
static const NameKeyType key = NAMEKEY( NAMEKEY_RailroadBehavior );
15521552
RailroadBehavior *rBehavior = (RailroadBehavior*)target->findUpdateModule( key );
15531553
if( !rBehavior )
15541554
{

Generals/Code/GameEngine/Source/Common/RTS/Player.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ void Player::becomingTeamMember(Object *obj, Bool yes)
10371037
// if so, award the cash bonus
10381038
if(this != ThePlayerList->getNeutralPlayer() && yes)
10391039
{
1040-
NameKeyType key_AutoDepositUpdate = NAMEKEY("AutoDepositUpdate");
1040+
NameKeyType key_AutoDepositUpdate = NAMEKEY(NAMEKEY_AutoDepositUpdate);
10411041
AutoDepositUpdate *adu = (AutoDepositUpdate *)obj->findUpdateModule(key_AutoDepositUpdate);
10421042
if (adu != NULL) {
10431043
adu->awardInitialCaptureBonus( this );
@@ -1107,7 +1107,7 @@ void Player::becomingLocalPlayer(Bool yes)
11071107
Drawable *draw = object->getDrawable();
11081108
if( draw )
11091109
{
1110-
static NameKeyType key_StealthUpdate = NAMEKEY( "StealthUpdate" );
1110+
static NameKeyType key_StealthUpdate = NAMEKEY( NAMEKEY_StealthUpdate );
11111111
StealthUpdate *update = (StealthUpdate*)object->findUpdateModule( key_StealthUpdate );
11121112
if( update && update->isDisguised() )
11131113
{
@@ -1737,7 +1737,7 @@ void Player::killPlayer(void)
17371737
}
17381738
else
17391739
{
1740-
TheControlBar->setControlBarSchemeByPlayerTemplate(ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY("FactionObserver")));
1740+
TheControlBar->setControlBarSchemeByPlayerTemplate(ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(NAMEKEY_FactionObserver)));
17411741
}
17421742
}
17431743

Generals/Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -278,23 +278,23 @@ void PlayerTemplateStore::update()
278278
const PlayerTemplate* PlayerTemplateStore::findPlayerTemplate(NameKeyType namekey) const
279279
{
280280
// begin ugly, hokey code to quietly load old maps...
281-
static NameKeyType a0 = NAMEKEY("FactionAmerica");
282-
static NameKeyType a1 = NAMEKEY("FactionAmericaChooseAGeneral");
283-
static NameKeyType a2 = NAMEKEY("FactionAmericaTankCommand");
284-
static NameKeyType a3 = NAMEKEY("FactionAmericaSpecialForces");
285-
static NameKeyType a4 = NAMEKEY("FactionAmericaAirForce");
286-
287-
static NameKeyType c0 = NAMEKEY("FactionChina");
288-
static NameKeyType c1 = NAMEKEY("FactionChinaChooseAGeneral");
289-
static NameKeyType c2 = NAMEKEY("FactionChinaRedArmy");
290-
static NameKeyType c3 = NAMEKEY("FactionChinaSpecialWeapons");
291-
static NameKeyType c4 = NAMEKEY("FactionChinaSecretPolice");
292-
293-
static NameKeyType g0 = NAMEKEY("FactionGLA");
294-
static NameKeyType g1 = NAMEKEY("FactionGLAChooseAGeneral");
295-
static NameKeyType g2 = NAMEKEY("FactionGLATerrorCell");
296-
static NameKeyType g3 = NAMEKEY("FactionGLABiowarCommand");
297-
static NameKeyType g4 = NAMEKEY("FactionGLAWarlordCommand");
281+
static NameKeyType a0 = NAMEKEY(NAMEKEY_FactionAmerica);
282+
static NameKeyType a1 = NAMEKEY(NAMEKEY_FactionAmericaChooseAGeneral);
283+
static NameKeyType a2 = NAMEKEY(NAMEKEY_FactionAmericaTankCommand);
284+
static NameKeyType a3 = NAMEKEY(NAMEKEY_FactionAmericaSpecialForces);
285+
static NameKeyType a4 = NAMEKEY(NAMEKEY_FactionAmericaAirForce);
286+
287+
static NameKeyType c0 = NAMEKEY(NAMEKEY_FactionChina);
288+
static NameKeyType c1 = NAMEKEY(NAMEKEY_FactionChinaChooseAGeneral);
289+
static NameKeyType c2 = NAMEKEY(NAMEKEY_FactionChinaRedArmy);
290+
static NameKeyType c3 = NAMEKEY(NAMEKEY_FactionChinaSpecialWeapons);
291+
static NameKeyType c4 = NAMEKEY(NAMEKEY_FactionChinaSecretPolice);
292+
293+
static NameKeyType g0 = NAMEKEY(NAMEKEY_FactionGLA);
294+
static NameKeyType g1 = NAMEKEY(NAMEKEY_FactionGLAChooseAGeneral);
295+
static NameKeyType g2 = NAMEKEY(NAMEKEY_FactionGLATerrorCell);
296+
static NameKeyType g3 = NAMEKEY(NAMEKEY_FactionGLABiowarCommand);
297+
static NameKeyType g4 = NAMEKEY(NAMEKEY_FactionGLAWarlordCommand);
298298

299299
if (namekey == a1 || namekey == a2 || namekey == a3 || namekey == a4)
300300
namekey = a0;

0 commit comments

Comments
 (0)