From f410b3040245530bcd5d4a3de3ecc10409fae50e Mon Sep 17 00:00:00 2001 From: Ada <60364512+GreatArgorath@users.noreply.github.com> Date: Sat, 23 Apr 2022 19:32:35 +0100 Subject: [PATCH] Adds text speed default to ConfigFile.cpp + removes workaround --- libultraship/libultraship/ConfigFile.cpp | 3 +++ soh/src/code/z_message_PAL.c | 10 ++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libultraship/libultraship/ConfigFile.cpp b/libultraship/libultraship/ConfigFile.cpp index 1b4952139..2e9a8cc94 100644 --- a/libultraship/libultraship/ConfigFile.cpp +++ b/libultraship/libultraship/ConfigFile.cpp @@ -2,6 +2,7 @@ #include "spdlog/spdlog.h" #include "GlobalCtx2.h" #include "Window.h" +#include "GameSettings.h" namespace Ship { ConfigFile::ConfigFile(std::shared_ptr Context, const std::string& Path) : Context(Context), Path(Path), File(Path.c_str()) { @@ -149,6 +150,8 @@ namespace Ship { (*this)["KEYBOARD CONTROLLER BINDING 4"][STR(BTN_STICKDOWN)] = std::to_string(0x01F); (*this)["KEYBOARD CONTROLLER BINDING 4"][STR(BTN_STICKUP)] = std::to_string(0x011); + (*this)["ENHANCEMENT SETTINGS"]["TEXT_SPEED"] = "1"; + (*this)["SDL CONTROLLER 1"]["GUID"] = ""; (*this)["SDL CONTROLLER 2"]["GUID"] = ""; (*this)["SDL CONTROLLER 3"]["GUID"] = ""; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 879ea50aa..a767ede79 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -951,10 +951,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { } } i = j - 1; - if (CVar_GetS32("gTextSpeed", 1) > 0) - msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); - else - CVar_SetS32("gTextSpeed", 1); + msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); if (character) {} } @@ -1147,10 +1144,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { } } if (msgCtx->textDelayTimer == 0) { - if (CVar_GetS32("gTextSpeed", 1) > 0) - msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); - else - CVar_SetS32("gTextSpeed", 1); + msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); msgCtx->textDelayTimer = msgCtx->textDelay; } else { msgCtx->textDelayTimer--;