Merge branch 'develop' into bugfix/block-simulation

This commit is contained in:
kyphii authored and GitHub committed 2025-10-10 13:08:08 -04:00
commit 5e4768c0ff
195 files changed
+3184 -3013

No files matched your search

+21 -1
View File
@@ -3296,7 +3296,7 @@ STR_6237 :Grups
STR_6238 :Opcions multijugador
STR_6239 :Retallat vertical
STR_6240 :Retallat horitzontal
STR_6241 :Seleccioneu una àrea
STR_6241 :Selecciona una àrea
STR_6242 :Esborra la selecció
STR_6243 :Retoca l’atracció,{NEWLINE}fent-la parèixer nova
STR_6244 :No es pot retocar l’atracció…
@@ -3825,3 +3825,23 @@ STR_6781 :Captures de pantalla
STR_6782 :Notificacions de parc
STR_6783 :Notificacions d’atraccions
STR_6784 :Notificacions de visitants
STR_6785 :Comandament de joc
STR_6786 :Zona morta:
STR_6787 :Zona morta del pal analògic (cal moviment mínim)
STR_6788 :Sensitivitat:
STR_6789 :Multiplicador de la sensivitat del pal analògic
STR_6790 :Zona morta {COMMA32} %
STR_6791 :Sensitivitat: {COMMA32} %
STR_6792 :Entrades d’edificis
STR_6793 :Visitants i treballadors
STR_6794 :Decoracions i temes
STR_6795 :{MOVE_X}{10}{STRINGID}
STR_6796 :•{MOVE_X}{10}{STRINGID}
STR_6797 :Sense previsualització
STR_6798 :Captura de pantalla
STR_6799 :Minimapa
STR_7000 :o
STR_7001 :Nom de l’atracció
STR_7002 :{STRINGID} {STRINGID}
STR_7003 :El fitxer d’àudio «{STRING}» està truncat. Mostra esperada de {INT32}, però només n’hi ha {INT32}. Considereu reinstal·lar el RCT2.
STR_7004 :Força que es torni a dibuixar
+2 -1
View File
@@ -2935,7 +2935,7 @@ STR_5835 :게임 밖으로 커서가 나가면 게임에서 소리가 나지
STR_5836 :첫 화면에서 사용할 음악을 선택합니다.{NEWLINE}RCT1 테마를 선택하려면 고급 탭에서 RCT1의 경로를 지정해야 합니다.
STR_5837 :사용자 UI 테마를 생성하고 관리합니다.
STR_5838 :메인 메뉴에 재정 창을 위한 별도의 버튼을 표시합니다.
STR_5839 :메인 매뉴에 연구 및 개발 창을 위한 별도의 버튼을 표시합니다.
STR_5839 :메인 메뉴에 연구 및 개발 창을 위한 별도의 버튼을 표시합니다.
STR_5840 :메인 메뉴에 치트 창을 위한 별도의 버튼을 표시합니다.
STR_5841 :메인 메뉴에 최근 메시지 창을 위한 별도의 버튼을 표시합니다.
STR_5842 :시나리오를 RCT2처럼 난이도별로 정렬하거나, RCT1처럼 게임별로 정렬합니다.
@@ -3842,3 +3842,4 @@ STR_7000 :(또는)
STR_7001 :놀이기구 이름
STR_7002 :{STRINGID} {STRINGID}
STR_7003 :오디오 파일(‘{STRING}’) 데이터가 잘려있습니다. {INT32}개의 데이터가 있어야 하지만 {INT32}개만 존재합니다. RCT2를 재설치해보세요.
STR_7004 :강제 화면 갱신
+21 -1
View File
@@ -7,5 +7,25 @@
[ 9, 74 ]
]
}
}
},
"paths": [
{
"railings": "rct2.footpath_railings.concrete",
"surface": "rct1aa.footpath_surface.queue_red",
"coordinates": [
[ 19, 58, 26 ],
[ 20, 58, 26 ],
[ 21, 58, 26 ],
[ 22, 58, 26 ],
[ 23, 58, 26 ],
[ 23, 57, 26 ],
[ 23, 56, 26 ],
[ 22, 56, 26 ],
[ 21, 56, 26 ],
[ 21, 57, 26 ],
[ 20, 57, 26 ]
],
"queue": true
}
]
}
+7 -1
View File
@@ -22,5 +22,11 @@
[ 95, 25 ]
]
}
}
},
"rides": [
{
"id": 34,
"operation": "swap_entrance_exit"
}
]
}
+21 -1
View File
@@ -7,5 +7,25 @@
[ 9, 74 ]
]
}
}
},
"paths": [
{
"railings": "rct2.footpath_railings.concrete",
"surface": "rct2.footpath_surface.queue_yellow",
"coordinates": [
[ 19, 58, 26 ],
[ 20, 58, 26 ],
[ 21, 58, 26 ],
[ 22, 58, 26 ],
[ 23, 58, 26 ],
[ 23, 57, 26 ],
[ 23, 56, 26 ],
[ 22, 56, 26 ],
[ 21, 56, 26 ],
[ 21, 57, 26 ],
[ 20, 57, 26 ]
],
"queue": true
}
]
}
+28
View File
@@ -17,5 +17,33 @@
[ 126, 73 ]
]
}
],
"paths": [
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.queue_green",
"coordinates": [ [ 51, 58, 16 ] ],
"queue": true
},
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.queue_green",
"coordinates": [ [ 51, 59, 14 ] ],
"slope_direction": 3,
"queue": true
},
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.tarmac_green",
"coordinates": [ [ 50, 58, 16 ] ],
"queue": false
},
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.tarmac_green",
"coordinates": [ [ 50, 59, 14 ] ],
"slope_direction": 3,
"queue": false
}
]
}
+28
View File
@@ -17,5 +17,33 @@
[ 126, 73 ]
]
}
],
"paths": [
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.queue_green",
"coordinates": [ [ 51, 58, 16 ] ],
"queue": true
},
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.queue_green",
"coordinates": [ [ 51, 59, 14 ] ],
"slope_direction": 3,
"queue": true
},
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.tarmac_green",
"coordinates": [ [ 50, 58, 16 ] ],
"queue": false
},
{
"railings": "rct2.footpath_railings.concrete_green",
"surface": "rct2.footpath_surface.tarmac_green",
"coordinates": [ [ 50, 59, 14 ] ],
"slope_direction": 3,
"queue": false
}
]
}
+2
View File
@@ -1,8 +1,10 @@
0.4.28 (in development)
------------------------------------------------------------------------
- Change: [#25089] Peep actions and animations that cause them to stop moving no longer trigger when they are on a level crossing.
- Fix: [#22779, #25330] Incorrect queue paths in Nevermore Park and Six Flags Holland scenarios (bug in the original scenarios).
- Fix: [#25190] Inserting a block brake while a coaster is simulating will cause the simulation to behave strangely.
- Fix: [#25299] The Mine Train Coaster left large helix draws incorrect sprites at certain angles (original bug).
- Fix: [#25328] Spiral Slide in Blackpool Pleasure Beach has its entrance and exit the wrong way round (bug in the original scenario).
0.4.27 (2025-10-04)
------------------------------------------------------------------------
+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;
@@ -57,10 +57,10 @@ namespace OpenRCT2::Scripting
auto range = GetMapRange(value);
if (range)
{
gMapSelectPositionA.x = range->GetLeft();
gMapSelectPositionA.y = range->GetTop();
gMapSelectPositionB.x = range->GetRight();
gMapSelectPositionB.y = range->GetBottom();
gMapSelectPositionA.x = range->GetX1();
gMapSelectPositionA.y = range->GetY1();
gMapSelectPositionB.x = range->GetX2();
gMapSelectPositionB.y = range->GetY2();
gMapSelectType = MapSelectType::full;
gMapSelectFlags.set(MapSelectFlag::enable);
}
+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
+4 -4
View File
@@ -67,8 +67,8 @@ namespace OpenRCT2::GameActions
result.ErrorTitle = STR_UNABLE_TO_REMOVE_ALL_SCENERY_FROM_HERE;
result.Expenditure = ExpenditureType::landscaping;
auto x = (_range.GetLeft() + _range.GetRight()) / 2 + 16;
auto y = (_range.GetTop() + _range.GetBottom()) / 2 + 16;
auto x = (_range.GetX1() + _range.GetX2()) / 2 + 16;
auto y = (_range.GetY1() + _range.GetY2()) / 2 + 16;
auto z = TileElementHeight({ x, y });
result.Position = CoordsXYZ(x, y, z);
@@ -85,9 +85,9 @@ namespace OpenRCT2::GameActions
money64 totalCost = 0;
auto validRange = ClampRangeWithinMap(_range);
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (LocationValid({ x, y }) && MapCanClearAt(gameState, { x, y }))
{
+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
+8 -8
View File
@@ -74,24 +74,24 @@ namespace OpenRCT2::GameActions
MapRange normRange = _range.Normalise();
// Keep big coordinates within map boundaries
auto mapSizeMaxXY = GetMapSizeMaxXY();
auto aX = std::max<decltype(normRange.GetLeft())>(32, normRange.GetLeft());
auto bX = std::min<decltype(normRange.GetRight())>(mapSizeMaxXY.x, normRange.GetRight());
auto aY = std::max<decltype(normRange.GetTop())>(32, normRange.GetTop());
auto bY = std::min<decltype(normRange.GetBottom())>(mapSizeMaxXY.y, normRange.GetBottom());
auto aX = std::max<decltype(normRange.GetX1())>(32, normRange.GetX1());
auto bX = std::min<decltype(normRange.GetX2())>(mapSizeMaxXY.x, normRange.GetX2());
auto aY = std::max<decltype(normRange.GetY1())>(32, normRange.GetY1());
auto bY = std::min<decltype(normRange.GetY2())>(mapSizeMaxXY.y, normRange.GetY2());
MapRange validRange = MapRange{ aX, aY, bX, bY };
CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16,
(validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 };
CoordsXYZ centre{ (validRange.GetX1() + validRange.GetX2()) / 2 + 16,
(validRange.GetY1() + validRange.GetY2()) / 2 + 16, 0 };
centre.z = TileElementHeight(centre);
res.Position = centre;
res.Expenditure = ExpenditureType::landPurchase;
// Game command modified to accept selection size
for (auto y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (auto y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (auto x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (auto x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (!LocationValid({ x, y }))
continue;
+2 -2
View File
@@ -87,9 +87,9 @@ namespace OpenRCT2::GameActions
uint8_t maxHeight = MapGetHighestLandHeight(validRange);
bool withinOwnership = false;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (!LocationValid({ x, y }))
continue;
+2 -2
View File
@@ -88,9 +88,9 @@ namespace OpenRCT2::GameActions
uint8_t minHeight = MapGetLowestLandHeight(validRange);
bool withinOwnership = false;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (!LocationValid({ x, y }))
continue;
+4 -4
View File
@@ -79,8 +79,8 @@ namespace OpenRCT2::GameActions
auto res = Result();
auto validRange = ClampRangeWithinMap(_range.Normalise());
CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16,
(validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 };
CoordsXYZ centre{ (validRange.GetX1() + validRange.GetX2()) / 2 + 16,
(validRange.GetY1() + validRange.GetY2()) / 2 + 16, 0 };
centre.z = TileElementHeight(centre);
res.Position = centre;
@@ -92,9 +92,9 @@ namespace OpenRCT2::GameActions
}
// Game command modified to accept selection size
for (auto y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (auto y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (auto x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (auto x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (!LocationValid({ x, y }))
continue;
+52 -52
View File
@@ -342,10 +342,10 @@ namespace OpenRCT2::GameActions
auto normRange = _range.Normalise();
// Cap bounds to map
auto l = std::max(normRange.GetLeft(), 32);
auto t = std::max(normRange.GetTop(), 32);
auto r = std::clamp(normRange.GetRight(), 0, kMaximumTileStartXY);
auto b = std::clamp(normRange.GetBottom(), 0, kMaximumTileStartXY);
auto l = std::max(normRange.GetX1(), 32);
auto t = std::max(normRange.GetY1(), 32);
auto r = std::clamp(normRange.GetX2(), 0, kMaximumTileStartXY);
auto b = std::clamp(normRange.GetY2(), 0, kMaximumTileStartXY);
auto validRange = MapRange{ l, t, r, b };
int32_t centreZ = TileElementHeight(_coords);
@@ -365,51 +365,51 @@ namespace OpenRCT2::GameActions
// Smooth the 4 corners
{ // top-left
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY1() });
if (surfaceElement != nullptr)
{
int32_t z = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, -32, 0, 2);
}
}
{ // bottom-left
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetBottom() });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY2() });
if (surfaceElement != nullptr)
{
int32_t z = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 3)), minHeight, maxHeight);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetBottom() }, z, -32, 32, 1, 3);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY2() }, z, -32, 32, 1, 3);
}
}
{ // bottom-right
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetBottom() });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX2(), validRange.GetY2() });
if (surfaceElement != nullptr)
{
int32_t z = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 0)), minHeight, maxHeight);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetRight(), validRange.GetBottom() }, z, 32, 32, 2, 0);
gameState, isExecuting, { validRange.GetX2(), validRange.GetY2() }, z, 32, 32, 2, 0);
}
}
{ // top-right
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetTop() });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX2(), validRange.GetY1() });
if (surfaceElement != nullptr)
{
int32_t z = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 1)), minHeight, maxHeight);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetRight(), validRange.GetTop() }, z, 32, -32, 3, 1);
gameState, isExecuting, { validRange.GetX2(), validRange.GetY1() }, z, 32, -32, 3, 1);
}
}
// Smooth the edges
int32_t z1, z2;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), y });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), y });
if (surfaceElement != nullptr)
{
z1 = std::clamp(
@@ -417,10 +417,10 @@ namespace OpenRCT2::GameActions
z2 = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight);
res.Cost += SmoothLandRowByEdge(
gameState, isExecuting, { validRange.GetLeft(), y }, z1, z2, -32, 0, 0, 1, 3, 2);
gameState, isExecuting, { validRange.GetX1(), y }, z1, z2, -32, 0, 0, 1, 3, 2);
}
surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), y });
surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX2(), y });
if (surfaceElement != nullptr)
{
z1 = std::clamp(
@@ -428,13 +428,13 @@ namespace OpenRCT2::GameActions
z2 = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 0)), minHeight, maxHeight);
res.Cost += SmoothLandRowByEdge(
gameState, isExecuting, { validRange.GetRight(), y }, z1, z2, 32, 0, 2, 3, 1, 0);
gameState, isExecuting, { validRange.GetX2(), y }, z1, z2, 32, 0, 2, 3, 1, 0);
}
}
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetTop() });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetY1() });
if (surfaceElement != nullptr)
{
z1 = std::clamp(
@@ -442,10 +442,10 @@ namespace OpenRCT2::GameActions
z2 = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight);
res.Cost += SmoothLandRowByEdge(
gameState, isExecuting, { x, validRange.GetTop() }, z1, z2, 0, -32, 0, 3, 1, 2);
gameState, isExecuting, { x, validRange.GetY1() }, z1, z2, 0, -32, 0, 3, 1, 2);
}
surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetBottom() });
surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetY2() });
if (surfaceElement != nullptr)
{
z1 = std::clamp(
@@ -453,7 +453,7 @@ namespace OpenRCT2::GameActions
z2 = std::clamp(
static_cast<uint8_t>(TileElementGetCornerHeight(surfaceElement, 3)), minHeight, maxHeight);
res.Cost += SmoothLandRowByEdge(
gameState, isExecuting, { x, validRange.GetBottom() }, z1, z2, 0, 32, 1, 2, 0, 3);
gameState, isExecuting, { x, validRange.GetY2() }, z1, z2, 0, 32, 1, 2, 0, 3);
}
}
break;
@@ -463,7 +463,7 @@ namespace OpenRCT2::GameActions
case MapSelectType::corner2:
case MapSelectType::corner3:
{
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY1() });
if (surfaceElement == nullptr)
break;
uint8_t newBaseZ = surfaceElement->BaseHeight;
@@ -488,16 +488,16 @@ namespace OpenRCT2::GameActions
// Smooth the corners
int32_t z = MapGetCornerHeight(newBaseZ, newSlope, 2);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, -32, 0, 2);
z = MapGetCornerHeight(newBaseZ, newSlope, 0);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 32, 2, 0);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 32, 2, 0);
z = MapGetCornerHeight(newBaseZ, newSlope, 3);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 32, 1, 3);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 32, 1, 3);
z = MapGetCornerHeight(newBaseZ, newSlope, 1);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, -32, 3, 1);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, -32, 3, 1);
// Smooth the edges
switch (selectionType)
@@ -505,54 +505,54 @@ namespace OpenRCT2::GameActions
case MapSelectType::corner0:
z = MapGetCornerHeight(newBaseZ, newSlope, 0);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 3, 0);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 3, 0);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 1, 0);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 1, 0);
z = MapGetCornerHeight(newBaseZ, newSlope, 3);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 0, 3);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 0, 3);
z = MapGetCornerHeight(newBaseZ, newSlope, 1);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 0, 1);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 0, 1);
break;
case MapSelectType::corner1:
z = MapGetCornerHeight(newBaseZ, newSlope, 1);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 2, 1);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 2, 1);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 0, 1);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 0, 1);
z = MapGetCornerHeight(newBaseZ, newSlope, 2);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 1, 2);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 1, 2);
z = MapGetCornerHeight(newBaseZ, newSlope, 0);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 1, 0);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 1, 0);
break;
case MapSelectType::corner2:
z = MapGetCornerHeight(newBaseZ, newSlope, 2);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 1, 2);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 1, 2);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 3, 2);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 3, 2);
z = MapGetCornerHeight(newBaseZ, newSlope, 1);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 2, 1);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 2, 1);
z = MapGetCornerHeight(newBaseZ, newSlope, 3);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 2, 3);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 2, 3);
break;
case MapSelectType::corner3:
z = MapGetCornerHeight(newBaseZ, newSlope, 3);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 0, 3);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 0, 3);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 2, 3);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 2, 3);
z = MapGetCornerHeight(newBaseZ, newSlope, 0);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 3, 0);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 3, 0);
z = MapGetCornerHeight(newBaseZ, newSlope, 2);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 3, 2);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 3, 2);
break;
default:
break;
@@ -566,7 +566,7 @@ namespace OpenRCT2::GameActions
{
// TODO: Handle smoothing by edge
// Get the two corners to raise
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() });
auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY1() });
if (surfaceElement == nullptr)
break;
uint8_t newBaseZ = surfaceElement->BaseHeight;
@@ -612,32 +612,32 @@ namespace OpenRCT2::GameActions
uint8_t z4 = MapGetCornerHeight(newBaseZ, newSlope, c4);
// Smooth the edge at the top of the new slope
res.Cost += SmoothLandRowByEdge(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z1, z2, stepOffsets[edge].x,
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z1, z2, stepOffsets[edge].x,
stepOffsets[edge].y, c3, c4, c1, c2);
// Smooth the edge at the bottom of the new slope
res.Cost += SmoothLandRowByEdge(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z3, z4, -stepOffsets[edge].x,
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z3, z4, -stepOffsets[edge].x,
-stepOffsets[edge].y, c1, c2, c3, c4);
// Smooth corners
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z1, -stepOffsets[edge].y,
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z1, -stepOffsets[edge].y,
stepOffsets[edge].x, c2, c1);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z2, stepOffsets[edge].y,
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z2, stepOffsets[edge].y,
-stepOffsets[edge].x, c1, c2);
int32_t z = MapGetCornerHeight(newBaseZ, newSlope, 2);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, -32, 0, 2);
z = MapGetCornerHeight(newBaseZ, newSlope, 0);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 32, 2, 0);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 32, 2, 0);
z = MapGetCornerHeight(newBaseZ, newSlope, 3);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 32, 1, 3);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 32, 1, 3);
z = MapGetCornerHeight(newBaseZ, newSlope, 1);
res.Cost += SmoothLandRowByCorner(
gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, -32, 3, 1);
gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, -32, 3, 1);
break;
}
default:
@@ -70,9 +70,9 @@ namespace OpenRCT2::GameActions
}
auto validRange = ClampRangeWithinMap(_range);
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (!LocationValid({ x, y }))
{
@@ -76,8 +76,8 @@ namespace OpenRCT2::GameActions
}
}
auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16;
auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16;
auto xMid = (validRange.GetX1() + validRange.GetX2()) / 2 + 16;
auto yMid = (validRange.GetY1() + validRange.GetY2()) / 2 + 16;
auto heightMid = TileElementHeight({ xMid, yMid });
res.Position.x = xMid;
@@ -93,10 +93,10 @@ namespace OpenRCT2::GameActions
money64 surfaceCost = 0;
money64 edgeCost = 0;
for (CoordsXY coords = { validRange.GetLeft(), validRange.GetTop() }; coords.x <= validRange.GetRight();
for (CoordsXY coords = { validRange.GetX1(), validRange.GetY1() }; coords.x <= validRange.GetX2();
coords.x += kCoordsXYStep)
{
for (coords.y = validRange.GetTop(); coords.y <= validRange.GetBottom(); coords.y += kCoordsXYStep)
for (coords.y = validRange.GetY1(); coords.y <= validRange.GetY2(); coords.y += kCoordsXYStep)
{
if (!LocationValid(coords))
continue;
@@ -150,8 +150,8 @@ namespace OpenRCT2::GameActions
res.Expenditure = ExpenditureType::landscaping;
auto validRange = ClampRangeWithinMap(_range.Normalise());
auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16;
auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16;
auto xMid = (validRange.GetX1() + validRange.GetX2()) / 2 + 16;
auto yMid = (validRange.GetY1() + validRange.GetY2()) / 2 + 16;
auto heightMid = TileElementHeight({ xMid, yMid });
res.Position.x = xMid;
@@ -160,10 +160,10 @@ namespace OpenRCT2::GameActions
money64 surfaceCost = 0;
money64 edgeCost = 0;
for (CoordsXY coords = { validRange.GetLeft(), validRange.GetTop() }; coords.x <= validRange.GetRight();
for (CoordsXY coords = { validRange.GetX1(), validRange.GetY1() }; coords.x <= validRange.GetX2();
coords.x += kCoordsXYStep)
{
for (coords.y = validRange.GetTop(); coords.y <= validRange.GetBottom(); coords.y += kCoordsXYStep)
for (coords.y = validRange.GetY1(); coords.y <= validRange.GetY2(); coords.y += kCoordsXYStep)
{
if (!LocationValid(coords))
continue;
+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);
+6 -6
View File
@@ -56,8 +56,8 @@ namespace OpenRCT2::GameActions
auto res = Result();
auto validRange = ClampRangeWithinMap(_range);
res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16;
res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16;
res.Position.x = ((validRange.GetX1() + validRange.GetX2()) / 2) + 16;
res.Position.y = ((validRange.GetY1() + validRange.GetY2()) / 2) + 16;
int16_t z = TileElementHeight(res.Position);
int16_t waterHeight = TileElementWaterHeight(res.Position);
if (waterHeight != 0)
@@ -70,9 +70,9 @@ namespace OpenRCT2::GameActions
uint8_t minHeight = GetLowestHeight(gameState, validRange);
bool hasChanged = false;
bool withinOwnership = false;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (!LocationValid({ x, y }))
continue;
@@ -135,9 +135,9 @@ namespace OpenRCT2::GameActions
{
// The lowest height to lower the water to is the highest water level in the selection
uint8_t minHeight{ 0 };
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
+6 -6
View File
@@ -56,8 +56,8 @@ namespace OpenRCT2::GameActions
auto res = Result();
auto validRange = ClampRangeWithinMap(_range);
res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16;
res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16;
res.Position.x = ((validRange.GetX1() + validRange.GetX2()) / 2) + 16;
res.Position.y = ((validRange.GetY1() + validRange.GetY2()) / 2) + 16;
int32_t z = TileElementHeight(res.Position);
int16_t waterHeight = TileElementWaterHeight(res.Position);
if (waterHeight != 0)
@@ -70,9 +70,9 @@ namespace OpenRCT2::GameActions
auto maxHeight = GetHighestHeight(gameState, validRange) / kCoordsZStep;
bool hasChanged = false;
bool withinOwnership = false;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (!LocationValid({ x, y }))
continue;
@@ -148,9 +148,9 @@ namespace OpenRCT2::GameActions
{
// The highest height to raise the water to is the lowest water level in the selection
uint16_t maxHeight = 255 * kCoordsZStep;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep)
for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep)
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep)
{
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
+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
+5 -6
View File
@@ -422,10 +422,10 @@ struct DataSerializerTraitsT<MapRange>
{
static void encode(OpenRCT2::IStream* stream, const MapRange& v)
{
stream->WriteValue(ByteSwapBE(v.GetLeft()));
stream->WriteValue(ByteSwapBE(v.GetTop()));
stream->WriteValue(ByteSwapBE(v.GetRight()));
stream->WriteValue(ByteSwapBE(v.GetBottom()));
stream->WriteValue(ByteSwapBE(v.GetX1()));
stream->WriteValue(ByteSwapBE(v.GetY1()));
stream->WriteValue(ByteSwapBE(v.GetX2()));
stream->WriteValue(ByteSwapBE(v.GetY2()));
}
static void decode(OpenRCT2::IStream* stream, MapRange& v)
{
@@ -439,8 +439,7 @@ struct DataSerializerTraitsT<MapRange>
{
char coords[128] = {};
snprintf(
coords, sizeof(coords), "MapRange(l = %d, t = %d, r = %d, b = %d)", v.GetLeft(), v.GetTop(), v.GetRight(),
v.GetBottom());
coords, sizeof(coords), "MapRange(x1 = %d, y1 = %d, x2 = %d, y2 = %d)", v.GetX1(), v.GetY1(), v.GetX2(), v.GetY2());
stream->Write(coords, strlen(coords));
}
+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;
+2 -2
View File
@@ -295,9 +295,9 @@ void Staff::SetPatrolArea(const CoordsXY& coords, bool value)
void Staff::SetPatrolArea(const MapRange& range, bool value)
{
for (int32_t yy = range.GetTop(); yy <= range.GetBottom(); yy += kCoordsXYStep)
for (int32_t yy = range.GetY1(); yy <= range.GetY2(); yy += kCoordsXYStep)
{
for (int32_t xx = range.GetLeft(); xx <= range.GetRight(); xx += kCoordsXYStep)
for (int32_t xx = range.GetX1(); xx <= range.GetX2(); xx += kCoordsXYStep)
{
SetPatrolArea({ xx, yy }, value);
}
+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
Loaded 100 of 195 files, more files were not shown because too many files have changed in this diff. Show more