From 2f2fa099db34f1bc87528af85d49f2bcb100ee40 Mon Sep 17 00:00:00 2001 From: Enduriel Date: Tue, 10 May 2022 11:12:46 +0100 Subject: [PATCH] fix(vanilla): bug where pressing double escape in menu screens hides ui --- msu/hooks/entity/tactical/actor.nut | 2 +- msu/hooks/states/tactical_state.nut | 7 +++++++ msu/hooks/states/world_state.nut | 7 +++++++ msu/vanilla_mod/vanilla_keybinds.nut | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/msu/hooks/entity/tactical/actor.nut b/msu/hooks/entity/tactical/actor.nut index 06571b894..4b1f1aadd 100644 --- a/msu/hooks/entity/tactical/actor.nut +++ b/msu/hooks/entity/tactical/actor.nut @@ -62,7 +62,7 @@ } } - local getActionPointsMax = o.getActionPointsMax; + local getActionPointsMax = o.getActionPointsMax; // VANILLAFIX http://battlebrothersgame.com/forums/topic/getactionpointsmax-of-actor-should-return-a-floored-value/ o.getActionPointsMax = function() { return ::Math.floor(getActionPointsMax()); diff --git a/msu/hooks/states/tactical_state.nut b/msu/hooks/states/tactical_state.nut index 919e1284d..dc71b282f 100644 --- a/msu/hooks/states/tactical_state.nut +++ b/msu/hooks/states/tactical_state.nut @@ -77,4 +77,11 @@ } return onMouseInput(_mouse); } + + local toggleMenuScreen = o.toggleMenuScreen; // VANILLAFIX https://steamcommunity.com/app/365360/discussions/1/3276942370896011321/ + o.toggleMenuScreen = function() + { + if (this.m.TacticalMenuScreen.isAnimating()) return false; + return toggleMenuScreen(); + } }); diff --git a/msu/hooks/states/world_state.nut b/msu/hooks/states/world_state.nut index 8bee75333..a345ddd15 100644 --- a/msu/hooks/states/world_state.nut +++ b/msu/hooks/states/world_state.nut @@ -188,6 +188,13 @@ return properties; } + local toggleMenuScreen = o.toggleMenuScreen; // VANILLAFIX https://steamcommunity.com/app/365360/discussions/1/3276942370896011321/ + o.toggleMenuScreen = function() + { + if (this.m.WorldMenuScreen.isAnimating()) return false; + return toggleMenuScreen(); + } + local onBeforeSerialize = o.onBeforeSerialize; o.onBeforeSerialize = function( _out ) { diff --git a/msu/vanilla_mod/vanilla_keybinds.nut b/msu/vanilla_mod/vanilla_keybinds.nut index 164d25d30..36576c91f 100644 --- a/msu/vanilla_mod/vanilla_keybinds.nut +++ b/msu/vanilla_mod/vanilla_keybinds.nut @@ -57,7 +57,7 @@ local function isCampfireScreen() if (::MSU.isKindOf(this, "world_state")) { if (isCampfireScreen.call(this)) return; - if (this.toggleMenuScreen()) + if (!this.m.WorldMenuScreen.isAnimating() && this.toggleMenuScreen()) { return true; }