Merge pull request #25320 from Gymnasiast/refactor/yet-more-code-style

Refactor/yet more code style
This commit is contained in:
Michael Steenbeek authored and GitHub committed 2025-10-09 01:36:09 +02:00
commit d0302e5466
168 files changed
+2768 -2768

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ CursorRepository::~CursorRepository()
void CursorRepository::LoadCursors()
{
SetCursorScale(static_cast<uint8_t>(round(Config::Get().general.WindowScale)));
SetCursorScale(static_cast<uint8_t>(round(Config::Get().general.windowScale)));
SetCurrentCursor(CursorID::Arrow);
}
+30 -30
View File
@@ -198,12 +198,12 @@ public:
// Set window size
UpdateFullscreenResolutions();
Resolution resolution = GetClosestResolution(
Config::Get().general.FullscreenWidth, Config::Get().general.FullscreenHeight);
Config::Get().general.fullscreenWidth, Config::Get().general.fullscreenHeight);
SDL_SetWindowSize(_window, resolution.Width, resolution.Height);
}
else if (mode == FullscreenMode::windowed)
{
SDL_SetWindowSize(_window, Config::Get().general.WindowWidth, Config::Get().general.WindowHeight);
SDL_SetWindowSize(_window, Config::Get().general.windowWidth, Config::Get().general.windowHeight);
}
if (SDL_SetWindowFullscreen(_window, windowFlags))
@@ -374,16 +374,16 @@ public:
{
// Update default display index
int32_t displayIndex = SDL_GetWindowDisplayIndex(_window);
if (displayIndex != Config::Get().general.DefaultDisplay)
if (displayIndex != Config::Get().general.defaultDisplay)
{
Config::Get().general.DefaultDisplay = displayIndex;
Config::Get().general.defaultDisplay = displayIndex;
Config::Save();
}
break;
}
}
if (Config::Get().sound.audio_focus)
if (Config::Get().sound.audioFocus)
{
if (e.window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
{
@@ -396,8 +396,8 @@ public:
}
break;
case SDL_MOUSEMOTION:
_cursorState.position = { static_cast<int32_t>(e.motion.x / Config::Get().general.WindowScale),
static_cast<int32_t>(e.motion.y / Config::Get().general.WindowScale) };
_cursorState.position = { static_cast<int32_t>(e.motion.x / Config::Get().general.windowScale),
static_cast<int32_t>(e.motion.y / Config::Get().general.windowScale) };
break;
case SDL_MOUSEWHEEL:
if (_inGameConsole.IsOpen())
@@ -413,8 +413,8 @@ public:
{
break;
}
ScreenCoordsXY mousePos = { static_cast<int32_t>(e.button.x / Config::Get().general.WindowScale),
static_cast<int32_t>(e.button.y / Config::Get().general.WindowScale) };
ScreenCoordsXY mousePos = { static_cast<int32_t>(e.button.x / Config::Get().general.windowScale),
static_cast<int32_t>(e.button.y / Config::Get().general.windowScale) };
switch (e.button.button)
{
case SDL_BUTTON_LEFT:
@@ -449,8 +449,8 @@ public:
{
break;
}
ScreenCoordsXY mousePos = { static_cast<int32_t>(e.button.x / Config::Get().general.WindowScale),
static_cast<int32_t>(e.button.y / Config::Get().general.WindowScale) };
ScreenCoordsXY mousePos = { static_cast<int32_t>(e.button.x / Config::Get().general.windowScale),
static_cast<int32_t>(e.button.y / Config::Get().general.windowScale) };
switch (e.button.button)
{
case SDL_BUTTON_LEFT:
@@ -604,7 +604,7 @@ public:
{
char scaleQualityBuffer[4];
_scaleQuality = ScaleQuality::SmoothNearestNeighbour;
if (Config::Get().general.WindowScale == std::floor(Config::Get().general.WindowScale))
if (Config::Get().general.windowScale == std::floor(Config::Get().general.windowScale))
{
_scaleQuality = ScaleQuality::NearestNeighbour;
}
@@ -624,10 +624,10 @@ public:
void CreateWindow() override
{
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, Config::Get().general.MinimizeFullscreenFocusLoss ? "1" : "0");
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, Config::Get().general.minimizeFullscreenFocusLoss ? "1" : "0");
// Set window position to default display
int32_t defaultDisplay = std::clamp(Config::Get().general.DefaultDisplay, 0, 0xFFFF);
int32_t defaultDisplay = std::clamp(Config::Get().general.defaultDisplay, 0, 0xFFFF);
auto windowPos = ScreenCoordsXY{ static_cast<int32_t>(SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay)),
static_cast<int32_t>(SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay)) };
@@ -770,7 +770,7 @@ private:
void InferDisplayDPI()
{
auto& config = Config::Get().general;
if (!config.InferDisplayDPI)
if (!config.inferDisplayDPI)
return;
int wWidth, wHeight;
@@ -779,9 +779,9 @@ private:
auto renderer = SDL_GetRenderer(_window);
int rWidth, rHeight;
if (SDL_GetRendererOutputSize(renderer, &rWidth, &rHeight) == 0)
config.WindowScale = rWidth / wWidth;
config.windowScale = rWidth / wWidth;
config.InferDisplayDPI = false;
config.inferDisplayDPI = false;
Config::Save();
}
@@ -797,8 +797,8 @@ private:
emscripten_get_canvas_element_size("!canvas", &width, &height);
#else
// Get saved window size
int32_t width = Config::Get().general.WindowWidth;
int32_t height = Config::Get().general.WindowHeight;
int32_t width = Config::Get().general.windowWidth;
int32_t height = Config::Get().general.windowHeight;
#endif
if (width <= 0)
width = 640;
@@ -807,7 +807,7 @@ private:
// Create window in window first rather than fullscreen so we have the display the window is on first
uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
if (Config::Get().general.DrawingEngine == DrawingEngine::OpenGL)
if (Config::Get().general.drawingEngine == DrawingEngine::OpenGL)
{
flags |= SDL_WINDOW_OPENGL;
}
@@ -821,7 +821,7 @@ private:
ApplyScreenSaverLockSetting();
SDL_SetWindowMinimumSize(_window, 720, 480);
SetCursorTrap(Config::Get().general.TrapCursor);
SetCursorTrap(Config::Get().general.trapCursor);
_platformUiContext->SetWindowIcon(_window);
// Initialise the surface, palette and draw buffer
@@ -831,15 +831,15 @@ private:
UpdateFullscreenResolutions();
SetFullscreenMode(static_cast<FullscreenMode>(Config::Get().general.FullscreenMode));
SetFullscreenMode(static_cast<FullscreenMode>(Config::Get().general.fullscreenMode));
TriggerResize();
}
void OnResize(int32_t width, int32_t height)
{
// Scale the native window size to the game's canvas size
_width = static_cast<int32_t>(width / Config::Get().general.WindowScale);
_height = static_cast<int32_t>(height / Config::Get().general.WindowScale);
_width = static_cast<int32_t>(width / Config::Get().general.windowScale);
_height = static_cast<int32_t>(height / Config::Get().general.windowScale);
DrawingEngineResize();
@@ -861,10 +861,10 @@ private:
if (!(flags & nonWindowFlags))
{
if (width != Config::Get().general.WindowWidth || height != Config::Get().general.WindowHeight)
if (width != Config::Get().general.windowWidth || height != Config::Get().general.windowHeight)
{
Config::Get().general.WindowWidth = width;
Config::Get().general.WindowHeight = height;
Config::Get().general.windowWidth = width;
Config::Get().general.windowHeight = height;
Config::Save();
}
}
@@ -911,10 +911,10 @@ private:
// Update config fullscreen resolution if not set
if (!resolutions.empty()
&& (Config::Get().general.FullscreenWidth == -1 || Config::Get().general.FullscreenHeight == -1))
&& (Config::Get().general.fullscreenWidth == -1 || Config::Get().general.fullscreenHeight == -1))
{
Config::Get().general.FullscreenWidth = resolutions.back().Width;
Config::Get().general.FullscreenHeight = resolutions.back().Height;
Config::Get().general.fullscreenWidth = resolutions.back().Width;
Config::Get().general.fullscreenHeight = resolutions.back().Height;
}
_fsResolutions = resolutions;
+2 -2
View File
@@ -182,7 +182,7 @@ public:
case WindowView::financesResearch:
return FinancesResearchOpen();
case WindowView::rideResearch:
if (Config::Get().interface.ToolbarShowResearch)
if (Config::Get().interface.toolbarShowResearch)
{
return this->OpenWindow(WindowClass::research);
}
@@ -855,7 +855,7 @@ public:
// Check if there are any window slots left
// include kWindowLimitReserved for items such as the main viewport and toolbars to not appear to be counted.
if (gWindowList.size() >= static_cast<size_t>(Config::Get().general.WindowLimit + kWindowLimitReserved))
if (gWindowList.size() >= static_cast<size_t>(Config::Get().general.windowLimit + kWindowLimitReserved))
{
// Close least recently used window
for (auto& w : gWindowList)
+7 -7
View File
@@ -146,8 +146,8 @@ void AudioMixer::GetNextAudioChunk(uint8_t* dst, size_t length)
else
{
auto group = channel->GetGroup();
if ((group != MixerGroup::Sound || Config::Get().sound.SoundEnabled) && Config::Get().sound.MasterSoundEnabled
&& Config::Get().sound.MasterVolume != 0)
if ((group != MixerGroup::Sound || Config::Get().sound.soundEnabled) && Config::Get().sound.masterSoundEnabled
&& Config::Get().sound.masterVolume != 0)
{
MixChannel(channel.get(), dst, length);
}
@@ -159,14 +159,14 @@ void AudioMixer::GetNextAudioChunk(uint8_t* dst, size_t length)
void AudioMixer::UpdateAdjustedSound()
{
// Did the volume level get changed? Recalculate level in this case.
if (_settingSoundVolume != Config::Get().sound.SoundVolume)
if (_settingSoundVolume != Config::Get().sound.soundVolume)
{
_settingSoundVolume = Config::Get().sound.SoundVolume;
_settingSoundVolume = Config::Get().sound.soundVolume;
_adjustSoundVolume = powf(static_cast<float>(_settingSoundVolume) / 100.f, 10.f / 6.f);
}
if (_settingMusicVolume != Config::Get().sound.AudioFocus)
if (_settingMusicVolume != Config::Get().sound.rideMusicVolume)
{
_settingMusicVolume = Config::Get().sound.AudioFocus;
_settingMusicVolume = Config::Get().sound.rideMusicVolume;
_adjustMusicVolume = powf(static_cast<float>(_settingMusicVolume) / 100.f, 10.f / 6.f);
}
}
@@ -297,7 +297,7 @@ void AudioMixer::ApplyPan(const IAudioChannel* channel, void* buffer, size_t len
int32_t AudioMixer::ApplyVolume(const IAudioChannel* channel, void* buffer, size_t len)
{
float volumeAdjust = _volume;
volumeAdjust *= Config::Get().sound.MasterSoundEnabled ? (static_cast<float>(Config::Get().sound.MasterVolume) / 100.0f)
volumeAdjust *= Config::Get().sound.masterSoundEnabled ? (static_cast<float>(Config::Get().sound.masterVolume) / 100.0f)
: 0.0f;
switch (channel->GetGroup())
@@ -153,7 +153,7 @@ public:
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaleQualityBuffer);
uint32_t scale = std::ceil(Config::Get().general.WindowScale);
uint32_t scale = std::ceil(Config::Get().general.windowScale);
_scaledScreenTexture = SDL_CreateTexture(
_sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_TARGET, width * scale, height * scale);
@@ -186,7 +186,7 @@ public:
_paletteHWMapped[i] = SDL_MapRGB(_screenTextureFormat, palette[i].Red, palette[i].Green, palette[i].Blue);
}
if (Config::Get().general.EnableLightFx)
if (Config::Get().general.enableLightFx)
{
auto& lightPalette = LightFx::GetPalette();
for (int32_t i = 0; i < 256; i++)
@@ -235,7 +235,7 @@ private:
{
auto* viewport = WindowGetViewport(WindowGetMain());
if (Config::Get().general.EnableLightFx && viewport != nullptr)
if (Config::Get().general.enableLightFx && viewport != nullptr)
{
void* pixels;
int32_t pitch;
@@ -351,8 +351,8 @@ private:
SDL_GetWindowSize(_window, &windowX, &windowY);
SDL_GetRendererOutputSize(_sdlRenderer, &renderX, &renderY);
float scaleX = Config::Get().general.WindowScale * renderX / static_cast<float>(windowX);
float scaleY = Config::Get().general.WindowScale * renderY / static_cast<float>(windowY);
float scaleX = Config::Get().general.windowScale * renderX / static_cast<float>(windowX);
float scaleY = Config::Get().general.windowScale * renderY / static_cast<float>(windowY);
SDL_SetRenderDrawBlendMode(_sdlRenderer, SDL_BLENDMODE_BLEND);
for (uint32_t y = 0; y < _invalidationGrid.getRowCount(); y++)
@@ -613,7 +613,7 @@ private:
}
if (GetContext()->GetUiContext().GetScaleQuality() == ScaleQuality::SmoothNearestNeighbour)
{
uint32_t scale = std::ceil(Config::Get().general.WindowScale);
uint32_t scale = std::ceil(Config::Get().general.windowScale);
_smoothScaleFramebuffer = std::make_unique<OpenGLFramebuffer>(_width * scale, _height * scale, false, false);
}
}
+2 -2
View File
@@ -263,7 +263,7 @@ void InputManager::handleViewScrolling()
}
// Mouse edge scrolling
if (Config::Get().general.EdgeScrolling)
if (Config::Get().general.edgeScrolling)
{
if (InputGetState() != InputState::Normal)
return;
@@ -299,7 +299,7 @@ void InputManager::handleModifiers()
}
#endif
if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off)
if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off)
{
if (isModifierKeyPressed(ModifierKey::ctrl) || isModifierKeyPressed(ModifierKey::shift))
VirtualFloorEnable();
+7 -7
View File
@@ -233,8 +233,8 @@ namespace OpenRCT2
windowMgr->InvalidateByNumber(w->classification, w->number);
ScreenCoordsXY fixedCursorPosition = {
static_cast<int32_t>(std::ceil(gInputDragLast.x * Config::Get().general.WindowScale)),
static_cast<int32_t>(std::ceil(gInputDragLast.y * Config::Get().general.WindowScale))
static_cast<int32_t>(std::ceil(gInputDragLast.x * Config::Get().general.windowScale)),
static_cast<int32_t>(std::ceil(gInputDragLast.y * Config::Get().general.windowScale))
};
ContextSetCursorPosition(fixedCursorPosition);
@@ -492,7 +492,7 @@ namespace OpenRCT2
{
int32_t snapProximity;
snapProximity = (w.flags.has(WindowFlag::noSnapping)) ? 0 : Config::Get().general.WindowSnapProximity;
snapProximity = (w.flags.has(WindowFlag::noSnapping)) ? 0 : Config::Get().general.windowSnapProximity;
WindowMoveAndSnap(w, newScreenCoords - lastScreenCoords, snapProximity);
}
@@ -547,7 +547,7 @@ namespace OpenRCT2
_ticksSinceDragStart = gCurrentRealTimeTicks;
auto cursorPosition = ContextGetCursorPosition();
gInputDragLast = cursorPosition;
if (!Config::Get().general.InvertViewportDrag)
if (!Config::Get().general.invertViewportDrag)
{
ContextHideCursor();
}
@@ -608,7 +608,7 @@ namespace OpenRCT2
differentialCoords.x = posX ? -differentialCoords.x : differentialCoords.x;
differentialCoords.y = posY ? -differentialCoords.y : differentialCoords.y;
if (Config::Get().general.InvertViewportDrag)
if (Config::Get().general.invertViewportDrag)
{
w->savedViewPos -= differentialCoords;
}
@@ -621,7 +621,7 @@ namespace OpenRCT2
#ifndef __EMSCRIPTEN__
const CursorState* cursorState = ContextGetCursorState();
if (cursorState->touch || Config::Get().general.InvertViewportDrag)
if (cursorState->touch || Config::Get().general.invertViewportDrag)
{
gInputDragLast = newDragCoords;
}
@@ -1634,7 +1634,7 @@ namespace OpenRCT2
if (viewport == nullptr)
return;
const int32_t speed = Config::Get().general.EdgeScrollingSpeed;
const int32_t speed = Config::Get().general.edgeScrollingSpeed;
int32_t multiplier = viewport->zoom.ApplyTo(speed);
int32_t dx = scrollScreenCoords.x * multiplier;
+6 -6
View File
@@ -457,7 +457,7 @@ static void ShortcutOpenSceneryPicker()
static void ShortcutScaleUp()
{
Config::Get().general.WindowScale += 0.25f;
Config::Get().general.windowScale += 0.25f;
Config::Save();
GfxInvalidateScreen();
ContextTriggerResize();
@@ -466,8 +466,8 @@ static void ShortcutScaleUp()
static void ShortcutScaleDown()
{
Config::Get().general.WindowScale -= 0.25f;
Config::Get().general.WindowScale = std::max(0.5f, Config::Get().general.WindowScale);
Config::Get().general.windowScale -= 0.25f;
Config::Get().general.windowScale = std::max(0.5f, Config::Get().general.windowScale);
Config::Save();
GfxInvalidateScreen();
ContextTriggerResize();
@@ -623,7 +623,7 @@ static void ShortcutToggleConsole()
{
console.Toggle();
}
else if (Config::Get().general.DebuggingTools && !ContextIsInputActive())
else if (Config::Get().general.debuggingTools && !ContextIsInputActive())
{
WindowCancelTextbox();
console.Toggle();
@@ -737,7 +737,7 @@ static void ShortcutToggleTransparentWater()
if (gLegacyScene == LegacyScene::titleSequence)
return;
Config::Get().general.TransparentWater ^= 1;
Config::Get().general.transparentWater ^= 1;
Config::Save();
GfxInvalidateScreen();
}
@@ -827,7 +827,7 @@ void ShortcutManager::registerDefaultShortcuts()
registerShortcut(ShortcutId::kInterfaceOpenTransparencyOptions, STR_SHORTCUT_OPEN_TRANSPARENCY_OPTIONS, "CTRL+T", ShortcutOpenTransparencyWindow);
registerShortcut(ShortcutId::kInterfaceOpenCheats, STR_SHORTCUT_OPEN_CHEATS_WINDOW, "CTRL+ALT+C", ShortcutOpenCheatWindow);
registerShortcut(ShortcutId::kInterfaceOpenTileInspector, STR_SHORTCUT_OPEN_TILE_INSPECTOR, []() {
if (Config::Get().interface.ToolbarShowCheats)
if (Config::Get().interface.toolbarShowCheats)
{
OpenWindow(WindowClass::tileInspector);
}
+18 -18
View File
@@ -62,7 +62,7 @@ namespace OpenRCT2::Ui::FileBrowser
auto& config = Config::Get().general;
// Open system file picker?
if (config.UseNativeBrowseDialog && hasFilePicker)
if (config.useNativeBrowseDialog && hasFilePicker)
{
const bool isSave = (action == LoadSaveAction::save);
const auto defaultDirectory = GetDir(type);
@@ -84,7 +84,7 @@ namespace OpenRCT2::Ui::FileBrowser
if (a.type != b.type)
return EnumValue(a.type) - EnumValue(b.type) < 0;
switch (Config::Get().general.LoadSaveSort)
switch (Config::Get().general.loadSaveSort)
{
case FileBrowserSort::NameAscending:
return String::logicalCmp(a.name.c_str(), b.name.c_str()) < 0;
@@ -123,16 +123,16 @@ namespace OpenRCT2::Ui::FileBrowser
switch (type)
{
case LoadSaveType::park:
return Config::Get().general.LastSaveGameDirectory;
return Config::Get().general.lastSaveGameDirectory;
case LoadSaveType::landscape:
return Config::Get().general.LastSaveLandscapeDirectory;
return Config::Get().general.lastSaveLandscapeDirectory;
case LoadSaveType::scenario:
return Config::Get().general.LastSaveScenarioDirectory;
return Config::Get().general.lastSaveScenarioDirectory;
case LoadSaveType::track:
return Config::Get().general.LastSaveTrackDirectory;
return Config::Get().general.lastSaveTrackDirectory;
default:
return u8string();
@@ -257,7 +257,7 @@ namespace OpenRCT2::Ui::FileBrowser
{
case (LoadSaveType::park):
{
SetAndSaveConfigPath(Config::Get().general.LastSaveGameDirectory, pathBuffer);
SetAndSaveConfigPath(Config::Get().general.lastSaveGameDirectory, pathBuffer);
if (GetContext()->LoadParkFromFile(pathBuffer))
{
InvokeCallback(ModalResult::ok, pathBuffer);
@@ -278,7 +278,7 @@ namespace OpenRCT2::Ui::FileBrowser
}
case (LoadSaveType::landscape):
{
SetAndSaveConfigPath(Config::Get().general.LastSaveLandscapeDirectory, pathBuffer);
SetAndSaveConfigPath(Config::Get().general.lastSaveLandscapeDirectory, pathBuffer);
if (Editor::LoadLandscape(pathBuffer))
{
gCurrentLoadedPath = pathBuffer;
@@ -295,12 +295,12 @@ namespace OpenRCT2::Ui::FileBrowser
}
case (LoadSaveType::scenario):
{
SetAndSaveConfigPath(Config::Get().general.LastSaveScenarioDirectory, pathBuffer);
SetAndSaveConfigPath(Config::Get().general.lastSaveScenarioDirectory, pathBuffer);
int32_t parkFlagsBackup = gameState.park.flags;
gameState.park.flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.editorStep = EditorStep::Invalid;
gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2);
int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2);
gameState.park.flags = parkFlagsBackup;
if (success)
@@ -321,7 +321,7 @@ namespace OpenRCT2::Ui::FileBrowser
}
case (LoadSaveType::track):
{
SetAndSaveConfigPath(Config::Get().general.LastSaveTrackDirectory, pathBuffer);
SetAndSaveConfigPath(Config::Get().general.lastSaveTrackDirectory, pathBuffer);
auto intent = Intent(WindowClass::installTrack);
intent.PutExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer });
ContextOpenIntent(&intent);
@@ -344,8 +344,8 @@ namespace OpenRCT2::Ui::FileBrowser
{
case LoadSaveType::park:
{
SetAndSaveConfigPath(Config::Get().general.LastSaveGameDirectory, pathBuffer);
if (ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 1 : 0))
SetAndSaveConfigPath(Config::Get().general.lastSaveGameDirectory, pathBuffer);
if (ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 1 : 0))
{
gScenarioSavePath = pathBuffer;
gCurrentLoadedPath = pathBuffer;
@@ -366,9 +366,9 @@ namespace OpenRCT2::Ui::FileBrowser
}
case LoadSaveType::landscape:
{
SetAndSaveConfigPath(Config::Get().general.LastSaveLandscapeDirectory, pathBuffer);
SetAndSaveConfigPath(Config::Get().general.lastSaveLandscapeDirectory, pathBuffer);
gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
if (ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2))
if (ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2))
{
gCurrentLoadedPath = pathBuffer;
windowMgr->CloseByClass(WindowClass::loadsave);
@@ -384,12 +384,12 @@ namespace OpenRCT2::Ui::FileBrowser
}
case LoadSaveType::scenario:
{
SetAndSaveConfigPath(Config::Get().general.LastSaveScenarioDirectory, pathBuffer);
SetAndSaveConfigPath(Config::Get().general.lastSaveScenarioDirectory, pathBuffer);
int32_t parkFlagsBackup = gameState.park.flags;
gameState.park.flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.editorStep = EditorStep::Invalid;
gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2);
int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2);
gameState.park.flags = parkFlagsBackup;
if (success)
@@ -410,7 +410,7 @@ namespace OpenRCT2::Ui::FileBrowser
}
case LoadSaveType::track:
{
SetAndSaveConfigPath(Config::Get().general.LastSaveTrackDirectory, pathBuffer);
SetAndSaveConfigPath(Config::Get().general.lastSaveTrackDirectory, pathBuffer);
const auto withExtension = Path::WithExtension(pathBuffer, ".td6");
String::set(pathBuffer, sizeof(pathBuffer), withExtension.c_str());
+2 -2
View File
@@ -33,7 +33,7 @@ static InGameConsole _inGameConsole;
static FontStyle InGameConsoleGetFontStyle()
{
return (Config::Get().interface.ConsoleSmallFont ? FontStyle::Small : FontStyle::Medium);
return (Config::Get().interface.consoleSmallFont ? FontStyle::Small : FontStyle::Medium);
}
static int32_t InGameConsoleGetLineHeight()
@@ -331,7 +331,7 @@ void InGameConsole::Draw(RenderTarget& rt) const
for (std::size_t i = 0; i < _consoleLines.size() && i < static_cast<size_t>(maxLines); i++)
{
const size_t index = i + _consoleScrollPos;
if (_consoleLines[index].second == FormatToken::ColourWindow2)
if (_consoleLines[index].second == FormatToken::colourWindow2)
{
// This is something of a hack to ensure the text is actually black
// as opposed to a desaturated grey
+7 -7
View File
@@ -649,9 +649,9 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
ActiveAvailableThemeIndex = 1;
bool configValid = false;
if (!Config::Get().interface.CurrentThemePreset.empty())
if (!Config::Get().interface.currentThemePreset.empty())
{
if (LoadThemeByConfigName(Config::Get().interface.CurrentThemePreset.c_str()))
if (LoadThemeByConfigName(Config::Get().interface.currentThemePreset.c_str()))
{
configValid = true;
}
@@ -659,7 +659,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
if (!configValid)
{
Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(1);
Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(1);
}
}
@@ -741,7 +741,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
}
}
ThemeManager::ActiveAvailableThemeIndex = index;
Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(index);
Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(index);
ColourSchemeUpdateAll();
}
@@ -837,7 +837,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path))
{
ThemeManager::ActiveAvailableThemeIndex = i;
Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(1);
Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(1);
break;
}
}
@@ -862,7 +862,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path))
{
ThemeManager::ActiveAvailableThemeIndex = i;
Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(i);
Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(i);
break;
}
}
@@ -873,7 +873,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] =
File::Delete(ThemeManager::CurrentThemePath);
ThemeManager::LoadTheme(const_cast<UITheme*>(&PredefinedThemeRCT2));
ThemeManager::ActiveAvailableThemeIndex = 1;
Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(1);
Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(1);
}
void ThemeManagerInitialise()
+2 -2
View File
@@ -568,9 +568,9 @@ namespace OpenRCT2::Ui
width -= kCloseButtonSize;
}
topLeft.x += width / 2;
if (Config::Get().interface.WindowButtonsOnTheLeft)
if (Config::Get().interface.windowButtonsOnTheLeft)
topLeft.x += kCloseButtonSize;
if (Config::Get().interface.EnlargedUi)
if (Config::Get().interface.enlargedUi)
topLeft.y += kTitleHeightLarge / 4;
DrawTextEllipsised(
+3 -3
View File
@@ -314,7 +314,7 @@ namespace OpenRCT2::Ui
void ApplyScreenSaverLockSetting()
{
Config::Get().general.DisableScreensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver();
Config::Get().general.disableScreensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver();
}
void Window::scrollToViewport()
@@ -514,7 +514,7 @@ namespace OpenRCT2::Ui
ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w)
{
const uint8_t buttonOffset = (Config::Get().interface.WindowButtonsOnTheLeft) ? kCloseButtonSize + 2 : 0;
const uint8_t buttonOffset = (Config::Get().interface.windowButtonsOnTheLeft) ? kCloseButtonSize + 2 : 0;
return w.windowPos + ScreenCoordsXY{ 2 + buttonOffset, 2 };
}
} // namespace OpenRCT2::Ui
@@ -960,7 +960,7 @@ namespace OpenRCT2::Ui::Windows
w.maxWidth = std::max(minSize.width, maxSize.width);
w.maxHeight = std::max(minSize.height, maxSize.height);
if (Config::Get().interface.EnlargedUi)
if (Config::Get().interface.enlargedUi)
{
// Not sure why plugin windows have to be treated differently,
// but they currently show a deviation if we don't.
+1 -1
View File
@@ -489,7 +489,7 @@ namespace OpenRCT2::Ui::Windows
{
auto& closeButton = widgets[WIDX_CLOSE];
bool translucent = colours[closeButton.colour].hasFlag(ColourFlag::translucent);
if (Config::Get().interface.EnlargedUi)
if (Config::Get().interface.enlargedUi)
closeButton.string = !translucent ? kCloseBoxStringBlackLarge : kCloseBoxStringWhiteLarge;
else
closeButton.string = !translucent ? kCloseBoxStringBlackNormal : kCloseBoxStringWhiteNormal;
+1 -1
View File
@@ -91,7 +91,7 @@ namespace OpenRCT2::Ui::Windows
(viewportWidget.width()) - 1, (viewportWidget.height()) - 1, Focus(_bannerViewPos));
if (viewport != nullptr)
viewport->flags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
viewport->flags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
invalidate();
}
+20 -20
View File
@@ -72,16 +72,16 @@ namespace OpenRCT2::Ui::Windows
close();
break;
case WIDX_RATE_UP:
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate += 1;
Config::Get().general.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate += 1;
Config::Get().general.customCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate;
Config::Save();
windowMgr->InvalidateAll();
break;
case WIDX_RATE_DOWN:
if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate > 1)
if (CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate > 1)
{
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate -= 1;
Config::Get().general.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate -= 1;
Config::Get().general.customCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate;
Config::Save();
windowMgr->InvalidateAll();
}
@@ -94,7 +94,7 @@ namespace OpenRCT2::Ui::Windows
{ windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0,
Dropdown::Flag::StayOpen, 2, widget->width() - 3);
if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix)
if (CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode == CurrencyAffix::prefix)
{
gDropdown.items[0].setChecked(true);
}
@@ -107,7 +107,7 @@ namespace OpenRCT2::Ui::Windows
case WIDX_SYMBOL_TEXT:
WindowTextInputRawOpen(
this, WIDX_SYMBOL_TEXT, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC,
{}, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, kCurrencySymbolMaxSize);
{}, CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode, kCurrencySymbolMaxSize);
break;
}
}
@@ -119,7 +119,7 @@ namespace OpenRCT2::Ui::Windows
case WIDX_RATE:
WindowTextInputOpen(
this, WIDX_RATE, STR_RATE_INPUT_TITLE, STR_RATE_INPUT_DESC, {}, STR_FORMAT_INTEGER,
static_cast<uint32_t>(CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate),
static_cast<uint32_t>(CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate),
kCurrencyRateMaxNumDigits);
break;
}
@@ -134,16 +134,16 @@ namespace OpenRCT2::Ui::Windows
{
if (dropdownIndex == 0)
{
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Prefix;
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Prefix;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_ascii = CurrencyAffix::prefix;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode = CurrencyAffix::prefix;
}
else if (dropdownIndex == 1)
{
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Suffix;
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Suffix;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_ascii = CurrencyAffix::suffix;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode = CurrencyAffix::suffix;
}
Config::Get().general.CustomCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode;
Config::Get().general.customCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode;
Config::Save();
auto* windowMgr = Ui::GetWindowManager();
@@ -162,10 +162,10 @@ namespace OpenRCT2::Ui::Windows
{
case WIDX_SYMBOL_TEXT:
String::safeUtf8Copy(
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, std::string(text).c_str(),
CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode, std::string(text).c_str(),
kCurrencySymbolMaxSize);
Config::Get().general.CustomCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::Custom)]
Config::Get().general.customCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::custom)]
.symbol_unicode;
Config::Save();
@@ -178,8 +178,8 @@ namespace OpenRCT2::Ui::Windows
if (res.has_value())
{
int32_t rate = res.value();
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = rate;
Config::Get().general.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate = rate;
Config::Get().general.customCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate;
Config::Save();
windowMgr->InvalidateAll();
}
@@ -198,7 +198,7 @@ namespace OpenRCT2::Ui::Windows
DrawTextBasic(rt, screenCoords, STR_RATE, {}, { colours[1] });
int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::Pounds)].rate;
int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::pounds)].rate;
ft = Formatter();
ft.Add<int32_t>(baseExchange);
DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] });
@@ -209,11 +209,11 @@ namespace OpenRCT2::Ui::Windows
screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_SYMBOL_TEXT].left + 1, widgets[WIDX_SYMBOL_TEXT].top };
DrawText(rt, screenCoords, { colours[1] }, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode);
DrawText(rt, screenCoords, { colours[1] }, CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode);
auto drawPos = windowPos
+ ScreenCoordsXY{ widgets[WIDX_AFFIX_DROPDOWN].left + 1, widgets[WIDX_AFFIX_DROPDOWN].top };
StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix)
StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode == CurrencyAffix::prefix)
? STR_PREFIX
: STR_SUFFIX;
DrawTextBasic(rt, drawPos, stringId, {}, { colours[1] });
+4 -4
View File
@@ -75,12 +75,12 @@ namespace OpenRCT2::Ui::Windows
static int32_t GetDefaultRowHeight()
{
return Config::Get().interface.EnlargedUi ? kDropdownItemHeightTouch : kDropdownItemHeight;
return Config::Get().interface.enlargedUi ? kDropdownItemHeightTouch : kDropdownItemHeight;
}
static int32_t GetAdditionalRowPadding()
{
return Config::Get().interface.EnlargedUi ? 6 : 0;
return Config::Get().interface.enlargedUi ? 6 : 0;
}
static void drawTextItem(
@@ -386,7 +386,7 @@ namespace OpenRCT2::Ui::Windows
size_t num_items, int32_t width, size_t prefRowsPerColumn)
{
gInputFlags.unset(InputFlag::dropdownStayOpen, InputFlag::dropdownMouseUp);
if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.TouchEnhancements)
if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.touchEnhancements)
gInputFlags.set(InputFlag::dropdownStayOpen);
WindowDropdownClose();
@@ -430,7 +430,7 @@ namespace OpenRCT2::Ui::Windows
int32_t itemHeight, int32_t numColumns)
{
gInputFlags.unset(InputFlag::dropdownStayOpen, InputFlag::dropdownMouseUp);
if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.TouchEnhancements)
if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.touchEnhancements)
gInputFlags.set(InputFlag::dropdownStayOpen);
// Close existing dropdown
@@ -107,7 +107,7 @@ namespace OpenRCT2::Ui::Windows
const StringId itemNameId = researchItem.GetName();
int16_t columnSplitOffset = width / 2;
if (researchItem.type == Research::EntryType::Ride
if (researchItem.type == Research::EntryType::ride
&& !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RtdFlag::listVehiclesSeparately))
{
const StringId rideTypeName = GetRideNaming(
@@ -386,7 +386,7 @@ namespace OpenRCT2::Ui::Windows
// Preview image
ObjectType objectEntryType = ObjectType::sceneryGroup;
if (researchItem->type == Research::EntryType::Ride)
if (researchItem->type == Research::EntryType::ride)
objectEntryType = ObjectType::ride;
auto chunk = ObjectEntryGetChunk(objectEntryType, researchItem->entryIndex);
@@ -415,7 +415,7 @@ namespace OpenRCT2::Ui::Windows
StringId stringId = researchItem->GetName();
auto ft = Formatter();
if (researchItem->type == Research::EntryType::Ride
if (researchItem->type == Research::EntryType::ride
&& !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RtdFlag::listVehiclesSeparately))
{
drawString = STR_WINDOW_COLOUR_2_STRINGID_STRINGID;
@@ -277,7 +277,7 @@ namespace OpenRCT2::Ui::Windows
Sub6AB211();
ResetSelectedObjectCountAndSize();
_filterFlags = FILTER_RIDES_ALL | Config::Get().interface.ObjectSelectionFilterFlags;
_filterFlags = FILTER_RIDES_ALL | Config::Get().interface.objectSelectionFilterFlags;
_filter.clear();
WindowInitScrollWidgets(*this);
@@ -411,7 +411,7 @@ namespace OpenRCT2::Ui::Windows
_filterFlags &= ~FILTER_RIDES_ALL;
_filterFlags |= subTabDef.flagFilter;
Config::Get().interface.ObjectSelectionFilterFlags = _filterFlags;
Config::Get().interface.objectSelectionFilterFlags = _filterFlags;
Config::Save();
VisibleListRefresh();
@@ -572,7 +572,7 @@ namespace OpenRCT2::Ui::Windows
{
_filterFlags ^= (1 << dropdownIndex);
}
Config::Get().interface.ObjectSelectionFilterFlags = _filterFlags;
Config::Get().interface.objectSelectionFilterFlags = _filterFlags;
Config::Save();
scrolls->contentOffsetY = 0;
@@ -923,7 +923,7 @@ namespace OpenRCT2::Ui::Windows
widget.type = WidgetType::empty;
}
if (Config::Get().general.DebuggingTools)
if (Config::Get().general.debuggingTools)
widgets[WIDX_RELOAD_OBJECT].type = WidgetType::imgBtn;
else
widgets[WIDX_RELOAD_OBJECT].type = WidgetType::empty;
@@ -1497,21 +1497,21 @@ namespace OpenRCT2::Ui::Windows
bool SourcesMatch(ObjectSourceGame source)
{
// clang-format off
return (IsFilterActive(FILTER_RCT1) && source == ObjectSourceGame::RCT1) ||
(IsFilterActive(FILTER_AA) && source == ObjectSourceGame::AddedAttractions) ||
(IsFilterActive(FILTER_LL) && source == ObjectSourceGame::LoopyLandscapes) ||
(IsFilterActive(FILTER_RCT2) && source == ObjectSourceGame::RCT2) ||
(IsFilterActive(FILTER_WW) && source == ObjectSourceGame::WackyWorlds) ||
(IsFilterActive(FILTER_TT) && source == ObjectSourceGame::TimeTwister) ||
(IsFilterActive(FILTER_OO) && source == ObjectSourceGame::OpenRCT2Official) ||
return (IsFilterActive(FILTER_RCT1) && source == ObjectSourceGame::rct1) ||
(IsFilterActive(FILTER_AA) && source == ObjectSourceGame::addedAttractions) ||
(IsFilterActive(FILTER_LL) && source == ObjectSourceGame::loopyLandscapes) ||
(IsFilterActive(FILTER_RCT2) && source == ObjectSourceGame::rct2) ||
(IsFilterActive(FILTER_WW) && source == ObjectSourceGame::wackyWorlds) ||
(IsFilterActive(FILTER_TT) && source == ObjectSourceGame::timeTwister) ||
(IsFilterActive(FILTER_OO) && source == ObjectSourceGame::openRCT2Official) ||
(IsFilterActive(FILTER_CUSTOM) &&
source != ObjectSourceGame::RCT1 &&
source != ObjectSourceGame::AddedAttractions &&
source != ObjectSourceGame::LoopyLandscapes &&
source != ObjectSourceGame::RCT2 &&
source != ObjectSourceGame::WackyWorlds &&
source != ObjectSourceGame::TimeTwister &&
source != ObjectSourceGame::OpenRCT2Official);
source != ObjectSourceGame::rct1 &&
source != ObjectSourceGame::addedAttractions &&
source != ObjectSourceGame::loopyLandscapes &&
source != ObjectSourceGame::rct2 &&
source != ObjectSourceGame::wackyWorlds &&
source != ObjectSourceGame::timeTwister &&
source != ObjectSourceGame::openRCT2Official);
// clang-format on
}
@@ -187,7 +187,7 @@ namespace OpenRCT2::Ui::Windows
int32_t day = date.GetDay();
auto colour = GetHoverWidgetColour(WIDX_DATE);
StringId stringId = DateFormatStringFormatIds[Config::Get().general.DateFormat];
StringId stringId = DateFormatStringFormatIds[Config::Get().general.dateFormat];
auto ft = Formatter();
ft.Add<StringId>(DateDayNames[day]);
ft.Add<int16_t>(month);
@@ -202,7 +202,7 @@ namespace OpenRCT2::Ui::Windows
int32_t temperature = getGameState().weatherCurrent.temperature;
StringId format = STR_CELSIUS_VALUE;
if (Config::Get().general.TemperatureFormat == TemperatureUnit::Fahrenheit)
if (Config::Get().general.temperatureFormat == TemperatureUnit::Fahrenheit)
{
temperature = ClimateCelsiusToFahrenheit(temperature);
format = STR_FAHRENHEIT_VALUE;
+2 -2
View File
@@ -494,7 +494,7 @@ namespace OpenRCT2::Ui::Windows
{
newDisabledWidgets |= (1uLL << WIDX_TAB_4); // Disable finance tab if no money
}
if (!Config::Get().general.DebuggingTools)
if (!Config::Get().general.debuggingTools)
{
newDisabledWidgets |= (1uLL << WIDX_TAB_7); // Disable debug tab when debug tools not turned on
}
@@ -1921,7 +1921,7 @@ namespace OpenRCT2::Ui::Windows
if (window == nullptr)
{
auto windowSize = kWindowSize;
if (Config::Get().general.DebuggingTools)
if (Config::Get().general.debuggingTools)
windowSize.width += kTabWidth;
window = windowMgr->Create<GuestWindow>(WindowClass::peep, windowSize, WindowFlag::resizable);
+38 -38
View File
@@ -136,13 +136,13 @@ namespace OpenRCT2::Ui::Windows
bool ShowPreviews()
{
auto& config = Config::Get().general;
return config.FileBrowserPreviewType != ParkPreviewPref::disabled;
return config.fileBrowserPreviewType != ParkPreviewPref::disabled;
}
ScreenSize GetPreviewSize() const
{
auto& config = Config::Get().general;
switch (config.FileBrowserPreviewType)
switch (config.fileBrowserPreviewType)
{
case ParkPreviewPref::screenshot:
return { kPreviewWidthScreenshot, kPreviewWidthScreenshot / 5 * 4 };
@@ -405,7 +405,7 @@ namespace OpenRCT2::Ui::Windows
{
// Find preview image to draw
PreviewImage* image = nullptr;
auto targetPref = Config::Get().general.FileBrowserPreviewType;
auto targetPref = Config::Get().general.fileBrowserPreviewType;
auto targetType = targetPref == ParkPreviewPref::screenshot ? PreviewImageType::screenshot
: PreviewImageType::miniMap;
for (auto& candidate : _preview.images)
@@ -483,7 +483,7 @@ namespace OpenRCT2::Ui::Windows
// Date
{
auto ft = Formatter();
ft.Add<StringId>(DateFormatStringFormatIds[Config::Get().general.DateFormat]);
ft.Add<StringId>(DateFormatStringFormatIds[Config::Get().general.dateFormat]);
ft.Add<StringId>(DateDayNames[_preview.day]);
ft.Add<int16_t>(_preview.month);
ft.Add<int16_t>(_preview.year + 1);
@@ -606,8 +606,8 @@ namespace OpenRCT2::Ui::Windows
WindowSetResize(*this, GetMinimumWindowSize(), kWindowSizeMax);
auto& config = Config::Get().general;
config.FileBrowserWidth = width;
config.FileBrowserHeight = height - getTitleBarDiffNormal();
config.fileBrowserWidth = width;
config.fileBrowserHeight = height - getTitleBarDiffNormal();
}
void onUpdate() override
@@ -642,7 +642,7 @@ namespace OpenRCT2::Ui::Windows
customiseWidget.left = customiseWidget.right - 14;
auto& config = Config::Get().general;
if (config.FileBrowserShowDateColumn)
if (config.fileBrowserShowDateColumn)
{
// Date column on the right
Widget& dateWidget = widgets[WIDX_SORT_DATE];
@@ -650,7 +650,7 @@ namespace OpenRCT2::Ui::Windows
dateWidget.right = customiseWidget.left - 1;
dateWidget.left = dateWidget.right - (maxDateWidth + maxTimeWidth + (4 * kDateTimeGap) + (kScrollBarWidth + 1));
if (config.FileBrowserShowSizeColumn)
if (config.fileBrowserShowSizeColumn)
{
// File size column in the middle
Widget& sizeWidget = widgets[WIDX_SORT_SIZE];
@@ -671,7 +671,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_SORT_NAME].right = dateWidget.left - 1;
}
}
else if (config.FileBrowserShowSizeColumn)
else if (config.fileBrowserShowSizeColumn)
{
// Hide date header
Widget& dateWidget = widgets[WIDX_SORT_DATE];
@@ -758,9 +758,9 @@ namespace OpenRCT2::Ui::Windows
const auto drawButtonCaption =
[rt, this](Widget& widget, StringId strId, FileBrowserSort ascSort, FileBrowserSort descSort) {
StringId indicatorId = kStringIdNone;
if (Config::Get().general.LoadSaveSort == ascSort)
if (Config::Get().general.loadSaveSort == ascSort)
indicatorId = STR_UP;
else if (Config::Get().general.LoadSaveSort == descSort)
else if (Config::Get().general.loadSaveSort == descSort)
indicatorId = STR_DOWN;
auto ft = Formatter();
@@ -776,12 +776,12 @@ namespace OpenRCT2::Ui::Windows
drawButtonCaption(
widgets[WIDX_SORT_NAME], STR_NAME_COLUMN, FileBrowserSort::NameAscending, FileBrowserSort::NameDescending);
if (config.FileBrowserShowSizeColumn)
if (config.fileBrowserShowSizeColumn)
drawButtonCaption(
widgets[WIDX_SORT_SIZE], STR_FILEBROWSER_SIZE_COLUMN, FileBrowserSort::SizeAscending,
FileBrowserSort::SizeDescending);
if (config.FileBrowserShowDateColumn)
if (config.fileBrowserShowDateColumn)
drawButtonCaption(
widgets[WIDX_SORT_DATE], STR_DATE_COLUMN, FileBrowserSort::DateAscending, FileBrowserSort::DateDescending);
@@ -833,13 +833,13 @@ namespace OpenRCT2::Ui::Windows
break;
case WIDX_SORT_NAME:
if (Config::Get().general.LoadSaveSort == FileBrowserSort::NameAscending)
if (Config::Get().general.loadSaveSort == FileBrowserSort::NameAscending)
{
Config::Get().general.LoadSaveSort = FileBrowserSort::NameDescending;
Config::Get().general.loadSaveSort = FileBrowserSort::NameDescending;
}
else
{
Config::Get().general.LoadSaveSort = FileBrowserSort::NameAscending;
Config::Get().general.loadSaveSort = FileBrowserSort::NameAscending;
}
Config::Save();
SortList();
@@ -847,13 +847,13 @@ namespace OpenRCT2::Ui::Windows
break;
case WIDX_SORT_SIZE:
if (Config::Get().general.LoadSaveSort == FileBrowserSort::SizeDescending)
if (Config::Get().general.loadSaveSort == FileBrowserSort::SizeDescending)
{
Config::Get().general.LoadSaveSort = FileBrowserSort::SizeAscending;
Config::Get().general.loadSaveSort = FileBrowserSort::SizeAscending;
}
else
{
Config::Get().general.LoadSaveSort = FileBrowserSort::SizeDescending;
Config::Get().general.loadSaveSort = FileBrowserSort::SizeDescending;
}
Config::Save();
SortList();
@@ -861,13 +861,13 @@ namespace OpenRCT2::Ui::Windows
break;
case WIDX_SORT_DATE:
if (Config::Get().general.LoadSaveSort == FileBrowserSort::DateDescending)
if (Config::Get().general.loadSaveSort == FileBrowserSort::DateDescending)
{
Config::Get().general.LoadSaveSort = FileBrowserSort::DateAscending;
Config::Get().general.loadSaveSort = FileBrowserSort::DateAscending;
}
else
{
Config::Get().general.LoadSaveSort = FileBrowserSort::DateDescending;
Config::Get().general.loadSaveSort = FileBrowserSort::DateDescending;
}
Config::Save();
SortList();
@@ -921,11 +921,11 @@ namespace OpenRCT2::Ui::Windows
auto& config = Config::Get().general;
gDropdown.items[0].setChecked(true);
gDropdown.items[1].setChecked(config.FileBrowserShowSizeColumn);
gDropdown.items[2].setChecked(config.FileBrowserShowDateColumn);
gDropdown.items[4].setChecked(config.FileBrowserPreviewType == ParkPreviewPref::disabled);
gDropdown.items[5].setChecked(config.FileBrowserPreviewType == ParkPreviewPref::miniMap);
gDropdown.items[6].setChecked(config.FileBrowserPreviewType == ParkPreviewPref::screenshot);
gDropdown.items[1].setChecked(config.fileBrowserShowSizeColumn);
gDropdown.items[2].setChecked(config.fileBrowserShowDateColumn);
gDropdown.items[4].setChecked(config.fileBrowserPreviewType == ParkPreviewPref::disabled);
gDropdown.items[5].setChecked(config.fileBrowserPreviewType == ParkPreviewPref::miniMap);
gDropdown.items[6].setChecked(config.fileBrowserPreviewType == ParkPreviewPref::screenshot);
}
void onDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override
@@ -937,23 +937,23 @@ namespace OpenRCT2::Ui::Windows
bool changed = false;
if (selectedIndex == 1)
{
config.FileBrowserShowSizeColumn ^= true;
config.fileBrowserShowSizeColumn ^= true;
changed = true;
}
else if (selectedIndex == 2)
{
config.FileBrowserShowDateColumn ^= true;
config.fileBrowserShowDateColumn ^= true;
changed = true;
}
else if (selectedIndex >= 4 && selectedIndex <= 6)
{
auto newPref = ParkPreviewPref(selectedIndex - 4);
if (config.FileBrowserPreviewType != newPref)
if (config.fileBrowserPreviewType != newPref)
{
invalidate();
width -= GetPreviewSize().width;
config.FileBrowserPreviewType = newPref;
config.fileBrowserPreviewType = newPref;
width += GetPreviewSize().width;
changed = true;
@@ -1127,7 +1127,7 @@ namespace OpenRCT2::Ui::Windows
if (_listItems[i].type != FileType::file)
continue;
if (config.FileBrowserShowSizeColumn)
if (config.fileBrowserShowSizeColumn)
{
ft = Formatter();
ft.Add<StringId>(STR_FILEBROWSER_FILE_SIZE_VALUE);
@@ -1136,7 +1136,7 @@ namespace OpenRCT2::Ui::Windows
DrawTextEllipsised(rt, { sizeColumnLeft + 2, y }, maxDateWidth + maxTimeWidth, stringId, ft);
}
if (config.FileBrowserShowDateColumn)
if (config.fileBrowserShowDateColumn)
{
ft = Formatter();
ft.Add<StringId>(STR_STRING);
@@ -1168,15 +1168,15 @@ namespace OpenRCT2::Ui::Windows
if (w == nullptr)
{
auto& config = Config::Get().general;
if (config.FileBrowserWidth < kWindowSizeMin.width || config.FileBrowserHeight < kWindowSizeMin.height
|| config.FileBrowserWidth > kWindowSizeMax.width || config.FileBrowserHeight > kWindowSizeMax.height)
if (config.fileBrowserWidth < kWindowSizeMin.width || config.fileBrowserHeight < kWindowSizeMin.height
|| config.fileBrowserWidth > kWindowSizeMax.width || config.fileBrowserHeight > kWindowSizeMax.height)
{
config.FileBrowserWidth = kWindowSize.width;
config.FileBrowserHeight = kWindowSize.height;
config.fileBrowserWidth = kWindowSize.width;
config.fileBrowserHeight = kWindowSize.height;
Config::Save();
}
ScreenSize windowSize = { config.FileBrowserWidth, config.FileBrowserHeight };
ScreenSize windowSize = { config.fileBrowserWidth, config.fileBrowserHeight };
w = windowMgr->Create<LoadSaveWindow>(
WindowClass::loadsave, windowSize,
+6 -6
View File
@@ -55,17 +55,17 @@ namespace OpenRCT2::Ui::Windows
void SetViewportFlags()
{
viewport->flags |= VIEWPORT_FLAG_SOUND_ON;
if (Config::Get().general.InvisibleRides)
if (Config::Get().general.invisibleRides)
viewport->flags |= VIEWPORT_FLAG_INVISIBLE_RIDES;
if (Config::Get().general.InvisibleVehicles)
if (Config::Get().general.invisibleVehicles)
viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEHICLES;
if (Config::Get().general.InvisibleTrees)
if (Config::Get().general.invisibleTrees)
viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEGETATION;
if (Config::Get().general.InvisibleScenery)
if (Config::Get().general.invisibleScenery)
viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SCENERY;
if (Config::Get().general.InvisiblePaths)
if (Config::Get().general.invisiblePaths)
viewport->flags |= VIEWPORT_FLAG_INVISIBLE_PATHS;
if (Config::Get().general.InvisibleSupports)
if (Config::Get().general.invisibleSupports)
viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SUPPORTS;
}
};
+1 -1
View File
@@ -1480,7 +1480,7 @@ namespace OpenRCT2::Ui::Windows
int32_t rawValue = value;
if (page != WINDOW_MAPGEN_PAGE_BASE)
{
switch (Config::Get().general.MeasurementFormat)
switch (Config::Get().general.measurementFormat)
{
case MeasurementFormat::Imperial:
value = FeetToMetres(value);
+7 -7
View File
@@ -137,7 +137,7 @@ namespace OpenRCT2::Ui::Windows
static bool IsServerPlayerInvisible()
{
return Network::IsServerPlayerInvisible() && !Config::Get().general.DebuggingTools;
return Network::IsServerPlayerInvisible() && !Config::Get().general.debuggingTools;
}
class MultiplayerWindow final : public Window
@@ -589,15 +589,15 @@ namespace OpenRCT2::Ui::Windows
switch (widgetIndex)
{
case WIDX_LOG_CHAT_CHECKBOX:
Config::Get().network.LogChat = !Config::Get().network.LogChat;
Config::Get().network.logChat = !Config::Get().network.logChat;
Config::Save();
break;
case WIDX_LOG_SERVER_ACTIONS_CHECKBOX:
Config::Get().network.LogServerActions = !Config::Get().network.LogServerActions;
Config::Get().network.logServerActions = !Config::Get().network.logServerActions;
Config::Save();
break;
case WIDX_KNOWN_KEYS_ONLY_CHECKBOX:
Config::Get().network.KnownKeysOnly = !Config::Get().network.KnownKeysOnly;
Config::Get().network.knownKeysOnly = !Config::Get().network.knownKeysOnly;
Config::Save();
break;
}
@@ -692,9 +692,9 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_KNOWN_KEYS_ONLY_CHECKBOX].type = WidgetType::empty;
}
setCheckboxValue(WIDX_LOG_CHAT_CHECKBOX, Config::Get().network.LogChat);
setCheckboxValue(WIDX_LOG_SERVER_ACTIONS_CHECKBOX, Config::Get().network.LogServerActions);
setCheckboxValue(WIDX_KNOWN_KEYS_ONLY_CHECKBOX, Config::Get().network.KnownKeysOnly);
setCheckboxValue(WIDX_LOG_CHAT_CHECKBOX, Config::Get().network.logChat);
setCheckboxValue(WIDX_LOG_SERVER_ACTIONS_CHECKBOX, Config::Get().network.logServerActions);
setCheckboxValue(WIDX_KNOWN_KEYS_ONLY_CHECKBOX, Config::Get().network.knownKeysOnly);
break;
}
}
+6 -6
View File
@@ -366,7 +366,7 @@ namespace OpenRCT2::Ui::Windows
ContextOpenWindowView(WindowView::financesResearch);
break;
case WIDX_GROUP_BY_TRACK_TYPE:
Config::Get().interface.ListRideVehiclesSeparately = !Config::Get().interface.ListRideVehiclesSeparately;
Config::Get().interface.listRideVehiclesSeparately = !Config::Get().interface.listRideVehiclesSeparately;
Config::Save();
PopulateRideList();
invalidate();
@@ -394,7 +394,7 @@ namespace OpenRCT2::Ui::Windows
{
SetPressedTab();
if (!Config::Get().interface.ListRideVehiclesSeparately)
if (!Config::Get().interface.listRideVehiclesSeparately)
pressedWidgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE);
else
pressedWidgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE);
@@ -695,7 +695,7 @@ namespace OpenRCT2::Ui::Windows
auto* rideObj = objMgr.GetLoadedObject<RideObject>(rideEntryIndex);
// Skip if the vehicle isn't the preferred vehicle for this generic track type
if (!Config::Get().interface.ListRideVehiclesSeparately
if (!Config::Get().interface.listRideVehiclesSeparately
&& !GetRideTypeDescriptor(rideType).HasFlag(RtdFlag::listVehiclesSeparately)
&& highestVehiclePriority > rideObj->GetEntry().BuildMenuPriority)
{
@@ -710,7 +710,7 @@ namespace OpenRCT2::Ui::Windows
highestVehiclePriority = rideObj->GetEntry().BuildMenuPriority;
// Determines how and where to draw a button for this ride type/vehicle.
if (Config::Get().interface.ListRideVehiclesSeparately
if (Config::Get().interface.listRideVehiclesSeparately
|| GetRideTypeDescriptor(rideType).HasFlag(RtdFlag::listVehiclesSeparately))
{
// Separate, draw apart
@@ -933,7 +933,7 @@ namespace OpenRCT2::Ui::Windows
if (!_vehicleAvailability.empty())
{
if (Config::Get().interface.ListRideVehiclesSeparately)
if (Config::Get().interface.listRideVehiclesSeparately)
{
ft = Formatter();
ft.Add<StringId>(rideEntry.naming.Name);
@@ -979,7 +979,7 @@ namespace OpenRCT2::Ui::Windows
}
// Draw object author(s) if debugging tools are active
if (Config::Get().general.DebuggingTools && !rideObj->GetAuthors().empty())
if (Config::Get().general.debuggingTools && !rideObj->GetAuthors().empty())
{
const auto& authors = rideObj->GetAuthors();
+18 -18
View File
@@ -80,24 +80,24 @@ namespace OpenRCT2::Ui::Windows
// clang-format off
static constexpr NewsOption kNewsItemOptionDefinitions[] = {
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(Config::Notification, ParkAward) },
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(Config::Notification, ParkMarketingCampaignFinished) },
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(Config::Notification, ParkWarnings) },
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(Config::Notification, ParkRatingWarnings) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(Config::Notification, RideBrokenDown) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(Config::Notification, RideCrashed) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CASUALTIES, offsetof(Config::Notification, RideCasualties) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(Config::Notification, RideWarnings) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(Config::Notification, RideResearched) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_VEHICLE_STALLED, offsetof(Config::Notification, RideStalledVehicles) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(Config::Notification, GuestWarnings) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(Config::Notification, GuestLeftPark) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(Config::Notification, GuestQueuingForRide) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(Config::Notification, GuestOnRide) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(Config::Notification, GuestLeftRide) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(Config::Notification, GuestBoughtItem) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(Config::Notification, GuestUsedFacility) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(Config::Notification, GuestDied) },
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(Config::Notification, parkAward) },
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(Config::Notification, parkMarketingCampaignFinished) },
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(Config::Notification, parkWarnings) },
{ STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(Config::Notification, parkRatingWarnings) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(Config::Notification, rideBrokenDown) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(Config::Notification, rideCrashed) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CASUALTIES, offsetof(Config::Notification, rideCasualties) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(Config::Notification, rideWarnings) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(Config::Notification, rideResearched) },
{ STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_VEHICLE_STALLED, offsetof(Config::Notification, rideStalledVehicles) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(Config::Notification, guestWarnings) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(Config::Notification, guestLeftPark) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(Config::Notification, guestQueuingForRide) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(Config::Notification, guestOnRide) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(Config::Notification, guestLeftRide) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(Config::Notification, guestBoughtItem) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(Config::Notification, guestUsedFacility) },
{ STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(Config::Notification, guestDied) },
};
// clang-format on
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -622,7 +622,7 @@ namespace OpenRCT2::Ui::Windows
int32_t viewportFlags{};
if (viewport == nullptr)
{
viewportFlags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
viewportFlags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
}
else
{
@@ -947,7 +947,7 @@ namespace OpenRCT2::Ui::Windows
// Draw park size
auto parkSize = gameState.park.size * 10;
auto stringIndex = STR_PARK_SIZE_METRIC_LABEL;
if (Config::Get().general.MeasurementFormat == MeasurementFormat::Imperial)
if (Config::Get().general.measurementFormat == MeasurementFormat::Imperial)
{
stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL;
parkSize = SquaredMetresToSquaredFeet(parkSize);
+1 -1
View File
@@ -409,7 +409,7 @@ namespace OpenRCT2::Ui::Windows
// only enable kick button for other players
const bool canKick = Network::CanPerformAction(
Network::GetCurrentPlayerGroupIndex(), Network::Permission::KickPlayer);
Network::GetCurrentPlayerGroupIndex(), Network::Permission::kickPlayer);
const bool isServer = Network::GetPlayerFlags(playerIndex) & Network::PlayerFlags::kIsServer;
const bool isOwnWindow = (Network::GetCurrentPlayerId() == number);
widgetSetEnabled(*this, WIDX_KICK, canKick && !isOwnWindow && !isServer);
+3 -3
View File
@@ -335,7 +335,7 @@ namespace OpenRCT2::Ui::Windows
{
auto type = gameState.researchLastItem->type;
w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WidgetType::flatBtn;
const auto image = type == Research::EntryType::Ride ? SPR_NEW_RIDE : SPR_NEW_SCENERY;
const auto image = type == Research::EntryType::ride ? SPR_NEW_RIDE : SPR_NEW_SCENERY;
w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].image = ImageId(image);
}
}
@@ -380,7 +380,7 @@ namespace OpenRCT2::Ui::Windows
{
ft.Add<StringId>(gameState.researchNextItem->GetCategoryName());
}
else if (gameState.researchNextItem->type == Research::EntryType::Ride)
else if (gameState.researchNextItem->type == Research::EntryType::ride)
{
const auto& rtd = GetRideTypeDescriptor(gameState.researchNextItem->baseRideType);
if (rtd.HasFlag(RtdFlag::listVehiclesSeparately))
@@ -434,7 +434,7 @@ namespace OpenRCT2::Ui::Windows
{
StringId lastDevelopmentFormat = kStringIdEmpty;
auto ft = Formatter();
if (gameState.researchLastItem->type == Research::EntryType::Scenery)
if (gameState.researchLastItem->type == Research::EntryType::scenery)
{
lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL;
ft.Add<StringId>(gameState.researchLastItem->GetName());
+2 -2
View File
@@ -1565,7 +1565,7 @@ namespace OpenRCT2::Ui::Windows
newViewportFlags = viewport->flags;
removeViewport();
}
else if (Config::Get().general.AlwaysShowGridlines)
else if (Config::Get().general.alwaysShowGridlines)
{
newViewportFlags |= VIEWPORT_FLAG_GRIDLINES;
}
@@ -3997,7 +3997,7 @@ namespace OpenRCT2::Ui::Windows
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10);
if (Config::Get().general.DebuggingTools && Network::GetMode() == Network::Mode::none)
if (Config::Get().general.debuggingTools && Network::GetMode() == Network::Mode::none)
{
widgets[WIDX_FORCE_BREAKDOWN].type = WidgetType::flatBtn;
}
+1 -1
View File
@@ -311,7 +311,7 @@ namespace OpenRCT2::Ui::Windows
if (RideTryGetOriginElement(*currentRide, nullptr))
{
// Auto open shops if required.
if (currentRide->mode == RideMode::shopStall && Config::Get().general.AutoOpenShops)
if (currentRide->mode == RideMode::shopStall && Config::Get().general.autoOpenShops)
{
// HACK: Until we find a good a way to defer the game command for opening the shop, stop this
// from getting stuck in an infinite loop as opening the currentRide will try to close this window
+1 -1
View File
@@ -211,7 +211,7 @@ namespace OpenRCT2::Ui::Windows
return nullptr;
}
if (!Config::Get().general.ConfirmationPrompt)
if (!Config::Get().general.confirmationPrompt)
{
/* game_load_or_quit_no_save_prompt() will exec requested task and close this window
* immediately again.
+4 -4
View File
@@ -352,7 +352,7 @@ namespace OpenRCT2::Ui::Windows
}
// Scenario path
if (Config::Get().general.DebuggingTools)
if (Config::Get().general.debuggingTools)
{
const auto shortPath = ShortenPath(scenario->Path, width - 6 - kTabWidth, FontStyle::Medium);
@@ -429,7 +429,7 @@ namespace OpenRCT2::Ui::Windows
pressedWidgets |= 1LL << (selectedTab + WIDX_TAB1);
const int32_t bottomMargin = Config::Get().general.DebuggingTools ? 17 : 5;
const int32_t bottomMargin = Config::Get().general.debuggingTools ? 17 : 5;
widgets[WIDX_SCENARIOLIST].right = width - GetPreviewPaneWidth() - 2 * kPadding;
widgets[WIDX_SCENARIOLIST].bottom = height - bottomMargin;
}
@@ -748,7 +748,7 @@ namespace OpenRCT2::Ui::Windows
bool megaParkLocked = (rct1CompletedScenarios & rct1RequiredCompletedScenarios)
!= rct1RequiredCompletedScenarios;
_listItems[megaParkListItemIndex.value()].scenario.is_locked = megaParkLocked;
if (megaParkLocked && Config::Get().general.ScenarioHideMegaPark)
if (megaParkLocked && Config::Get().general.scenarioHideMegaPark)
{
// Remove mega park
_listItems.pop_back();
@@ -784,7 +784,7 @@ namespace OpenRCT2::Ui::Windows
bool IsLockingEnabled() const
{
if (!Config::Get().general.ScenarioUnlockingEnabled)
if (!Config::Get().general.scenarioUnlockingEnabled)
return false;
if (selectedTab >= 6)
return false;
+7 -7
View File
@@ -881,7 +881,7 @@ namespace OpenRCT2::Ui::Windows
DrawTextEllipsised(rt, { windowPos.x + 3, windowPos.y + height - 23 }, width - 19, STR_BLACK_STRING, ft);
// Draw object author(s) if debugging tools are active
if (Config::Get().general.DebuggingTools)
if (Config::Get().general.debuggingTools)
{
auto sceneryObjectType = GetObjectTypeFromSceneryType(selectedSceneryEntry.SceneryType);
auto& objManager = GetContext()->GetObjectManager();
@@ -2573,7 +2573,7 @@ namespace OpenRCT2::Ui::Windows
rotation -= GetCurrentRotation();
rotation &= 0x3;
if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off)
if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off)
{
VirtualFloorSetHeight(gSceneryPlaceZ);
}
@@ -2657,7 +2657,7 @@ namespace OpenRCT2::Ui::Windows
rotation -= GetCurrentRotation();
rotation &= 0x3;
if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off)
if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off)
{
VirtualFloorSetHeight(gSceneryPlaceZ);
}
@@ -2692,7 +2692,7 @@ namespace OpenRCT2::Ui::Windows
return;
}
if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off)
if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off)
{
VirtualFloorSetHeight(gSceneryPlaceZ);
}
@@ -2783,7 +2783,7 @@ namespace OpenRCT2::Ui::Windows
if (gridPos.IsNull())
return;
if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off)
if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off)
{
VirtualFloorSetHeight(gSceneryPlaceZ);
}
@@ -2884,7 +2884,7 @@ namespace OpenRCT2::Ui::Windows
rotation -= GetCurrentRotation();
rotation &= 0x3;
if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off)
if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off)
{
VirtualFloorSetHeight(gSceneryPlaceZ);
}
@@ -2933,7 +2933,7 @@ namespace OpenRCT2::Ui::Windows
}
}
if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off)
if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off)
{
VirtualFloorSetHeight(gSceneryPlaceZ);
}
+2 -2
View File
@@ -91,7 +91,7 @@ namespace OpenRCT2::Ui::Windows
void onOpen() override
{
_playerName = Config::Get().network.PlayerName;
_playerName = Config::Get().network.playerName;
setWidgets(_serverListWidgets);
widgets[WIDX_PLAYER_NAME_INPUT].string = const_cast<utf8*>(_playerName.c_str());
initScrollWidgets();
@@ -275,7 +275,7 @@ namespace OpenRCT2::Ui::Windows
return;
_playerName = temp;
Config::Get().network.PlayerName = _playerName;
Config::Get().network.playerName = _playerName;
widgets[WIDX_PLAYER_NAME_INPUT].string = const_cast<utf8*>(_playerName.c_str());
invalidateWidget(WIDX_PLAYER_NAME_INPUT);
+17 -17
View File
@@ -78,10 +78,10 @@ namespace OpenRCT2::Ui::Windows
page = 0;
listInformationType = 0;
snprintf(_port, 7, "%u", Config::Get().network.DefaultPort);
String::safeUtf8Copy(_name, Config::Get().network.ServerName.c_str(), sizeof(_name));
String::safeUtf8Copy(_description, Config::Get().network.ServerDescription.c_str(), sizeof(_description));
String::safeUtf8Copy(_greeting, Config::Get().network.ServerGreeting.c_str(), sizeof(_greeting));
snprintf(_port, 7, "%u", Config::Get().network.defaultPort);
String::safeUtf8Copy(_name, Config::Get().network.serverName.c_str(), sizeof(_name));
String::safeUtf8Copy(_description, Config::Get().network.serverDescription.c_str(), sizeof(_description));
String::safeUtf8Copy(_greeting, Config::Get().network.serverGreeting.c_str(), sizeof(_greeting));
}
void onMouseUp(WidgetIndex widgetIndex) override
{
@@ -106,23 +106,23 @@ namespace OpenRCT2::Ui::Windows
WindowStartTextbox(*this, widgetIndex, _password, 32);
break;
case WIDX_MAXPLAYERS_INCREASE:
if (Config::Get().network.Maxplayers < 255)
if (Config::Get().network.maxplayers < 255)
{
Config::Get().network.Maxplayers++;
Config::Get().network.maxplayers++;
}
Config::Save();
invalidate();
break;
case WIDX_MAXPLAYERS_DECREASE:
if (Config::Get().network.Maxplayers > 1)
if (Config::Get().network.maxplayers > 1)
{
Config::Get().network.Maxplayers--;
Config::Get().network.maxplayers--;
}
Config::Save();
invalidate();
break;
case WIDX_ADVERTISE_CHECKBOX:
Config::Get().network.Advertise = !Config::Get().network.Advertise;
Config::Get().network.advertise = !Config::Get().network.advertise;
Config::Save();
invalidate();
break;
@@ -144,10 +144,10 @@ namespace OpenRCT2::Ui::Windows
{
ColourSchemeUpdateByClass(this, WindowClass::serverList);
setCheckboxValue(WIDX_ADVERTISE_CHECKBOX, Config::Get().network.Advertise);
setCheckboxValue(WIDX_ADVERTISE_CHECKBOX, Config::Get().network.advertise);
auto ft = Formatter::Common();
ft.Increment(18);
ft.Add<uint16_t>(Config::Get().network.Maxplayers);
ft.Add<uint16_t>(Config::Get().network.maxplayers);
}
void onUpdate() override
{
@@ -177,7 +177,7 @@ namespace OpenRCT2::Ui::Windows
tempPort = atoi(_port);
if (tempPort > 0)
{
Config::Get().network.DefaultPort = tempPort;
Config::Get().network.defaultPort = tempPort;
Config::Save();
}
@@ -192,7 +192,7 @@ namespace OpenRCT2::Ui::Windows
// Don't allow empty server names
if (_name[0] != '\0')
{
Config::Get().network.ServerName = _name;
Config::Get().network.serverName = _name;
Config::Save();
}
@@ -203,7 +203,7 @@ namespace OpenRCT2::Ui::Windows
return;
String::safeUtf8Copy(_description, temp.c_str(), sizeof(_description));
Config::Get().network.ServerDescription = _description;
Config::Get().network.serverDescription = _description;
Config::Save();
invalidateWidget(WIDX_DESCRIPTION_INPUT);
@@ -213,7 +213,7 @@ namespace OpenRCT2::Ui::Windows
return;
String::safeUtf8Copy(_greeting, temp.c_str(), sizeof(_greeting));
Config::Get().network.ServerGreeting = _greeting;
Config::Get().network.serverGreeting = _greeting;
Config::Save();
invalidateWidget(WIDX_GREETING_INPUT);
@@ -257,7 +257,7 @@ namespace OpenRCT2::Ui::Windows
GameNotifyMapChange();
if (GetContext()->LoadParkFromFile(path, false, true))
{
Network::BeginServer(Config::Get().network.DefaultPort, Config::Get().network.ListenAddress);
Network::BeginServer(Config::Get().network.defaultPort, Config::Get().network.listenAddress);
}
}
@@ -267,7 +267,7 @@ namespace OpenRCT2::Ui::Windows
{
GameNotifyMapChange();
GetContext()->LoadParkFromFile(path);
Network::BeginServer(Config::Get().network.DefaultPort, Config::Get().network.ListenAddress);
Network::BeginServer(Config::Get().network.defaultPort, Config::Get().network.listenAddress);
}
}
};
+2 -2
View File
@@ -137,7 +137,7 @@ namespace OpenRCT2::Ui::Windows
*this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 },
viewportWidget.width() - 1, viewportWidget.height() - 1, Focus(CoordsXYZ{ signViewPosition, viewZ }));
viewport->flags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
viewport->flags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
invalidate();
return true;
@@ -320,7 +320,7 @@ namespace OpenRCT2::Ui::Windows
*this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 },
viewportWidget->width() - 1, viewportWidget->height() - 1, Focus(CoordsXYZ{ signViewPos }));
if (viewport != nullptr)
viewport->flags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
viewport->flags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE;
invalidate();
}
};
+1 -1
View File
@@ -1137,7 +1137,7 @@ namespace OpenRCT2::Ui::Windows
else
{
viewport_flags = 0;
if (Config::Get().general.AlwaysShowGridlines)
if (Config::Get().general.alwaysShowGridlines)
viewport_flags |= VIEWPORT_FLAG_GRIDLINES;
}
+2 -2
View File
@@ -511,7 +511,7 @@ namespace OpenRCT2::Ui::Windows
*/
void HireNewMember(StaffType staffType)
{
bool autoPosition = Config::Get().general.AutoStaffPlacement;
bool autoPosition = Config::Get().general.autoStaffPlacement;
if (GetInputManager().isModifierKeyPressed(ModifierKey::shift))
{
autoPosition = autoPosition ^ 1;
@@ -522,7 +522,7 @@ namespace OpenRCT2::Ui::Windows
if (staffType == StaffType::handyman)
{
staffOrders = STAFF_ORDERS_SWEEPING | STAFF_ORDERS_WATER_FLOWERS | STAFF_ORDERS_EMPTY_BINS;
if (Config::Get().general.HandymenMowByDefault)
if (Config::Get().general.handymenMowByDefault)
{
staffOrders |= STAFF_ORDERS_MOWING;
}
+14 -14
View File
@@ -317,7 +317,7 @@ namespace OpenRCT2::Ui::Windows
auto mvpFlags = WindowGetMain()->viewport->flags;
gDropdown.items[DDIDX_UNDERGROUND_INSIDE].setChecked(mvpFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE);
gDropdown.items[DDIDX_TRANSPARENT_WATER].setChecked(Config::Get().general.TransparentWater);
gDropdown.items[DDIDX_TRANSPARENT_WATER].setChecked(Config::Get().general.transparentWater);
gDropdown.items[DDIDX_HIDE_BASE].setChecked(mvpFlags & VIEWPORT_FLAG_HIDE_BASE);
gDropdown.items[DDIDX_HIDE_VERTICAL].setChecked(mvpFlags & VIEWPORT_FLAG_HIDE_VERTICAL);
gDropdown.items[DDIDX_HIDE_RIDES].setChecked(mvpFlags & VIEWPORT_FLAG_HIDE_RIDES);
@@ -348,7 +348,7 @@ namespace OpenRCT2::Ui::Windows
w->viewport->flags ^= VIEWPORT_FLAG_UNDERGROUND_INSIDE;
break;
case DDIDX_TRANSPARENT_WATER:
Config::Get().general.TransparentWater ^= 1;
Config::Get().general.transparentWater ^= 1;
Config::Save();
break;
case DDIDX_HIDE_BASE:
@@ -502,7 +502,7 @@ namespace OpenRCT2::Ui::Windows
gDropdown.items[2] = Dropdown::MenuLabel(STR_SPEED_FAST);
gDropdown.items[3] = Dropdown::MenuLabel(STR_SPEED_TURBO);
if (Config::Get().general.DebuggingTools)
if (Config::Get().general.debuggingTools)
{
num_items = 6;
@@ -524,7 +524,7 @@ namespace OpenRCT2::Ui::Windows
gDropdown.items[5].setChecked(true);
}
if (Config::Get().general.DebuggingTools)
if (Config::Get().general.debuggingTools)
{
gDropdown.defaultIndex = (gGameSpeed == 8 ? 0 : gGameSpeed);
}
@@ -1108,35 +1108,35 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_RESEARCH].type = WidgetType::trnBtn;
widgets[WIDX_FASTFORWARD].type = WidgetType::trnBtn;
widgets[WIDX_CHEATS].type = WidgetType::trnBtn;
widgets[WIDX_DEBUG].type = Config::Get().general.DebuggingTools ? WidgetType::trnBtn : WidgetType::empty;
widgets[WIDX_DEBUG].type = Config::Get().general.debuggingTools ? WidgetType::trnBtn : WidgetType::empty;
widgets[WIDX_NEWS].type = WidgetType::trnBtn;
widgets[WIDX_NETWORK].type = WidgetType::trnBtn;
}
void HideDisabledButtons()
{
if (!Config::Get().interface.ToolbarShowMute)
if (!Config::Get().interface.toolbarShowMute)
widgets[WIDX_MUTE].type = WidgetType::empty;
if (!Config::Get().interface.ToolbarShowChat)
if (!Config::Get().interface.toolbarShowChat)
widgets[WIDX_CHAT].type = WidgetType::empty;
if (!Config::Get().interface.ToolbarShowResearch)
if (!Config::Get().interface.toolbarShowResearch)
widgets[WIDX_RESEARCH].type = WidgetType::empty;
if (!Config::Get().interface.ToolbarShowCheats)
if (!Config::Get().interface.toolbarShowCheats)
widgets[WIDX_CHEATS].type = WidgetType::empty;
if (!Config::Get().interface.ToolbarShowNews)
if (!Config::Get().interface.toolbarShowNews)
widgets[WIDX_NEWS].type = WidgetType::empty;
if (!Config::Get().interface.ToolbarShowZoom)
if (!Config::Get().interface.toolbarShowZoom)
{
widgets[WIDX_ZOOM_IN].type = WidgetType::empty;
widgets[WIDX_ZOOM_OUT].type = WidgetType::empty;
}
if (!Config::Get().interface.ToolbarShowRotateAnticlockwise)
if (!Config::Get().interface.toolbarShowRotateAnticlockwise)
widgets[WIDX_ROTATE_ANTI_CLOCKWISE].type = WidgetType::empty;
if (gLegacyScene == LegacyScene::scenarioEditor || gLegacyScene == LegacyScene::trackDesignsManager)
@@ -1144,7 +1144,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_PAUSE].type = WidgetType::empty;
}
if ((getGameState().park.flags & PARK_FLAGS_NO_MONEY) || !Config::Get().interface.ToolbarShowFinances)
if ((getGameState().park.flags & PARK_FLAGS_NO_MONEY) || !Config::Get().interface.toolbarShowFinances)
widgets[WIDX_FINANCES].type = WidgetType::empty;
}
@@ -1364,7 +1364,7 @@ namespace OpenRCT2::Ui::Windows
ApplyMapRotation();
ApplyFootpathPressed();
if (!Config::Get().interface.ToolbarButtonsCentred)
if (!Config::Get().interface.toolbarButtonsCentred)
AlignButtonsLeftRight();
else
AlignButtonsCentre();
+2 -2
View File
@@ -423,7 +423,7 @@ namespace OpenRCT2::Ui::Windows
}
// When debugging tools are on, shift everything up a bit to make room for displaying the path.
const int32_t bottomMargin = Config::Get().general.DebuggingTools ? (kWindowPadding + kDebugPathHeight)
const int32_t bottomMargin = Config::Get().general.debuggingTools ? (kWindowPadding + kDebugPathHeight)
: kWindowPadding;
widgets[WIDX_TRACK_LIST].bottom = height - bottomMargin;
widgets[WIDX_ROTATE].bottom = height - bottomMargin;
@@ -471,7 +471,7 @@ namespace OpenRCT2::Ui::Windows
u8string path = _trackDesigns[trackIndex].path;
// Show track file path (in debug mode)
if (Config::Get().general.DebuggingTools)
if (Config::Get().general.debuggingTools)
{
const auto shortPath = ShortenPath(path, width, FontStyle::Medium);
auto ft = Formatter();
+6 -6
View File
@@ -230,12 +230,12 @@ namespace OpenRCT2::Ui::Windows
void SaveInConfig(uint32_t wflags)
{
Config::Get().general.InvisibleRides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES;
Config::Get().general.InvisibleVehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES;
Config::Get().general.InvisibleScenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY;
Config::Get().general.InvisibleTrees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION;
Config::Get().general.InvisiblePaths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS;
Config::Get().general.InvisibleSupports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS;
Config::Get().general.invisibleRides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES;
Config::Get().general.invisibleVehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES;
Config::Get().general.invisibleScenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY;
Config::Get().general.invisibleTrees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION;
Config::Get().general.invisiblePaths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS;
Config::Get().general.invisibleSupports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS;
Config::Save();
}
};
+2 -2
View File
@@ -316,7 +316,7 @@ namespace OpenRCT2::Ui::Windows
case DisplayType::DisplayUnits:
{
// Print the value in the configured height label type:
if (Config::Get().general.ShowHeightAsUnits)
if (Config::Get().general.showHeightAsUnits)
{
// Height label is Units.
auto ft = Formatter();
@@ -329,7 +329,7 @@ namespace OpenRCT2::Ui::Windows
{
// Height label is Real Values.
// Print the value in the configured measurement units.
switch (Config::Get().general.MeasurementFormat)
switch (Config::Get().general.measurementFormat)
{
case MeasurementFormat::Metric:
case MeasurementFormat::SI:
+4 -4
View File
@@ -164,7 +164,7 @@ namespace OpenRCT2
{
// Re-order asset packs
std::vector<std::unique_ptr<AssetPack>> newAssetPacks;
EnumerateCommaSeparatedList(Config::Get().general.AssetPackOrder, [&](std::string_view id) {
EnumerateCommaSeparatedList(Config::Get().general.assetPackOrder, [&](std::string_view id) {
auto index = GetAssetPackIndex(id);
if (index != std::numeric_limits<size_t>::max())
{
@@ -181,7 +181,7 @@ namespace OpenRCT2
_assetPacks = std::move(newAssetPacks);
// Set which asset packs are enabled
EnumerateCommaSeparatedList(Config::Get().general.EnabledAssetPacks, [&](std::string_view id) {
EnumerateCommaSeparatedList(Config::Get().general.enabledAssetPacks, [&](std::string_view id) {
auto assetPack = GetAssetPack(id);
if (assetPack != nullptr)
{
@@ -208,8 +208,8 @@ namespace OpenRCT2
orderList.pop_back();
if (enabledList.size() > 0)
enabledList.pop_back();
Config::Get().general.AssetPackOrder = orderList;
Config::Get().general.EnabledAssetPacks = enabledList;
Config::Get().general.assetPackOrder = orderList;
Config::Get().general.enabledAssetPacks = enabledList;
Config::Save();
}
} // namespace OpenRCT2
+19 -19
View File
@@ -409,20 +409,20 @@ namespace OpenRCT2
CrashInit();
if (String::equals(Config::Get().general.LastRunVersion, kOpenRCT2Version))
if (String::equals(Config::Get().general.lastRunVersion, kOpenRCT2Version))
{
gOpenRCT2ShowChangelog = false;
}
else
{
gOpenRCT2ShowChangelog = true;
Config::Get().general.LastRunVersion = kOpenRCT2Version;
Config::Get().general.lastRunVersion = kOpenRCT2Version;
Config::Save();
}
try
{
_localisationService->OpenLanguage(Config::Get().general.Language);
_localisationService->OpenLanguage(Config::Get().general.language);
}
catch (const std::exception& e)
{
@@ -518,7 +518,7 @@ namespace OpenRCT2
Audio::Init();
Audio::PopulateDevices();
Audio::InitRideSoundsAndInfo();
Audio::gGameSoundsOff = !Config::Get().sound.MasterSoundEnabled;
Audio::gGameSoundsOff = !Config::Get().sound.masterSoundEnabled;
}
ChatInit();
@@ -622,7 +622,7 @@ namespace OpenRCT2
}
drawingEngine->Initialise();
drawingEngine->SetVSync(Config::Get().general.UseVSync);
drawingEngine->SetVSync(Config::Get().general.useVSync);
return drawingEngine;
}
@@ -634,7 +634,7 @@ namespace OpenRCT2
return nullptr;
};
auto drawingEngineType = Config::Get().general.DrawingEngine;
auto drawingEngineType = Config::Get().general.drawingEngine;
// Attempt to create drawing engine of the type specified in the config.
{
@@ -667,7 +667,7 @@ namespace OpenRCT2
_drawingEngineType = drawingEngineType;
Config::Get().general.DrawingEngine = drawingEngineType;
Config::Get().general.drawingEngine = drawingEngineType;
Config::Save();
WindowCheckAllValidZoom();
@@ -1006,11 +1006,11 @@ namespace OpenRCT2
if (gCustomRCT2DataPath.empty())
{
// Check install directory
if (Config::Get().general.RCT2Path.empty() || !Platform::OriginalGameDataExists(Config::Get().general.RCT2Path))
if (Config::Get().general.rct2Path.empty() || !Platform::OriginalGameDataExists(Config::Get().general.rct2Path))
{
LOG_VERBOSE(
"install directory does not exist or invalid directory selected, %s",
Config::Get().general.RCT2Path.c_str());
Config::Get().general.rct2Path.c_str());
if (!Config::FindOrBrowseInstallDirectory())
{
auto path = Config::GetDefaultPath();
@@ -1019,7 +1019,7 @@ namespace OpenRCT2
return std::string();
}
}
result = Config::Get().general.RCT2Path;
result = Config::Get().general.rct2Path;
}
else
{
@@ -1053,7 +1053,7 @@ namespace OpenRCT2
}
else
{
if ((gOpenRCT2StartupAction == StartupAction::Title) && Config::Get().general.PlayIntro)
if ((gOpenRCT2StartupAction == StartupAction::Title) && Config::Get().general.playIntro)
{
gOpenRCT2StartupAction = StartupAction::Intro;
}
@@ -1159,17 +1159,17 @@ namespace OpenRCT2
{
if (gNetworkStartPort == 0)
{
gNetworkStartPort = Config::Get().network.DefaultPort;
gNetworkStartPort = Config::Get().network.defaultPort;
}
if (gNetworkStartAddress.empty())
{
gNetworkStartAddress = Config::Get().network.ListenAddress;
gNetworkStartAddress = Config::Get().network.listenAddress;
}
if (gCustomPassword.empty())
{
_network.SetPassword(Config::Get().network.DefaultPassword.c_str());
_network.SetPassword(Config::Get().network.defaultPassword.c_str());
}
else
{
@@ -1190,7 +1190,7 @@ namespace OpenRCT2
{
if (gNetworkStartPort == 0)
{
gNetworkStartPort = Config::Get().network.DefaultPort;
gNetworkStartPort = Config::Get().network.defaultPort;
}
_network.BeginClient(gNetworkStartHost, gNetworkStartPort);
}
@@ -1251,7 +1251,7 @@ namespace OpenRCT2
{
if (!ShouldDraw())
return false;
if (!Config::Get().general.UncapFPS)
if (!Config::Get().general.uncapFPS)
return false;
if (gGameSpeed > 4)
return false;
@@ -1608,7 +1608,7 @@ namespace OpenRCT2
void ContextUpdateCursorScale()
{
GetContext()->GetUiContext().SetCursorScale(static_cast<uint8_t>(std::round(Config::Get().general.WindowScale)));
GetContext()->GetUiContext().SetCursorScale(static_cast<uint8_t>(std::round(Config::Get().general.windowScale)));
}
void ContextHideCursor()
@@ -1630,8 +1630,8 @@ namespace OpenRCT2
{
auto cursorCoords = ContextGetCursorPosition();
// Compensate for window scaling.
return { static_cast<int32_t>(std::ceil(cursorCoords.x / Config::Get().general.WindowScale)),
static_cast<int32_t>(std::ceil(cursorCoords.y / Config::Get().general.WindowScale)) };
return { static_cast<int32_t>(std::ceil(cursorCoords.x / Config::Get().general.windowScale)),
static_cast<int32_t>(std::ceil(cursorCoords.y / Config::Get().general.windowScale)) };
}
void ContextSetCursorPosition(const ScreenCoordsXY& cursorPosition)
@@ -382,7 +382,7 @@ static void RemoveSelectedObjectsFromResearch(const ObjectEntryDescriptor& descr
for (auto rideType : rideEntry->ride_type)
{
ResearchItem tmp = {};
tmp.type = Research::EntryType::Ride;
tmp.type = Research::EntryType::ride;
tmp.entryIndex = entryIndex;
tmp.baseRideType = rideType;
ResearchRemove(tmp);
@@ -392,7 +392,7 @@ static void RemoveSelectedObjectsFromResearch(const ObjectEntryDescriptor& descr
case ObjectType::sceneryGroup:
{
ResearchItem tmp = {};
tmp.type = Research::EntryType::Scenery;
tmp.type = Research::EntryType::scenery;
tmp.entryIndex = entryIndex;
tmp.baseRideType = 0;
ResearchRemove(tmp);
+4 -4
View File
@@ -115,7 +115,7 @@ void GameResetSpeed()
void GameIncreaseGameSpeed()
{
auto newSpeed = std::min(Config::Get().general.DebuggingTools ? 5 : 4, gGameSpeed + 1);
auto newSpeed = std::min(Config::Get().general.debuggingTools ? 5 : 4, gGameSpeed + 1);
if (newSpeed == 5)
newSpeed = 8;
@@ -184,7 +184,7 @@ void RCT2StringToUTF8Self(char* buffer, size_t length)
{
if (length > 0)
{
auto temp = RCT2StringToUTF8(buffer, RCT2LanguageId::EnglishUK);
auto temp = RCT2StringToUTF8(buffer, RCT2LanguageId::englishUK);
String::safeUtf8Copy(buffer, temp.data(), length);
}
}
@@ -498,7 +498,7 @@ void SaveGameWithName(u8string_view name)
LOG_VERBOSE("Saving to %s", u8string(name).c_str());
auto& gameState = getGameState();
if (ScenarioSave(gameState, name, Config::Get().general.SavePluginData ? 1 : 0))
if (ScenarioSave(gameState, name, Config::Get().general.savePluginData ? 1 : 0))
{
LOG_VERBOSE("Saved to %s", u8string(name).c_str());
gCurrentLoadedPath = name;
@@ -609,7 +609,7 @@ void GameAutosave()
timeName, sizeof(timeName), "autosave_%04u-%02u-%02u_%02u-%02u-%02u%s", currentDate.year, currentDate.month,
currentDate.day, currentTime.hour, currentTime.minute, currentTime.second, fileExtension);
int32_t autosavesToKeep = Config::Get().general.AutosaveAmount;
int32_t autosavesToKeep = Config::Get().general.autosaveAmount;
LimitAutosaveCount(autosavesToKeep - 1, isInEditorMode());
auto& env = GetContext()->GetPlatformEnvironment();
+1 -1
View File
@@ -139,7 +139,7 @@ namespace OpenRCT2
}
bool isPaused = GameIsPaused();
if (Network::GetMode() == Network::Mode::server && Config::Get().network.PauseServerIfNoClients)
if (Network::GetMode() == Network::Mode::server && Config::Get().network.pauseServerIfNoClients)
{
// If we are headless we always have 1 player (host), pause if no one else is around.
if (gOpenRCT2Headless && Network::GetNumPlayers() == 1)
+2 -2
View File
@@ -285,11 +285,11 @@ std::unique_ptr<IPlatformEnvironment> OpenRCT2::CreatePlatformEnvironment()
}
if (gCustomRCT1DataPath.empty())
{
env->SetBasePath(DirBase::rct1, Config::Get().general.RCT1Path);
env->SetBasePath(DirBase::rct1, Config::Get().general.rct1Path);
}
if (gCustomRCT2DataPath.empty())
{
env->SetBasePath(DirBase::rct2, Config::Get().general.RCT2Path);
env->SetBasePath(DirBase::rct2, Config::Get().general.rct2Path);
}
// Log base paths
+1 -1
View File
@@ -645,7 +645,7 @@ namespace OpenRCT2
serialiser << park.guestGenerationProbability;
serialiser << park.suggestedGuestMaximum;
serialiser << Config::Get().general.ShowRealNamesOfGuests;
serialiser << Config::Get().general.showRealNamesOfGuests;
// To make this a little bit less volatile against updates
// we reserve some space for future additions.
+2 -2
View File
@@ -79,7 +79,7 @@ NewVersionInfo GetLatestVersion()
NewVersionInfo verinfo{ tag, "", "" };
#if !defined(DISABLE_HTTP) && !defined(DISABLE_VERSION_CHECKER)
auto now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
auto then = Config::Get().general.LastVersionCheckTime;
auto then = Config::Get().general.lastVersionCheckTime;
using namespace std::chrono_literals;
if (then < now - std::chrono::seconds(24h).count())
@@ -107,7 +107,7 @@ NewVersionInfo GetLatestVersion()
verinfo.name = Json::GetString(root["name"]);
verinfo.changelog = Json::GetString(root["body"]);
Config::Get().general.LastVersionCheckTime = now;
Config::Get().general.lastVersionCheckTime = now;
Config::Save();
}
#endif
+1 -1
View File
@@ -70,6 +70,6 @@ namespace OpenRCT2::GameActions
bool GameSetSpeedAction::IsValidSpeed(uint8_t speed) const
{
return speed >= 1 && (speed <= 4 || (Config::Get().general.DebuggingTools && speed <= 8));
return speed >= 1 && (speed <= 4 || (Config::Get().general.debuggingTools && speed <= 8));
}
} // namespace OpenRCT2::GameActions
+1 -1
View File
@@ -236,7 +236,7 @@ namespace OpenRCT2::GameActions
auto numCircuits = std::max<uint8_t>(1, _td.operation.numCircuits);
SetOperatingSettingNested(ride->id, RideSetSetting::NumCircuits, numCircuits, flags);
uint8_t defaultInspectionInterval = Config::Get().general.DefaultInspectionInterval;
uint8_t defaultInspectionInterval = Config::Get().general.defaultInspectionInterval;
if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER)
SetOperatingSettingNested(ride->id, RideSetSetting::InspectionInterval, defaultInspectionInterval, flags);
+7 -7
View File
@@ -68,7 +68,7 @@ namespace OpenRCT2::Audio
return false;
if (gGameSoundsOff)
return false;
if (!Config::Get().sound.SoundEnabled)
if (!Config::Get().sound.soundEnabled)
return false;
if (gOpenRCT2Headless)
return false;
@@ -78,19 +78,19 @@ namespace OpenRCT2::Audio
void Init()
{
auto& audioContext = GetContext()->GetAudioContext();
if (Config::Get().sound.Device.empty())
if (Config::Get().sound.device.empty())
{
audioContext.SetOutputDevice("");
_currentAudioDevice = 0;
}
else
{
audioContext.SetOutputDevice(Config::Get().sound.Device);
audioContext.SetOutputDevice(Config::Get().sound.device);
PopulateDevices();
for (int32_t i = 0; i < GetDeviceCount(); i++)
{
if (_audioDevices[i] == Config::Get().sound.Device)
if (_audioDevices[i] == Config::Get().sound.device)
{
_currentAudioDevice = i;
}
@@ -305,7 +305,7 @@ namespace OpenRCT2::Audio
}
// Load title sequence audio object
auto descriptor = GetTitleMusicDescriptor(Config::Get().sound.TitleMusic);
auto descriptor = GetTitleMusicDescriptor(Config::Get().sound.titleMusic);
auto& objManager = GetContext()->GetObjectManager();
auto* audioObject = static_cast<AudioObject*>(objManager.LoadObject(descriptor));
if (audioObject != nullptr)
@@ -404,8 +404,8 @@ namespace OpenRCT2::Audio
void ToggleAllSounds()
{
Config::Get().sound.MasterSoundEnabled = !Config::Get().sound.MasterSoundEnabled;
if (Config::Get().sound.MasterSoundEnabled)
Config::Get().sound.masterSoundEnabled = !Config::Get().sound.masterSoundEnabled;
if (Config::Get().sound.masterSoundEnabled)
{
Resume();
}
+2 -2
View File
@@ -376,7 +376,7 @@ namespace OpenRCT2
auto configPath = env->GetFilePath(OpenRCT2::PathId::config);
Config::SetDefaults();
Config::OpenFromPath(configPath);
Config::Get().general.RCT2Path = path;
Config::Get().general.rct2Path = path;
if (Config::SaveToPath(configPath))
{
Console::WriteFormat("Updating RCT2 path to '%s'.", path.c_str());
@@ -403,7 +403,7 @@ namespace OpenRCT2
auto context = OpenRCT2::CreateContext();
auto& env = context->GetPlatformEnvironment();
auto objectRepository = CreateObjectRepository(env);
objectRepository->Construct(Config::Get().general.Language);
objectRepository->Construct(Config::Get().general.language);
return EXITCODE_OK;
}
+352 -352
View File
@@ -68,29 +68,29 @@ namespace OpenRCT2::Config
});
static const auto Enum_Currency = ConfigEnum<CurrencyType>({
ConfigEnumEntry<CurrencyType>("GBP", CurrencyType::Pounds),
ConfigEnumEntry<CurrencyType>("USD", CurrencyType::Dollars),
ConfigEnumEntry<CurrencyType>("FRF", CurrencyType::Franc),
ConfigEnumEntry<CurrencyType>("DEM", CurrencyType::DeutscheMark),
ConfigEnumEntry<CurrencyType>("JPY", CurrencyType::Yen),
ConfigEnumEntry<CurrencyType>("ESP", CurrencyType::Peseta),
ConfigEnumEntry<CurrencyType>("ITL", CurrencyType::Lira),
ConfigEnumEntry<CurrencyType>("NLG", CurrencyType::Guilders),
ConfigEnumEntry<CurrencyType>("SEK", CurrencyType::Krona),
ConfigEnumEntry<CurrencyType>("EUR", CurrencyType::Euros),
ConfigEnumEntry<CurrencyType>("KRW", CurrencyType::Won),
ConfigEnumEntry<CurrencyType>("RUB", CurrencyType::Rouble),
ConfigEnumEntry<CurrencyType>("CZK", CurrencyType::CzechKoruna),
ConfigEnumEntry<CurrencyType>("HKD", CurrencyType::HKD),
ConfigEnumEntry<CurrencyType>("TWD", CurrencyType::TWD),
ConfigEnumEntry<CurrencyType>("CNY", CurrencyType::Yuan),
ConfigEnumEntry<CurrencyType>("HUF", CurrencyType::Forint),
ConfigEnumEntry<CurrencyType>("CUSTOM", CurrencyType::Custom),
ConfigEnumEntry<CurrencyType>("GBP", CurrencyType::pounds),
ConfigEnumEntry<CurrencyType>("USD", CurrencyType::dollars),
ConfigEnumEntry<CurrencyType>("FRF", CurrencyType::franc),
ConfigEnumEntry<CurrencyType>("DEM", CurrencyType::deutscheMark),
ConfigEnumEntry<CurrencyType>("JPY", CurrencyType::yen),
ConfigEnumEntry<CurrencyType>("ESP", CurrencyType::peseta),
ConfigEnumEntry<CurrencyType>("ITL", CurrencyType::lira),
ConfigEnumEntry<CurrencyType>("NLG", CurrencyType::guilders),
ConfigEnumEntry<CurrencyType>("SEK", CurrencyType::krona),
ConfigEnumEntry<CurrencyType>("EUR", CurrencyType::euros),
ConfigEnumEntry<CurrencyType>("KRW", CurrencyType::won),
ConfigEnumEntry<CurrencyType>("RUB", CurrencyType::rouble),
ConfigEnumEntry<CurrencyType>("CZK", CurrencyType::czechKoruna),
ConfigEnumEntry<CurrencyType>("HKD", CurrencyType::hongKongDollar),
ConfigEnumEntry<CurrencyType>("TWD", CurrencyType::newTaiwanDollar),
ConfigEnumEntry<CurrencyType>("CNY", CurrencyType::yuan),
ConfigEnumEntry<CurrencyType>("HUF", CurrencyType::forint),
ConfigEnumEntry<CurrencyType>("CUSTOM", CurrencyType::custom),
});
static const auto Enum_CurrencySymbolAffix = ConfigEnum<CurrencyAffix>({
ConfigEnumEntry<CurrencyAffix>("PREFIX", CurrencyAffix::Prefix),
ConfigEnumEntry<CurrencyAffix>("SUFFIX", CurrencyAffix::Suffix),
ConfigEnumEntry<CurrencyAffix>("PREFIX", CurrencyAffix::prefix),
ConfigEnumEntry<CurrencyAffix>("SUFFIX", CurrencyAffix::suffix),
});
static const auto Enum_DateFormat = ConfigEnum<int32_t>({
@@ -164,110 +164,110 @@ namespace OpenRCT2::Config
if (reader->ReadSection("general"))
{
auto model = &_config.general;
model->AlwaysShowGridlines = reader->GetBoolean("always_show_gridlines", false);
model->AutosaveFrequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES);
model->AutosaveAmount = reader->GetInt32("autosave_amount", kDefaultNumAutosavesToKeep);
model->ConfirmationPrompt = reader->GetBoolean("confirmation_prompt", false);
model->CurrencyFormat = reader->GetEnum<CurrencyType>(
model->alwaysShowGridlines = reader->GetBoolean("always_show_gridlines", false);
model->autosaveFrequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES);
model->autosaveAmount = reader->GetInt32("autosave_amount", kDefaultNumAutosavesToKeep);
model->confirmationPrompt = reader->GetBoolean("confirmation_prompt", false);
model->currencyFormat = reader->GetEnum<CurrencyType>(
"currency_format", Platform::GetLocaleCurrency(), Enum_Currency);
model->CustomCurrencyRate = reader->GetInt32("custom_currency_rate", 10);
model->CustomCurrencyAffix = reader->GetEnum<CurrencyAffix>(
"custom_currency_affix", CurrencyAffix::Suffix, Enum_CurrencySymbolAffix);
model->CustomCurrencySymbol = reader->GetString("custom_currency_symbol", "Ctm");
model->EdgeScrolling = reader->GetBoolean("edge_scrolling", true);
model->EdgeScrollingSpeed = reader->GetInt32("edge_scrolling_speed", 12);
model->FullscreenMode = reader->GetInt32("fullscreen_mode", 0);
model->FullscreenHeight = reader->GetInt32("fullscreen_height", -1);
model->FullscreenWidth = reader->GetInt32("fullscreen_width", -1);
model->RCT1Path = reader->GetString("rct1_path", "");
model->RCT2Path = reader->GetString("game_path", "");
model->LandscapeSmoothing = reader->GetBoolean("landscape_smoothing", true);
model->Language = reader->GetEnum<int32_t>("language", Platform::GetLocaleLanguage(), Enum_LanguageEnum);
model->MeasurementFormat = reader->GetEnum<MeasurementFormat>(
model->customCurrencyRate = reader->GetInt32("custom_currency_rate", 10);
model->customCurrencyAffix = reader->GetEnum<CurrencyAffix>(
"custom_currency_affix", CurrencyAffix::suffix, Enum_CurrencySymbolAffix);
model->customCurrencySymbol = reader->GetString("custom_currency_symbol", "Ctm");
model->edgeScrolling = reader->GetBoolean("edge_scrolling", true);
model->edgeScrollingSpeed = reader->GetInt32("edge_scrolling_speed", 12);
model->fullscreenMode = reader->GetInt32("fullscreen_mode", 0);
model->fullscreenHeight = reader->GetInt32("fullscreen_height", -1);
model->fullscreenWidth = reader->GetInt32("fullscreen_width", -1);
model->rct1Path = reader->GetString("rct1_path", "");
model->rct2Path = reader->GetString("game_path", "");
model->landscapeSmoothing = reader->GetBoolean("landscape_smoothing", true);
model->language = reader->GetEnum<int32_t>("language", Platform::GetLocaleLanguage(), Enum_LanguageEnum);
model->measurementFormat = reader->GetEnum<MeasurementFormat>(
"measurement_format", Platform::GetLocaleMeasurementFormat(), Enum_MeasurementFormat);
model->PlayIntro = reader->GetBoolean("play_intro", false);
model->SavePluginData = reader->GetBoolean("save_plugin_data", true);
model->DebuggingTools = reader->GetBoolean("debugging_tools", false);
model->ShowHeightAsUnits = reader->GetBoolean("show_height_as_units", false);
model->TemperatureFormat = reader->GetEnum<TemperatureUnit>(
model->playIntro = reader->GetBoolean("play_intro", false);
model->savePluginData = reader->GetBoolean("save_plugin_data", true);
model->debuggingTools = reader->GetBoolean("debugging_tools", false);
model->showHeightAsUnits = reader->GetBoolean("show_height_as_units", false);
model->temperatureFormat = reader->GetEnum<TemperatureUnit>(
"temperature_format", Platform::GetLocaleTemperatureFormat(), Enum_Temperature);
model->WindowHeight = reader->GetInt32("window_height", -1);
model->WindowSnapProximity = reader->GetInt32("window_snap_proximity", 5);
model->WindowWidth = reader->GetInt32("window_width", -1);
model->DefaultDisplay = reader->GetInt32("default_display", 0);
model->DrawingEngine = reader->GetEnum<DrawingEngine>(
model->windowHeight = reader->GetInt32("window_height", -1);
model->windowSnapProximity = reader->GetInt32("window_snap_proximity", 5);
model->windowWidth = reader->GetInt32("window_width", -1);
model->defaultDisplay = reader->GetInt32("default_display", 0);
model->drawingEngine = reader->GetEnum<DrawingEngine>(
"drawing_engine", DrawingEngine::SoftwareWithHardwareDisplay, Enum_DrawingEngine);
model->UncapFPS = reader->GetBoolean("uncap_fps", false);
model->UseVSync = reader->GetBoolean("use_vsync", true);
model->VirtualFloorStyle = reader->GetEnum<VirtualFloorStyles>(
model->uncapFPS = reader->GetBoolean("uncap_fps", false);
model->useVSync = reader->GetBoolean("use_vsync", true);
model->virtualFloorStyle = reader->GetEnum<VirtualFloorStyles>(
"virtual_floor_style", VirtualFloorStyles::Glassy, Enum_VirtualFloorStyle);
model->DateFormat = reader->GetEnum<int32_t>("date_format", Platform::GetLocaleDateFormat(), Enum_DateFormat);
model->AutoStaffPlacement = reader->GetBoolean("auto_staff", true);
model->HandymenMowByDefault = reader->GetBoolean("handymen_mow_default", false);
model->DefaultInspectionInterval = reader->GetInt32("default_inspection_interval", 2);
model->LastRunVersion = reader->GetString("last_run_version", "");
model->InvertViewportDrag = reader->GetBoolean("invert_viewport_drag", false);
model->LoadSaveSort = reader->GetEnum<FileBrowserSort>(
model->dateFormat = reader->GetEnum<int32_t>("date_format", Platform::GetLocaleDateFormat(), Enum_DateFormat);
model->autoStaffPlacement = reader->GetBoolean("auto_staff", true);
model->handymenMowByDefault = reader->GetBoolean("handymen_mow_default", false);
model->defaultInspectionInterval = reader->GetInt32("default_inspection_interval", 2);
model->lastRunVersion = reader->GetString("last_run_version", "");
model->invertViewportDrag = reader->GetBoolean("invert_viewport_drag", false);
model->loadSaveSort = reader->GetEnum<FileBrowserSort>(
"load_save_sort", FileBrowserSort::NameAscending, Enum_FileBrowserSort);
model->MinimizeFullscreenFocusLoss = reader->GetBoolean("minimize_fullscreen_focus_loss", true);
model->DisableScreensaver = reader->GetBoolean("disable_screensaver", true);
model->minimizeFullscreenFocusLoss = reader->GetBoolean("minimize_fullscreen_focus_loss", true);
model->disableScreensaver = reader->GetBoolean("disable_screensaver", true);
// Default config setting is false until the games canvas can be separated from the effect
model->DayNightCycle = reader->GetBoolean("day_night_cycle", false);
const bool supportsLightFx = model->DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay;
model->EnableLightFx = supportsLightFx && reader->GetBoolean("enable_light_fx", false);
model->EnableLightFxForVehicles = supportsLightFx && reader->GetBoolean("enable_light_fx_for_vehicles", false);
model->UpperCaseBanners = reader->GetBoolean("upper_case_banners", false);
model->DisableLightningEffect = reader->GetBoolean("disable_lightning_effect", false);
model->WindowScale = reader->GetFloat("window_scale", Platform::GetDefaultScale());
model->InferDisplayDPI = reader->GetBoolean("infer_display_dpi", true);
model->ShowFPS = reader->GetBoolean("show_fps", false);
model->dayNightCycle = reader->GetBoolean("day_night_cycle", false);
const bool supportsLightFx = model->drawingEngine == DrawingEngine::SoftwareWithHardwareDisplay;
model->enableLightFx = supportsLightFx && reader->GetBoolean("enable_light_fx", false);
model->enableLightFxForVehicles = supportsLightFx && reader->GetBoolean("enable_light_fx_for_vehicles", false);
model->upperCaseBanners = reader->GetBoolean("upper_case_banners", false);
model->disableLightningEffect = reader->GetBoolean("disable_lightning_effect", false);
model->windowScale = reader->GetFloat("window_scale", Platform::GetDefaultScale());
model->inferDisplayDPI = reader->GetBoolean("infer_display_dpi", true);
model->showFPS = reader->GetBoolean("show_fps", false);
#ifdef _DEBUG
// Always have multi-threading disabled in debug builds, this makes things slower.
model->MultiThreading = false;
model->multiThreading = false;
#else
model->MultiThreading = reader->GetBoolean("multithreading", true);
model->multiThreading = reader->GetBoolean("multithreading", true);
#endif // _DEBUG
model->TrapCursor = reader->GetBoolean("trap_cursor", false);
model->AutoOpenShops = reader->GetBoolean("auto_open_shops", false);
model->trapCursor = reader->GetBoolean("trap_cursor", false);
model->autoOpenShops = reader->GetBoolean("auto_open_shops", false);
// Gamepad settings
model->gamepadDeadzone = reader->GetInt32("gamepad_deadzone", 3600);
model->gamepadSensitivity = reader->GetFloat("gamepad_sensitivity", 1.5f);
model->ScenarioUnlockingEnabled = reader->GetBoolean("scenario_unlocking_enabled", true);
model->ScenarioHideMegaPark = reader->GetBoolean("scenario_hide_mega_park", true);
model->LastSaveGameDirectory = reader->GetString("last_game_directory", "");
model->LastSaveLandscapeDirectory = reader->GetString("last_landscape_directory", "");
model->LastSaveScenarioDirectory = reader->GetString("last_scenario_directory", "");
model->LastSaveTrackDirectory = reader->GetString("last_track_directory", "");
model->UseNativeBrowseDialog = reader->GetBoolean("use_native_browse_dialog", false);
model->WindowLimit = reader->GetInt32("window_limit", kWindowLimitMax);
model->ZoomToCursor = reader->GetBoolean("zoom_to_cursor", true);
model->RenderWeatherEffects = reader->GetBoolean("render_weather_effects", true);
model->RenderWeatherGloom = reader->GetBoolean("render_weather_gloom", true);
model->ShowGuestPurchases = reader->GetBoolean("show_guest_purchases", false);
model->ShowRealNamesOfGuests = reader->GetBoolean("show_real_names_of_guests", true);
model->ShowRealNamesOfStaff = reader->GetBoolean("show_real_names_of_staff", false);
model->AllowEarlyCompletion = reader->GetBoolean("allow_early_completion", false);
model->AssetPackOrder = reader->GetString("asset_pack_order", "");
model->EnabledAssetPacks = reader->GetString("enabled_asset_packs", "");
model->TransparentScreenshot = reader->GetBoolean("transparent_screenshot", true);
model->TransparentWater = reader->GetBoolean("transparent_water", true);
model->scenarioUnlockingEnabled = reader->GetBoolean("scenario_unlocking_enabled", true);
model->scenarioHideMegaPark = reader->GetBoolean("scenario_hide_mega_park", true);
model->lastSaveGameDirectory = reader->GetString("last_game_directory", "");
model->lastSaveLandscapeDirectory = reader->GetString("last_landscape_directory", "");
model->lastSaveScenarioDirectory = reader->GetString("last_scenario_directory", "");
model->lastSaveTrackDirectory = reader->GetString("last_track_directory", "");
model->useNativeBrowseDialog = reader->GetBoolean("use_native_browse_dialog", false);
model->windowLimit = reader->GetInt32("window_limit", kWindowLimitMax);
model->zoomToCursor = reader->GetBoolean("zoom_to_cursor", true);
model->renderWeatherEffects = reader->GetBoolean("render_weather_effects", true);
model->renderWeatherGloom = reader->GetBoolean("render_weather_gloom", true);
model->showGuestPurchases = reader->GetBoolean("show_guest_purchases", false);
model->showRealNamesOfGuests = reader->GetBoolean("show_real_names_of_guests", true);
model->showRealNamesOfStaff = reader->GetBoolean("show_real_names_of_staff", false);
model->allowEarlyCompletion = reader->GetBoolean("allow_early_completion", false);
model->assetPackOrder = reader->GetString("asset_pack_order", "");
model->enabledAssetPacks = reader->GetString("enabled_asset_packs", "");
model->transparentScreenshot = reader->GetBoolean("transparent_screenshot", true);
model->transparentWater = reader->GetBoolean("transparent_water", true);
model->InvisibleRides = reader->GetBoolean("invisible_rides", false);
model->InvisibleVehicles = reader->GetBoolean("invisible_vehicles", false);
model->InvisibleTrees = reader->GetBoolean("invisible_trees", false);
model->InvisibleScenery = reader->GetBoolean("invisible_scenery", false);
model->InvisiblePaths = reader->GetBoolean("invisible_paths", false);
model->InvisibleSupports = reader->GetBoolean("invisible_supports", true);
model->invisibleRides = reader->GetBoolean("invisible_rides", false);
model->invisibleVehicles = reader->GetBoolean("invisible_vehicles", false);
model->invisibleTrees = reader->GetBoolean("invisible_trees", false);
model->invisibleScenery = reader->GetBoolean("invisible_scenery", false);
model->invisiblePaths = reader->GetBoolean("invisible_paths", false);
model->invisibleSupports = reader->GetBoolean("invisible_supports", true);
model->LastVersionCheckTime = reader->GetInt64("last_version_check_time", 0);
model->lastVersionCheckTime = reader->GetInt64("last_version_check_time", 0);
model->FileBrowserWidth = reader->GetInt32("file_browser_width", 0);
model->FileBrowserHeight = reader->GetInt32("file_browser_height", 0);
model->FileBrowserShowSizeColumn = reader->GetBoolean("file_browser_show_size_column", true);
model->FileBrowserShowDateColumn = reader->GetBoolean("file_browser_show_date_column", true);
model->FileBrowserPreviewType = reader->GetEnum<ParkPreviewPref>(
model->fileBrowserWidth = reader->GetInt32("file_browser_width", 0);
model->fileBrowserHeight = reader->GetInt32("file_browser_height", 0);
model->fileBrowserShowSizeColumn = reader->GetBoolean("file_browser_show_size_column", true);
model->fileBrowserShowDateColumn = reader->GetBoolean("file_browser_show_date_column", true);
model->fileBrowserPreviewType = reader->GetEnum<ParkPreviewPref>(
"file_browser_preview_type", ParkPreviewPref::screenshot, Enum_ParkPreviewPref);
}
}
@@ -276,92 +276,92 @@ namespace OpenRCT2::Config
{
auto model = &_config.general;
writer->WriteSection("general");
writer->WriteBoolean("always_show_gridlines", model->AlwaysShowGridlines);
writer->WriteInt32("autosave", model->AutosaveFrequency);
writer->WriteInt32("autosave_amount", model->AutosaveAmount);
writer->WriteBoolean("confirmation_prompt", model->ConfirmationPrompt);
writer->WriteEnum<CurrencyType>("currency_format", model->CurrencyFormat, Enum_Currency);
writer->WriteInt32("custom_currency_rate", model->CustomCurrencyRate);
writer->WriteEnum<CurrencyAffix>("custom_currency_affix", model->CustomCurrencyAffix, Enum_CurrencySymbolAffix);
writer->WriteString("custom_currency_symbol", model->CustomCurrencySymbol);
writer->WriteBoolean("edge_scrolling", model->EdgeScrolling);
writer->WriteInt32("edge_scrolling_speed", model->EdgeScrollingSpeed);
writer->WriteInt32("fullscreen_mode", model->FullscreenMode);
writer->WriteInt32("fullscreen_height", model->FullscreenHeight);
writer->WriteInt32("fullscreen_width", model->FullscreenWidth);
writer->WriteString("rct1_path", model->RCT1Path);
writer->WriteString("game_path", model->RCT2Path);
writer->WriteBoolean("landscape_smoothing", model->LandscapeSmoothing);
writer->WriteEnum<int32_t>("language", model->Language, Enum_LanguageEnum);
writer->WriteEnum<MeasurementFormat>("measurement_format", model->MeasurementFormat, Enum_MeasurementFormat);
writer->WriteBoolean("play_intro", model->PlayIntro);
writer->WriteBoolean("save_plugin_data", model->SavePluginData);
writer->WriteBoolean("debugging_tools", model->DebuggingTools);
writer->WriteBoolean("show_height_as_units", model->ShowHeightAsUnits);
writer->WriteEnum<TemperatureUnit>("temperature_format", model->TemperatureFormat, Enum_Temperature);
writer->WriteInt32("window_height", model->WindowHeight);
writer->WriteInt32("window_snap_proximity", model->WindowSnapProximity);
writer->WriteInt32("window_width", model->WindowWidth);
writer->WriteInt32("default_display", model->DefaultDisplay);
writer->WriteEnum<DrawingEngine>("drawing_engine", model->DrawingEngine, Enum_DrawingEngine);
writer->WriteBoolean("uncap_fps", model->UncapFPS);
writer->WriteBoolean("use_vsync", model->UseVSync);
writer->WriteEnum<int32_t>("date_format", model->DateFormat, Enum_DateFormat);
writer->WriteBoolean("auto_staff", model->AutoStaffPlacement);
writer->WriteBoolean("handymen_mow_default", model->HandymenMowByDefault);
writer->WriteInt32("default_inspection_interval", model->DefaultInspectionInterval);
writer->WriteString("last_run_version", model->LastRunVersion);
writer->WriteBoolean("invert_viewport_drag", model->InvertViewportDrag);
writer->WriteEnum<FileBrowserSort>("load_save_sort", model->LoadSaveSort, Enum_FileBrowserSort);
writer->WriteBoolean("minimize_fullscreen_focus_loss", model->MinimizeFullscreenFocusLoss);
writer->WriteBoolean("disable_screensaver", model->DisableScreensaver);
writer->WriteBoolean("day_night_cycle", model->DayNightCycle);
writer->WriteBoolean("enable_light_fx", model->EnableLightFx);
writer->WriteBoolean("enable_light_fx_for_vehicles", model->EnableLightFxForVehicles);
writer->WriteBoolean("upper_case_banners", model->UpperCaseBanners);
writer->WriteBoolean("disable_lightning_effect", model->DisableLightningEffect);
writer->WriteFloat("window_scale", model->WindowScale);
writer->WriteBoolean("infer_display_dpi", model->InferDisplayDPI);
writer->WriteBoolean("show_fps", model->ShowFPS);
writer->WriteBoolean("multithreading", model->MultiThreading);
writer->WriteBoolean("trap_cursor", model->TrapCursor);
writer->WriteBoolean("auto_open_shops", model->AutoOpenShops);
writer->WriteBoolean("always_show_gridlines", model->alwaysShowGridlines);
writer->WriteInt32("autosave", model->autosaveFrequency);
writer->WriteInt32("autosave_amount", model->autosaveAmount);
writer->WriteBoolean("confirmation_prompt", model->confirmationPrompt);
writer->WriteEnum<CurrencyType>("currency_format", model->currencyFormat, Enum_Currency);
writer->WriteInt32("custom_currency_rate", model->customCurrencyRate);
writer->WriteEnum<CurrencyAffix>("custom_currency_affix", model->customCurrencyAffix, Enum_CurrencySymbolAffix);
writer->WriteString("custom_currency_symbol", model->customCurrencySymbol);
writer->WriteBoolean("edge_scrolling", model->edgeScrolling);
writer->WriteInt32("edge_scrolling_speed", model->edgeScrollingSpeed);
writer->WriteInt32("fullscreen_mode", model->fullscreenMode);
writer->WriteInt32("fullscreen_height", model->fullscreenHeight);
writer->WriteInt32("fullscreen_width", model->fullscreenWidth);
writer->WriteString("rct1_path", model->rct1Path);
writer->WriteString("game_path", model->rct2Path);
writer->WriteBoolean("landscape_smoothing", model->landscapeSmoothing);
writer->WriteEnum<int32_t>("language", model->language, Enum_LanguageEnum);
writer->WriteEnum<MeasurementFormat>("measurement_format", model->measurementFormat, Enum_MeasurementFormat);
writer->WriteBoolean("play_intro", model->playIntro);
writer->WriteBoolean("save_plugin_data", model->savePluginData);
writer->WriteBoolean("debugging_tools", model->debuggingTools);
writer->WriteBoolean("show_height_as_units", model->showHeightAsUnits);
writer->WriteEnum<TemperatureUnit>("temperature_format", model->temperatureFormat, Enum_Temperature);
writer->WriteInt32("window_height", model->windowHeight);
writer->WriteInt32("window_snap_proximity", model->windowSnapProximity);
writer->WriteInt32("window_width", model->windowWidth);
writer->WriteInt32("default_display", model->defaultDisplay);
writer->WriteEnum<DrawingEngine>("drawing_engine", model->drawingEngine, Enum_DrawingEngine);
writer->WriteBoolean("uncap_fps", model->uncapFPS);
writer->WriteBoolean("use_vsync", model->useVSync);
writer->WriteEnum<int32_t>("date_format", model->dateFormat, Enum_DateFormat);
writer->WriteBoolean("auto_staff", model->autoStaffPlacement);
writer->WriteBoolean("handymen_mow_default", model->handymenMowByDefault);
writer->WriteInt32("default_inspection_interval", model->defaultInspectionInterval);
writer->WriteString("last_run_version", model->lastRunVersion);
writer->WriteBoolean("invert_viewport_drag", model->invertViewportDrag);
writer->WriteEnum<FileBrowserSort>("load_save_sort", model->loadSaveSort, Enum_FileBrowserSort);
writer->WriteBoolean("minimize_fullscreen_focus_loss", model->minimizeFullscreenFocusLoss);
writer->WriteBoolean("disable_screensaver", model->disableScreensaver);
writer->WriteBoolean("day_night_cycle", model->dayNightCycle);
writer->WriteBoolean("enable_light_fx", model->enableLightFx);
writer->WriteBoolean("enable_light_fx_for_vehicles", model->enableLightFxForVehicles);
writer->WriteBoolean("upper_case_banners", model->upperCaseBanners);
writer->WriteBoolean("disable_lightning_effect", model->disableLightningEffect);
writer->WriteFloat("window_scale", model->windowScale);
writer->WriteBoolean("infer_display_dpi", model->inferDisplayDPI);
writer->WriteBoolean("show_fps", model->showFPS);
writer->WriteBoolean("multithreading", model->multiThreading);
writer->WriteBoolean("trap_cursor", model->trapCursor);
writer->WriteBoolean("auto_open_shops", model->autoOpenShops);
// Gamepad settings
writer->WriteInt32("gamepad_deadzone", model->gamepadDeadzone);
writer->WriteFloat("gamepad_sensitivity", model->gamepadSensitivity);
writer->WriteBoolean("scenario_unlocking_enabled", model->ScenarioUnlockingEnabled);
writer->WriteBoolean("scenario_hide_mega_park", model->ScenarioHideMegaPark);
writer->WriteString("last_game_directory", model->LastSaveGameDirectory);
writer->WriteString("last_landscape_directory", model->LastSaveLandscapeDirectory);
writer->WriteString("last_scenario_directory", model->LastSaveScenarioDirectory);
writer->WriteString("last_track_directory", model->LastSaveTrackDirectory);
writer->WriteBoolean("use_native_browse_dialog", model->UseNativeBrowseDialog);
writer->WriteInt32("window_limit", model->WindowLimit);
writer->WriteBoolean("zoom_to_cursor", model->ZoomToCursor);
writer->WriteBoolean("render_weather_effects", model->RenderWeatherEffects);
writer->WriteBoolean("render_weather_gloom", model->RenderWeatherGloom);
writer->WriteBoolean("show_guest_purchases", model->ShowGuestPurchases);
writer->WriteBoolean("show_real_names_of_guests", model->ShowRealNamesOfGuests);
writer->WriteBoolean("show_real_names_of_staff", model->ShowRealNamesOfStaff);
writer->WriteBoolean("allow_early_completion", model->AllowEarlyCompletion);
writer->WriteString("asset_pack_order", model->AssetPackOrder);
writer->WriteString("enabled_asset_packs", model->EnabledAssetPacks);
writer->WriteEnum<VirtualFloorStyles>("virtual_floor_style", model->VirtualFloorStyle, Enum_VirtualFloorStyle);
writer->WriteBoolean("transparent_screenshot", model->TransparentScreenshot);
writer->WriteBoolean("transparent_water", model->TransparentWater);
writer->WriteBoolean("invisible_rides", model->InvisibleRides);
writer->WriteBoolean("invisible_vehicles", model->InvisibleVehicles);
writer->WriteBoolean("invisible_trees", model->InvisibleTrees);
writer->WriteBoolean("invisible_scenery", model->InvisibleScenery);
writer->WriteBoolean("invisible_paths", model->InvisiblePaths);
writer->WriteBoolean("invisible_supports", model->InvisibleSupports);
writer->WriteInt64("last_version_check_time", model->LastVersionCheckTime);
writer->WriteInt32("file_browser_width", model->FileBrowserWidth);
writer->WriteInt32("file_browser_height", model->FileBrowserHeight);
writer->WriteBoolean("file_browser_show_size_column", model->FileBrowserShowSizeColumn);
writer->WriteBoolean("file_browser_show_date_column", model->FileBrowserShowDateColumn);
writer->WriteEnum<ParkPreviewPref>("file_browser_preview_type", model->FileBrowserPreviewType, Enum_ParkPreviewPref);
writer->WriteBoolean("scenario_unlocking_enabled", model->scenarioUnlockingEnabled);
writer->WriteBoolean("scenario_hide_mega_park", model->scenarioHideMegaPark);
writer->WriteString("last_game_directory", model->lastSaveGameDirectory);
writer->WriteString("last_landscape_directory", model->lastSaveLandscapeDirectory);
writer->WriteString("last_scenario_directory", model->lastSaveScenarioDirectory);
writer->WriteString("last_track_directory", model->lastSaveTrackDirectory);
writer->WriteBoolean("use_native_browse_dialog", model->useNativeBrowseDialog);
writer->WriteInt32("window_limit", model->windowLimit);
writer->WriteBoolean("zoom_to_cursor", model->zoomToCursor);
writer->WriteBoolean("render_weather_effects", model->renderWeatherEffects);
writer->WriteBoolean("render_weather_gloom", model->renderWeatherGloom);
writer->WriteBoolean("show_guest_purchases", model->showGuestPurchases);
writer->WriteBoolean("show_real_names_of_guests", model->showRealNamesOfGuests);
writer->WriteBoolean("show_real_names_of_staff", model->showRealNamesOfStaff);
writer->WriteBoolean("allow_early_completion", model->allowEarlyCompletion);
writer->WriteString("asset_pack_order", model->assetPackOrder);
writer->WriteString("enabled_asset_packs", model->enabledAssetPacks);
writer->WriteEnum<VirtualFloorStyles>("virtual_floor_style", model->virtualFloorStyle, Enum_VirtualFloorStyle);
writer->WriteBoolean("transparent_screenshot", model->transparentScreenshot);
writer->WriteBoolean("transparent_water", model->transparentWater);
writer->WriteBoolean("invisible_rides", model->invisibleRides);
writer->WriteBoolean("invisible_vehicles", model->invisibleVehicles);
writer->WriteBoolean("invisible_trees", model->invisibleTrees);
writer->WriteBoolean("invisible_scenery", model->invisibleScenery);
writer->WriteBoolean("invisible_paths", model->invisiblePaths);
writer->WriteBoolean("invisible_supports", model->invisibleSupports);
writer->WriteInt64("last_version_check_time", model->lastVersionCheckTime);
writer->WriteInt32("file_browser_width", model->fileBrowserWidth);
writer->WriteInt32("file_browser_height", model->fileBrowserHeight);
writer->WriteBoolean("file_browser_show_size_column", model->fileBrowserShowSizeColumn);
writer->WriteBoolean("file_browser_show_date_column", model->fileBrowserShowDateColumn);
writer->WriteEnum<ParkPreviewPref>("file_browser_preview_type", model->fileBrowserPreviewType, Enum_ParkPreviewPref);
}
static void ReadInterface(IIniReader* reader)
@@ -369,26 +369,26 @@ namespace OpenRCT2::Config
if (reader->ReadSection("interface"))
{
auto model = &_config.interface;
model->ToolbarButtonsCentred = reader->GetBoolean("toolbar_buttons_centred", false);
model->ToolbarShowFinances = reader->GetBoolean("toolbar_show_finances", true);
model->ToolbarShowResearch = reader->GetBoolean("toolbar_show_research", true);
model->ToolbarShowCheats = reader->GetBoolean("toolbar_show_cheats", false);
model->ToolbarShowNews = reader->GetBoolean("toolbar_show_news", false);
model->ToolbarShowMute = reader->GetBoolean("toolbar_show_mute", false);
model->ToolbarShowChat = reader->GetBoolean("toolbar_show_chat", false);
model->ToolbarShowZoom = reader->GetBoolean("toolbar_show_zoom", true);
model->ToolbarShowRotateAnticlockwise = reader->GetBoolean("toolbar_show_rotate_anti_clockwise", false);
model->ConsoleSmallFont = reader->GetBoolean("console_small_font", false);
model->CurrentThemePreset = reader->GetString("current_theme", "*RCT2");
model->CurrentTitleSequencePreset = reader->GetString("current_title_sequence", "*OPENRCT2");
model->RandomTitleSequence = reader->GetBoolean("random_title_sequence", false);
model->ObjectSelectionFilterFlags = reader->GetInt32("object_selection_filter_flags", 0x3FFF);
model->toolbarButtonsCentred = reader->GetBoolean("toolbar_buttons_centred", false);
model->toolbarShowFinances = reader->GetBoolean("toolbar_show_finances", true);
model->toolbarShowResearch = reader->GetBoolean("toolbar_show_research", true);
model->toolbarShowCheats = reader->GetBoolean("toolbar_show_cheats", false);
model->toolbarShowNews = reader->GetBoolean("toolbar_show_news", false);
model->toolbarShowMute = reader->GetBoolean("toolbar_show_mute", false);
model->toolbarShowChat = reader->GetBoolean("toolbar_show_chat", false);
model->toolbarShowZoom = reader->GetBoolean("toolbar_show_zoom", true);
model->toolbarShowRotateAnticlockwise = reader->GetBoolean("toolbar_show_rotate_anti_clockwise", false);
model->consoleSmallFont = reader->GetBoolean("console_small_font", false);
model->currentThemePreset = reader->GetString("current_theme", "*RCT2");
model->currentTitleSequencePreset = reader->GetString("current_title_sequence", "*OPENRCT2");
model->randomTitleSequence = reader->GetBoolean("random_title_sequence", false);
model->objectSelectionFilterFlags = reader->GetInt32("object_selection_filter_flags", 0x3FFF);
model->scenarioSelectLastTab = reader->GetInt32("scenarioselect_last_tab", 0);
model->scenarioPreviewScreenshots = reader->GetBoolean("scenario_preview_screenshots", true);
model->ListRideVehiclesSeparately = reader->GetBoolean("list_ride_vehicles_separately", false);
model->WindowButtonsOnTheLeft = reader->GetBoolean("window_buttons_on_the_left", kWindowButtonsOnTheLeftDefault);
model->EnlargedUi = reader->GetBoolean("enlarged_ui", kEnlargedUiDefault);
model->TouchEnhancements = reader->GetBoolean("touch_enhancements", kEnlargedUiDefault);
model->listRideVehiclesSeparately = reader->GetBoolean("list_ride_vehicles_separately", false);
model->windowButtonsOnTheLeft = reader->GetBoolean("window_buttons_on_the_left", kWindowButtonsOnTheLeftDefault);
model->enlargedUi = reader->GetBoolean("enlarged_ui", kEnlargedUiDefault);
model->touchEnhancements = reader->GetBoolean("touch_enhancements", kEnlargedUiDefault);
}
}
@@ -396,26 +396,26 @@ namespace OpenRCT2::Config
{
auto model = &_config.interface;
writer->WriteSection("interface");
writer->WriteBoolean("toolbar_buttons_centred", model->ToolbarButtonsCentred);
writer->WriteBoolean("toolbar_show_finances", model->ToolbarShowFinances);
writer->WriteBoolean("toolbar_show_research", model->ToolbarShowResearch);
writer->WriteBoolean("toolbar_show_cheats", model->ToolbarShowCheats);
writer->WriteBoolean("toolbar_show_news", model->ToolbarShowNews);
writer->WriteBoolean("toolbar_show_mute", model->ToolbarShowMute);
writer->WriteBoolean("toolbar_show_chat", model->ToolbarShowChat);
writer->WriteBoolean("toolbar_show_zoom", model->ToolbarShowZoom);
writer->WriteBoolean("toolbar_show_rotate_anti_clockwise", model->ToolbarShowRotateAnticlockwise);
writer->WriteBoolean("console_small_font", model->ConsoleSmallFont);
writer->WriteString("current_theme", model->CurrentThemePreset);
writer->WriteString("current_title_sequence", model->CurrentTitleSequencePreset);
writer->WriteBoolean("random_title_sequence", model->RandomTitleSequence);
writer->WriteInt32("object_selection_filter_flags", model->ObjectSelectionFilterFlags);
writer->WriteBoolean("toolbar_buttons_centred", model->toolbarButtonsCentred);
writer->WriteBoolean("toolbar_show_finances", model->toolbarShowFinances);
writer->WriteBoolean("toolbar_show_research", model->toolbarShowResearch);
writer->WriteBoolean("toolbar_show_cheats", model->toolbarShowCheats);
writer->WriteBoolean("toolbar_show_news", model->toolbarShowNews);
writer->WriteBoolean("toolbar_show_mute", model->toolbarShowMute);
writer->WriteBoolean("toolbar_show_chat", model->toolbarShowChat);
writer->WriteBoolean("toolbar_show_zoom", model->toolbarShowZoom);
writer->WriteBoolean("toolbar_show_rotate_anti_clockwise", model->toolbarShowRotateAnticlockwise);
writer->WriteBoolean("console_small_font", model->consoleSmallFont);
writer->WriteString("current_theme", model->currentThemePreset);
writer->WriteString("current_title_sequence", model->currentTitleSequencePreset);
writer->WriteBoolean("random_title_sequence", model->randomTitleSequence);
writer->WriteInt32("object_selection_filter_flags", model->objectSelectionFilterFlags);
writer->WriteInt32("scenarioselect_last_tab", model->scenarioSelectLastTab);
writer->WriteBoolean("scenario_preview_screenshots", model->scenarioPreviewScreenshots);
writer->WriteBoolean("list_ride_vehicles_separately", model->ListRideVehiclesSeparately);
writer->WriteBoolean("window_buttons_on_the_left", model->WindowButtonsOnTheLeft);
writer->WriteBoolean("enlarged_ui", model->EnlargedUi);
writer->WriteBoolean("touch_enhancements", model->TouchEnhancements);
writer->WriteBoolean("list_ride_vehicles_separately", model->listRideVehiclesSeparately);
writer->WriteBoolean("window_buttons_on_the_left", model->windowButtonsOnTheLeft);
writer->WriteBoolean("enlarged_ui", model->enlargedUi);
writer->WriteBoolean("touch_enhancements", model->touchEnhancements);
}
static void ReadSound(IIniReader* reader)
@@ -423,16 +423,16 @@ namespace OpenRCT2::Config
if (reader->ReadSection("sound"))
{
auto model = &_config.sound;
model->Device = reader->GetString("audio_device", "");
model->MasterSoundEnabled = reader->GetBoolean("master_sound", true);
model->MasterVolume = reader->GetInt32("master_volume", 100);
model->TitleMusic = static_cast<TitleMusicKind>(
model->device = reader->GetString("audio_device", "");
model->masterSoundEnabled = reader->GetBoolean("master_sound", true);
model->masterVolume = reader->GetInt32("master_volume", 100);
model->titleMusic = static_cast<TitleMusicKind>(
reader->GetInt32("title_theme", EnumValue(TitleMusicKind::OpenRCT2)));
model->SoundEnabled = reader->GetBoolean("sound", true);
model->SoundVolume = reader->GetInt32("sound_volume", 100);
model->RideMusicEnabled = reader->GetBoolean("ride_music", true);
model->AudioFocus = reader->GetInt32("ride_music_volume", 100);
model->audio_focus = reader->GetBoolean("audio_focus", false);
model->soundEnabled = reader->GetBoolean("sound", true);
model->soundVolume = reader->GetInt32("sound_volume", 100);
model->rideMusicEnabled = reader->GetBoolean("ride_music", true);
model->rideMusicVolume = reader->GetInt32("ride_music_volume", 100);
model->audioFocus = reader->GetBoolean("audio_focus", false);
}
}
@@ -440,15 +440,15 @@ namespace OpenRCT2::Config
{
auto model = &_config.sound;
writer->WriteSection("sound");
writer->WriteString("audio_device", model->Device);
writer->WriteBoolean("master_sound", model->MasterSoundEnabled);
writer->WriteInt32("master_volume", model->MasterVolume);
writer->WriteInt32("title_theme", EnumValue(model->TitleMusic));
writer->WriteBoolean("sound", model->SoundEnabled);
writer->WriteInt32("sound_volume", model->SoundVolume);
writer->WriteBoolean("ride_music", model->RideMusicEnabled);
writer->WriteInt32("ride_music_volume", model->AudioFocus);
writer->WriteBoolean("audio_focus", model->audio_focus);
writer->WriteString("audio_device", model->device);
writer->WriteBoolean("master_sound", model->masterSoundEnabled);
writer->WriteInt32("master_volume", model->masterVolume);
writer->WriteInt32("title_theme", EnumValue(model->titleMusic));
writer->WriteBoolean("sound", model->soundEnabled);
writer->WriteInt32("sound_volume", model->soundVolume);
writer->WriteBoolean("ride_music", model->rideMusicEnabled);
writer->WriteInt32("ride_music_volume", model->rideMusicVolume);
writer->WriteBoolean("audio_focus", model->audioFocus);
}
static void ReadNetwork(IIniReader* reader)
@@ -472,26 +472,26 @@ namespace OpenRCT2::Config
playerName = String::trim(playerName);
auto model = &_config.network;
model->PlayerName = std::move(playerName);
model->DefaultPort = reader->GetInt32("default_port", ::Network::kDefaultPort);
model->ListenAddress = reader->GetString("listen_address", "");
model->DefaultPassword = reader->GetString("default_password", "");
model->StayConnected = reader->GetBoolean("stay_connected", true);
model->Advertise = reader->GetBoolean("advertise", true);
model->AdvertiseAddress = reader->GetString("advertise_address", "");
model->Maxplayers = reader->GetInt32("maxplayers", 16);
model->ServerName = reader->GetString("server_name", "Server");
model->ServerDescription = reader->GetString("server_description", "");
model->ServerGreeting = reader->GetString("server_greeting", "");
model->MasterServerUrl = reader->GetString("master_server_url", "");
model->ProviderName = reader->GetString("provider_name", "");
model->ProviderEmail = reader->GetString("provider_email", "");
model->ProviderWebsite = reader->GetString("provider_website", "");
model->KnownKeysOnly = reader->GetBoolean("known_keys_only", false);
model->LogChat = reader->GetBoolean("log_chat", false);
model->LogServerActions = reader->GetBoolean("log_server_actions", false);
model->PauseServerIfNoClients = reader->GetBoolean("pause_server_if_no_clients", false);
model->DesyncDebugging = reader->GetBoolean("desync_debugging", false);
model->playerName = std::move(playerName);
model->defaultPort = reader->GetInt32("default_port", ::Network::kDefaultPort);
model->listenAddress = reader->GetString("listen_address", "");
model->defaultPassword = reader->GetString("default_password", "");
model->stayConnected = reader->GetBoolean("stay_connected", true);
model->advertise = reader->GetBoolean("advertise", true);
model->advertiseAddress = reader->GetString("advertise_address", "");
model->maxplayers = reader->GetInt32("maxplayers", 16);
model->serverName = reader->GetString("server_name", "Server");
model->serverDescription = reader->GetString("server_description", "");
model->serverGreeting = reader->GetString("server_greeting", "");
model->masterServerUrl = reader->GetString("master_server_url", "");
model->providerName = reader->GetString("provider_name", "");
model->providerEmail = reader->GetString("provider_email", "");
model->providerWebsite = reader->GetString("provider_website", "");
model->knownKeysOnly = reader->GetBoolean("known_keys_only", false);
model->logChat = reader->GetBoolean("log_chat", false);
model->logServerActions = reader->GetBoolean("log_server_actions", false);
model->pauseServerIfNoClients = reader->GetBoolean("pause_server_if_no_clients", false);
model->desyncDebugging = reader->GetBoolean("desync_debugging", false);
}
}
@@ -499,26 +499,26 @@ namespace OpenRCT2::Config
{
auto model = &_config.network;
writer->WriteSection("network");
writer->WriteString("player_name", model->PlayerName);
writer->WriteInt32("default_port", model->DefaultPort);
writer->WriteString("listen_address", model->ListenAddress);
writer->WriteString("default_password", model->DefaultPassword);
writer->WriteBoolean("stay_connected", model->StayConnected);
writer->WriteBoolean("advertise", model->Advertise);
writer->WriteString("advertise_address", model->AdvertiseAddress);
writer->WriteInt32("maxplayers", model->Maxplayers);
writer->WriteString("server_name", model->ServerName);
writer->WriteString("server_description", model->ServerDescription);
writer->WriteString("server_greeting", model->ServerGreeting);
writer->WriteString("master_server_url", model->MasterServerUrl);
writer->WriteString("provider_name", model->ProviderName);
writer->WriteString("provider_email", model->ProviderEmail);
writer->WriteString("provider_website", model->ProviderWebsite);
writer->WriteBoolean("known_keys_only", model->KnownKeysOnly);
writer->WriteBoolean("log_chat", model->LogChat);
writer->WriteBoolean("log_server_actions", model->LogServerActions);
writer->WriteBoolean("pause_server_if_no_clients", model->PauseServerIfNoClients);
writer->WriteBoolean("desync_debugging", model->DesyncDebugging);
writer->WriteString("player_name", model->playerName);
writer->WriteInt32("default_port", model->defaultPort);
writer->WriteString("listen_address", model->listenAddress);
writer->WriteString("default_password", model->defaultPassword);
writer->WriteBoolean("stay_connected", model->stayConnected);
writer->WriteBoolean("advertise", model->advertise);
writer->WriteString("advertise_address", model->advertiseAddress);
writer->WriteInt32("maxplayers", model->maxplayers);
writer->WriteString("server_name", model->serverName);
writer->WriteString("server_description", model->serverDescription);
writer->WriteString("server_greeting", model->serverGreeting);
writer->WriteString("master_server_url", model->masterServerUrl);
writer->WriteString("provider_name", model->providerName);
writer->WriteString("provider_email", model->providerEmail);
writer->WriteString("provider_website", model->providerWebsite);
writer->WriteBoolean("known_keys_only", model->knownKeysOnly);
writer->WriteBoolean("log_chat", model->logChat);
writer->WriteBoolean("log_server_actions", model->logServerActions);
writer->WriteBoolean("pause_server_if_no_clients", model->pauseServerIfNoClients);
writer->WriteBoolean("desync_debugging", model->desyncDebugging);
}
static void ReadNotifications(IIniReader* reader)
@@ -526,24 +526,24 @@ namespace OpenRCT2::Config
if (reader->ReadSection("notifications"))
{
auto model = &_config.notifications;
model->ParkAward = reader->GetBoolean("park_award", true);
model->ParkMarketingCampaignFinished = reader->GetBoolean("park_marketing_campaign_finished", true);
model->ParkWarnings = reader->GetBoolean("park_warnings", true);
model->ParkRatingWarnings = reader->GetBoolean("park_rating_warnings", true);
model->RideBrokenDown = reader->GetBoolean("ride_broken_down", true);
model->RideCrashed = reader->GetBoolean("ride_crashed", true);
model->RideCasualties = reader->GetBoolean("ride_casualties", true);
model->RideWarnings = reader->GetBoolean("ride_warnings", true);
model->RideResearched = reader->GetBoolean("ride_researched", true);
model->RideStalledVehicles = reader->GetBoolean("ride_stalled_vehicles", true);
model->GuestWarnings = reader->GetBoolean("guest_warnings", true);
model->GuestLeftPark = reader->GetBoolean("guest_left_park", true);
model->GuestQueuingForRide = reader->GetBoolean("guest_queuing_for_ride", true);
model->GuestOnRide = reader->GetBoolean("guest_on_ride", true);
model->GuestLeftRide = reader->GetBoolean("guest_left_ride", true);
model->GuestBoughtItem = reader->GetBoolean("guest_bought_item", true);
model->GuestUsedFacility = reader->GetBoolean("guest_used_facility", true);
model->GuestDied = reader->GetBoolean("guest_died", true);
model->parkAward = reader->GetBoolean("park_award", true);
model->parkMarketingCampaignFinished = reader->GetBoolean("park_marketing_campaign_finished", true);
model->parkWarnings = reader->GetBoolean("park_warnings", true);
model->parkRatingWarnings = reader->GetBoolean("park_rating_warnings", true);
model->rideBrokenDown = reader->GetBoolean("ride_broken_down", true);
model->rideCrashed = reader->GetBoolean("ride_crashed", true);
model->rideCasualties = reader->GetBoolean("ride_casualties", true);
model->rideWarnings = reader->GetBoolean("ride_warnings", true);
model->rideResearched = reader->GetBoolean("ride_researched", true);
model->rideStalledVehicles = reader->GetBoolean("ride_stalled_vehicles", true);
model->guestWarnings = reader->GetBoolean("guest_warnings", true);
model->guestLeftPark = reader->GetBoolean("guest_left_park", true);
model->guestQueuingForRide = reader->GetBoolean("guest_queuing_for_ride", true);
model->guestOnRide = reader->GetBoolean("guest_on_ride", true);
model->guestLeftRide = reader->GetBoolean("guest_left_ride", true);
model->guestBoughtItem = reader->GetBoolean("guest_bought_item", true);
model->guestUsedFacility = reader->GetBoolean("guest_used_facility", true);
model->guestDied = reader->GetBoolean("guest_died", true);
}
}
@@ -551,24 +551,24 @@ namespace OpenRCT2::Config
{
auto model = &_config.notifications;
writer->WriteSection("notifications");
writer->WriteBoolean("park_award", model->ParkAward);
writer->WriteBoolean("park_marketing_campaign_finished", model->ParkMarketingCampaignFinished);
writer->WriteBoolean("park_warnings", model->ParkWarnings);
writer->WriteBoolean("park_rating_warnings", model->ParkRatingWarnings);
writer->WriteBoolean("ride_broken_down", model->RideBrokenDown);
writer->WriteBoolean("ride_crashed", model->RideCrashed);
writer->WriteBoolean("ride_casualties", model->RideCasualties);
writer->WriteBoolean("ride_warnings", model->RideWarnings);
writer->WriteBoolean("ride_researched", model->RideResearched);
writer->WriteBoolean("ride_stalled_vehicles", model->RideStalledVehicles);
writer->WriteBoolean("guest_warnings", model->GuestWarnings);
writer->WriteBoolean("guest_left_park", model->GuestLeftPark);
writer->WriteBoolean("guest_queuing_for_ride", model->GuestQueuingForRide);
writer->WriteBoolean("guest_on_ride", model->GuestOnRide);
writer->WriteBoolean("guest_left_ride", model->GuestLeftRide);
writer->WriteBoolean("guest_bought_item", model->GuestBoughtItem);
writer->WriteBoolean("guest_used_facility", model->GuestUsedFacility);
writer->WriteBoolean("guest_died", model->GuestDied);
writer->WriteBoolean("park_award", model->parkAward);
writer->WriteBoolean("park_marketing_campaign_finished", model->parkMarketingCampaignFinished);
writer->WriteBoolean("park_warnings", model->parkWarnings);
writer->WriteBoolean("park_rating_warnings", model->parkRatingWarnings);
writer->WriteBoolean("ride_broken_down", model->rideBrokenDown);
writer->WriteBoolean("ride_crashed", model->rideCrashed);
writer->WriteBoolean("ride_casualties", model->rideCasualties);
writer->WriteBoolean("ride_warnings", model->rideWarnings);
writer->WriteBoolean("ride_researched", model->rideResearched);
writer->WriteBoolean("ride_stalled_vehicles", model->rideStalledVehicles);
writer->WriteBoolean("guest_warnings", model->guestWarnings);
writer->WriteBoolean("guest_left_park", model->guestLeftPark);
writer->WriteBoolean("guest_queuing_for_ride", model->guestQueuingForRide);
writer->WriteBoolean("guest_on_ride", model->guestOnRide);
writer->WriteBoolean("guest_left_ride", model->guestLeftRide);
writer->WriteBoolean("guest_bought_item", model->guestBoughtItem);
writer->WriteBoolean("guest_used_facility", model->guestUsedFacility);
writer->WriteBoolean("guest_died", model->guestDied);
}
static void ReadFont(IIniReader* reader)
@@ -576,20 +576,20 @@ namespace OpenRCT2::Config
if (reader->ReadSection("font"))
{
auto model = &_config.fonts;
model->FileName = reader->GetString("file_name", "");
model->FontName = reader->GetString("font_name", "");
model->OffsetX = reader->GetInt32("x_offset", false);
model->OffsetY = reader->GetInt32("y_offset", true);
model->SizeTiny = reader->GetInt32("size_tiny", true);
model->SizeSmall = reader->GetInt32("size_small", false);
model->SizeMedium = reader->GetInt32("size_medium", false);
model->SizeBig = reader->GetInt32("size_big", false);
model->HeightTiny = reader->GetInt32("height_tiny", false);
model->HeightSmall = reader->GetInt32("height_small", false);
model->HeightMedium = reader->GetInt32("height_medium", false);
model->HeightBig = reader->GetInt32("height_big", false);
model->EnableHinting = reader->GetBoolean("enable_hinting", true);
model->HintingThreshold = reader->GetInt32("hinting_threshold", false);
model->fileName = reader->GetString("file_name", "");
model->fontName = reader->GetString("font_name", "");
model->offsetX = reader->GetInt32("x_offset", false);
model->offsetY = reader->GetInt32("y_offset", true);
model->sizeTiny = reader->GetInt32("size_tiny", true);
model->sizeSmall = reader->GetInt32("size_small", false);
model->sizeMedium = reader->GetInt32("size_medium", false);
model->sizeBig = reader->GetInt32("size_big", false);
model->heightTiny = reader->GetInt32("height_tiny", false);
model->heightSmall = reader->GetInt32("height_small", false);
model->heightMedium = reader->GetInt32("height_medium", false);
model->heightBig = reader->GetInt32("height_big", false);
model->enableHinting = reader->GetBoolean("enable_hinting", true);
model->hintingThreshold = reader->GetInt32("hinting_threshold", false);
}
}
@@ -597,20 +597,20 @@ namespace OpenRCT2::Config
{
auto model = &_config.fonts;
writer->WriteSection("font");
writer->WriteString("file_name", model->FileName);
writer->WriteString("font_name", model->FontName);
writer->WriteInt32("x_offset", model->OffsetX);
writer->WriteInt32("y_offset", model->OffsetY);
writer->WriteInt32("size_tiny", model->SizeTiny);
writer->WriteInt32("size_small", model->SizeSmall);
writer->WriteInt32("size_medium", model->SizeMedium);
writer->WriteInt32("size_big", model->SizeBig);
writer->WriteInt32("height_tiny", model->HeightTiny);
writer->WriteInt32("height_small", model->HeightSmall);
writer->WriteInt32("height_medium", model->HeightMedium);
writer->WriteInt32("height_big", model->HeightBig);
writer->WriteBoolean("enable_hinting", model->EnableHinting);
writer->WriteInt32("hinting_threshold", model->HintingThreshold);
writer->WriteString("file_name", model->fileName);
writer->WriteString("font_name", model->fontName);
writer->WriteInt32("x_offset", model->offsetX);
writer->WriteInt32("y_offset", model->offsetY);
writer->WriteInt32("size_tiny", model->sizeTiny);
writer->WriteInt32("size_small", model->sizeSmall);
writer->WriteInt32("size_medium", model->sizeMedium);
writer->WriteInt32("size_big", model->sizeBig);
writer->WriteInt32("height_tiny", model->heightTiny);
writer->WriteInt32("height_small", model->heightSmall);
writer->WriteInt32("height_medium", model->heightMedium);
writer->WriteInt32("height_big", model->heightBig);
writer->WriteBoolean("enable_hinting", model->enableHinting);
writer->WriteInt32("hinting_threshold", model->hintingThreshold);
}
static void ReadPlugin(IIniReader* reader)
@@ -618,8 +618,8 @@ namespace OpenRCT2::Config
if (reader->ReadSection("plugin"))
{
auto model = &_config.plugin;
model->EnableHotReloading = reader->GetBoolean("enable_hot_reloading", false);
model->AllowedHosts = reader->GetString("allowed_hosts", "");
model->enableHotReloading = reader->GetBoolean("enable_hot_reloading", false);
model->allowedHosts = reader->GetString("allowed_hosts", "");
}
}
@@ -627,8 +627,8 @@ namespace OpenRCT2::Config
{
auto model = &_config.plugin;
writer->WriteSection("plugin");
writer->WriteBoolean("enable_hot_reloading", model->EnableHotReloading);
writer->WriteString("allowed_hosts", model->AllowedHosts);
writer->WriteBoolean("enable_hot_reloading", model->enableHotReloading);
writer->WriteString("allowed_hosts", model->allowedHosts);
}
bool SetDefaults()
@@ -852,7 +852,7 @@ namespace OpenRCT2::Config
std::string path = FindRCT2Path();
if (!path.empty())
{
Get().general.RCT2Path = path;
Get().general.rct2Path = path;
}
else
{
@@ -950,7 +950,7 @@ namespace OpenRCT2::Config
{
if (Platform::OriginalGameDataExists(possiblePath))
{
Get().general.RCT2Path = possiblePath;
Get().general.rct2Path = possiblePath;
return true;
}
}
@@ -968,7 +968,7 @@ namespace OpenRCT2::Config
std::string rct1Path = FindRCT1Path();
if (!rct1Path.empty())
{
Get().general.RCT1Path = std::move(rct1Path);
Get().general.rct2Path = std::move(rct1Path);
}
return true;
+163 -163
View File
@@ -24,212 +24,212 @@ namespace OpenRCT2::Config
struct General
{
// Paths
u8string RCT1Path;
u8string RCT2Path;
u8string rct1Path;
u8string rct2Path;
// Display
int32_t DefaultDisplay;
int32_t WindowWidth;
int32_t WindowHeight;
int32_t FullscreenMode;
int32_t FullscreenWidth;
int32_t FullscreenHeight;
float WindowScale;
bool InferDisplayDPI;
::DrawingEngine DrawingEngine;
bool UncapFPS;
bool UseVSync;
bool ShowFPS;
std::atomic_uint8_t MultiThreading;
bool MinimizeFullscreenFocusLoss;
bool DisableScreensaver;
int32_t defaultDisplay;
int32_t windowWidth;
int32_t windowHeight;
int32_t fullscreenMode;
int32_t fullscreenWidth;
int32_t fullscreenHeight;
float windowScale;
bool inferDisplayDPI;
::DrawingEngine drawingEngine;
bool uncapFPS;
bool useVSync;
bool showFPS;
std::atomic_uint8_t multiThreading;
bool minimizeFullscreenFocusLoss;
bool disableScreensaver;
// Map rendering
bool LandscapeSmoothing;
bool AlwaysShowGridlines;
VirtualFloorStyles VirtualFloorStyle;
bool DayNightCycle;
bool EnableLightFx;
bool EnableLightFxForVehicles;
bool UpperCaseBanners;
bool RenderWeatherEffects;
bool RenderWeatherGloom;
bool DisableLightningEffect;
bool ShowGuestPurchases;
bool TransparentScreenshot;
bool TransparentWater;
bool landscapeSmoothing;
bool alwaysShowGridlines;
VirtualFloorStyles virtualFloorStyle;
bool dayNightCycle;
bool enableLightFx;
bool enableLightFxForVehicles;
bool upperCaseBanners;
bool renderWeatherEffects;
bool renderWeatherGloom;
bool disableLightningEffect;
bool showGuestPurchases;
bool transparentScreenshot;
bool transparentWater;
bool InvisibleRides;
bool InvisibleVehicles;
bool InvisibleTrees;
bool InvisibleScenery;
bool InvisiblePaths;
bool InvisibleSupports;
bool invisibleRides;
bool invisibleVehicles;
bool invisibleTrees;
bool invisibleScenery;
bool invisiblePaths;
bool invisibleSupports;
// Localisation
int32_t Language;
OpenRCT2::MeasurementFormat MeasurementFormat;
TemperatureUnit TemperatureFormat;
bool ShowHeightAsUnits;
int32_t DateFormat;
CurrencyType CurrencyFormat;
int32_t CustomCurrencyRate;
CurrencyAffix CustomCurrencyAffix;
u8string CustomCurrencySymbol;
int32_t language;
OpenRCT2::MeasurementFormat measurementFormat;
TemperatureUnit temperatureFormat;
bool showHeightAsUnits;
int32_t dateFormat;
CurrencyType currencyFormat;
int32_t customCurrencyRate;
CurrencyAffix customCurrencyAffix;
u8string customCurrencySymbol;
// Controls
bool EdgeScrolling;
int32_t EdgeScrollingSpeed;
bool TrapCursor;
bool InvertViewportDrag;
bool ZoomToCursor;
bool edgeScrolling;
int32_t edgeScrollingSpeed;
bool trapCursor;
bool invertViewportDrag;
bool zoomToCursor;
// Gamepad
int32_t gamepadDeadzone;
float gamepadSensitivity;
// Miscellaneous
bool PlayIntro;
int32_t WindowSnapProximity;
bool SavePluginData;
bool DebuggingTools;
int32_t AutosaveFrequency;
int32_t AutosaveAmount;
bool AutoStaffPlacement;
bool HandymenMowByDefault;
bool AutoOpenShops;
int32_t DefaultInspectionInterval;
int32_t WindowLimit;
bool ScenarioUnlockingEnabled;
bool ScenarioHideMegaPark;
bool ShowRealNamesOfGuests;
bool ShowRealNamesOfStaff;
bool AllowEarlyCompletion;
u8string AssetPackOrder;
u8string EnabledAssetPacks;
bool playIntro;
int32_t windowSnapProximity;
bool savePluginData;
bool debuggingTools;
int32_t autosaveFrequency;
int32_t autosaveAmount;
bool autoStaffPlacement;
bool handymenMowByDefault;
bool autoOpenShops;
int32_t defaultInspectionInterval;
int32_t windowLimit;
bool scenarioUnlockingEnabled;
bool scenarioHideMegaPark;
bool showRealNamesOfGuests;
bool showRealNamesOfStaff;
bool allowEarlyCompletion;
u8string assetPackOrder;
u8string enabledAssetPacks;
// Loading and saving
bool ConfirmationPrompt;
FileBrowserSort LoadSaveSort;
u8string LastSaveGameDirectory;
u8string LastSaveLandscapeDirectory;
u8string LastSaveScenarioDirectory;
u8string LastSaveTrackDirectory;
u8string LastRunVersion;
bool UseNativeBrowseDialog;
int64_t LastVersionCheckTime;
int16_t FileBrowserWidth;
int16_t FileBrowserHeight;
bool FileBrowserShowSizeColumn;
bool FileBrowserShowDateColumn;
ParkPreviewPref FileBrowserPreviewType;
bool confirmationPrompt;
FileBrowserSort loadSaveSort;
u8string lastSaveGameDirectory;
u8string lastSaveLandscapeDirectory;
u8string lastSaveScenarioDirectory;
u8string lastSaveTrackDirectory;
u8string lastRunVersion;
bool useNativeBrowseDialog;
int64_t lastVersionCheckTime;
int16_t fileBrowserWidth;
int16_t fileBrowserHeight;
bool fileBrowserShowSizeColumn;
bool fileBrowserShowDateColumn;
ParkPreviewPref fileBrowserPreviewType;
};
struct Interface
{
bool ToolbarButtonsCentred;
bool ToolbarShowFinances;
bool ToolbarShowResearch;
bool ToolbarShowCheats;
bool ToolbarShowNews;
bool ToolbarShowMute;
bool ToolbarShowChat;
bool ToolbarShowZoom;
bool ToolbarShowRotateAnticlockwise;
bool ConsoleSmallFont;
bool RandomTitleSequence;
u8string CurrentThemePreset;
u8string CurrentTitleSequencePreset;
int32_t ObjectSelectionFilterFlags;
bool toolbarButtonsCentred;
bool toolbarShowFinances;
bool toolbarShowResearch;
bool toolbarShowCheats;
bool toolbarShowNews;
bool toolbarShowMute;
bool toolbarShowChat;
bool toolbarShowZoom;
bool toolbarShowRotateAnticlockwise;
bool consoleSmallFont;
bool randomTitleSequence;
u8string currentThemePreset;
u8string currentTitleSequencePreset;
int32_t objectSelectionFilterFlags;
int32_t scenarioSelectLastTab;
bool scenarioPreviewScreenshots;
bool ListRideVehiclesSeparately;
bool WindowButtonsOnTheLeft;
bool EnlargedUi;
bool TouchEnhancements;
bool listRideVehiclesSeparately;
bool windowButtonsOnTheLeft;
bool enlargedUi;
bool touchEnhancements;
};
struct Sound
{
u8string Device;
bool MasterSoundEnabled;
uint8_t MasterVolume;
TitleMusicKind TitleMusic;
bool SoundEnabled;
uint8_t SoundVolume;
bool RideMusicEnabled;
uint8_t AudioFocus;
bool audio_focus;
u8string device;
bool masterSoundEnabled;
uint8_t masterVolume;
TitleMusicKind titleMusic;
bool soundEnabled;
uint8_t soundVolume;
bool rideMusicEnabled;
uint8_t rideMusicVolume;
bool audioFocus;
};
struct Network
{
u8string PlayerName;
int32_t DefaultPort;
u8string ListenAddress;
u8string DefaultPassword;
bool StayConnected;
bool Advertise;
u8string AdvertiseAddress;
int32_t Maxplayers;
u8string ServerName;
u8string ServerDescription;
u8string ServerGreeting;
u8string MasterServerUrl;
u8string ProviderName;
u8string ProviderEmail;
u8string ProviderWebsite;
bool KnownKeysOnly;
bool LogChat;
bool LogServerActions;
bool PauseServerIfNoClients;
bool DesyncDebugging;
u8string playerName;
int32_t defaultPort;
u8string listenAddress;
u8string defaultPassword;
bool stayConnected;
bool advertise;
u8string advertiseAddress;
int32_t maxplayers;
u8string serverName;
u8string serverDescription;
u8string serverGreeting;
u8string masterServerUrl;
u8string providerName;
u8string providerEmail;
u8string providerWebsite;
bool knownKeysOnly;
bool logChat;
bool logServerActions;
bool pauseServerIfNoClients;
bool desyncDebugging;
};
struct Notification
{
bool ParkAward;
bool ParkMarketingCampaignFinished;
bool ParkWarnings;
bool ParkRatingWarnings;
bool RideBrokenDown;
bool RideCrashed;
bool RideCasualties;
bool RideWarnings;
bool RideResearched;
bool RideStalledVehicles;
bool GuestWarnings;
bool GuestLeftPark;
bool GuestQueuingForRide;
bool GuestOnRide;
bool GuestLeftRide;
bool GuestBoughtItem;
bool GuestUsedFacility;
bool GuestDied;
bool parkAward;
bool parkMarketingCampaignFinished;
bool parkWarnings;
bool parkRatingWarnings;
bool rideBrokenDown;
bool rideCrashed;
bool rideCasualties;
bool rideWarnings;
bool rideResearched;
bool rideStalledVehicles;
bool guestWarnings;
bool guestLeftPark;
bool guestQueuingForRide;
bool guestOnRide;
bool guestLeftRide;
bool guestBoughtItem;
bool guestUsedFacility;
bool guestDied;
};
struct Font
{
u8string FileName;
u8string FontName;
int32_t OffsetX;
int32_t OffsetY;
int32_t SizeTiny;
int32_t SizeSmall;
int32_t SizeMedium;
int32_t SizeBig;
int32_t HeightTiny;
int32_t HeightSmall;
int32_t HeightMedium;
int32_t HeightBig;
bool EnableHinting;
int32_t HintingThreshold;
u8string fileName;
u8string fontName;
int32_t offsetX;
int32_t offsetY;
int32_t sizeTiny;
int32_t sizeSmall;
int32_t sizeMedium;
int32_t sizeBig;
int32_t heightTiny;
int32_t heightSmall;
int32_t heightMedium;
int32_t heightBig;
bool enableHinting;
int32_t hintingThreshold;
};
struct Plugin
{
bool EnableHotReloading;
u8string AllowedHosts;
bool enableHotReloading;
u8string allowedHosts;
};
struct Config
+3 -3
View File
@@ -606,14 +606,14 @@ bool GfxLoadCsg()
{
LOG_VERBOSE("GfxLoadCsg()");
if (Config::Get().general.RCT1Path.empty())
if (Config::Get().general.rct1Path.empty())
{
LOG_VERBOSE(" unable to load CSG, RCT1 path not set");
return false;
}
auto pathHeaderPath = FindCsg1idatAtLocation(Config::Get().general.RCT1Path);
auto pathDataPath = FindCsg1datAtLocation(Config::Get().general.RCT1Path);
auto pathHeaderPath = FindCsg1idatAtLocation(Config::Get().general.rct1Path);
auto pathDataPath = FindCsg1datAtLocation(Config::Get().general.rct1Path);
try
{
auto fileHeader = FileStream(pathHeaderPath, FileMode::open);
+20 -20
View File
@@ -39,7 +39,7 @@ int32_t GfxGetStringWidthNewLined(std::string_view text, FontStyle fontStyle)
FmtString fmt(text);
for (const auto& token : fmt)
{
if (token.kind == FormatToken::Newline || token.kind == FormatToken::NewlineSmall)
if (token.kind == FormatToken::newline || token.kind == FormatToken::newlineSmall)
{
auto width = GfxGetStringWidth(buffer, fontStyle);
if (!maxWidth.has_value() || maxWidth.value() > width)
@@ -221,7 +221,7 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8
}
}
}
else if (token.kind == FormatToken::Newline)
else if (token.kind == FormatToken::newline)
{
buffer.push_back('\0');
@@ -360,7 +360,7 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle)
{
switch (token.kind)
{
case FormatToken::Newline:
case FormatToken::newline:
if (fontStyle == FontStyle::Small || fontStyle == FontStyle::Medium)
{
height += 10;
@@ -374,7 +374,7 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle)
}
height += 18;
break;
case FormatToken::NewlineSmall:
case FormatToken::newlineSmall:
if (fontStyle == FontStyle::Small || fontStyle == FontStyle::Medium)
{
height += 5;
@@ -388,13 +388,13 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle)
}
height += 9;
break;
case FormatToken::FontTiny:
case FormatToken::fontTiny:
fontStyle = FontStyle::Tiny;
break;
case FormatToken::FontMedium:
case FormatToken::fontMedium:
fontStyle = FontStyle::Medium;
break;
case FormatToken::FontSmall:
case FormatToken::fontSmall:
fontStyle = FontStyle::Small;
break;
default:
@@ -533,7 +533,7 @@ static void TTFDrawStringRawTTF(RenderTarget& rt, std::string_view text, TextDra
{
int32_t drawX = info->x + fontDesc->offset_x;
int32_t drawY = info->y + fontDesc->offset_y;
uint8_t hintThresh = Config::Get().fonts.EnableHinting ? fontDesc->hinting_threshold : 0;
uint8_t hintThresh = Config::Get().fonts.enableHinting ? fontDesc->hinting_threshold : 0;
OpenRCT2::Drawing::IDrawingContext* dc = drawingEngine->GetDrawingContext();
dc->DrawTTFBitmap(rt, info, surface, drawX, drawY, hintThresh);
}
@@ -546,51 +546,51 @@ static void TTFProcessFormatCode(RenderTarget& rt, const FmtString::Token& token
{
switch (token.kind)
{
case FormatToken::Move:
case FormatToken::move:
info->x = info->startX + token.parameter;
break;
case FormatToken::Newline:
case FormatToken::newline:
info->x = info->startX;
info->y += FontGetLineHeight(info->FontStyle);
break;
case FormatToken::NewlineSmall:
case FormatToken::newlineSmall:
info->x = info->startX;
info->y += FontGetLineHeightSmall(info->FontStyle);
break;
case FormatToken::FontTiny:
case FormatToken::fontTiny:
info->FontStyle = FontStyle::Tiny;
break;
case FormatToken::FontSmall:
case FormatToken::fontSmall:
info->FontStyle = FontStyle::Small;
break;
case FormatToken::FontMedium:
case FormatToken::fontMedium:
info->FontStyle = FontStyle::Medium;
break;
case FormatToken::OutlineEnable:
case FormatToken::outlineEnable:
info->flags |= TEXT_DRAW_FLAG_OUTLINE;
break;
case FormatToken::OutlineDisable:
case FormatToken::outlineDisable:
info->flags &= ~TEXT_DRAW_FLAG_OUTLINE;
break;
case FormatToken::ColourWindow1:
case FormatToken::colourWindow1:
{
uint16_t flags = info->flags;
ColourCharacterWindow(gCurrentWindowColours[0], &flags, info->palette);
break;
}
case FormatToken::ColourWindow2:
case FormatToken::colourWindow2:
{
uint16_t flags = info->flags;
ColourCharacterWindow(gCurrentWindowColours[1], &flags, info->palette);
break;
}
case FormatToken::ColourWindow3:
case FormatToken::colourWindow3:
{
uint16_t flags = info->flags;
ColourCharacterWindow(gCurrentWindowColours[2], &flags, info->palette);
break;
}
case FormatToken::InlineSprite:
case FormatToken::inlineSprite:
{
auto imageId = ImageId(token.parameter);
auto g1 = GfxGetG1Element(imageId);
+3 -3
View File
@@ -1011,7 +1011,7 @@ void UpdatePaletteEffects()
// Animate the water/lava/chain movement palette
uint32_t shade = 0;
if (Config::Get().general.RenderWeatherGloom)
if (Config::Get().general.renderWeatherGloom)
{
auto paletteId = ClimateGetWeatherGloomPaletteId(getGameState().weatherCurrent);
if (paletteId != FilterPaletteID::paletteNull)
@@ -1113,9 +1113,9 @@ void RefreshVideo()
void ToggleWindowedMode()
{
int32_t rt = Config::Get().general.FullscreenMode == 0 ? 2 : 0;
int32_t rt = Config::Get().general.fullscreenMode == 0 ? 2 : 0;
ContextSetFullscreenMode(rt);
Config::Get().general.FullscreenMode = rt;
Config::Get().general.fullscreenMode = rt;
Config::Save();
}
+2 -2
View File
@@ -22,7 +22,7 @@ class DrawingUniqueLock
public:
DrawingUniqueLock(T& mutex)
: _mutex(mutex)
, _enabled(Config::Get().general.MultiThreading)
, _enabled(Config::Get().general.multiThreading)
{
if (_enabled)
_mutex.lock();
@@ -43,7 +43,7 @@ class DrawingSharedLock
public:
DrawingSharedLock(T& mutex)
: _mutex(mutex)
, _enabled(Config::Get().general.MultiThreading)
, _enabled(Config::Get().general.multiThreading)
{
if (_enabled)
_mutex.lock_shared();
+2 -2
View File
@@ -142,12 +142,12 @@ namespace OpenRCT2::Drawing::LightFx
bool IsAvailable()
{
return _lightfxAvailable && Config::Get().general.EnableLightFx;
return _lightfxAvailable && Config::Get().general.enableLightFx;
}
bool ForVehiclesIsAvailable()
{
return IsAvailable() && Config::Get().general.EnableLightFxForVehicles;
return IsAvailable() && Config::Get().general.enableLightFxForVehicles;
}
void Init()
+2 -2
View File
@@ -143,7 +143,7 @@ static int32_t ScrollingTextGetMatchingOrOldest(
static void ScrollingTextFormat(utf8* dst, size_t size, DrawScrollText* scrollText)
{
if (Config::Get().general.UpperCaseBanners)
if (Config::Get().general.upperCaseBanners)
{
FormatStringToUpper(dst, size, scrollText->string_id, scrollText->string_args);
}
@@ -1585,7 +1585,7 @@ static void ScrollingTextSetBitmapForTTF(
int32_t min_vpos = -fontDesc->offset_y;
int32_t max_vpos = std::min(surface->h - 2, min_vpos + 7);
bool use_hinting = Config::Get().fonts.EnableHinting && fontDesc->hinting_threshold > 0;
bool use_hinting = Config::Get().fonts.enableHinting && fontDesc->hinting_threshold > 0;
for (int32_t x = 0;; x++)
{
+1 -1
View File
@@ -82,7 +82,7 @@ static void TTFToggleHinting(bool)
for (int32_t i = 0; i < FontStyleCount; i++)
{
TTFFontDescriptor* fontDesc = &(gCurrentTTFFontSet->size[i]);
bool use_hinting = Config::Get().fonts.EnableHinting && fontDesc->hinting_threshold;
bool use_hinting = Config::Get().fonts.enableHinting && fontDesc->hinting_threshold;
TTF_SetFontHinting(fontDesc->font, use_hinting ? 1 : 0);
}
+1 -1
View File
@@ -53,7 +53,7 @@ const DrawWeatherFunc DrawSnowFunctions[] = {
*/
void DrawWeather(RenderTarget& rt, IWeatherDrawer* weatherDrawer)
{
if (!Config::Get().general.RenderWeatherEffects)
if (!Config::Get().general.renderWeatherEffects)
return;
uint32_t viewFlags = 0;
+3 -3
View File
@@ -123,7 +123,7 @@ X8DrawingEngine::X8DrawingEngine([[maybe_unused]] Ui::IUiContext& uiContext)
_drawingContext = new X8DrawingContext(this);
_mainRT.DrawingEngine = this;
LightFx::SetAvailable(true);
_lastLightFXenabled = Config::Get().general.EnableLightFx;
_lastLightFXenabled = Config::Get().general.enableLightFx;
}
X8DrawingEngine::~X8DrawingEngine()
@@ -165,11 +165,11 @@ void X8DrawingEngine::BeginDraw()
if (!IntroIsPlaying())
{
// HACK we need to re-configure the bits if light fx has been enabled / disabled
if (_lastLightFXenabled != Config::Get().general.EnableLightFx)
if (_lastLightFXenabled != Config::Get().general.enableLightFx)
{
Resize(_width, _height);
GfxInvalidateScreen();
_lastLightFXenabled = Config::Get().general.EnableLightFx;
_lastLightFXenabled = Config::Get().general.enableLightFx;
}
_weatherDrawer.Restore(_mainRT);
}
+4 -4
View File
@@ -1701,7 +1701,7 @@ static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopI
auto ft = Formatter();
guest.FormatNameTo(ft);
ft.Add<StringId>(shopItemDescriptor.Naming.Indefinite);
if (Config::Get().notifications.GuestBoughtItem)
if (Config::Get().notifications.guestBoughtItem)
{
News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_NOTIFICATION_BOUGHT_X, guest.Id, ft);
}
@@ -3633,7 +3633,7 @@ void PeepUpdateRideLeaveEntranceDefault(Guest& guest, Ride& ride, CoordsXYZD& en
auto ft = Formatter();
ride.formatNameTo(ft);
if (Config::Get().notifications.RideWarnings)
if (Config::Get().notifications.rideWarnings)
{
News::AddItemToQueue(News::ItemType::ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, guest.CurrentRide.ToUnderlying(), ft);
}
@@ -3938,7 +3938,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride)
else
msg_string = STR_PEEP_TRACKING_PEEP_IS_ON_X;
if (Config::Get().notifications.GuestOnRide)
if (Config::Get().notifications.guestOnRide)
{
News::AddItemToQueue(News::ItemType::peepOnRide, msg_string, Id, ft);
}
@@ -5097,7 +5097,7 @@ void Guest::UpdateRideLeaveExit()
FormatNameTo(ft);
ride->formatNameTo(ft);
if (Config::Get().notifications.GuestLeftRide)
if (Config::Get().notifications.guestLeftRide)
{
News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_LEFT_RIDE_X, Id, ft);
}
+1 -1
View File
@@ -192,7 +192,7 @@ void MoneyEffect::Paint(PaintSession& session, int32_t imageDirection) const
return;
}
if (GuestPurchase && !Config::Get().general.ShowGuestPurchases)
if (GuestPurchase && !Config::Get().general.showGuestPurchases)
{
// Don't show the money effect for guest purchases when the option is disabled.
return;
+17 -17
View File
@@ -757,7 +757,7 @@ void Peep::UpdateFalling()
if (Action == PeepActionType::drowning)
return;
if (Config::Get().notifications.GuestDied)
if (Config::Get().notifications.guestDied)
{
auto ft = Formatter();
FormatNameTo(ft);
@@ -1020,7 +1020,7 @@ void PeepProblemWarningsUpdate()
else if (hungerCounter >= kPeepHungerWarningThreshold && hungerCounter >= gameState.park.numGuestsInPark / 16)
{
warningThrottle[0] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::Hungry);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_ARE_HUNGRY, thoughtId, {});
@@ -1032,7 +1032,7 @@ void PeepProblemWarningsUpdate()
else if (thirstCounter >= kPeepThirstWarningThreshold && thirstCounter >= gameState.park.numGuestsInPark / 16)
{
warningThrottle[1] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::Thirsty);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_ARE_THIRSTY, thoughtId, {});
@@ -1044,7 +1044,7 @@ void PeepProblemWarningsUpdate()
else if (toiletCounter >= kPeepToiletWarningThreshold && toiletCounter >= gameState.park.numGuestsInPark / 16)
{
warningThrottle[2] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::Toilet);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_CANT_FIND_TOILET, thoughtId, {});
@@ -1056,7 +1056,7 @@ void PeepProblemWarningsUpdate()
else if (litterCounter >= kPeepLitterWarningThreshold && litterCounter >= gameState.park.numGuestsInPark / 32)
{
warningThrottle[3] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::BadLitter);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_DISLIKE_LITTER, thoughtId, {});
@@ -1068,7 +1068,7 @@ void PeepProblemWarningsUpdate()
else if (disgustCounter >= kPeepDisgustWarningThreshold && disgustCounter >= gameState.park.numGuestsInPark / 32)
{
warningThrottle[4] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::PathDisgusting);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_DISGUSTED_BY_PATHS, thoughtId, {});
@@ -1080,7 +1080,7 @@ void PeepProblemWarningsUpdate()
else if (vandalismCounter >= kPeepVandalismWarningThreshold && vandalismCounter >= gameState.park.numGuestsInPark / 32)
{
warningThrottle[5] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::Vandalism);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_DISLIKE_VANDALISM, thoughtId, {});
@@ -1092,7 +1092,7 @@ void PeepProblemWarningsUpdate()
else if (noexitCounter >= kPeepNoExitWarningThreshold)
{
warningThrottle[6] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::CantFindExit);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_GETTING_LOST_OR_STUCK, thoughtId, {});
@@ -1101,7 +1101,7 @@ void PeepProblemWarningsUpdate()
else if (lostCounter >= kPeepLostWarningThreshold)
{
warningThrottle[6] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
constexpr auto thoughtId = static_cast<uint32_t>(PeepThoughtType::Lost);
News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_GETTING_LOST_OR_STUCK, thoughtId, {});
@@ -1114,7 +1114,7 @@ void PeepProblemWarningsUpdate()
{ // The amount of guests complaining about queue duration is at least 5% of the amount of queuing guests.
// This includes guests who are no longer queuing.
warningThrottle[7] = 4;
if (Config::Get().notifications.GuestWarnings)
if (Config::Get().notifications.guestWarnings)
{
auto rideWithMostQueueComplaints = std::max_element(
queueComplainingGuestsMap.begin(), queueComplainingGuestsMap.end(),
@@ -1145,7 +1145,7 @@ void PeepUpdateCrowdNoise()
if (OpenRCT2::Audio::gGameSoundsOff)
return;
if (!Config::Get().sound.SoundEnabled)
if (!Config::Get().sound.soundEnabled)
return;
if (gLegacyScene == LegacyScene::scenarioEditor)
@@ -1709,7 +1709,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_
auto ft = Formatter();
guest->FormatNameTo(ft);
ride->formatNameTo(ft);
if (Config::Get().notifications.GuestQueuingForRide)
if (Config::Get().notifications.guestQueuingForRide)
{
News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_PEEP_JOINED_QUEUE_FOR_X, guest->Id, ft);
}
@@ -1770,7 +1770,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_
{
auto ft = Formatter();
guest->FormatNameTo(ft);
if (Config::Get().notifications.GuestLeftPark)
if (Config::Get().notifications.guestLeftPark)
{
News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_LEFT_PARK, guest->Id, ft);
}
@@ -2161,7 +2161,7 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords)
auto ft = Formatter();
guest->FormatNameTo(ft);
ride->formatNameTo(ft);
if (Config::Get().notifications.GuestQueuingForRide)
if (Config::Get().notifications.guestQueuingForRide)
{
News::AddItemToQueue(
News::ItemType::peepOnRide, STR_PEEP_TRACKING_PEEP_JOINED_QUEUE_FOR_X, guest->Id, ft);
@@ -2279,7 +2279,7 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords)
StringId string_id = ride->getRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside)
? STR_PEEP_TRACKING_PEEP_IS_IN_X
: STR_PEEP_TRACKING_PEEP_IS_ON_X;
if (Config::Get().notifications.GuestUsedFacility)
if (Config::Get().notifications.guestUsedFacility)
{
News::AddItemToQueue(News::ItemType::peepOnRide, string_id, guest->Id, ft);
}
@@ -2556,12 +2556,12 @@ void PeepUpdateNames()
auto& gameState = getGameState();
auto& config = Config::Get().general;
if (config.ShowRealNamesOfGuests)
if (config.showRealNamesOfGuests)
gameState.park.flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
else
gameState.park.flags &= ~PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
if (config.ShowRealNamesOfStaff)
if (config.showRealNamesOfStaff)
gameState.park.flags |= PARK_FLAGS_SHOW_REAL_STAFF_NAMES;
else
gameState.park.flags &= ~PARK_FLAGS_SHOW_REAL_STAFF_NAMES;
+10 -10
View File
@@ -149,15 +149,15 @@ static bool LoadFont(LocalisationService& localisationService, TTFFontSetDescrip
static bool LoadCustomConfigFont(LocalisationService& localisationService)
{
static TTFFontSetDescriptor TTFFontCustom = { {
{ Config::Get().fonts.FileName.c_str(), Config::Get().fonts.FontName.c_str(), Config::Get().fonts.SizeTiny,
Config::Get().fonts.OffsetX, Config::Get().fonts.OffsetY, Config::Get().fonts.HeightTiny,
Config::Get().fonts.HintingThreshold, nullptr },
{ Config::Get().fonts.FileName.c_str(), Config::Get().fonts.FontName.c_str(), Config::Get().fonts.SizeSmall,
Config::Get().fonts.OffsetX, Config::Get().fonts.OffsetY, Config::Get().fonts.HeightSmall,
Config::Get().fonts.HintingThreshold, nullptr },
{ Config::Get().fonts.FileName.c_str(), Config::Get().fonts.FontName.c_str(), Config::Get().fonts.SizeMedium,
Config::Get().fonts.OffsetX, Config::Get().fonts.OffsetY, Config::Get().fonts.HeightMedium,
Config::Get().fonts.HintingThreshold, nullptr },
{ Config::Get().fonts.fileName.c_str(), Config::Get().fonts.fontName.c_str(), Config::Get().fonts.sizeTiny,
Config::Get().fonts.offsetX, Config::Get().fonts.offsetY, Config::Get().fonts.heightTiny,
Config::Get().fonts.hintingThreshold, nullptr },
{ Config::Get().fonts.fileName.c_str(), Config::Get().fonts.fontName.c_str(), Config::Get().fonts.sizeSmall,
Config::Get().fonts.offsetX, Config::Get().fonts.offsetY, Config::Get().fonts.heightSmall,
Config::Get().fonts.hintingThreshold, nullptr },
{ Config::Get().fonts.fileName.c_str(), Config::Get().fonts.fontName.c_str(), Config::Get().fonts.sizeMedium,
Config::Get().fonts.offsetX, Config::Get().fonts.offsetY, Config::Get().fonts.heightMedium,
Config::Get().fonts.hintingThreshold, nullptr },
} };
TTFDispose();
@@ -177,7 +177,7 @@ void TryLoadFonts(LocalisationService& localisationService)
if (fontFamily != kFamilyOpenRCT2Sprite)
{
if (!Config::Get().fonts.FileName.empty())
if (!Config::Get().fonts.fileName.empty())
{
if (LoadCustomConfigFont(localisationService))
{
+14 -14
View File
@@ -682,7 +682,7 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar
}
else if (argv[0] == "console_small_font")
{
console.WriteFormatLine("console_small_font %d", Config::Get().interface.ConsoleSmallFont);
console.WriteFormatLine("console_small_font %d", Config::Get().interface.consoleSmallFont);
}
else if (argv[0] == "location")
{
@@ -699,19 +699,19 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar
}
else if (argv[0] == "window_scale")
{
console.WriteFormatLine("window_scale %.3f", Config::Get().general.WindowScale);
console.WriteFormatLine("window_scale %.3f", Config::Get().general.windowScale);
}
else if (argv[0] == "window_limit")
{
console.WriteFormatLine("window_limit %d", Config::Get().general.WindowLimit);
console.WriteFormatLine("window_limit %d", Config::Get().general.windowLimit);
}
else if (argv[0] == "render_weather_effects")
{
console.WriteFormatLine("render_weather_effects %d", Config::Get().general.RenderWeatherEffects);
console.WriteFormatLine("render_weather_effects %d", Config::Get().general.renderWeatherEffects);
}
else if (argv[0] == "render_weather_gloom")
{
console.WriteFormatLine("render_weather_gloom %d", Config::Get().general.RenderWeatherGloom);
console.WriteFormatLine("render_weather_gloom %d", Config::Get().general.renderWeatherGloom);
}
else if (argv[0] == "cheat_sandbox_mode")
{
@@ -736,7 +736,7 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar
#ifndef DISABLE_TTF
else if (argv[0] == "enable_hinting")
{
console.WriteFormatLine("enable_hinting %d", Config::Get().fonts.EnableHinting);
console.WriteFormatLine("enable_hinting %d", Config::Get().fonts.enableHinting);
}
#endif
else
@@ -923,7 +923,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar
}
else if (varName == "console_small_font" && InvalidArguments(&invalidArgs, int_valid[0]))
{
Config::Get().interface.ConsoleSmallFont = (int_val[0] != 0);
Config::Get().interface.consoleSmallFont = (int_val[0] != 0);
Config::Save();
console.Execute("get console_small_font");
}
@@ -941,7 +941,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar
else if (varName == "window_scale" && InvalidArguments(&invalidArgs, double_valid[0]))
{
float newScale = static_cast<float>(0.001 * std::trunc(1000 * double_val[0]));
Config::Get().general.WindowScale = std::clamp(newScale, 0.5f, 5.0f);
Config::Get().general.windowScale = std::clamp(newScale, 0.5f, 5.0f);
Config::Save();
GfxInvalidateScreen();
ContextTriggerResize();
@@ -955,13 +955,13 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar
}
else if (varName == "render_weather_effects" && InvalidArguments(&invalidArgs, int_valid[0]))
{
Config::Get().general.RenderWeatherEffects = (int_val[0] != 0);
Config::Get().general.renderWeatherEffects = (int_val[0] != 0);
Config::Save();
console.Execute("get render_weather_effects");
}
else if (varName == "render_weather_gloom" && InvalidArguments(&invalidArgs, int_valid[0]))
{
Config::Get().general.RenderWeatherGloom = (int_val[0] != 0);
Config::Get().general.renderWeatherGloom = (int_val[0] != 0);
Config::Save();
console.Execute("get render_weather_gloom");
}
@@ -1026,7 +1026,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar
#ifndef DISABLE_TTF
else if (varName == "enable_hinting" && InvalidArguments(&invalidArgs, int_valid[0]))
{
Config::Get().fonts.EnableHinting = (int_val[0] != 0);
Config::Get().fonts.enableHinting = (int_val[0] != 0);
Config::Save();
console.Execute("get enable_hinting");
TTFToggleHinting();
@@ -1955,17 +1955,17 @@ void InteractiveConsole::Execute(const std::string& s)
void InteractiveConsole::WriteLine(const std::string& s)
{
WriteLine(s, FormatToken::ColourWindow2);
WriteLine(s, FormatToken::colourWindow2);
}
void InteractiveConsole::WriteLineError(const std::string& s)
{
WriteLine(s, FormatToken::ColourRed);
WriteLine(s, FormatToken::colourRed);
}
void InteractiveConsole::WriteLineWarning(const std::string& s)
{
WriteLine(s, FormatToken::ColourYellow);
WriteLine(s, FormatToken::colourYellow);
}
void InteractiveConsole::WriteFormatLine(const char* format, ...)
+2 -2
View File
@@ -350,7 +350,7 @@ void ScreenshotGiant()
{
viewport.flags = vp->flags;
}
if (Config::Get().general.TransparentScreenshot)
if (Config::Get().general.transparentScreenshot)
{
viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND;
}
@@ -418,7 +418,7 @@ static void ApplyOptions(const ScreenshotOptions* options, Viewport& viewport)
CheatsSet(CheatType::removeLitter);
}
if (options->transparent || Config::Get().general.TransparentScreenshot)
if (options->transparent || Config::Get().general.transparentScreenshot)
{
viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND;
}
+2 -2
View File
@@ -123,10 +123,10 @@ void StdInOutConsole::WriteLine(const std::string& s, FormatToken colourFormat)
std::string formatBegin;
switch (colourFormat)
{
case FormatToken::ColourRed:
case FormatToken::colourRed:
formatBegin = "\033[31m";
break;
case FormatToken::ColourYellow:
case FormatToken::colourYellow:
formatBegin = "\033[33m";
break;
default:
+6 -6
View File
@@ -201,7 +201,7 @@ namespace OpenRCT2
viewport->flags = 0;
viewport->rotation = GetCurrentRotation();
if (Config::Get().general.AlwaysShowGridlines)
if (Config::Get().general.alwaysShowGridlines)
viewport->flags |= VIEWPORT_FLAG_GRIDLINES;
w.viewport = viewport;
viewport->isVisible = w.isVisible;
@@ -889,7 +889,7 @@ namespace OpenRCT2
PaintDrawStructs(session);
if (Config::Get().general.RenderWeatherGloom && !gTrackDesignSaveMode
if (Config::Get().general.renderWeatherGloom && !gTrackDesignSaveMode
&& !(session.ViewFlags & VIEWPORT_FLAG_HIDE_ENTITIES) && !(session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES))
{
ViewportPaintWeatherGloom(session.DPI);
@@ -934,7 +934,7 @@ namespace OpenRCT2
_paintColumns.clear();
bool useMultithreading = Config::Get().general.MultiThreading;
bool useMultithreading = Config::Get().general.multiThreading;
if (useMultithreading && _paintJobs == nullptr)
{
_paintJobs = std::make_unique<JobPool>();
@@ -1172,7 +1172,7 @@ namespace OpenRCT2
WindowBase* mainWindow = WindowGetMain();
if (mainWindow != nullptr)
{
if (!Config::Get().general.AlwaysShowGridlines)
if (!Config::Get().general.alwaysShowGridlines)
{
mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES;
mainWindow->invalidate();
@@ -1989,11 +1989,11 @@ namespace OpenRCT2
int32_t GetHeightMarkerOffset()
{
// Height labels in units
if (Config::Get().general.ShowHeightAsUnits)
if (Config::Get().general.showHeightAsUnits)
return 0;
// Height labels in feet
if (Config::Get().general.MeasurementFormat == MeasurementFormat::Imperial)
if (Config::Get().general.measurementFormat == MeasurementFormat::Imperial)
return 1 * 256;
// Height labels in metres
+3 -3
View File
@@ -209,9 +209,9 @@ static constexpr float kWindowScrollLocations[][2] = {
*/
void WindowSetWindowLimit(int32_t value)
{
int32_t prev = Config::Get().general.WindowLimit;
int32_t prev = Config::Get().general.windowLimit;
int32_t val = std::clamp<int32_t>(value, kWindowLimitMin, kWindowLimitMax);
Config::Get().general.WindowLimit = val;
Config::Get().general.windowLimit = val;
Config::Save();
// Checks if value decreases and then closes surplus
// windows if one sets a limit lower than the number of windows open
@@ -455,7 +455,7 @@ static constexpr float kWindowScrollLocations[][2] = {
w.savedViewPos.y -= v->ViewHeight() / 4;
}
if (Config::Get().general.ZoomToCursor && atCursor)
if (Config::Get().general.zoomToCursor && atCursor)
{
const auto mouseCoords = ContextGetCursorPositionScaled() - v->pos;
const int32_t diffX = (mouseCoords.x - (zoomLevel.ApplyInversedTo(v->ViewWidth()) / 2));
+3 -3
View File
@@ -51,8 +51,8 @@ namespace OpenRCT2
static inline void repositionCloseButton(Widget& closeButton, int32_t windowWidth, bool translucent)
{
auto closeButtonSize = Config::Get().interface.EnlargedUi ? kCloseButtonSizeTouch : kCloseButtonSize;
if (Config::Get().interface.WindowButtonsOnTheLeft)
auto closeButtonSize = Config::Get().interface.enlargedUi ? kCloseButtonSizeTouch : kCloseButtonSize;
if (Config::Get().interface.windowButtonsOnTheLeft)
{
closeButton.left = 2;
closeButton.right = 2 + closeButtonSize;
@@ -146,7 +146,7 @@ namespace OpenRCT2
int16_t WindowBase::getTitleBarTargetHeight() const
{
return Config::Get().interface.EnlargedUi ? kTitleHeightLarge : kTitleHeightNormal;
return Config::Get().interface.enlargedUi ? kTitleHeightLarge : kTitleHeightNormal;
}
int16_t WindowBase::getTitleBarCurrentHeight() const
+26 -26
View File
@@ -21,44 +21,44 @@
namespace OpenRCT2
{
// clang-format off
CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)] = {
{ "GBP", 10, CurrencyAffix::Prefix, u8"£", CurrencyAffix::Suffix, "GBP", STR_POUNDS }, // British Pound
{ "USD", 10, CurrencyAffix::Prefix, u8"$", CurrencyAffix::Prefix, "$", STR_DOLLARS }, // US Dollar
{ "FRF", 10, CurrencyAffix::Suffix, u8"F", CurrencyAffix::Suffix, "F", STR_FRANC }, // French Franc
{ "DEM", 10, CurrencyAffix::Prefix, u8"DM", CurrencyAffix::Prefix, "DM", STR_DEUTSCHE_MARK }, // Deutsche Mark
{ "JPY", 1000, CurrencyAffix::Prefix, u8"¥", CurrencyAffix::Suffix, "YEN", STR_YEN }, // Japanese Yen
{ "ESP", 10, CurrencyAffix::Suffix, u8"Pts", CurrencyAffix::Suffix, "Pts", STR_PESETA }, // Spanish Peseta
{ "ITL", 1000, CurrencyAffix::Prefix, u8"L", CurrencyAffix::Prefix, "L", STR_LIRA }, // Italian Lira
{ "NLG", 10, CurrencyAffix::Prefix, u8"ƒ ", CurrencyAffix::Prefix, "fl.", STR_GUILDERS }, // Dutch Guilder
{ "SEK", 100, CurrencyAffix::Suffix, u8" kr", CurrencyAffix::Suffix, " kr", STR_KRONA }, // Swedish Krona
{ "EUR", 10, CurrencyAffix::Prefix, u8"€", CurrencyAffix::Suffix, "EUR", STR_EUROS }, // Euro
{ "KRW", 10000, CurrencyAffix::Prefix, u8"₩", CurrencyAffix::Prefix, "W", STR_WON }, // South Korean Won
{ "RUB", 1000, CurrencyAffix::Suffix, u8"₽", CurrencyAffix::Prefix, "R ", STR_ROUBLE }, // Russian Rouble
{ "CZK", 100, CurrencyAffix::Suffix, u8" Kč", CurrencyAffix::Suffix, " Kc", STR_CZECH_KORUNA }, // Czech koruna
{ "HKD", 100, CurrencyAffix::Prefix, u8"$", CurrencyAffix::Prefix, "HKD", STR_HONG_KONG_DOLLAR}, // Hong Kong Dollar
{ "TWD", 1000, CurrencyAffix::Prefix, u8"NT$", CurrencyAffix::Prefix, "NT$", STR_NEW_TAIWAN_DOLLAR}, // New Taiwan Dollar
{ "CNY", 100, CurrencyAffix::Prefix, u8"CN¥", CurrencyAffix::Prefix, "CNY", STR_CHINESE_YUAN }, // Chinese Yuan
{ "HUF", 1000, CurrencyAffix::Suffix, u8" Ft", CurrencyAffix::Suffix, " Ft", STR_HUNGARIAN_FORINT}, // Hungarian Forint
{ "CTM", 10, CurrencyAffix::Prefix, u8"Ctm", CurrencyAffix::Prefix, "Ctm", STR_CUSTOM_CURRENCY }, // Customizable currency
CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::count)] = {
{ "GBP", 10, CurrencyAffix::prefix, u8"£", CurrencyAffix::suffix, "GBP", STR_POUNDS }, // British Pound
{ "USD", 10, CurrencyAffix::prefix, u8"$", CurrencyAffix::prefix, "$", STR_DOLLARS }, // US Dollar
{ "FRF", 10, CurrencyAffix::suffix, u8"F", CurrencyAffix::suffix, "F", STR_FRANC }, // French Franc
{ "DEM", 10, CurrencyAffix::prefix, u8"DM", CurrencyAffix::prefix, "DM", STR_DEUTSCHE_MARK }, // Deutsche Mark
{ "JPY", 1000, CurrencyAffix::prefix, u8"¥", CurrencyAffix::suffix, "YEN", STR_YEN }, // Japanese Yen
{ "ESP", 10, CurrencyAffix::suffix, u8"Pts", CurrencyAffix::suffix, "Pts", STR_PESETA }, // Spanish Peseta
{ "ITL", 1000, CurrencyAffix::prefix, u8"L", CurrencyAffix::prefix, "L", STR_LIRA }, // Italian Lira
{ "NLG", 10, CurrencyAffix::prefix, u8"ƒ ", CurrencyAffix::prefix, "fl.", STR_GUILDERS }, // Dutch Guilder
{ "SEK", 100, CurrencyAffix::suffix, u8" kr", CurrencyAffix::suffix, " kr", STR_KRONA }, // Swedish Krona
{ "EUR", 10, CurrencyAffix::prefix, u8"€", CurrencyAffix::suffix, "EUR", STR_EUROS }, // Euro
{ "KRW", 10000, CurrencyAffix::prefix, u8"₩", CurrencyAffix::prefix, "W", STR_WON }, // South Korean Won
{ "RUB", 1000, CurrencyAffix::suffix, u8"₽", CurrencyAffix::prefix, "R ", STR_ROUBLE }, // Russian Rouble
{ "CZK", 100, CurrencyAffix::suffix, u8" Kč", CurrencyAffix::suffix, " Kc", STR_CZECH_KORUNA }, // Czech koruna
{ "HKD", 100, CurrencyAffix::prefix, u8"$", CurrencyAffix::prefix, "HKD", STR_HONG_KONG_DOLLAR}, // Hong Kong Dollar
{ "TWD", 1000, CurrencyAffix::prefix, u8"NT$", CurrencyAffix::prefix, "NT$", STR_NEW_TAIWAN_DOLLAR}, // New Taiwan Dollar
{ "CNY", 100, CurrencyAffix::prefix, u8"CN¥", CurrencyAffix::prefix, "CNY", STR_CHINESE_YUAN }, // Chinese Yuan
{ "HUF", 1000, CurrencyAffix::suffix, u8" Ft", CurrencyAffix::suffix, " Ft", STR_HUNGARIAN_FORINT}, // Hungarian Forint
{ "CTM", 10, CurrencyAffix::prefix, u8"Ctm", CurrencyAffix::prefix, "Ctm", STR_CUSTOM_CURRENCY }, // Customizable currency
};
// clang-format on
void CurrencyLoadCustomCurrencyConfig()
{
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = Config::Get().general.CustomCurrencyRate;
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = Config::Get().general.CustomCurrencyAffix;
if (!Config::Get().general.CustomCurrencySymbol.empty())
CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate = Config::Get().general.customCurrencyRate;
CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode = Config::Get().general.customCurrencyAffix;
if (!Config::Get().general.customCurrencySymbol.empty())
{
String::safeUtf8Copy(
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode,
Config::Get().general.CustomCurrencySymbol.c_str(), kCurrencySymbolMaxSize);
CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode,
Config::Get().general.customCurrencySymbol.c_str(), kCurrencySymbolMaxSize);
}
}
money64 StringToMoney(const char* string_to_monetise)
{
const char* decimal_char = LanguageGetString(STR_LOCALE_DECIMAL_POINT);
const CurrencyDescriptor* currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)];
const CurrencyDescriptor* currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)];
char processedString[128] = {};
Guard::Assert(strlen(string_to_monetise) < sizeof(processedString));
@@ -148,7 +148,7 @@ namespace OpenRCT2
return;
}
const CurrencyDescriptor& currencyDesc = CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)];
const CurrencyDescriptor& currencyDesc = CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)];
const char* sign = amount >= 0 ? "" : "-";
const uint64_t a = std::abs(amount) * currencyDesc.rate;
+1 -1
View File
@@ -35,7 +35,7 @@ namespace OpenRCT2
// List of currency formats
// TODO: refactor into getter
extern CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)];
extern CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::count)];
/**
* Loads custom currency saved parameters into {@link CurrencyDescriptors}'
+21 -21
View File
@@ -16,32 +16,32 @@ namespace OpenRCT2
// List of currencies
enum class CurrencyType : uint8_t
{
Pounds, // British Pound
Dollars, // US Dollar
Franc, // French Franc
DeutscheMark, // Deutsche Mark
Yen, // Japanese Yen
Peseta, // Spanish Peseta
Lira, // Italian Lira
Guilders, // Dutch Gilder
Krona, // Swedish Krona
Euros, // Euro
Won, // South Korean Won
Rouble, // Russian Rouble
CzechKoruna, // Czech koruna
HKD, // Hong Kong Dollar
TWD, // New Taiwan Dollar
Yuan, // Chinese Yuan
Forint, // Hungarian Forint
pounds, // British Pound
dollars, // US Dollar
franc, // French Franc
deutscheMark, // Deutsche Mark
yen, // Japanese Yen
peseta, // Spanish Peseta
lira, // Italian Lira
guilders, // Dutch Gilder
krona, // Swedish Krona
euros, // Euro
won, // South Korean Won
rouble, // Russian Rouble
czechKoruna, // Czech koruna
hongKongDollar, // Hong Kong Dollar
newTaiwanDollar, // New Taiwan Dollar
yuan, // Chinese Yuan
forint, // Hungarian Forint
Custom, // Custom currency
custom, // Custom currency
Count // Last item
count, // Last item
};
enum class CurrencyAffix : uint8_t
{
Prefix,
Suffix
prefix,
suffix
};
} // namespace OpenRCT2
+96 -96
View File
@@ -17,60 +17,60 @@ namespace OpenRCT2
{
// clang-format off
static const EnumMap<FormatToken> FormatTokenMap = {
{ "MOVE_X", FormatToken::Move, },
{ "NEWLINE", FormatToken::Newline, },
{ "NEWLINE_SMALLER", FormatToken::NewlineSmall, },
{ "TINYFONT", FormatToken::FontTiny, },
{ "MEDIUMFONT", FormatToken::FontMedium, },
{ "SMALLFONT", FormatToken::FontSmall, },
{ "OUTLINE", FormatToken::OutlineEnable, },
{ "OUTLINE_OFF", FormatToken::OutlineDisable, },
{ "WINDOW_COLOUR_1", FormatToken::ColourWindow1, },
{ "WINDOW_COLOUR_2", FormatToken::ColourWindow2, },
{ "WINDOW_COLOUR_3", FormatToken::ColourWindow3, },
{ "INLINE_SPRITE", FormatToken::InlineSprite, },
{ "COMMA32", FormatToken::Comma32, },
{ "INT32", FormatToken::Int32, },
{ "COMMA1DP16", FormatToken::Comma1dp16, },
{ "COMMA2DP32", FormatToken::Comma2dp32, },
{ "COMMA16", FormatToken::Comma16, },
{ "UINT16", FormatToken::UInt16, },
{ "CURRENCY2DP", FormatToken::Currency2dp, },
{ "CURRENCY", FormatToken::Currency, },
{ "STRINGID", FormatToken::StringById, },
{ "STRING", FormatToken::String, },
{ "MONTHYEAR", FormatToken::MonthYear, },
{ "MONTHYEAR_SENTENCE", FormatToken::MonthYearSentence, },
{ "MONTH", FormatToken::Month, },
{ "VELOCITY", FormatToken::Velocity, },
{ "POP16", FormatToken::Pop16, },
{ "PUSH16", FormatToken::Push16, },
{ "DURATION", FormatToken::DurationShort, },
{ "REALTIME", FormatToken::DurationLong, },
{ "LENGTH", FormatToken::Length, },
{ "HEIGHT", FormatToken::Height, },
{ "SPRITE", FormatToken::Sprite, },
{ "BLACK", FormatToken::ColourBlack, },
{ "GREY", FormatToken::ColourGrey, },
{ "WHITE", FormatToken::ColourWhite, },
{ "RED", FormatToken::ColourRed, },
{ "GREEN", FormatToken::ColourGreen, },
{ "YELLOW", FormatToken::ColourYellow, },
{ "TOPAZ", FormatToken::ColourTopaz, },
{ "CELADON", FormatToken::ColourCeladon, },
{ "BABYBLUE", FormatToken::ColourBabyBlue, },
{ "PALELAVENDER", FormatToken::ColourPaleLavender, },
{ "PALEGOLD", FormatToken::ColourPaleGold, },
{ "LIGHTPINK", FormatToken::ColourLightPink, },
{ "PEARLAQUA", FormatToken::ColourPearlAqua, },
{ "PALESILVER", FormatToken::ColourPaleSilver, },
{ "MOVE_X", FormatToken::move, },
{ "NEWLINE", FormatToken::newline, },
{ "NEWLINE_SMALLER", FormatToken::newlineSmall, },
{ "TINYFONT", FormatToken::fontTiny, },
{ "MEDIUMFONT", FormatToken::fontMedium, },
{ "SMALLFONT", FormatToken::fontSmall, },
{ "OUTLINE", FormatToken::outlineEnable, },
{ "OUTLINE_OFF", FormatToken::outlineDisable, },
{ "WINDOW_COLOUR_1", FormatToken::colourWindow1, },
{ "WINDOW_COLOUR_2", FormatToken::colourWindow2, },
{ "WINDOW_COLOUR_3", FormatToken::colourWindow3, },
{ "INLINE_SPRITE", FormatToken::inlineSprite, },
{ "COMMA32", FormatToken::comma32, },
{ "INT32", FormatToken::int32, },
{ "COMMA1DP16", FormatToken::comma1dp16, },
{ "COMMA2DP32", FormatToken::comma2dp32, },
{ "COMMA16", FormatToken::comma16, },
{ "UINT16", FormatToken::uint16, },
{ "CURRENCY2DP", FormatToken::currency2dp, },
{ "CURRENCY", FormatToken::currency, },
{ "STRINGID", FormatToken::stringById, },
{ "STRING", FormatToken::string, },
{ "MONTHYEAR", FormatToken::monthYear, },
{ "MONTHYEAR_SENTENCE", FormatToken::monthYearSentence, },
{ "MONTH", FormatToken::month, },
{ "VELOCITY", FormatToken::velocity, },
{ "POP16", FormatToken::pop16, },
{ "PUSH16", FormatToken::push16, },
{ "DURATION", FormatToken::durationShort, },
{ "REALTIME", FormatToken::durationLong, },
{ "LENGTH", FormatToken::length, },
{ "HEIGHT", FormatToken::height, },
{ "SPRITE", FormatToken::sprite, },
{ "BLACK", FormatToken::colourBlack, },
{ "GREY", FormatToken::colourGrey, },
{ "WHITE", FormatToken::colourWhite, },
{ "RED", FormatToken::colourRed, },
{ "GREEN", FormatToken::colourGreen, },
{ "YELLOW", FormatToken::colourYellow, },
{ "TOPAZ", FormatToken::colourTopaz, },
{ "CELADON", FormatToken::colourCeladon, },
{ "BABYBLUE", FormatToken::colourBabyBlue, },
{ "PALELAVENDER", FormatToken::colourPaleLavender, },
{ "PALEGOLD", FormatToken::colourPaleGold, },
{ "LIGHTPINK", FormatToken::colourLightPink, },
{ "PEARLAQUA", FormatToken::colourPearlAqua, },
{ "PALESILVER", FormatToken::colourPaleSilver, },
};
// clang-format on
FormatToken FormatTokenFromString(std::string_view token)
{
auto result = FormatTokenMap.find(token);
return result != std::end(FormatTokenMap) ? result->second : FormatToken::Unknown;
return result != std::end(FormatTokenMap) ? result->second : FormatToken::unknown;
}
std::string FormatTokenToString(FormatToken token)
@@ -91,25 +91,25 @@ namespace OpenRCT2
{
switch (token)
{
case FormatToken::Comma32:
case FormatToken::Int32:
case FormatToken::Comma1dp16:
case FormatToken::Comma2dp32:
case FormatToken::Comma16:
case FormatToken::UInt16:
case FormatToken::Currency2dp:
case FormatToken::Currency:
case FormatToken::StringById:
case FormatToken::String:
case FormatToken::MonthYear:
case FormatToken::MonthYearSentence:
case FormatToken::Month:
case FormatToken::Velocity:
case FormatToken::DurationShort:
case FormatToken::DurationLong:
case FormatToken::Length:
case FormatToken::Height:
case FormatToken::Sprite:
case FormatToken::comma32:
case FormatToken::int32:
case FormatToken::comma1dp16:
case FormatToken::comma2dp32:
case FormatToken::comma16:
case FormatToken::uint16:
case FormatToken::currency2dp:
case FormatToken::currency:
case FormatToken::stringById:
case FormatToken::string:
case FormatToken::monthYear:
case FormatToken::monthYearSentence:
case FormatToken::month:
case FormatToken::velocity:
case FormatToken::durationShort:
case FormatToken::durationLong:
case FormatToken::length:
case FormatToken::height:
case FormatToken::sprite:
return true;
default:
return false;
@@ -120,20 +120,20 @@ namespace OpenRCT2
{
switch (token)
{
case FormatToken::ColourBlack:
case FormatToken::ColourGrey:
case FormatToken::ColourWhite:
case FormatToken::ColourRed:
case FormatToken::ColourGreen:
case FormatToken::ColourYellow:
case FormatToken::ColourTopaz:
case FormatToken::ColourCeladon:
case FormatToken::ColourBabyBlue:
case FormatToken::ColourPaleLavender:
case FormatToken::ColourPaleGold:
case FormatToken::ColourLightPink:
case FormatToken::ColourPearlAqua:
case FormatToken::ColourPaleSilver:
case FormatToken::colourBlack:
case FormatToken::colourGrey:
case FormatToken::colourWhite:
case FormatToken::colourRed:
case FormatToken::colourGreen:
case FormatToken::colourYellow:
case FormatToken::colourTopaz:
case FormatToken::colourCeladon:
case FormatToken::colourBabyBlue:
case FormatToken::colourPaleLavender:
case FormatToken::colourPaleGold:
case FormatToken::colourLightPink:
case FormatToken::colourPearlAqua:
case FormatToken::colourPaleSilver:
return true;
default:
return false;
@@ -142,7 +142,7 @@ namespace OpenRCT2
TextColour FormatTokenToTextColour(FormatToken token)
{
uint8_t value = EnumValue(token) - EnumValue(FormatToken::ColourBlack);
uint8_t value = EnumValue(token) - EnumValue(FormatToken::colourBlack);
if (value >= kNumTextColours)
return TextColour::black;
@@ -152,20 +152,20 @@ namespace OpenRCT2
FormatToken FormatTokenFromTextColour(TextColour textColour)
{
static constexpr FormatToken tokens[] = {
FormatToken::ColourBlack, // TextColour::black
FormatToken::ColourGrey, // TextColour::grey
FormatToken::ColourWhite, // TextColour::white
FormatToken::ColourRed, // TextColour::red
FormatToken::ColourGreen, // TextColour::green
FormatToken::ColourYellow, // TextColour::yellow
FormatToken::ColourTopaz, // TextColour::topaz
FormatToken::ColourCeladon, // TextColour::celadon
FormatToken::ColourBabyBlue, // TextColour::babyBlue
FormatToken::ColourPaleLavender, // TextColour::paleLavender
FormatToken::ColourPaleGold, // TextColour::paleGold
FormatToken::ColourLightPink, // TextColour::lightPink
FormatToken::ColourPearlAqua, // TextColour::pearlAqua
FormatToken::ColourPaleSilver, // TextColour::paleSilver
FormatToken::colourBlack, // TextColour::black
FormatToken::colourGrey, // TextColour::grey
FormatToken::colourWhite, // TextColour::white
FormatToken::colourRed, // TextColour::red
FormatToken::colourGreen, // TextColour::green
FormatToken::colourYellow, // TextColour::yellow
FormatToken::colourTopaz, // TextColour::topaz
FormatToken::colourCeladon, // TextColour::celadon
FormatToken::colourBabyBlue, // TextColour::babyBlue
FormatToken::colourPaleLavender, // TextColour::paleLavender
FormatToken::colourPaleGold, // TextColour::paleGold
FormatToken::colourLightPink, // TextColour::lightPink
FormatToken::colourPearlAqua, // TextColour::pearlAqua
FormatToken::colourPaleSilver, // TextColour::paleSilver
};
return tokens[EnumValue(textColour)];
+50 -50
View File
@@ -19,66 +19,66 @@ namespace OpenRCT2
{
enum class FormatToken : uint8_t
{
Unknown,
Literal,
Escaped,
unknown,
literal,
escaped,
Newline,
NewlineSmall,
newline,
newlineSmall,
// With parameters
Move,
InlineSprite,
move,
inlineSprite,
// With arguments
Comma32,
Int32,
Comma1dp16,
Comma2dp32,
Comma16,
UInt16,
Currency2dp,
Currency,
StringById,
String,
MonthYear,
MonthYearSentence,
Month,
Velocity,
DurationShort,
DurationLong,
Length,
Height,
Sprite,
Pop16,
Push16,
comma32,
int32,
comma1dp16,
comma2dp32,
comma16,
uint16,
currency2dp,
currency,
stringById,
string,
monthYear,
monthYearSentence,
month,
velocity,
durationShort,
durationLong,
length,
height,
sprite,
pop16,
push16,
// Colours
ColourWindow1,
ColourWindow2,
ColourWindow3,
ColourBlack,
ColourGrey,
ColourWhite,
ColourRed,
ColourGreen,
ColourYellow,
ColourTopaz,
ColourCeladon,
ColourBabyBlue,
ColourPaleLavender,
ColourPaleGold,
ColourLightPink,
ColourPearlAqua,
ColourPaleSilver,
colourWindow1,
colourWindow2,
colourWindow3,
colourBlack,
colourGrey,
colourWhite,
colourRed,
colourGreen,
colourYellow,
colourTopaz,
colourCeladon,
colourBabyBlue,
colourPaleLavender,
colourPaleGold,
colourLightPink,
colourPearlAqua,
colourPaleSilver,
// Fonts
FontTiny,
FontSmall,
FontMedium,
fontTiny,
fontSmall,
fontMedium,
OutlineEnable,
OutlineDisable,
outlineEnable,
outlineDisable,
};
FormatToken FormatTokenFromString(std::string_view token);
+56 -56
View File
@@ -70,17 +70,17 @@ namespace OpenRCT2
bool FmtString::Token::IsLiteral() const
{
return kind == FormatToken::Literal;
return kind == FormatToken::literal;
}
bool FmtString::Token::IsCodepoint() const
{
return kind == FormatToken::Escaped;
return kind == FormatToken::escaped;
}
codepoint_t FmtString::Token::GetCodepoint() const
{
if (kind == FormatToken::Escaped)
if (kind == FormatToken::escaped)
{
// Assume text is only "{{" or "}}" for now
return text[0];
@@ -137,7 +137,7 @@ namespace OpenRCT2
{
p = *p0;
}
current = Token(FormatToken::Move, str.substr(startIndex, i - startIndex), p);
current = Token(FormatToken::move, str.substr(startIndex, i - startIndex), p);
return;
}
@@ -155,7 +155,7 @@ namespace OpenRCT2
p |= (*p2) << 16;
p |= (*p3) << 24;
}
current = Token(FormatToken::InlineSprite, str.substr(startIndex, i - startIndex), p);
current = Token(FormatToken::inlineSprite, str.substr(startIndex, i - startIndex), p);
return;
}
}
@@ -186,7 +186,7 @@ namespace OpenRCT2
if (sztoken.size() >= 2 && ((sztoken[0] == '{' && sztoken[1] == '{') || (sztoken[0] == '}' && sztoken[1] == '}')))
{
return Token(FormatToken::Escaped, sztoken);
return Token(FormatToken::escaped, sztoken);
}
if (sztoken.size() >= 2 && sztoken[0] == '{' && sztoken[1] != '{')
{
@@ -195,9 +195,9 @@ namespace OpenRCT2
}
if (sztoken == "\n" || sztoken == "\r")
{
return Token(FormatToken::Newline, sztoken);
return Token(FormatToken::newline, sztoken);
}
return Token(FormatToken::Literal, sztoken);
return Token(FormatToken::literal, sztoken);
}
const FmtString::Token* FmtString::iterator::operator->() const
@@ -400,7 +400,7 @@ namespace OpenRCT2
template<size_t TDecimalPlace, bool TDigitSep, typename T>
void FormatCurrency(FormatBuffer& ss, T rawValue)
{
auto currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)];
auto currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)];
auto value = static_cast<int64_t>(rawValue) * currencyDesc->rate;
// Negative sign
@@ -426,7 +426,7 @@ namespace OpenRCT2
}
// Currency symbol prefix
if (affix == CurrencyAffix::Prefix)
if (affix == CurrencyAffix::prefix)
{
ss << symbol;
}
@@ -447,7 +447,7 @@ namespace OpenRCT2
}
// Currency symbol suffix
if (affix == CurrencyAffix::Suffix)
if (affix == CurrencyAffix::suffix)
{
ss << symbol;
}
@@ -504,21 +504,21 @@ namespace OpenRCT2
{
switch (token)
{
case FormatToken::UInt16:
case FormatToken::Int32:
case FormatToken::uint16:
case FormatToken::int32:
if constexpr (std::is_integral<T>())
{
FormatNumber<0, false>(ss, arg);
}
break;
case FormatToken::Comma16:
case FormatToken::Comma32:
case FormatToken::comma16:
case FormatToken::comma32:
if constexpr (std::is_integral<T>())
{
FormatNumber<0, true>(ss, arg);
}
break;
case FormatToken::Comma1dp16:
case FormatToken::comma1dp16:
if constexpr (std::is_integral<T>())
{
FormatNumber<1, true>(ss, arg);
@@ -528,7 +528,7 @@ namespace OpenRCT2
FormatNumber<1, true>(ss, std::round(arg * 10));
}
break;
case FormatToken::Comma2dp32:
case FormatToken::comma2dp32:
if constexpr (std::is_integral<T>())
{
FormatNumber<2, true>(ss, arg);
@@ -538,22 +538,22 @@ namespace OpenRCT2
FormatNumber<2, true>(ss, std::round(arg * 100));
}
break;
case FormatToken::Currency2dp:
case FormatToken::currency2dp:
if constexpr (std::is_integral<T>())
{
FormatCurrency<2, true>(ss, arg);
}
break;
case FormatToken::Currency:
case FormatToken::currency:
if constexpr (std::is_integral<T>())
{
FormatCurrency<0, true>(ss, arg);
}
break;
case FormatToken::Velocity:
case FormatToken::velocity:
if constexpr (std::is_integral<T>())
{
switch (Config::Get().general.MeasurementFormat)
switch (Config::Get().general.measurementFormat)
{
default:
case MeasurementFormat::Imperial:
@@ -568,22 +568,22 @@ namespace OpenRCT2
}
}
break;
case FormatToken::DurationShort:
case FormatToken::durationShort:
if constexpr (std::is_integral<T>())
{
FormatMinutesSeconds(ss, arg);
}
break;
case FormatToken::DurationLong:
case FormatToken::durationLong:
if constexpr (std::is_integral<T>())
{
FormatHoursMinutes(ss, arg);
}
break;
case FormatToken::Length:
case FormatToken::length:
if constexpr (std::is_integral<T>())
{
switch (Config::Get().general.MeasurementFormat)
switch (Config::Get().general.measurementFormat)
{
default:
case MeasurementFormat::Imperial:
@@ -596,11 +596,11 @@ namespace OpenRCT2
}
}
break;
case FormatToken::Height:
case FormatToken::height:
if constexpr (std::is_integral<T>())
{
auto metres = HeightUnitsToMetres(arg);
switch (Config::Get().general.MeasurementFormat)
switch (Config::Get().general.measurementFormat)
{
default:
case MeasurementFormat::Imperial:
@@ -613,16 +613,16 @@ namespace OpenRCT2
}
}
break;
case FormatToken::MonthYear:
case FormatToken::MonthYearSentence:
case FormatToken::monthYear:
case FormatToken::monthYearSentence:
if constexpr (std::is_integral<T>())
{
auto month = DateGetMonth(arg);
auto year = DateGetYear(arg) + 1;
FormatMonthYear(ss, month, year, token == FormatToken::MonthYearSentence);
FormatMonthYear(ss, month, year, token == FormatToken::monthYearSentence);
}
break;
case FormatToken::Month:
case FormatToken::month:
if constexpr (std::is_integral<T>())
{
auto szMonth = LanguageGetString(DateGameMonthNames[DateGetMonth(arg)]);
@@ -632,10 +632,10 @@ namespace OpenRCT2
}
}
break;
case FormatToken::String:
case FormatToken::string:
ss << arg;
break;
case FormatToken::Sprite:
case FormatToken::sprite:
if constexpr (std::is_integral<T>())
{
auto idx = static_cast<uint32_t>(arg);
@@ -720,7 +720,7 @@ namespace OpenRCT2
{
for (const auto& token : fmt)
{
if (token.kind == FormatToken::StringById)
if (token.kind == FormatToken::stringById)
{
if (argIndex < args.size())
{
@@ -760,7 +760,7 @@ namespace OpenRCT2
}
argIndex++;
}
else if (token.kind != FormatToken::Push16 && token.kind != FormatToken::Pop16)
else if (token.kind != FormatToken::push16 && token.kind != FormatToken::pop16)
{
ss << token.text;
}
@@ -798,48 +798,48 @@ namespace OpenRCT2
{
switch (t.kind)
{
case FormatToken::Comma32:
case FormatToken::Int32:
case FormatToken::Comma2dp32:
case FormatToken::Sprite:
case FormatToken::comma32:
case FormatToken::int32:
case FormatToken::comma2dp32:
case FormatToken::sprite:
anyArgs.emplace_back(ReadFromArgs<int32_t>(args));
break;
case FormatToken::Currency2dp:
case FormatToken::Currency:
case FormatToken::currency2dp:
case FormatToken::currency:
anyArgs.emplace_back(ReadFromArgs<int64_t>(args));
break;
case FormatToken::UInt16:
case FormatToken::MonthYear:
case FormatToken::MonthYearSentence:
case FormatToken::Month:
case FormatToken::Velocity:
case FormatToken::DurationShort:
case FormatToken::DurationLong:
case FormatToken::uint16:
case FormatToken::monthYear:
case FormatToken::monthYearSentence:
case FormatToken::month:
case FormatToken::velocity:
case FormatToken::durationShort:
case FormatToken::durationLong:
anyArgs.emplace_back(ReadFromArgs<uint16_t>(args));
break;
case FormatToken::Comma16:
case FormatToken::Length:
case FormatToken::Height:
case FormatToken::Comma1dp16:
case FormatToken::comma16:
case FormatToken::length:
case FormatToken::height:
case FormatToken::comma1dp16:
anyArgs.emplace_back(ReadFromArgs<int16_t>(args));
break;
case FormatToken::StringById:
case FormatToken::stringById:
{
auto stringId = ReadFromArgs<StringId>(args);
anyArgs.emplace_back(stringId);
BuildAnyArgListFromLegacyArgBuffer(GetFmtStringById(stringId), anyArgs, args);
break;
}
case FormatToken::String:
case FormatToken::string:
{
auto sz = ReadFromArgs<const char*>(args);
anyArgs.emplace_back(sz);
break;
}
case FormatToken::Pop16:
case FormatToken::pop16:
args = reinterpret_cast<const char*>(reinterpret_cast<uintptr_t>(args) + 2);
break;
case FormatToken::Push16:
case FormatToken::push16:
args = reinterpret_cast<const char*>(reinterpret_cast<uintptr_t>(args) - 2);
break;
default:
+1 -1
View File
@@ -238,7 +238,7 @@ namespace OpenRCT2
while (!it.eol())
{
auto token = *it++;
if (token.kind == FormatToken::StringById)
if (token.kind == FormatToken::stringById)
{
if constexpr (std::is_integral<TArg0>())
{
+16 -16
View File
@@ -53,22 +53,22 @@ namespace OpenRCT2
enum class RCT2LanguageId : uint8_t
{
EnglishUK,
EnglishUS,
French,
German,
Spanish,
Italian,
Dutch,
Swedish,
Japanese,
Korean,
ChineseSimplified,
ChineseTraditional,
Undefined,
Portuguese,
Blank = 254,
End = 255
englishUK,
englishUS,
french,
german,
spanish,
italian,
dutch,
swedish,
japanese,
korean,
chineseSimplified,
chineseTraditional,
undefined,
portuguese,
blank = 254,
end = 255
};
struct LanguageDescriptor
+18 -18
View File
@@ -85,11 +85,11 @@ StringId AwardGetNews(AwardType type)
/** More than 1/16 of the total guests must be thinking untidy thoughts. */
static bool AwardIsDeservedMostUntidy(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::MostBeautiful))
if (activeAwardTypes & EnumToFlag(AwardType::mostBeautiful))
return false;
if (activeAwardTypes & EnumToFlag(AwardType::BestStaff))
if (activeAwardTypes & EnumToFlag(AwardType::bestStaff))
return false;
if (activeAwardTypes & EnumToFlag(AwardType::MostTidy))
if (activeAwardTypes & EnumToFlag(AwardType::mostTidy))
return false;
uint32_t negativeCount = 0;
@@ -115,9 +115,9 @@ static bool AwardIsDeservedMostUntidy(GameState_t& gameState, int32_t activeAwar
/** More than 1/64 of the total guests must be thinking tidy thoughts and less than 6 guests thinking untidy thoughts. */
static bool AwardIsDeservedMostTidy(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::MostUntidy))
if (activeAwardTypes & EnumToFlag(AwardType::mostUntidy))
return false;
if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing))
if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing))
return false;
uint32_t positiveCount = 0;
@@ -176,10 +176,10 @@ static bool AwardIsDeservedBestValue(GameState_t& gameState, int32_t activeAward
{
auto& park = gameState.park;
if (activeAwardTypes & EnumToFlag(AwardType::WorstValue))
if (activeAwardTypes & EnumToFlag(AwardType::worstValue))
return false;
if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing))
if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing))
return false;
if ((park.flags & PARK_FLAGS_NO_MONEY) || !Park::EntranceFeeUnlocked())
@@ -197,9 +197,9 @@ static bool AwardIsDeservedBestValue(GameState_t& gameState, int32_t activeAward
/** More than 1/128 of the total guests must be thinking scenic thoughts and fewer than 16 untidy thoughts. */
static bool AwardIsDeservedMostBeautiful(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::MostUntidy))
if (activeAwardTypes & EnumToFlag(AwardType::mostUntidy))
return false;
if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing))
if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing))
return false;
uint32_t positiveCount = 0;
@@ -232,7 +232,7 @@ static bool AwardIsDeservedWorstValue(GameState_t& gameState, int32_t activeAwar
{
auto& park = gameState.park;
if (activeAwardTypes & EnumToFlag(AwardType::BestValue))
if (activeAwardTypes & EnumToFlag(AwardType::bestValue))
return false;
if (park.flags & PARK_FLAGS_NO_MONEY)
return false;
@@ -277,7 +277,7 @@ static bool AwardIsDeservedSafest(GameState_t& gameState, [[maybe_unused]] int32
/** All staff types, at least 20 staff, one staff per 32 peeps. */
static bool AwardIsDeservedBestStaff(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::MostUntidy))
if (activeAwardTypes & EnumToFlag(AwardType::mostUntidy))
return false;
auto staffCount = gameState.entities.GetEntityListCount(EntityType::staff);
@@ -289,7 +289,7 @@ static bool AwardIsDeservedBestStaff(GameState_t& gameState, int32_t activeAward
/** At least 7 shops, 4 unique, one shop per 128 guests and no more than 12 hungry guests. */
static bool AwardIsDeservedBestFood(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::WorstFood))
if (activeAwardTypes & EnumToFlag(AwardType::worstFood))
return false;
uint32_t shops = 0;
@@ -334,7 +334,7 @@ static bool AwardIsDeservedBestFood(GameState_t& gameState, int32_t activeAwardT
/** No more than 2 unique shops, less than one shop per 256 guests and more than 15 hungry guests. */
static bool AwardIsDeservedWorstFood(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::BestFood))
if (activeAwardTypes & EnumToFlag(AwardType::bestFood))
return false;
uint32_t shops = 0;
@@ -411,7 +411,7 @@ static bool AwardIsDeservedBestToilets(GameState_t& gameState, [[maybe_unused]]
/** More than half of the rides have satisfaction <= 6 and park rating <= 650. */
static bool AwardIsDeservedMostDisappointing(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::BestValue))
if (activeAwardTypes & EnumToFlag(AwardType::bestValue))
return false;
if (gameState.park.rating > 650)
return false;
@@ -466,7 +466,7 @@ static bool AwardIsDeservedBestWaterRides(GameState_t& gameState, [[maybe_unused
/** At least 6 custom designed rides. */
static bool AwardIsDeservedBestCustomDesignedRides(GameState_t& gameState, int32_t activeAwardTypes)
{
if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing))
if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing))
return false;
auto customDesignedRides = 0;
@@ -497,7 +497,7 @@ static bool AwardIsDeservedMostDazzlingRideColours(GameState_t& gameState, int32
COLOUR_BRIGHT_PINK,
};
if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing))
if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing))
return false;
auto countedRides = 0;
@@ -607,7 +607,7 @@ void AwardReset()
static void AwardAdd(AwardType type)
{
getGameState().park.currentAwards.push_back(Award{ 5u, type });
if (Config::Get().notifications.ParkAward)
if (Config::Get().notifications.parkAward)
{
News::AddItemToQueue(News::ItemType::award, AwardGetNews(type), 0, {});
}
@@ -658,7 +658,7 @@ void AwardUpdateAll()
AwardType awardType;
do
{
awardType = static_cast<AwardType>((((ScenarioRand() & 0xFF) * EnumValue(AwardType::Count)) >> 8) & 0xFF);
awardType = static_cast<AwardType>((((ScenarioRand() & 0xFF) * EnumValue(AwardType::count)) >> 8) & 0xFF);
} while (activeAwardTypes & (1 << EnumValue(awardType)));
// Check if award is deserved
+19 -19
View File
@@ -17,26 +17,26 @@
enum class AwardType : uint16_t
{
MostUntidy,
MostTidy,
BestRollerCoasters,
BestValue,
MostBeautiful,
WorstValue,
Safest,
BestStaff,
BestFood,
WorstFood,
BestToilets,
MostDisappointing,
BestWaterRides,
BestCustomDesignedRides,
MostDazzlingRideColours,
MostConfusingLayout,
BestGentleRides,
Count
mostUntidy,
mostTidy,
bestRollerCoasters,
bestValue,
mostBeautiful,
worstValue,
safest,
bestStaff,
bestFood,
worstFood,
bestToilets,
mostDisappointing,
bestWaterRides,
bestCustomDesignedRides,
mostDazzlingRideColours,
mostConfusingLayout,
bestGentleRides,
count,
};
static_assert(static_cast<uint32_t>(AwardType::Count) < 32); // Awards are used in a 32bit bitset
static_assert(static_cast<uint32_t>(AwardType::count) < 32); // Awards are used in a 32bit bitset
struct Award
{
+1 -1
View File
@@ -83,7 +83,7 @@ uint16_t MarketingGetCampaignGuestGenerationProbability(int32_t campaignType)
static void MarketingRaiseFinishedNotification(const MarketingCampaign& campaign)
{
if (Config::Get().notifications.ParkMarketingCampaignFinished)
if (Config::Get().notifications.parkMarketingCampaignFinished)
{
Formatter ft;
// This sets the string parameters for the marketing types that have an argument.
+2 -2
View File
@@ -397,8 +397,8 @@ void News::OpenSubject(News::ItemType type, int32_t subject)
break;
case News::ItemType::research:
{
auto item = ResearchItem(subject, ResearchCategory::Transport, 0);
if (item.type == Research::EntryType::Ride)
auto item = ResearchItem(subject, ResearchCategory::transport, 0);
if (item.type == Research::EntryType::ride)
{
auto intent = Intent(INTENT_ACTION_NEW_RIDE_OF_TYPE);
intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, item.baseRideType);
+12 -12
View File
@@ -198,7 +198,7 @@ void ResearchFinishItem(const ResearchItem& researchItem)
gameState.researchLastItem = researchItem;
ResearchInvalidateRelatedWindows();
if (researchItem.type == Research::EntryType::Ride)
if (researchItem.type == Research::EntryType::ride)
{
// Ride
auto base_ride_type = researchItem.baseRideType;
@@ -270,7 +270,7 @@ void ResearchFinishItem(const ResearchItem& researchItem)
if (!gSilentResearch)
{
if (Config::Get().notifications.RideResearched)
if (Config::Get().notifications.rideResearched)
{
News::AddItemToQueue(News::ItemType::research, availabilityString, researchItem.rawValue, ft);
}
@@ -292,7 +292,7 @@ void ResearchFinishItem(const ResearchItem& researchItem)
if (!gSilentResearch)
{
if (Config::Get().notifications.RideResearched)
if (Config::Get().notifications.rideResearched)
{
News::AddItemToQueue(
News::ItemType::research, STR_NEWS_ITEM_RESEARCH_NEW_SCENERY_SET_AVAILABLE, researchItem.rawValue, ft);
@@ -503,7 +503,7 @@ bool ResearchInsertRideEntry(ride_type_t rideType, ObjectEntryIndex entryIndex,
{
if (rideType != kRideTypeNull && entryIndex != kObjectEntryIndexNull)
{
auto tmpItem = ResearchItem(Research::EntryType::Ride, entryIndex, rideType, category, 0);
auto tmpItem = ResearchItem(Research::EntryType::ride, entryIndex, rideType, category, 0);
ResearchInsert(std::move(tmpItem), researched);
return true;
}
@@ -531,7 +531,7 @@ bool ResearchInsertSceneryGroupEntry(ObjectEntryIndex entryIndex, bool researche
{
if (entryIndex != kObjectEntryIndexNull)
{
auto tmpItem = ResearchItem(Research::EntryType::Scenery, entryIndex, 0, ResearchCategory::SceneryGroup, 0);
auto tmpItem = ResearchItem(Research::EntryType::scenery, entryIndex, 0, ResearchCategory::sceneryGroup, 0);
ResearchInsert(std::move(tmpItem), researched);
return true;
}
@@ -648,7 +648,7 @@ bool SceneryGroupIsInvented(int32_t sgIndex)
return std::none_of(
std::begin(gameState.researchItemsUninvented), std::end(gameState.researchItemsUninvented),
[sgIndex](const ResearchItem& item) {
return item.type == Research::EntryType::Scenery && item.entryIndex == sgIndex;
return item.type == Research::EntryType::scenery && item.entryIndex == sgIndex;
});
}
@@ -723,7 +723,7 @@ void SetEveryRideEntryNotInvented()
*/
StringId ResearchItem::GetName() const
{
if (type == Research::EntryType::Ride)
if (type == Research::EntryType::ride)
{
const auto* rideEntry = GetRideEntryByIndex(entryIndex);
if (rideEntry == nullptr)
@@ -765,7 +765,7 @@ void ResearchRemoveFlags()
static void ResearchRemoveNullItems(std::vector<ResearchItem>& items)
{
const auto it = std::remove_if(std::begin(items), std::end(items), [](const ResearchItem& researchItem) {
if (researchItem.type == Research::EntryType::Ride)
if (researchItem.type == Research::EntryType::ride)
{
return GetRideEntryByIndex(researchItem.entryIndex) == nullptr;
}
@@ -779,7 +779,7 @@ static void ResearchRemoveNullItems(std::vector<ResearchItem>& items)
static void ResearchMarkItemAsResearched(const ResearchItem& item)
{
if (item.type == Research::EntryType::Ride)
if (item.type == Research::EntryType::ride)
{
const auto* rideEntry = GetRideEntryByIndex(item.entryIndex);
if (rideEntry != nullptr)
@@ -794,7 +794,7 @@ static void ResearchMarkItemAsResearched(const ResearchItem& item)
}
}
}
else if (item.type == Research::EntryType::Scenery)
else if (item.type == Research::EntryType::scenery)
{
const auto sgEntry = OpenRCT2::ObjectManager::GetObjectEntry<SceneryGroupEntry>(item.entryIndex);
if (sgEntry != nullptr)
@@ -1031,7 +1031,7 @@ static void ResearchUpdateFirstOfType(ResearchItem* researchItem)
if (researchItem->IsNull())
return;
if (researchItem->type != Research::EntryType::Ride)
if (researchItem->type != Research::EntryType::ride)
return;
auto rideType = researchItem->baseRideType;
@@ -1069,7 +1069,7 @@ void ResearchDetermineFirstOfType()
for (const auto& researchItem : gameState.researchItemsInvented)
{
if (researchItem.type != Research::EntryType::Ride)
if (researchItem.type != Research::EntryType::ride)
continue;
auto rideType = researchItem.baseRideType;
+9 -9
View File
@@ -27,8 +27,8 @@ namespace OpenRCT2::Research
{
enum class EntryType : uint8_t
{
Scenery = 0,
Ride = 1,
scenery = 0,
ride = 1,
};
}
@@ -41,13 +41,13 @@ enum
enum class ResearchCategory : uint8_t
{
Transport = 0,
Gentle = 1,
Rollercoaster = 2,
Thrill = 3,
Water = 4,
Shop = 5,
SceneryGroup = 6,
transport = 0,
gentle = 1,
rollercoaster = 2,
thrill = 3,
water = 4,
shop = 5,
sceneryGroup = 6,
};
struct ResearchItem
+3 -3
View File
@@ -34,7 +34,7 @@ namespace OpenRCT2::Network
{
return static_cast<Permission>(it - Actions.begin());
}
return Permission::Count;
return Permission::count;
}
Permission NetworkActions::FindCommandByPermissionName(const std::string& permission_name)
@@ -46,10 +46,10 @@ namespace OpenRCT2::Network
{
return static_cast<Permission>(it - Actions.begin());
}
return Permission::Count;
return Permission::count;
}
const std::array<NetworkAction, static_cast<size_t>(Permission::Count)> NetworkActions::Actions = {
const std::array<NetworkAction, static_cast<size_t>(Permission::count)> NetworkActions::Actions = {
NetworkAction{
STR_ACTION_CHAT,
"PERMISSION_CHAT",
+25 -25
View File
@@ -20,31 +20,31 @@ namespace OpenRCT2::Network
{
enum class Permission : uint32_t
{
Chat,
Terraform,
SetWaterLevel,
TogglePause,
CreateRide,
RemoveRide,
BuildRide,
RideProperties,
Scenery,
Path,
ClearLandscape,
Guest,
Staff,
ParkProperties,
ParkFunding,
KickPlayer,
ModifyGroups,
SetPlayerGroup,
Cheat,
ToggleSceneryCluster,
PasswordlessLogin,
ModifyTile,
EditScenarioOptions,
chat,
terraform,
setWaterLevel,
togglePause,
createRide,
removeRide,
buildRide,
rideProperties,
scenery,
path,
clearLandscape,
guest,
staff,
parkProperties,
parkFunding,
kickPlayer,
modifyGroups,
setPlayerGroup,
cheat,
toggleSceneryCluster,
passwordlessLogin,
modifyTile,
editScenarioOptions,
Count
count,
};
class NetworkAction final
@@ -58,7 +58,7 @@ namespace OpenRCT2::Network
class NetworkActions final
{
public:
static const std::array<NetworkAction, static_cast<size_t>(Permission::Count)> Actions;
static const std::array<NetworkAction, static_cast<size_t>(Permission::count)> Actions;
static Permission FindCommand(GameCommand command);
static Permission FindCommandByPermissionName(const std::string& permission_name);
+38 -38
View File
@@ -283,7 +283,7 @@ namespace OpenRCT2::Network
// risk of tick collision with the server map and title screen map.
GameActions::SuspendQueue();
auto keyPath = GetPrivateKeyPath(Config::Get().network.PlayerName);
auto keyPath = GetPrivateKeyPath(Config::Get().network.playerName);
if (!File::Exists(keyPath))
{
Console::WriteLine("Generating key... This may take a while");
@@ -311,7 +311,7 @@ namespace OpenRCT2::Network
const std::string hash = _key.PublicKeyHash();
const utf8* publicKeyHash = hash.c_str();
keyPath = GetPublicKeyPath(Config::Get().network.PlayerName, publicKeyHash);
keyPath = GetPublicKeyPath(Config::Get().network.playerName, publicKeyHash);
Console::WriteLine("Key generated, saving public bits as %s", keyPath.c_str());
try
@@ -373,12 +373,12 @@ namespace OpenRCT2::Network
return false;
}
ServerName = Config::Get().network.ServerName;
ServerDescription = Config::Get().network.ServerDescription;
ServerGreeting = Config::Get().network.ServerGreeting;
ServerProviderName = Config::Get().network.ProviderName;
ServerProviderEmail = Config::Get().network.ProviderEmail;
ServerProviderWebsite = Config::Get().network.ProviderWebsite;
ServerName = Config::Get().network.serverName;
ServerDescription = Config::Get().network.serverDescription;
ServerGreeting = Config::Get().network.serverGreeting;
ServerProviderName = Config::Get().network.providerName;
ServerProviderEmail = Config::Get().network.providerEmail;
ServerProviderWebsite = Config::Get().network.providerWebsite;
IsServerPlayerInvisible = gOpenRCT2Headless;
@@ -386,7 +386,7 @@ namespace OpenRCT2::Network
BeginChatLog();
BeginServerLog();
Player* player = AddPlayer(Config::Get().network.PlayerName, "");
Player* player = AddPlayer(Config::Get().network.playerName, "");
player->Flags |= PlayerFlags::kIsServer;
player->Group = 0;
player_id = player->Id;
@@ -407,7 +407,7 @@ namespace OpenRCT2::Network
status = Status::connected;
listening_port = port;
_serverState.gamestateSnapshotsEnabled = Config::Get().network.DesyncDebugging;
_serverState.gamestateSnapshotsEnabled = Config::Get().network.desyncDebugging;
_advertiser = CreateServerAdvertiser(listening_port);
GameLoadScripts();
@@ -863,7 +863,7 @@ namespace OpenRCT2::Network
intent.PutExtra(INTENT_EXTRA_MESSAGE, std::string{ str_desync });
ContextOpenIntent(&intent);
if (!Config::Get().network.StayConnected)
if (!Config::Get().network.stayConnected)
{
Close();
}
@@ -935,12 +935,12 @@ namespace OpenRCT2::Network
std::string NetworkBase::GetMasterServerUrl()
{
if (Config::Get().network.MasterServerUrl.empty())
if (Config::Get().network.masterServerUrl.empty())
{
return kMasterServerURL;
}
return Config::Get().network.MasterServerUrl;
return Config::Get().network.masterServerUrl;
}
NetworkGroup* NetworkBase::AddGroup()
@@ -1059,7 +1059,7 @@ namespace OpenRCT2::Network
// Spectator group
auto spectator = std::make_unique<NetworkGroup>();
spectator->SetName("Spectator");
spectator->ToggleActionPermission(Permission::Chat);
spectator->ToggleActionPermission(Permission::chat);
spectator->Id = 1;
group_list.push_back(std::move(spectator));
@@ -1067,13 +1067,13 @@ namespace OpenRCT2::Network
auto user = std::make_unique<NetworkGroup>();
user->SetName("User");
user->ActionsAllowed.fill(0xFF);
user->ToggleActionPermission(Permission::KickPlayer);
user->ToggleActionPermission(Permission::ModifyGroups);
user->ToggleActionPermission(Permission::SetPlayerGroup);
user->ToggleActionPermission(Permission::Cheat);
user->ToggleActionPermission(Permission::PasswordlessLogin);
user->ToggleActionPermission(Permission::ModifyTile);
user->ToggleActionPermission(Permission::EditScenarioOptions);
user->ToggleActionPermission(Permission::kickPlayer);
user->ToggleActionPermission(Permission::modifyGroups);
user->ToggleActionPermission(Permission::setPlayerGroup);
user->ToggleActionPermission(Permission::cheat);
user->ToggleActionPermission(Permission::passwordlessLogin);
user->ToggleActionPermission(Permission::modifyTile);
user->ToggleActionPermission(Permission::editScenarioOptions);
user->Id = 2;
group_list.push_back(std::move(user));
@@ -1180,7 +1180,7 @@ namespace OpenRCT2::Network
void NetworkBase::AppendChatLog(std::string_view s)
{
if (Config::Get().network.LogChat && _chat_log_fs.is_open())
if (Config::Get().network.logChat && _chat_log_fs.is_open())
{
AppendLog(_chat_log_fs, s);
}
@@ -1218,7 +1218,7 @@ namespace OpenRCT2::Network
void NetworkBase::AppendServerLog(const std::string& s)
{
if (Config::Get().network.LogServerActions && _server_log_fs.is_open())
if (Config::Get().network.logServerActions && _server_log_fs.is_open())
{
AppendLog(_server_log_fs, s);
}
@@ -1670,13 +1670,13 @@ namespace OpenRCT2::Network
json_t NetworkBase::GetServerInfoAsJson() const
{
json_t jsonObj = {
{ "name", Config::Get().network.ServerName },
{ "name", Config::Get().network.serverName },
{ "requiresPassword", _password.size() > 0 },
{ "version", GetVersion() },
{ "players", GetNumVisiblePlayers() },
{ "maxPlayers", Config::Get().network.Maxplayers },
{ "description", Config::Get().network.ServerDescription },
{ "greeting", Config::Get().network.ServerGreeting },
{ "maxPlayers", Config::Get().network.maxplayers },
{ "description", Config::Get().network.serverDescription },
{ "greeting", Config::Get().network.serverGreeting },
{ "dedicated", gOpenRCT2Headless },
};
return jsonObj;
@@ -1690,9 +1690,9 @@ namespace OpenRCT2::Network
// Provider details
json_t jsonProvider = {
{ "name", Config::Get().network.ProviderName },
{ "email", Config::Get().network.ProviderEmail },
{ "website", Config::Get().network.ProviderWebsite },
{ "name", Config::Get().network.providerName },
{ "email", Config::Get().network.providerEmail },
{ "website", Config::Get().network.providerWebsite },
};
jsonObj["provider"] = jsonProvider;
@@ -2212,7 +2212,7 @@ namespace OpenRCT2::Network
void NetworkBase::Client_Handle_TOKEN(Connection& connection, Packet& packet)
{
auto keyPath = GetPrivateKeyPath(Config::Get().network.PlayerName);
auto keyPath = GetPrivateKeyPath(Config::Get().network.playerName);
if (!File::Exists(keyPath))
{
LOG_ERROR("Key file (%s) was not found. Restart client to re-generate it.", keyPath.c_str());
@@ -2255,7 +2255,7 @@ namespace OpenRCT2::Network
// when process dump gets collected at some point in future.
_key.Unload();
Client_Send_AUTH(Config::Get().network.PlayerName, gCustomPassword, pubkey, signature);
Client_Send_AUTH(Config::Get().network.playerName, gCustomPassword, pubkey, signature);
}
void NetworkBase::ServerHandleRequestGamestate(Connection& connection, Packet& packet)
@@ -2688,7 +2688,7 @@ namespace OpenRCT2::Network
if (verified)
{
LOG_VERBOSE("Connection %s: Signature verification ok. Hash %s", hostName, hash.c_str());
if (Config::Get().network.KnownKeysOnly && _userManager.GetUserByHash(hash) == nullptr)
if (Config::Get().network.knownKeysOnly && _userManager.GetUserByHash(hash) == nullptr)
{
LOG_VERBOSE("Connection %s: Hash %s, not known", hostName, hash.c_str());
connection.AuthStatus = Auth::unknownKeyDisallowed;
@@ -2717,7 +2717,7 @@ namespace OpenRCT2::Network
const NetworkGroup* group = GetGroupByID(GetGroupIDByHash(connection.key.PublicKeyHash()));
if (group != nullptr)
{
passwordless = group->CanPerformAction(Permission::PasswordlessLogin);
passwordless = group->CanPerformAction(Permission::passwordlessLogin);
}
}
if (gameversion != GetVersion())
@@ -2744,7 +2744,7 @@ namespace OpenRCT2::Network
}
}
if (GetNumVisiblePlayers() >= Config::Get().network.Maxplayers)
if (GetNumVisiblePlayers() >= Config::Get().network.maxplayers)
{
connection.AuthStatus = Auth::full;
LOG_INFO("Connection %s: Server is full.", hostName);
@@ -2952,7 +2952,7 @@ namespace OpenRCT2::Network
if (connection.player != nullptr)
{
NetworkGroup* group = GetGroupByID(connection.player->Group);
if (group == nullptr || !group->CanPerformAction(Permission::Chat))
if (group == nullptr || !group->CanPerformAction(Permission::chat))
{
return;
}
@@ -3981,7 +3981,7 @@ namespace OpenRCT2::Network
void SendPassword(const std::string& password)
{
auto& network = GetContext()->GetNetwork();
const auto keyPath = GetPrivateKeyPath(Config::Get().network.PlayerName);
const auto keyPath = GetPrivateKeyPath(Config::Get().network.playerName);
if (!File::Exists(keyPath))
{
LOG_ERROR("Private key %s missing! Restart the game to generate it.", keyPath.c_str());
@@ -4004,7 +4004,7 @@ namespace OpenRCT2::Network
// Don't keep private key in memory. There's no need and it may get leaked
// when process dump gets collected at some point in future.
network._key.Unload();
network.Client_Send_AUTH(Config::Get().network.PlayerName, password, pubkey, signature);
network.Client_Send_AUTH(Config::Get().network.playerName, password, pubkey, signature);
}
void SetPassword(const char* password)
+2 -2
View File
@@ -40,7 +40,7 @@ namespace OpenRCT2::Network
const std::string permission = Json::GetString(jsonValue);
Permission action_id = NetworkActions::FindCommandByPermissionName(permission);
if (action_id != Permission::Count)
if (action_id != Permission::count)
{
group.ToggleActionPermission(action_id);
}
@@ -123,7 +123,7 @@ namespace OpenRCT2::Network
bool NetworkGroup::CanPerformCommand(GameCommand command) const
{
Permission action = NetworkActions::FindCommand(command);
if (action != Permission::Count)
if (action != Permission::count)
{
return CanPerformAction(action);
}
@@ -93,7 +93,7 @@ namespace OpenRCT2::Network
{
UpdateLAN();
#ifndef DISABLE_HTTP
if (Config::Get().network.Advertise)
if (Config::Get().network.advertise)
{
UpdateWAN();
}
@@ -183,9 +183,9 @@ namespace OpenRCT2::Network
{ "port", _port },
};
if (!Config::Get().network.AdvertiseAddress.empty())
if (!Config::Get().network.advertiseAddress.empty())
{
body["address"] = Config::Get().network.AdvertiseAddress;
body["address"] = Config::Get().network.advertiseAddress;
}
request.body = body.dump();
@@ -346,9 +346,9 @@ namespace OpenRCT2::Network
static std::string GetMasterServerUrl()
{
std::string result = kMasterServerURL;
if (!Config::Get().network.MasterServerUrl.empty())
if (!Config::Get().network.masterServerUrl.empty())
{
result = Config::Get().network.MasterServerUrl;
result = Config::Get().network.masterServerUrl;
}
return result;
}
+2 -2
View File
@@ -364,9 +364,9 @@ namespace OpenRCT2::Network
auto f = p->get_future();
std::string masterServerUrl = kMasterServerURL;
if (!Config::Get().network.MasterServerUrl.empty())
if (!Config::Get().network.masterServerUrl.empty())
{
masterServerUrl = Config::Get().network.MasterServerUrl;
masterServerUrl = Config::Get().network.masterServerUrl;
}
Http::Request request;
+3 -3
View File
@@ -29,7 +29,7 @@ namespace OpenRCT2
_legacyType.scenery_tab_id = kObjectEntryIndexNull;
stream->Seek(2, OpenRCT2::STREAM_SEEK_CURRENT);
GetStringTable().Read(context, stream, ObjectStringID::NAME);
GetStringTable().Read(context, stream, ObjectStringID::name);
RCTObjectEntry sgEntry = stream->ReadValue<RCTObjectEntry>();
SetPrimarySceneryGroup(ObjectEntryDescriptor(sgEntry));
@@ -39,13 +39,13 @@ namespace OpenRCT2
// Validate properties
if (_legacyType.price <= 0.00_GBP)
{
context->LogError(ObjectError::InvalidProperty, "Price can not be free or negative.");
context->LogError(ObjectError::invalidProperty, "Price can not be free or negative.");
}
// Add banners to 'Signs and items for footpaths' group, rather than lumping them in the Miscellaneous tab.
// Since this is already done the other way round for original items, avoid adding those to prevent duplicates.
auto firstSourceGame = GetFirstSourceGame();
if (firstSourceGame == ObjectSourceGame::Custom)
if (firstSourceGame == ObjectSourceGame::custom)
{
auto scgPathX = Object::GetScgPathXHeader();
SetPrimarySceneryGroup(scgPathX);
Loaded 100 of 168 files, more files were not shown because too many files have changed in this diff. Show more