Skip to content

Commit 9fc0ae2

Browse files
Refactoring
1 parent 66541c9 commit 9fc0ae2

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/FactionsManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <future>
21
#include "Logger.hpp"
32
#include "FactionsManager.hpp"
43

src/FactionsManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class FactionManager final
1010
{
1111
private: // 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;
1414
public:
1515
inline static std::unique_ptr<FactionManager> Instance = nullptr;

src/GUI/SetUpWindowsWrapper.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,12 @@ void SetUpWindowsWrapper::BtnSettings_Clicked() { setCurrentWidget(pSettings
121121
void SetUpWindowsWrapper::BtnBack_Clicked() { WINDOW_MANAGER->SetCSFFilePath(""); setCurrentWidget(pGreetingWidget); }
122122

123123
void 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
}

0 commit comments

Comments
 (0)