Small Tweaks

This commit is contained in:
TheBrokenRail 2022-04-24 22:30:35 -04:00
parent 9412c07c45
commit 186728ca5f
3 changed files with 13 additions and 1 deletions

View File

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

View File

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

View File

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