Offset back button, fix buttons appearing in ingame menu when returning from options

This commit is contained in:
NyakoFox 2024-04-12 08:27:58 -03:00
parent 206fac9ab4
commit a449f98c45
2 changed files with 3 additions and 1 deletions

View File

@ -7955,6 +7955,8 @@ static void returntoingametemp(void)
{ {
extern Game game; extern Game game;
game.returntomenu(game.kludge_ingametemp); game.returntomenu(game.kludge_ingametemp);
// Hacky fix to prevent touch buttons from being stuck on the screen
touch::remove_dynamic_buttons();
} }
static void returntoedsettings(void) static void returntoedsettings(void)

View File

@ -404,7 +404,7 @@ namespace touch
buttons[TOUCH_BUTTON_CONFIRM].image = graphics.grphx.im_button_right; buttons[TOUCH_BUTTON_CONFIRM].image = graphics.grphx.im_button_right;
buttons[TOUCH_BUTTON_MAP_BACK].x = width - ((double)(240 - (int) graphics.lerp(graphics.oldmenuoffset, graphics.menuoffset)) / 240.0) * (60 * scale); buttons[TOUCH_BUTTON_MAP_BACK].x = width - ((double)(240 - (int) graphics.lerp(graphics.oldmenuoffset, graphics.menuoffset)) / 240.0) * (60 * scale);
buttons[TOUCH_BUTTON_MAP_BACK].y = 0; buttons[TOUCH_BUTTON_MAP_BACK].y = 8;
buttons[TOUCH_BUTTON_MAP_BACK].width = 60 * scale; buttons[TOUCH_BUTTON_MAP_BACK].width = 60 * scale;
buttons[TOUCH_BUTTON_MAP_BACK].height = 26 * scale; buttons[TOUCH_BUTTON_MAP_BACK].height = 26 * scale;
buttons[TOUCH_BUTTON_MAP_BACK].text = loc::gettext("BACK"); buttons[TOUCH_BUTTON_MAP_BACK].text = loc::gettext("BACK");