Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning a value for ModCallbacks.MC_MENU_INPUT_ACTION doesn't do anything #541

Open
Block-Vader opened this issue Sep 8, 2024 · 0 comments

Comments

@Block-Vader
Copy link

Block-Vader commented Sep 8, 2024

local function onInput(_, entity, hook, action)
    if action == ButtonAction.ACTION_MENUCONFIRM then
        print("preventing input")
        if hook == InputHook.GET_ACTION_VALUE then
            return 0
        else
            return false
        end
    end
end

mod:AddCallback(ModCallbacks.MC_MENU_INPUT_ACTION, onInput)

When I am in I open the save selection menu, message "preventing input" is getting printed in the console, but selected save still opens when the key is pressed. Returning 0 for InputHook.GET_ACTION_VALUE and false for InputHook.IS_ACTION_PRESSED/TRIGGERED should stop the game from recognizing the input, but in this case, it doesn't have any effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant