• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Return-To-The-Roots / s25client / 5735031298

pending completion
5735031298

Pull #1617

github

web-flow
Merge d291cd187 into a397539c1
Pull Request #1617: Show Popup on missing game files

11 of 11 new or added lines in 3 files covered. (100.0%)

21762 of 43119 relevant lines covered (50.47%)

32710.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.71
/libs/s25main/Settings.cpp
1
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
2
//
3
// SPDX-License-Identifier: GPL-2.0-or-later
4

5
#include "Settings.h"
6
#include "DrawPoint.h"
7
#include "RTTR_Version.h"
8
#include "RttrConfig.h"
9
#include "drivers/AudioDriverWrapper.h"
10
#include "drivers/VideoDriverWrapper.h"
11
#include "files.h"
12
#include "helpers/strUtils.h"
13
#include "languages.h"
14
#include "gameData/const_gui_ids.h"
15
#include "libsiedler2/ArchivItem_Ini.h"
16
#include "libsiedler2/ArchivItem_Text.h"
17
#include "libsiedler2/libsiedler2.h"
18
#include "s25util/StringConversion.h"
19
#include "s25util/System.h"
20
#include "s25util/error.h"
21
#include <boost/filesystem/operations.hpp>
22

23
const int Settings::VERSION = 13;
24
const std::array<std::string, 10> Settings::SECTION_NAMES = {
25
  {"global", "video", "language", "driver", "sound", "lobby", "server", "proxy", "interface", "addons"}};
26

27
const std::array<short, 13> Settings::SCREEN_REFRESH_RATES = {
28
  {-1, 25, 30, 50, 60, 75, 80, 100, 120, 150, 180, 200, 240}};
29

30
const std::map<GUI_ID, std::string> persistentWindows = {{CGI_CHAT, "wnd_chat"},
31
                                                         {CGI_POSTOFFICE, "wnd_postoffice"},
32
                                                         {CGI_DISTRIBUTION, "wnd_distribution"},
33
                                                         {CGI_BUILDORDER, "wnd_buildorder"},
34
                                                         {CGI_TRANSPORT, "wnd_transport"},
35
                                                         {CGI_MILITARY, "wnd_military"},
36
                                                         {CGI_TOOLS, "wnd_tools"},
37
                                                         {CGI_INVENTORY, "wnd_inventory"},
38
                                                         {CGI_MINIMAP, "wnd_minimap"},
39
                                                         {CGI_BUILDINGS, "wnd_buildings"},
40
                                                         {CGI_BUILDINGSPRODUCTIVITY, "wnd_buildingsproductivity"},
41
                                                         {CGI_MUSICPLAYER, "wnd_musicplayer"},
42
                                                         {CGI_STATISTICS, "wnd_statistics"},
43
                                                         {CGI_ECONOMICPROGRESS, "wnd_economicprogress"},
44
                                                         {CGI_DIPLOMACY, "wnd_diplomacy"},
45
                                                         {CGI_SHIP, "wnd_ship"},
46
                                                         {CGI_MERCHANDISE_STATISTICS, "wnd_merchandise_statistics"}};
47

48
namespace validate {
49
boost::optional<uint16_t> checkPort(const std::string& port)
9✔
50
{
51
    int32_t iPort;
52
    if((helpers::tryFromString(port, iPort) || s25util::tryFromStringClassic(port, iPort)) && checkPort(iPort))
9✔
53
        return static_cast<uint16_t>(iPort);
3✔
54
    else
55
        return boost::none;
6✔
56
}
57
bool checkPort(int port)
7✔
58
{
59
    // Disallow port 0 as it may cause problems
60
    return port > 0 && port <= 65535;
7✔
61
}
62
} // namespace validate
63

64
Settings::Settings() //-V730
5✔
65
{
66
    LoadDefaults();
5✔
67
}
5✔
68

69
void Settings::LoadDefaults()
5✔
70
{
71
    // global
72
    // {
73
    // 0 = ask user at start, 1 = enabled, 2 = always ask
74
    global.submit_debug_data = 0;
5✔
75
    global.use_upnp = false;
5✔
76
    global.smartCursor = true;
5✔
77
    global.debugMode = false;
5✔
78
    global.showGFInfo = false;
5✔
79
    // }
80

81
    // video
82
    // {
83
    if(VIDEODRIVER.IsLoaded())
5✔
84
    {
85
        video.fullscreenSize = VIDEODRIVER.GetWindowSize();
3✔
86
        video.windowedSize = VIDEODRIVER.IsFullscreen() ? VideoMode(800, 600) : video.fullscreenSize;
3✔
87
        video.fullscreen = VIDEODRIVER.IsFullscreen();
3✔
88
    } else
89
    {
90
        video.windowedSize = video.fullscreenSize = VideoMode(800, 600);
2✔
91
        video.fullscreen = false;
2✔
92
    }
93
    video.framerate = 0; // Special value for HW vsync
5✔
94
    video.vbo = true;
5✔
95
    video.shared_textures = true;
5✔
96
    // }
97

98
    // language
99
    // {
100
    language.language.clear();
5✔
101
    // }
102

103
    LANGUAGES.setLanguage(language.language);
5✔
104

105
    // driver
106
    // {
107
    driver.audio = AUDIODRIVER.GetName();
5✔
108
    driver.video = VIDEODRIVER.GetName();
5✔
109
    // }
110

111
    // sound
112
    // {
113
    sound.musicEnabled = false;
5✔
114
    sound.musicVolume = 30;
5✔
115
    sound.effectsEnabled = true;
5✔
116
    sound.effectsVolume = 75;
5✔
117
    sound.playlist = s25::files::defaultPlaylist;
5✔
118
    // }
119

120
    // lobby
121
    // {
122

123
    lobby.name = System::getUserName();
5✔
124
    lobby.password.clear();
5✔
125
    lobby.save_password = false;
5✔
126
    // }
127

128
    // server
129
    // {
130
    server.last_ip.clear();
5✔
131
    server.localPort = 3665;
5✔
132
    server.ipv6 = false;
5✔
133
    // }
134

135
    proxy = ProxySettings();
5✔
136
    proxy.port = 1080;
5✔
137

138
    // interface
139
    // {
140
    interface.autosave_interval = 0;
5✔
141
    interface.revert_mouse = false;
5✔
142
    interface.enableWindowPinning = false;
5✔
143
    // }
144

145
    // addons
146
    // {
147
    addons.configuration.clear();
5✔
148
    // }
149

150
    LoadIngameDefaults();
5✔
151
}
5✔
152

153
void Settings::LoadIngameDefaults()
5✔
154
{
155
    // ingame
156
    // {
157
    ingame.scale_statistics = false;
5✔
158
    ingame.showBQ = false;
5✔
159
    ingame.showNames = false;
5✔
160
    ingame.showProductivity = false;
5✔
161
    ingame.minimapExtended = false;
5✔
162
    // }
163

164
    // windows
165
    // {
166
    for(const auto& window : persistentWindows)
90✔
167
        windows.persistentSettings[window.first] = PersistentWindowSettings();
85✔
168
    // }
169
}
5✔
170

171
///////////////////////////////////////////////////////////////////////////////
172
// Routine zum Laden der Konfiguration
173
void Settings::Load()
×
174
{
175
    libsiedler2::Archiv settings;
×
176
    const auto settingsPath = RTTRCONFIG.ExpandPath(s25::resources::config);
×
177
    try
178
    {
179
        if(libsiedler2::Load(settingsPath, settings) != 0 || settings.size() < SECTION_NAMES.size())
×
180
            throw std::runtime_error("File missing or invalid");
×
181

182
        const libsiedler2::ArchivItem_Ini* iniGlobal =
183
          static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("global"));
×
184
        const libsiedler2::ArchivItem_Ini* iniVideo = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("video"));
×
185
        const libsiedler2::ArchivItem_Ini* iniLanguage =
186
          static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("language"));
×
187
        const libsiedler2::ArchivItem_Ini* iniDriver =
188
          static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("driver"));
×
189
        const libsiedler2::ArchivItem_Ini* iniSound = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("sound"));
×
190
        const libsiedler2::ArchivItem_Ini* iniLobby = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("lobby"));
×
191
        const libsiedler2::ArchivItem_Ini* iniServer =
192
          static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("server"));
×
193
        const libsiedler2::ArchivItem_Ini* iniProxy = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("proxy"));
×
194
        const libsiedler2::ArchivItem_Ini* iniInterface =
195
          static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("interface"));
×
196
        const libsiedler2::ArchivItem_Ini* iniAddons =
197
          static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("addons"));
×
198

199
        // ist eine der Kategorien nicht vorhanden?
200
        if(!iniGlobal || !iniVideo || !iniLanguage || !iniDriver || !iniSound || !iniLobby || !iniServer || !iniProxy
×
201
           || !iniInterface || !iniAddons)
×
202
        {
203
            throw std::runtime_error("Missing section");
×
204
        }
205
        // stimmt die Settingsversion?
206
        if(iniGlobal->getValue("version", 0) != VERSION)
×
207
            throw std::runtime_error("Wrong version");
×
208

209
        // global
210
        // {
211
        if(iniGlobal->getValue("gameversion") != rttr::version::GetRevision())
×
212
            s25util::warning("Your application version has changed - please recheck your settings!");
×
213

214
        global.submit_debug_data = iniGlobal->getIntValue("submit_debug_data");
×
215
        global.use_upnp = iniGlobal->getBoolValue("use_upnp");
×
216
        global.smartCursor = iniGlobal->getValue("smartCursor", true);
×
217
        global.debugMode = iniGlobal->getValue("debugMode", false);
×
218
        global.showGFInfo = iniGlobal->getValue("showGFInfo", false);
×
219
        // };
220

221
        // video
222
        // {
223
        video.windowedSize.width = iniVideo->getIntValue("windowed_width");
×
224
        video.windowedSize.height = iniVideo->getIntValue("windowed_height");
×
225
        video.fullscreenSize.width = iniVideo->getIntValue("fullscreen_width");
×
226
        video.fullscreenSize.height = iniVideo->getIntValue("fullscreen_height");
×
227
        video.fullscreen = iniVideo->getBoolValue("fullscreen");
×
228
        video.framerate = iniVideo->getValue("framerate", 0);
×
229
        video.vbo = iniVideo->getBoolValue("vbo");
×
230
        video.shared_textures = iniVideo->getBoolValue("shared_textures");
×
231
        // };
232

233
        if(video.fullscreenSize.width == 0 || video.fullscreenSize.height == 0 || video.windowedSize.width == 0
×
234
           || video.windowedSize.height == 0)
×
235
            throw std::runtime_error("Invalid video settings");
×
236

237
        // language
238
        // {
239
        language.language = iniLanguage->getValue("language");
×
240
        // }
241

242
        LANGUAGES.setLanguage(language.language);
×
243

244
        // driver
245
        // {
246
        driver.video = iniDriver->getValue("video");
×
247
        driver.audio = iniDriver->getValue("audio");
×
248
        // }
249

250
        // sound
251
        // {
252
        sound.musicEnabled = iniSound->getBoolValue("musik");
×
253
        sound.musicVolume = iniSound->getIntValue("musik_volume");
×
254
        sound.effectsEnabled = iniSound->getBoolValue("effekte");
×
255
        sound.effectsVolume = iniSound->getIntValue("effekte_volume");
×
256
        sound.playlist = iniSound->getValue("playlist");
×
257
        // }
258

259
        // lobby
260
        // {
261
        lobby.name = iniLobby->getValue("name");
×
262
        lobby.password = iniLobby->getValue("password");
×
263
        lobby.save_password = iniLobby->getBoolValue("save_password");
×
264
        // }
265

266
        if(lobby.name.empty())
×
267
            lobby.name = System::getUserName();
×
268

269
        // server
270
        // {
271
        server.last_ip = iniServer->getValue("last_ip");
×
272
        boost::optional<uint16_t> port = validate::checkPort(iniServer->getValue("local_port"));
×
273
        server.localPort = port.value_or(3665);
×
274
        server.ipv6 = iniServer->getBoolValue("ipv6");
×
275
        // }
276

277
        // proxy
278
        // {
279
        proxy.hostname = iniProxy->getValue("proxy");
×
280
        port = validate::checkPort(iniProxy->getValue("port"));
×
281
        proxy.port = port.value_or(1080);
×
282
        proxy.type = ProxyType(iniProxy->getIntValue("typ"));
×
283
        // }
284

285
        // leere proxyadresse deaktiviert proxy komplett
286
        // deaktivierter proxy entfernt proxyadresse
287
        if(proxy.hostname.empty() || (proxy.type != ProxyType::Socks4 && proxy.type != ProxyType::Socks5))
×
288
        {
289
            proxy.type = ProxyType::None;
×
290
            proxy.hostname.clear();
×
291
        }
292
        // aktivierter Socks v4 deaktiviert ipv6
293
        else if(proxy.type == ProxyType::Socks4 && server.ipv6)
×
294
            server.ipv6 = false;
×
295

296
        // interface
297
        // {
298
        interface.autosave_interval = iniInterface->getIntValue("autosave_interval");
×
299
        interface.revert_mouse = iniInterface->getBoolValue("revert_mouse");
×
300
        interface.enableWindowPinning = iniInterface->getValue("enable_window_pinning", false);
×
301
        // }
302

303
        // addons
304
        // {
305
        for(unsigned addon = 0; addon < iniAddons->size(); ++addon)
×
306
        {
307
            const auto* item = dynamic_cast<const libsiedler2::ArchivItem_Text*>(iniAddons->get(addon));
×
308

309
            if(item)
×
310
                addons.configuration.insert(std::make_pair(s25util::fromStringClassic<unsigned>(item->getName()),
×
311
                                                           s25util::fromStringClassic<unsigned>(item->getText())));
×
312
        }
313

314
        LoadIngame();
×
315
        // }
316
    } catch(std::runtime_error& e)
×
317
    {
318
        s25util::warning(std::string("Could not use settings from \"") + settingsPath.string()
×
319
                         + "\", using default values. Reason: " + e.what());
×
320
        LoadDefaults();
×
321
        Save();
×
322
    }
323
}
×
324

325
void Settings::LoadIngame()
×
326
{
327
    libsiedler2::Archiv settingsIngame;
×
328
    const auto settingsPathIngame = RTTRCONFIG.ExpandPath(s25::resources::ingameOptions);
×
329
    try
330
    {
331
        if(libsiedler2::Load(settingsPathIngame, settingsIngame) != 0)
×
332
            throw std::runtime_error("File missing");
×
333

334
        const libsiedler2::ArchivItem_Ini* iniIngame =
335
          static_cast<libsiedler2::ArchivItem_Ini*>(settingsIngame.find("ingame"));
×
336
        if(!iniIngame)
×
337
            throw std::runtime_error("Missing section");
×
338
        // ingame
339
        // {
340
        ingame.scale_statistics = iniIngame->getBoolValue("scale_statistics");
×
341
        ingame.showBQ = iniIngame->getBoolValue("show_building_quality");
×
342
        ingame.showNames = iniIngame->getBoolValue("show_names");
×
343
        ingame.showProductivity = iniIngame->getBoolValue("show_productivity");
×
344
        ingame.minimapExtended = iniIngame->getBoolValue("minimap_extended");
×
345
        // }
346
        // ingame windows
347
        for(const auto& window : persistentWindows)
×
348
        {
349
            const auto* iniWindow = static_cast<const libsiedler2::ArchivItem_Ini*>(settingsIngame.find(window.second));
×
350
            if(!iniWindow)
×
351
                continue;
×
352
            auto& settings = windows.persistentSettings[window.first];
×
353
            const auto lastPos = settings.lastPos =
×
354
              DrawPoint(iniWindow->getIntValue("pos_x"), iniWindow->getIntValue("pos_y"));
×
355
            settings.restorePos = DrawPoint(iniWindow->getValue("restore_pos_x", lastPos.x),
×
356
                                            iniWindow->getValue("restore_pos_y", lastPos.y));
×
357
            settings.isOpen = iniWindow->getIntValue("is_open");
×
358
            settings.isPinned = iniWindow->getValue("is_pinned", false);
×
359
            settings.isMinimized = iniWindow->getValue("is_minimized", false);
×
360
        }
361
    } catch(std::runtime_error& e)
×
362
    {
363
        s25util::warning(std::string("Could not use ingame settings from \"") + settingsPathIngame.string()
×
364
                         + "\", using default values. Reason: " + e.what());
×
365
        LoadIngameDefaults();
×
366
        SaveIngame();
×
367
    }
368
}
×
369

370
///////////////////////////////////////////////////////////////////////////////
371
// Routine zum Speichern der Konfiguration
372
void Settings::Save()
×
373
{
374
    libsiedler2::Archiv settings;
×
375
    settings.alloc(SECTION_NAMES.size());
×
376
    for(unsigned i = 0; i < SECTION_NAMES.size(); ++i)
×
377
        settings.set(i, std::make_unique<libsiedler2::ArchivItem_Ini>(SECTION_NAMES[i]));
×
378

379
    libsiedler2::ArchivItem_Ini* iniGlobal = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("global"));
×
380
    libsiedler2::ArchivItem_Ini* iniVideo = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("video"));
×
381
    libsiedler2::ArchivItem_Ini* iniLanguage = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("language"));
×
382
    libsiedler2::ArchivItem_Ini* iniDriver = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("driver"));
×
383
    libsiedler2::ArchivItem_Ini* iniSound = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("sound"));
×
384
    libsiedler2::ArchivItem_Ini* iniLobby = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("lobby"));
×
385
    libsiedler2::ArchivItem_Ini* iniServer = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("server"));
×
386
    libsiedler2::ArchivItem_Ini* iniProxy = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("proxy"));
×
387
    libsiedler2::ArchivItem_Ini* iniInterface = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("interface"));
×
388
    libsiedler2::ArchivItem_Ini* iniAddons = static_cast<libsiedler2::ArchivItem_Ini*>(settings.find("addons"));
×
389

390
    // ist eine der Kategorien nicht vorhanden?
391
    RTTR_Assert(iniGlobal && iniVideo && iniLanguage && iniDriver && iniSound && iniLobby && iniServer && iniProxy
×
392
                && iniInterface && iniAddons);
393

394
    // global
395
    // {
396
    iniGlobal->setValue("version", VERSION);
×
397
    iniGlobal->setValue("gameversion", rttr::version::GetRevision());
×
398
    iniGlobal->setValue("submit_debug_data", global.submit_debug_data);
×
399
    iniGlobal->setValue("use_upnp", global.use_upnp);
×
400
    iniGlobal->setValue("smartCursor", global.smartCursor);
×
401
    iniGlobal->setValue("debugMode", global.debugMode);
×
402
    iniGlobal->setValue("showGFInfo", global.showGFInfo);
×
403
    // };
404

405
    // video
406
    // {
407
    iniVideo->setValue("fullscreen_width", video.fullscreenSize.width);
×
408
    iniVideo->setValue("fullscreen_height", video.fullscreenSize.height);
×
409
    iniVideo->setValue("windowed_width", video.windowedSize.width);
×
410
    iniVideo->setValue("windowed_height", video.windowedSize.height);
×
411
    iniVideo->setValue("fullscreen", video.fullscreen);
×
412
    iniVideo->setValue("framerate", video.framerate);
×
413
    iniVideo->setValue("vbo", video.vbo);
×
414
    iniVideo->setValue("shared_textures", video.shared_textures);
×
415
    // };
416

417
    // language
418
    // {
419
    iniLanguage->setValue("language", language.language);
×
420
    // }
421

422
    // driver
423
    // {
424
    iniDriver->setValue("video", driver.video);
×
425
    iniDriver->setValue("audio", driver.audio);
×
426
    // }
427

428
    // sound
429
    // {
430
    iniSound->setValue("musik", sound.musicEnabled);
×
431
    iniSound->setValue("musik_volume", sound.musicVolume);
×
432
    iniSound->setValue("effekte", sound.effectsEnabled);
×
433
    iniSound->setValue("effekte_volume", sound.effectsVolume);
×
434
    iniSound->setValue("playlist", sound.playlist);
×
435
    // }
436

437
    // lobby
438
    // {
439
    iniLobby->setValue("name", lobby.name);
×
440
    iniLobby->setValue("password", lobby.password);
×
441
    iniLobby->setValue("save_password", lobby.save_password);
×
442
    // }
443

444
    // server
445
    // {
446
    iniServer->setValue("last_ip", server.last_ip);
×
447
    iniServer->setValue("local_port", server.localPort);
×
448
    iniServer->setValue("ipv6", server.ipv6);
×
449
    // }
450

451
    // proxy
452
    // {
453
    iniProxy->setValue("proxy", proxy.hostname);
×
454
    iniProxy->setValue("port", proxy.port);
×
455
    iniProxy->setValue("typ", static_cast<int>(proxy.type));
×
456
    // }
457

458
    // interface
459
    // {
460
    iniInterface->setValue("autosave_interval", interface.autosave_interval);
×
461
    iniInterface->setValue("revert_mouse", interface.revert_mouse);
×
462
    iniInterface->setValue("enable_window_pinning", interface.enableWindowPinning);
×
463
    // }
464

465
    // addons
466
    // {
467
    iniAddons->clear();
×
468
    for(const auto& it : addons.configuration)
×
469
        iniAddons->setValue(s25util::toStringClassic(it.first), s25util::toStringClassic(it.second));
×
470
    // }
471

472
    bfs::path settingsPath = RTTRCONFIG.ExpandPath(s25::resources::config);
×
473
    if(libsiedler2::Write(settingsPath, settings) == 0)
×
474
        bfs::permissions(settingsPath, bfs::owner_read | bfs::owner_write);
×
475

476
    SaveIngame();
×
477
}
×
478

479
void Settings::SaveIngame()
×
480
{
481
    libsiedler2::Archiv settingsIngame;
×
482
    settingsIngame.alloc(1 + persistentWindows.size());
×
483
    settingsIngame.set(0, std::make_unique<libsiedler2::ArchivItem_Ini>("ingame"));
×
484
    unsigned i = 1;
×
485
    for(const auto& window : persistentWindows)
×
486
    {
487
        settingsIngame.set(i, std::make_unique<libsiedler2::ArchivItem_Ini>(window.second));
×
488
        i++;
×
489
    }
490

491
    auto* iniIngame = static_cast<libsiedler2::ArchivItem_Ini*>(settingsIngame.find("ingame"));
×
492

493
    RTTR_Assert(iniIngame);
×
494

495
    // ingame
496
    // {
497
    iniIngame->setValue("scale_statistics", ingame.scale_statistics);
×
498
    iniIngame->setValue("show_building_quality", ingame.showBQ);
×
499
    iniIngame->setValue("show_names", ingame.showNames);
×
500
    iniIngame->setValue("show_productivity", ingame.showProductivity);
×
501
    iniIngame->setValue("minimap_extended", ingame.minimapExtended);
×
502
    // }
503

504
    // ingame windows
505
    for(const auto& window : persistentWindows)
×
506
    {
507
        auto* iniWindow = static_cast<libsiedler2::ArchivItem_Ini*>(settingsIngame.find(window.second));
×
508
        if(!iniWindow)
×
509
            continue;
×
510
        const auto& settings = windows.persistentSettings[window.first];
×
511
        iniWindow->setValue("pos_x", settings.lastPos.x);
×
512
        iniWindow->setValue("pos_y", settings.lastPos.y);
×
513
        if(settings.restorePos != settings.lastPos)
×
514
        {
515
            // only save if different; defaults to lastPos on load
516
            iniWindow->setValue("restore_pos_x", settings.restorePos.x);
×
517
            iniWindow->setValue("restore_pos_y", settings.restorePos.y);
×
518
        }
519
        iniWindow->setValue("is_open", settings.isOpen);
×
520
        iniWindow->setValue("is_pinned", settings.isPinned);
×
521
        iniWindow->setValue("is_minimized", settings.isMinimized);
×
522
    }
523

524
    bfs::path settingsPathIngame = RTTRCONFIG.ExpandPath(s25::resources::ingameOptions);
×
525
    if(libsiedler2::Write(settingsPathIngame, settingsIngame) == 0)
×
526
        bfs::permissions(settingsPathIngame, bfs::owner_read | bfs::owner_write);
×
527
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc