TeamREPENTOGON/REPENTOGON

ModCallbacks.MC_MENU_INPUT_ACTION not working as expected

Opened this issue · 0 comments

Issue

I made a function to print which key i press where i'm in the main menu, but it doesn't work.
The problem is that when i'm in the MainMenuType.GAME (where it should check for keypress) it doesn't print anything.
But if i go to the save menu, then back on the main menu again, it always print this key no matter what i press:
ACTION_MENULEFT⚓︎
ACTION_MENURIGHT⚓︎
ACTION_MENUCONFIRM⚓︎

Code

mod = RegisterMod("leggiand", 1)
local isMenu = false
function mod:TestOverride(_, hook, button)
    if not isMenu then
        if pcall(MenuManager.GetActiveMenu) then
            isMenu = false
        else
            print(3)
            return
        end
    end
    local activeMenu = MenuManager.GetActiveMenu()
    if (activeMenu == MainMenuType.GAME) then
        --exclude full screen and mute keys, 
        --because they fire every frame
        if (button ~= 17 and button ~= 18) then
            print(button)
        end
    end
end
mod:AddCallback(ModCallbacks.MC_MENU_INPUT_ACTION,mod.TestOverride)

Video

The.Binding.of.Isaac_.Repentance.+.REPENTOGON.1.0.11c.2024-08-16.00-47-39.mp4

the extra online tab is only a modified sprite, i'm trying to made an online mode