RGON: Allow to use Hide and Scale keybinds in the collection page main menu
This commit is contained in:
1 parent
0162ef2e35
commit
b734c85e6b
2 files changed
+13
-6
No files matched your search
@@ -69,6 +69,9 @@ end
|
|||||||
local skipItemIDs = {}
|
local skipItemIDs = {}
|
||||||
function EID:OnMenuRender()
|
function EID:OnMenuRender()
|
||||||
if EID.Config["RGON_ShowOnCollectionPage"] and MenuManager:GetActiveMenu() == MainMenuType.COLLECTION then
|
if EID.Config["RGON_ShowOnCollectionPage"] and MenuManager:GetActiveMenu() == MainMenuType.COLLECTION then
|
||||||
|
EID:HandleRenderingKeys()
|
||||||
|
if EID.isHidden then return end
|
||||||
|
|
||||||
if #skipItemIDs == 0 then -- build list of items not listed in the collectionpage
|
if #skipItemIDs == 0 then -- build list of items not listed in the collectionpage
|
||||||
local itemConfig = Isaac.GetItemConfig()
|
local itemConfig = Isaac.GetItemConfig()
|
||||||
for i = 1, EID:GetMaxCollectibleID(), 1 do
|
for i = 1, EID:GetMaxCollectibleID(), 1 do
|
||||||
|
|||||||
@@ -402,6 +402,14 @@ function EID:CheckVoidAbsorbs(_, _, player)
|
|||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, EID.CheckVoidAbsorbs, CollectibleType.COLLECTIBLE_VOID)
|
EID:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, EID.CheckVoidAbsorbs, CollectibleType.COLLECTIBLE_VOID)
|
||||||
|
|
||||||
|
function EID:HandleRenderingKeys()
|
||||||
|
-- scale key must be handled before resetting to non-local mode
|
||||||
|
EID:HandleScaleKey()
|
||||||
|
if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or (EID.player and Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex)) then
|
||||||
|
EID.isHidden = not EID.isHidden
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--------------------------Handle Scale Shortcut----------------------------
|
--------------------------Handle Scale Shortcut----------------------------
|
||||||
|
|
||||||
@@ -411,7 +419,7 @@ local scaleSpeed = 0.01 -- scale size per frame
|
|||||||
local scaleToBigger = true
|
local scaleToBigger = true
|
||||||
EID.CurrentScaleType = "Size" -- Size or LocalModeSize; checked by EID:getTextPosition() to not apply modifiers in local mode
|
EID.CurrentScaleType = "Size" -- Size or LocalModeSize; checked by EID:getTextPosition() to not apply modifiers in local mode
|
||||||
local scaleHoldFrame = 0
|
local scaleHoldFrame = 0
|
||||||
local function handleScaleKey()
|
function EID:HandleScaleKey()
|
||||||
local scaleKey = EID.Config["SizeHotkey"]
|
local scaleKey = EID.Config["SizeHotkey"]
|
||||||
|
|
||||||
-- press and hold ScaleKey
|
-- press and hold ScaleKey
|
||||||
@@ -1323,11 +1331,7 @@ function EID:OnRender()
|
|||||||
|
|
||||||
-- Do not check our hide or scale hotkeys while a tab that can modify them is open
|
-- Do not check our hide or scale hotkeys while a tab that can modify them is open
|
||||||
if EID.MCMCompat_isDisplayingEIDTab ~= "General" then
|
if EID.MCMCompat_isDisplayingEIDTab ~= "General" then
|
||||||
-- scale key must be handled before resetting to non-local mode
|
EID:HandleRenderingKeys()
|
||||||
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
|
end
|
||||||
EID.TabPreviewID = 0
|
EID.TabPreviewID = 0
|
||||||
EID.TabDescThisFrame = false
|
EID.TabDescThisFrame = false
|
||||||
|
|||||||
Reference in new issue
Block a user