unify(common-ini): Move shared INI loaders to Core#2863
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/CMakeLists.txt | Uncomments 24 INI source files now living in Core/; mirrors the inverse changes in Generals and GeneralsMD CMakeLists. |
| Generals/Code/GameEngine/CMakeLists.txt | Comments out 24 INI source files that are now compiled from Core/ instead of the Generals-local copies. |
| GeneralsMD/Code/GameEngine/CMakeLists.txt | Comments out the same 24 INI source files that were formerly compiled from GeneralsMD-local copies; now delegated to Core/. |
| Generals/Code/GameEngine/Source/Common/MultiplayerSettings.cpp | Adds addStartingMoneyChoice and initialises m_gotDefaultStartingMoney in the constructor to match GeneralsMD; new function body uses 2-space indentation inconsistent with the tab-indented rest of the file. |
| Core/GameEngine/Source/Common/INI/INIMultiplayer.cpp | Moved unchanged from GeneralsMD; includes the new parseMultiplayerStartingMoneyChoiceDefinition handler which is registered in Core/INI.cpp and declared in Core/INI.h. |
| scripts/cpp/unify_move_files.py | Appends 24 already-executed unify_file calls as commented-out entries, serving as a historical record of what was unified in this PR. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before
G_INI["Generals/Code/GameEngine/\nSource/Common/INI/*.cpp\n(24 files)"]
MD_INI["GeneralsMD/Code/GameEngine/\nSource/Common/INI/*.cpp\n(24 files)"]
end
subgraph After
CORE_INI["Core/GameEngine/\nSource/Common/INI/*.cpp\n(24 files — shared)"]
G_CMAKE["Generals CMakeLists.txt\n(references Core/)"]
MD_CMAKE["GeneralsMD CMakeLists.txt\n(references Core/)"]
CORE_CMAKE["Core CMakeLists.txt\n(enables 24 files)"]
end
G_INI -->|"moved to"| CORE_INI
MD_INI -->|"moved to"| CORE_INI
CORE_INI --> CORE_CMAKE
CORE_CMAKE --> G_CMAKE
CORE_CMAKE --> MD_CMAKE
subgraph MultiplayerSettings
GMS["Generals/MultiplayerSettings.cpp\n+addStartingMoneyChoice()\n+m_gotDefaultStartingMoney=false"]
MDMS["GeneralsMD/MultiplayerSettings.cpp\n(already had addStartingMoneyChoice)"]
CORE_MP["Core/INI/INIMultiplayer.cpp\nparseMultiplayerStartingMoneyChoiceDefinition\n→ TheMultiplayerSettings->addStartingMoneyChoice()"]
end
CORE_MP --> GMS
CORE_MP --> MDMS
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
subgraph Before
G_INI["Generals/Code/GameEngine/\nSource/Common/INI/*.cpp\n(24 files)"]
MD_INI["GeneralsMD/Code/GameEngine/\nSource/Common/INI/*.cpp\n(24 files)"]
end
subgraph After
CORE_INI["Core/GameEngine/\nSource/Common/INI/*.cpp\n(24 files — shared)"]
G_CMAKE["Generals CMakeLists.txt\n(references Core/)"]
MD_CMAKE["GeneralsMD CMakeLists.txt\n(references Core/)"]
CORE_CMAKE["Core CMakeLists.txt\n(enables 24 files)"]
end
G_INI -->|"moved to"| CORE_INI
MD_INI -->|"moved to"| CORE_INI
CORE_INI --> CORE_CMAKE
CORE_CMAKE --> G_CMAKE
CORE_CMAKE --> MD_CMAKE
subgraph MultiplayerSettings
GMS["Generals/MultiplayerSettings.cpp\n+addStartingMoneyChoice()\n+m_gotDefaultStartingMoney=false"]
MDMS["GeneralsMD/MultiplayerSettings.cpp\n(already had addStartingMoneyChoice)"]
CORE_MP["Core/INI/INIMultiplayer.cpp\nparseMultiplayerStartingMoneyChoiceDefinition\n→ TheMultiplayerSettings->addStartingMoneyChoice()"]
end
CORE_MP --> GMS
CORE_MP --> MDMS
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
Generals/Code/GameEngine/Source/Common/MultiplayerSettings.cpp:144-153
The `addStartingMoneyChoice` function body uses 2-space indentation while the rest of this file uses tabs. This is inconsistent with the surrounding code style — for example, the `MultiplayerSettings` constructor, `newMultiplayerColorDefinition`, and the `operator=` overload all indent with tabs.
```suggestion
void MultiplayerSettings::addStartingMoneyChoice( const Money & money, Bool isDefault )
{
m_startingMoneyList.push_back( money );
if ( isDefault )
{
DEBUG_ASSERTCRASH( !m_gotDefaultStartingMoney, ("Cannot have more than one default MultiplayerStartingMoneyChoice") );
m_defaultStartingMoney = money;
m_gotDefaultStartingMoney = true;
}
}
```
Reviews (1): Last reviewed commit: "unify(ini): Move INI parser files to Cor..." | Re-trigger Greptile
Generals gains "MultiplayerSettings::addStartingMoneyChoice", doesn't affect user facing UI.
Move 24 files from GeneralsMD/Code/GameEngine/Source/Common/INI/* to Core/GameEngine/Source/Common/INI/*