File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 1- #include < future>
21#include " Logger.hpp"
32#include " FactionsManager.hpp"
43
Original file line number Diff line number Diff line change 99class FactionManager final
1010{
1111private: // Data
12- JSONFile TECH_TREE_SOURCE{PROGRAM_CONSTANTS->TECH_TREE_FILE };
12+ const JSONFile TECH_TREE_SOURCE{PROGRAM_CONSTANTS->TECH_TREE_FILE };
1313 QVector<Faction> vFactions;
1414public:
1515 inline static std::unique_ptr<FactionManager> Instance = nullptr ;
Original file line number Diff line number Diff line change @@ -121,13 +121,12 @@ void SetUpWindowsWrapper::BtnSettings_Clicked() { setCurrentWidget(pSettings
121121void SetUpWindowsWrapper::BtnBack_Clicked () { WINDOW_MANAGER->SetCSFFilePath (" " ); setCurrentWidget (pGreetingWidget); }
122122
123123void SetUpWindowsWrapper::LoadFromTheGameWindow_AcceptConfiguration ()
124- {
124+ {
125125 // TODO: Make it load vanila Generals
126- // Also as work with non-ascii paths
127- // Also as search in big-archives (see more at GZH source code)
128- QString gamePath = QString::fromStdWString (Windows::Registry::GetPathToGame (Windows::Registry::Games::GeneralsZeroHour));
129- QString pathDataEngGenCsf = gamePath + " Data\\ English\\ generals.csf" ;
130- QString pathEngBig = gamePath + " \\ EnglishZH.big" ;
126+ // Also as search in all big-archives (see more at GZH source code)
127+ const QString gamePath = QString::fromStdWString (Windows::Registry::GetPathToGame (Windows::Registry::Games::GeneralsZeroHour));
128+ const QString pathDataEngGenCsf = gamePath + " Data\\ English\\ generals.csf" ;
129+ const QString pathEngBig = gamePath + " \\ EnglishZH.big" ;
131130
132131 if (!QFile::exists (pathDataEngGenCsf) && !QFile::exists (pathEngBig))
133132 {
@@ -137,9 +136,15 @@ void SetUpWindowsWrapper::LoadFromTheGameWindow_AcceptConfiguration()
137136 }
138137
139138 if (QFile::exists (pathDataEngGenCsf))
139+ {
140140 WINDOW_MANAGER->SetCSFFilePath (pathDataEngGenCsf);
141+ }
141142 else
143+ {
144+ LOGMSG (" Unable to find " + pathDataEngGenCsf);
145+ LOGMSG (" Loading " + pathEngBig + " ..." );
142146 WINDOW_MANAGER->SetCSFFilePath (pathEngBig);
147+ }
143148
144149 WINDOW_MANAGER->StartUpWindow_AcceptConfiguration ();
145150}
You can’t perform that action at this time.
0 commit comments