Fix EID toggle key getting triggered while setting it

This commit is contained in:
Buurazu authored and GitHub committed 2022-02-05 19:31:32 -05:00
1 parent cc3edf0aa2
commit 69b3a178b4
1 file changed
+7 -6
+7 -6
View File
@@ -387,7 +387,6 @@ local scaleToBigger = true
local scaleConfigName = "Size"
local scaleHoldFrame = 0
local function handleScaleKey()
if not ModConfigMenu or not ModConfigMenu.IsVisible then
local scaleKey = EID.Config["SizeHotkey"]
-- press and hold ScaleKey
@@ -430,7 +429,6 @@ local function handleScaleKey()
EID.Config[scaleConfigName] = scale
EID.Scale = scale
end
end
end
---------------------------------------------------------------------------
@@ -944,17 +942,20 @@ local function onRender(t)
EID.OptionChanged = EID.MCM_OptionChanged
EID.MCM_OptionChanged = false
EID:resumeCoroutines()
-- Do not check our hotkeys while MCM is open, or they will be triggered while rebinding
if not ModConfigMenu or not ModConfigMenu.IsVisible then
handleScaleKey()
if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex) then
EID.isHidden = not EID.isHidden
end
end
EID.isDisplaying = false
EID:setPlayer()
EID:PositionLocalMode() -- default to non-local mode to fix MCM / Bag errors
EID.TabPreviewID = 0
if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex) then
EID.isHidden = not EID.isHidden
end
if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting" then --if the mod config menu exists, is opened and Hide Hud is enabled, and ModConfigMenu isn't currently in the "Visuals" or "Crafting" tab of EID
return
end