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

Activation KEYPRESS events not restoring previously global assigned key handlers #91

Open
swordmaster2k opened this issue Sep 28, 2020 · 0 comments
Assignees
Milestone

Comments

@swordmaster2k
Copy link
Owner

It is possible to overwrite a global key handler such as the swordslash in the action battle system using a KEYPRESS based event. Once the event has finished running the key handler is not being restored.

The bug occurs in the character.js code:

    events.forEach(function (event) {
        if (event.program) {
            if (event.type.toUpperCase() === "OVERLAP") {
                rpgwizard.runProgram(PATH_PROGRAM.concat(event.program), object);
            } else if (event.type.toUpperCase() === "KEYPRESS") {
                if (event.key) {
                    entity.previousKeyHandler = {
                        key: event.key,
                        callback: rpgwizard.keyboardHandler.downHandlers[event.key]
                    };
                    var callback = function () {
                        rpgcode.unregisterKeyDown(event.key, true);
                        rpgwizard.runProgram(PATH_PROGRAM.concat(event.program), object);
                    };
                    rpgcode.registerKeyDown(event.key, callback, true);
                }
            }
        }
    });
@swordmaster2k swordmaster2k added this to the 1.8.0 milestone Sep 28, 2020
@swordmaster2k swordmaster2k self-assigned this Sep 28, 2020
@swordmaster2k swordmaster2k modified the milestones: 1.7.1, Backlog Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant