From 63f248f7930f8bad3dc7438e758314a0cbe63a5e Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 5 Nov 2020 01:00:54 +1100 Subject: [PATCH] Fix while chatlines defaults to 12 when loading from options.txt, it was 10 in chat options menu - now it's consistently 10 in classic mode and 12 in normal (Thanks fizzwhiz) --- src/Gui.c | 3 ++- src/Gui.h | 1 + src/Menus.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Gui.c b/src/Gui.c index 7dddfd531..d103efcef 100644 --- a/src/Gui.c +++ b/src/Gui.c @@ -78,7 +78,8 @@ void Gui_ShowDefault(void) { } static void Gui_LoadOptions(void) { - Gui.Chatlines = Options_GetInt(OPT_CHATLINES, 0, 30, 12); + Gui.DefaultLines = Game_ClassicMode ? 10 : 12; + Gui.Chatlines = Options_GetInt(OPT_CHATLINES, 0, 30, Gui.DefaultLines); Gui.ClickableChat = Options_GetBool(OPT_CLICKABLE_CHAT, true) && !Game_ClassicMode; Gui.TabAutocomplete = Options_GetBool(OPT_TAB_AUTOCOMPLETE, true) && !Game_ClassicMode; diff --git a/src/Gui.h b/src/Gui.h index 58903facb..f3287afe5 100644 --- a/src/Gui.h +++ b/src/Gui.h @@ -42,6 +42,7 @@ CC_VAR extern struct _GuiData { cc_bool ShowFPS; float RawHotbarScale, RawChatScale, RawInventoryScale; GfxResourceID GuiTex, GuiClassicTex, IconsTex, TouchTex; + int DefaultLines; } Gui; float Gui_Scale(float value); diff --git a/src/Menus.c b/src/Menus.c index f120cbd53..28af20320 100644 --- a/src/Menus.c +++ b/src/Menus.c @@ -2701,8 +2701,8 @@ static void ChatOptionsScreen_InitWidgets(struct MenuOptionsScreen* s) { void ChatOptionsScreen_Show(void) { static struct MenuInputDesc descs[5]; - MenuInput_Float(descs[0], 0.25f, 4.00f, 1); - MenuInput_Int(descs[1], 0, 30, 10); + MenuInput_Float(descs[0], 0.25f, 4.00f, 1); + MenuInput_Int(descs[1], 0, 30, Gui.DefaultLines); MenuOptionsScreen_Show(descs, NULL, 0, ChatOptionsScreen_InitWidgets); }