Skip to content

Commit

Permalink
fix(vanilla): bug where pressing double escape in menu screens hides ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Enduriel committed May 10, 2022
1 parent 93f1026 commit 2f2fa09
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion msu/hooks/entity/tactical/actor.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
7 changes: 7 additions & 0 deletions msu/hooks/states/tactical_state.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
7 changes: 7 additions & 0 deletions msu/hooks/states/world_state.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion msu/vanilla_mod/vanilla_keybinds.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2f2fa09

Please sign in to comment.