From 2b55c6fdb87a55bcd0b9a04ff5d73909556febf3 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 21 Jan 2022 08:52:44 +1100 Subject: [PATCH] Make chat input always cover entire width of the game window (like Minecraft) --- src/ClassiCube.vcxproj | 10 +++++----- src/Menus.c | 6 +++--- src/Widgets.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ClassiCube.vcxproj b/src/ClassiCube.vcxproj index bde3e307c..cb1e96ad7 100644 --- a/src/ClassiCube.vcxproj +++ b/src/ClassiCube.vcxproj @@ -22,32 +22,32 @@ {8A7D82BD-178A-4785-B41B-70EDE998920A} Win32Proj ClassiCube - 10.0 + 8.1 Application true Unicode - v142 + v140 Application false true Unicode - v142 + v140 Application true - v142 + v140 Unicode Application false - v142 + v140 true Unicode diff --git a/src/Menus.c b/src/Menus.c index d4f8913d4..a1d1638b8 100644 --- a/src/Menus.c +++ b/src/Menus.c @@ -3825,7 +3825,7 @@ static void TouchOnscreenScreen_Init(void* screen) { s->numWidgets = Array_Elems(touchOnscreen_widgets); s->maxVertices = TOUCHONSCREEN_MAX_VERTICES; - Menu_InitBack(&s->back, TouchOnscreen_More); + ButtonWidget_Init(&s->back, 400, TouchOnscreen_More); ButtonWidget_Init(&s->left, 40, TouchOnscreen_Left); ButtonWidget_Init(&s->right, 40, TouchOnscreen_Right); TouchOnscreen_SetPage(s, true); @@ -4002,7 +4002,7 @@ static void TouchCtrlsScreen_Init(void* screen) { Menu_InitButtons(s->btns, 195, touchCtrls_btns, 4); Menu_InitButtons(s->btns + 4, 400, touchCtrls_btns + 4, 1); - Menu_InitBack(&s->back, TouchCtrls_More); + ButtonWidget_Init(&s->back, 400, TouchCtrls_More); } static const struct ScreenVTABLE TouchCtrlsScreen_VTABLE = { @@ -4096,7 +4096,7 @@ static void TouchMoreScreen_Init(void* screen) { Menu_InitButtons(s->btns, 195, touchMore_btns, 4); Menu_InitButtons(s->btns + 4, 400, touchMore_btns + 4, 2); - Menu_InitBack(&s->back, TouchMore_Game); + ButtonWidget_Init(&s->back, 400, TouchMore_Game); } static const struct ScreenVTABLE TouchMoreScreen_VTABLE = { diff --git a/src/Widgets.c b/src/Widgets.c index 9976c52c9..6c73f70f4 100644 --- a/src/Widgets.c +++ b/src/Widgets.c @@ -1724,8 +1724,8 @@ static void ChatInputWidget_Render(void* widget, double delta) { caretAtEnd = (w->caretY == i) && (w->caretX == INPUTWIDGET_LEN || w->caretPos == -1); width = w->lineWidths[i] + (caretAtEnd ? w->caretTex.Width : 0); - /* Cover whole window width to match original classic behaviour */ - if (Gui.ClassicChat) { width = max(width, WindowInfo.Width - x * 4); } + /* Cover whole window width to match Minecraft behaviour */ + width = max(width, WindowInfo.Width - x * 4); Gfx_Draw2DFlat(x, y, width + w->padding * 2, w->lineHeight, backColor); y += w->lineHeight;