From 186728ca5f307a76cdf26ab52fc341642ac8e47a Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 24 Apr 2022 22:30:35 -0400 Subject: [PATCH] Small Tweaks --- mods/src/options/options.cpp | 6 +++++- mods/src/touch/touch.cpp | 3 +++ symbols/include/symbols/minecraft.h | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mods/src/options/options.cpp b/mods/src/options/options.cpp index bcd86618..87579711 100644 --- a/mods/src/options/options.cpp +++ b/mods/src/options/options.cpp @@ -93,6 +93,7 @@ static char *get_new_options_txt_path() { // Modify Option Toggles static void OptionsPane_unknown_toggle_creating_function_injection(unsigned char *options_pane, unsigned char *unknown_object, std::string const& name, unsigned char *option) { // Modify + std::string new_name = name; if (name == "Fancy Graphics") { option = Options_Option_GRAPHICS; } else if (name == "Soft shadows") { @@ -109,10 +110,13 @@ static void OptionsPane_unknown_toggle_creating_function_injection(unsigned char } else if (name == "Vibrate on destroy") { // This toggle requires vibration support, so disable it. return; + } else if (name == "Invert X-axis") { + // Fix Incorrect Name + new_name = "Invert Y-axis"; } // Call Original Method - (*OptionsPane_unknown_toggle_creating_function)(options_pane, unknown_object, name, option); + (*OptionsPane_unknown_toggle_creating_function)(options_pane, unknown_object, new_name, option); } // Add Missing Options To Options::getBooleanValue diff --git a/mods/src/touch/touch.cpp b/mods/src/touch/touch.cpp index 37f04696..02d0e04b 100644 --- a/mods/src/touch/touch.cpp +++ b/mods/src/touch/touch.cpp @@ -56,6 +56,9 @@ void init_touch() { if (feature_has("Force Touch GUI Inventory", server_disabled)) { overwrite_call((void *) 0x2943c, (void *) operator_new_IngameBlockSelectionScreen_injection); overwrite_call((void *) 0x29444, (void *) Touch_IngameBlockSelectionScreen); + // Make "Craft" And "Armor" Buttons Use Classic GUI Style (Button And TButton Have The Same Size) + overwrite_call((void *) 0x3b060, (void *) Button); + overwrite_call((void *) 0x3b08c, (void *) Button); } // Force Touch Button Behavior diff --git a/symbols/include/symbols/minecraft.h b/symbols/include/symbols/minecraft.h index c8f3a624..3409757c 100644 --- a/symbols/include/symbols/minecraft.h +++ b/symbols/include/symbols/minecraft.h @@ -779,6 +779,11 @@ static Gui_addMessage_t Gui_addMessage = (Gui_addMessage_t) 0x27820; typedef void (*GuiComponent_drawCenteredString_t)(unsigned char *component, unsigned char *font, std::string const& text, int32_t x, int32_t y, int32_t color); static GuiComponent_drawCenteredString_t GuiComponent_drawCenteredString = (GuiComponent_drawCenteredString_t) 0x2821c; +// Button + +typedef unsigned char *(*Button_t)(unsigned char *button, int32_t param_1, std::string const& text); +static Button_t Button = (Button_t) 0x1bc54; + // ServerSideNetworkHandler typedef void (*ServerSideNetworkHandler_displayGameMessage_t)(unsigned char *server_side_network_handler, std::string const& message);