Skip to content

Commit 91b77aa

Browse files
committed
Make setting member naming consistent
1 parent 47be8ff commit 91b77aa

14 files changed

Lines changed: 59 additions & 60 deletions

libs/s25client/s25client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ bool askForDebugData()
140140
}
141141
bool shouldSendDebugData()
142142
{
143-
return (SETTINGS.global.submit_debug_data == 1) || askForDebugData();
143+
return (SETTINGS.global.submitDebugData == 1) || askForDebugData();
144144
}
145145

146146
void showCrashMessage()

libs/s25main/Loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ void Loader::fillCaches()
10091009
}
10101010
}
10111011

1012-
if(SETTINGS.video.shared_textures)
1012+
if(SETTINGS.video.sharedTextures)
10131013
{
10141014
// generate mega texture
10151015
stp->pack();

libs/s25main/Settings.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ void Settings::LoadDefaults()
8585
// global
8686
// {
8787
// 0 = ask user at start, 1 = enabled, 2 = always ask
88-
global.submit_debug_data = 0;
89-
global.use_upnp = false;
88+
global.submitDebugData = 0;
89+
global.useUPNP = false;
9090
global.smartCursor = true;
9191
global.debugMode = false;
9292
global.showGFInfo = false;
@@ -107,7 +107,7 @@ void Settings::LoadDefaults()
107107
}
108108
video.framerate = 0; // Special value for HW vsync
109109
video.vbo = true;
110-
video.shared_textures = SHARED_TEXTURES_DEFAULT;
110+
video.sharedTextures = SHARED_TEXTURES_DEFAULT;
111111
video.guiScale = 0; // special value indicating automatic selection
112112
// }
113113

@@ -140,12 +140,12 @@ void Settings::LoadDefaults()
140140
lobby.name = System::getUserName();
141141
lobby.portraitIndex = 0;
142142
lobby.password.clear();
143-
lobby.save_password = false;
143+
lobby.savePassword = false;
144144
// }
145145

146146
// server
147147
// {
148-
server.last_ip.clear();
148+
server.lastIP.clear();
149149
server.localPort = 3665;
150150
server.ipv6 = false;
151151
// }
@@ -155,7 +155,7 @@ void Settings::LoadDefaults()
155155

156156
// interface
157157
// {
158-
interface.autosave_interval = 0;
158+
interface.autosaveInterval = 0;
159159
interface.mapScrollMode = MAP_SCROLL_MODE_DEFAULT;
160160
interface.enableWindowPinning = false;
161161
interface.windowSnapDistance = 8;
@@ -173,7 +173,7 @@ void Settings::LoadIngameDefaults()
173173
{
174174
// ingame
175175
// {
176-
ingame.scale_statistics = false;
176+
ingame.scaleStatistics = false;
177177
ingame.showBQ = false;
178178
ingame.showNames = false;
179179
ingame.showProductivity = false;
@@ -230,8 +230,8 @@ void Settings::Load()
230230
if(iniGlobal->getValue("gameversion") != rttr::version::GetRevision())
231231
s25util::warning("Your application version has changed - please recheck your settings!");
232232

233-
global.submit_debug_data = iniGlobal->getIntValue("submit_debug_data");
234-
global.use_upnp = iniGlobal->getBoolValue("use_upnp");
233+
global.submitDebugData = iniGlobal->getIntValue("submit_debug_data");
234+
global.useUPNP = iniGlobal->getBoolValue("use_upnp");
235235
global.smartCursor = iniGlobal->getValue("smartCursor", true);
236236
global.debugMode = iniGlobal->getValue("debugMode", false);
237237
global.showGFInfo = iniGlobal->getValue("showGFInfo", false);
@@ -253,7 +253,7 @@ void Settings::Load()
253253
}
254254
video.framerate = iniVideo->getValue("framerate", 0);
255255
video.vbo = iniVideo->getBoolValue("vbo");
256-
video.shared_textures = iniVideo->getBoolValue("shared_textures");
256+
video.sharedTextures = iniVideo->getBoolValue("shared_textures");
257257
video.guiScale = iniVideo->getValue("gui_scale", 0);
258258
// };
259259

@@ -289,7 +289,7 @@ void Settings::Load()
289289
lobby.name = iniLobby->getValue("name");
290290
lobby.portraitIndex = iniLobby->getIntValue("portrait_index");
291291
lobby.password = iniLobby->getValue("password");
292-
lobby.save_password = iniLobby->getBoolValue("save_password");
292+
lobby.savePassword = iniLobby->getBoolValue("save_password");
293293
// }
294294

295295
if(lobby.name.empty())
@@ -302,7 +302,7 @@ void Settings::Load()
302302

303303
// server
304304
// {
305-
server.last_ip = iniServer->getValue("last_ip");
305+
server.lastIP = iniServer->getValue("last_ip");
306306
boost::optional<uint16_t> port = validate::checkPort(iniServer->getValue("local_port"));
307307
server.localPort = port.value_or(3665);
308308
server.ipv6 = iniServer->getBoolValue("ipv6");
@@ -329,7 +329,7 @@ void Settings::Load()
329329

330330
// interface
331331
// {
332-
interface.autosave_interval = iniInterface->getIntValue("autosave_interval");
332+
interface.autosaveInterval = iniInterface->getIntValue("autosave_interval");
333333
try
334334
{
335335
interface.mapScrollMode = static_cast<MapScrollMode>(iniInterface->getIntValue("map_scroll_mode"));
@@ -381,7 +381,7 @@ void Settings::LoadIngame()
381381
throw std::runtime_error("Missing section");
382382
// ingame
383383
// {
384-
ingame.scale_statistics = iniIngame->getBoolValue("scale_statistics");
384+
ingame.scaleStatistics = iniIngame->getBoolValue("scale_statistics");
385385
ingame.showBQ = iniIngame->getBoolValue("show_building_quality");
386386
ingame.showNames = iniIngame->getBoolValue("show_names");
387387
ingame.showProductivity = iniIngame->getBoolValue("show_productivity");
@@ -439,8 +439,8 @@ void Settings::Save()
439439
// {
440440
iniGlobal->setValue("version", VERSION);
441441
iniGlobal->setValue("gameversion", rttr::version::GetRevision());
442-
iniGlobal->setValue("submit_debug_data", global.submit_debug_data);
443-
iniGlobal->setValue("use_upnp", global.use_upnp);
442+
iniGlobal->setValue("submit_debug_data", global.submitDebugData);
443+
iniGlobal->setValue("use_upnp", global.useUPNP);
444444
iniGlobal->setValue("smartCursor", global.smartCursor);
445445
iniGlobal->setValue("debugMode", global.debugMode);
446446
iniGlobal->setValue("showGFInfo", global.showGFInfo);
@@ -455,7 +455,7 @@ void Settings::Save()
455455
iniVideo->setValue("displayMode", rttr::enum_cast(video.displayMode));
456456
iniVideo->setValue("framerate", video.framerate);
457457
iniVideo->setValue("vbo", video.vbo);
458-
iniVideo->setValue("shared_textures", video.shared_textures);
458+
iniVideo->setValue("shared_textures", video.sharedTextures);
459459
iniVideo->setValue("gui_scale", video.guiScale);
460460
// };
461461

@@ -485,12 +485,12 @@ void Settings::Save()
485485
iniLobby->setValue("name", lobby.name);
486486
iniLobby->setValue("portrait_index", lobby.portraitIndex);
487487
iniLobby->setValue("password", lobby.password);
488-
iniLobby->setValue("save_password", lobby.save_password);
488+
iniLobby->setValue("save_password", lobby.savePassword);
489489
// }
490490

491491
// server
492492
// {
493-
iniServer->setValue("last_ip", server.last_ip);
493+
iniServer->setValue("last_ip", server.lastIP);
494494
iniServer->setValue("local_port", server.localPort);
495495
iniServer->setValue("ipv6", server.ipv6);
496496
// }
@@ -504,7 +504,7 @@ void Settings::Save()
504504

505505
// interface
506506
// {
507-
iniInterface->setValue("autosave_interval", interface.autosave_interval);
507+
iniInterface->setValue("autosave_interval", interface.autosaveInterval);
508508
iniInterface->setValue("map_scroll_mode", static_cast<int>(interface.mapScrollMode));
509509
iniInterface->setValue("enable_window_pinning", interface.enableWindowPinning);
510510
iniInterface->setValue("window_snap_distance", interface.windowSnapDistance);
@@ -542,7 +542,7 @@ void Settings::SaveIngame()
542542

543543
// ingame
544544
// {
545-
iniIngame->setValue("scale_statistics", ingame.scale_statistics);
545+
iniIngame->setValue("scale_statistics", ingame.scaleStatistics);
546546
iniIngame->setValue("show_building_quality", ingame.showBQ);
547547
iniIngame->setValue("show_names", ingame.showNames);
548548
iniIngame->setValue("show_productivity", ingame.showProductivity);

libs/s25main/Settings.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class Settings : public Singleton<Settings, SingletonPolicies::WithLongevity>
6060
public:
6161
struct
6262
{
63-
uint8_t submit_debug_data;
64-
bool use_upnp, smartCursor, debugMode, showGFInfo;
63+
uint8_t submitDebugData;
64+
bool useUPNP, smartCursor, debugMode, showGFInfo;
6565
} global;
6666

6767
struct
@@ -70,7 +70,7 @@ class Settings : public Singleton<Settings, SingletonPolicies::WithLongevity>
7070
signed short framerate; // <0 for unlimited, 0 for HW Vsync
7171
DisplayMode displayMode;
7272
bool vbo;
73-
bool shared_textures;
73+
bool sharedTextures;
7474
unsigned guiScale; ///< UI scaling in percent; 0 indicates automatic selection
7575
} video;
7676

@@ -100,12 +100,12 @@ class Settings : public Singleton<Settings, SingletonPolicies::WithLongevity>
100100
std::string name;
101101
unsigned portraitIndex;
102102
std::string password;
103-
bool save_password;
103+
bool savePassword;
104104
} lobby;
105105

106106
struct
107107
{
108-
std::string last_ip; /// last entered ip or hostname
108+
std::string lastIP; /// last entered ip or hostname
109109
uint16_t localPort;
110110
bool ipv6; /// listen/connect on ipv6 as default or not
111111
} server;
@@ -114,15 +114,15 @@ class Settings : public Singleton<Settings, SingletonPolicies::WithLongevity>
114114

115115
struct
116116
{
117-
unsigned autosave_interval;
117+
unsigned autosaveInterval;
118118
MapScrollMode mapScrollMode;
119119
bool enableWindowPinning;
120120
unsigned windowSnapDistance;
121121
} interface;
122122

123123
struct
124124
{
125-
bool scale_statistics;
125+
bool scaleStatistics;
126126
bool showNames;
127127
bool showProductivity;
128128
bool showBQ;

libs/s25main/desktops/dskMainMenu.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dskMainMenu::dskMainMenu()
5050
AddImage(ID_logo, DrawPoint(20, 20), LOADER.GetImageN("logo", 0));
5151

5252
using namespace std::chrono_literals;
53-
if(SETTINGS.global.submit_debug_data == 0)
53+
if(SETTINGS.global.submitDebugData == 0)
5454
AddTimer(ID_tmrDebugData, 250ms);
5555

5656
/*AddText(20, DrawPoint(50, 450), _("Font Test"), COLOR_YELLOW, FontStyle::LEFT, SmallFont);
@@ -73,9 +73,9 @@ void dskMainMenu::Msg_MsgBoxResult(const unsigned msgbox_id, const MsgboxResult
7373
if(msgbox_id == 100)
7474
{
7575
if(mbr == MsgboxResult::Yes)
76-
SETTINGS.global.submit_debug_data = 1;
76+
SETTINGS.global.submitDebugData = 1;
7777
else
78-
SETTINGS.global.submit_debug_data = 2;
78+
SETTINGS.global.submitDebugData = 2;
7979

8080
SETTINGS.Save();
8181
}

libs/s25main/desktops/dskOptions.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0))
254254
ctrlOptionGroup* upnp = groupCommon->AddOptionGroup(ID_grpUPNP, GroupSelectType::Check);
255255
upnp->AddTextButton(ID_btOn, curPos + ctrlOffset, ctrlSize, TextureColor::Grey, _("On"), NormalFont);
256256
upnp->AddTextButton(ID_btOff, curPos + ctrlOffset2, ctrlSize, TextureColor::Grey, _("Off"), NormalFont);
257-
upnp->SetSelection(SETTINGS.global.use_upnp);
257+
upnp->SetSelection(SETTINGS.global.useUPNP);
258258
curPos.y += rowHeight;
259259

260260
// Proxy type
@@ -312,8 +312,7 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0))
312312
mainGroup->AddTextButton(ID_btSubmitDebugAsk, curPos + ctrlOffset2, ctrlSize, TextureColor::Grey, _("Ask always"),
313313
NormalFont);
314314

315-
mainGroup->SetSelection((SETTINGS.global.submit_debug_data == 1) ? ID_btSubmitDebugOn :
316-
ID_btSubmitDebugAsk); //-V807
315+
mainGroup->SetSelection((SETTINGS.global.submitDebugData == 1) ? ID_btSubmitDebugOn : ID_btSubmitDebugAsk); //-V807
317316
curPos.y += rowHeight;
318317

319318
groupCommon->AddText(ID_txtGFInfo, curPos, _("Show GameFrame Info:"), COLOR_YELLOW, FontStyle{}, NormalFont);
@@ -479,7 +478,7 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0))
479478

480479
groupGraphics->GetCtrl<ctrlOptionGroup>(ID_grpVBO)->SetSelection(SETTINGS.video.vbo);
481480

482-
groupGraphics->GetCtrl<ctrlOptionGroup>(ID_grpOptTextures)->SetSelection(SETTINGS.video.shared_textures);
481+
groupGraphics->GetCtrl<ctrlOptionGroup>(ID_grpOptTextures)->SetSelection(SETTINGS.video.sharedTextures);
483482
// }
484483

485484
// Sound
@@ -594,7 +593,7 @@ void dskOptions::Msg_Group_OptionGroupChange(const unsigned /*group_id*/, const
594593
{
595594
case ID_grpIpv6: SETTINGS.server.ipv6 = enabled; break;
596595
case ID_grpVBO: SETTINGS.video.vbo = enabled; break;
597-
case ID_grpOptTextures: SETTINGS.video.shared_textures = enabled; break;
596+
case ID_grpOptTextures: SETTINGS.video.sharedTextures = enabled; break;
598597
case ID_grpEffects: SETTINGS.sound.effectsEnabled = enabled; break;
599598
case ID_grpBirdSounds: SETTINGS.sound.birdsEnabled = enabled; break;
600599
case ID_grpMusic:
@@ -606,9 +605,9 @@ void dskOptions::Msg_Group_OptionGroupChange(const unsigned /*group_id*/, const
606605
break;
607606
case ID_grpDebugData:
608607
// Special case: Uses e.g. ID_btSubmitDebugOn directly
609-
SETTINGS.global.submit_debug_data = selection;
608+
SETTINGS.global.submitDebugData = selection;
610609
break;
611-
case ID_grpUPNP: SETTINGS.global.use_upnp = enabled; break;
610+
case ID_grpUPNP: SETTINGS.global.useUPNP = enabled; break;
612611
case ID_grpSmartCursor:
613612
SETTINGS.global.smartCursor = enabled;
614613
VIDEODRIVER.SetMouseWarping(enabled);

libs/s25main/ingameWindows/iwDirectIPConnect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ iwDirectIPConnect::iwDirectIPConnect(ServerType serverType)
6565
AddTextButton(ID_btBack, DrawPoint(155, 240), Extent(125, 22), TextureColor::Red1, _("Back"), NormalFont);
6666

6767
host->SetFocus();
68-
host->SetText(SETTINGS.server.last_ip);
68+
host->SetText(SETTINGS.server.lastIP);
6969
port->SetText(SETTINGS.server.localPort);
7070
}
7171

@@ -105,7 +105,7 @@ void iwDirectIPConnect::Msg_ButtonClick(const unsigned ctrl_id)
105105
}
106106

107107
// save settings
108-
SETTINGS.server.last_ip = edtHost->GetText();
108+
SETTINGS.server.lastIP = edtHost->GetText();
109109

110110
if(!GAMECLIENT.Connect(edtHost->GetText(), edtPw->GetText(), serverType_, *port, false,
111111
SETTINGS.server.ipv6))

libs/s25main/ingameWindows/iwDirectIPCreate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void iwDirectIPCreate::Msg_ButtonClick(const unsigned ctrl_id)
143143
}
144144

145145
CreateServerInfo csi(server_type, *port, edtName->GetText(), edtPw->GetText(), SETTINGS.server.ipv6,
146-
SETTINGS.global.use_upnp);
146+
SETTINGS.global.useUPNP);
147147

148148
// Map auswählen
149149
WINDOWMANAGER.Switch(std::make_unique<dskSelectMap>(csi));

libs/s25main/ingameWindows/iwLobbyConnect.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ iwLobbyConnect::iwLobbyConnect()
7575
NormalFont);
7676
savepassword->AddTextButton(1, DrawPoint(secCtrlStartPos, curLblPos.y), btSize, TextureColor::Green2, _("Yes"),
7777
NormalFont);
78-
savepassword->SetSelection((SETTINGS.lobby.save_password ? 1 : 0));
78+
savepassword->SetSelection((SETTINGS.lobby.savePassword ? 1 : 0));
7979
curLblPos.y += 30;
8080

8181
AddText(ID_txtProtocol, curLblPos, _("Use IPv6:"), COLOR_YELLOW, FontStyle{}, NormalFont);
@@ -123,7 +123,7 @@ void iwLobbyConnect::ReadFromEditAndSaveLobbyData(std::string& user, std::string
123123

124124
// Save name and password if requested
125125
SETTINGS.lobby.name = user; //-V807
126-
if(SETTINGS.lobby.save_password)
126+
if(SETTINGS.lobby.savePassword)
127127
SETTINGS.lobby.password = "md5:" + pass;
128128
else
129129
SETTINGS.lobby.password.clear();
@@ -183,7 +183,7 @@ void iwLobbyConnect::Msg_OptionGroupChange(const unsigned ctrl_id, const unsigne
183183
{
184184
switch(ctrl_id)
185185
{
186-
case ID_optSavePw: SETTINGS.lobby.save_password = (selection == 1); break;
186+
case ID_optSavePw: SETTINGS.lobby.savePassword = (selection == 1); break;
187187
case ID_optProtocol: // IPv6 yes/no
188188
SETTINGS.server.ipv6 = (selection == 1);
189189
break;

libs/s25main/ingameWindows/iwSave.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ iwSave::iwSave() : iwSaveLoad(_("Save game!"), LOADER.GetTextureN("io", 47), 30)
146146

147147
// Select interval
148148
combo->SetSelection(0); // Use disabled by default and change if possible
149-
if(SETTINGS.interface.autosave_interval == 1)
149+
if(SETTINGS.interface.autosaveInterval == 1)
150150
combo->SetSelection(AUTO_SAVE_INTERVALS.size() + 1);
151151
else
152152
{
153153
// Start selection index at 1, 0 is "disabled"
154154
for(const auto& i : AUTO_SAVE_INTERVALS | boost::adaptors::indexed(1))
155155
{
156-
if(SETTINGS.interface.autosave_interval == duration_to_gfs(i.value()))
156+
if(SETTINGS.interface.autosaveInterval == duration_to_gfs(i.value()))
157157
{
158158
combo->SetSelection(static_cast<unsigned>(i.index()));
159159
break;
@@ -165,14 +165,14 @@ iwSave::iwSave() : iwSaveLoad(_("Save game!"), LOADER.GetTextureN("io", 47), 30)
165165
void iwSave::Msg_ComboSelectItem(const unsigned /*ctrl_id*/, const unsigned selection)
166166
{
167167
if(selection == 0) // First entry is "disabled"
168-
SETTINGS.interface.autosave_interval = 0;
168+
SETTINGS.interface.autosaveInterval = 0;
169169
else if(selection > AUTO_SAVE_INTERVALS.size()) // Last entry is "every GF" (in debug mode)
170-
SETTINGS.interface.autosave_interval = 1;
170+
SETTINGS.interface.autosaveInterval = 1;
171171
else
172172
{
173173
// selection is the index into the array ignoring the first ("disabled") entry
174174
RTTR_Assert(selection >= 1 && selection <= AUTO_SAVE_INTERVALS.size());
175-
SETTINGS.interface.autosave_interval = duration_to_gfs(AUTO_SAVE_INTERVALS[selection - 1]);
175+
SETTINGS.interface.autosaveInterval = duration_to_gfs(AUTO_SAVE_INTERVALS[selection - 1]);
176176
}
177177
}
178178

0 commit comments

Comments
 (0)