Make chat input always cover entire width of the game window (like Minecraft)

This commit is contained in:
UnknownShadow200 2022-01-21 08:52:44 +11:00
parent 03e4c19853
commit 2b55c6fdb8
3 changed files with 10 additions and 10 deletions

View file

@ -22,32 +22,32 @@
<ProjectGuid>{8A7D82BD-178A-4785-B41B-70EDE998920A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ClassiCube</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

View file

@ -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 = {

View file

@ -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;