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

Quality of Life Shortcuts #42

Merged
merged 7 commits into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/app/core/mods/shortcuts/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,26 @@ export class Shortcuts extends Mods {

// Spell
async.forEachOf(this.params.spell, (shortcut: string, index: number) => {
const selectedSpell = this.wGame.gui.shortcutBar._panels.spell.slotList[index];

this.shortcutsHelper.bind(shortcut, () => {
this.wGame.gui.shortcutBar._panels.spell.slotList[index].tap();
selectedSpell.tap();
//this.tab.window.gui.shortcutBar.panels.spell.slotList[index].tap();
});
selectedSpell.on('doubletap', () => {
/*TODO (HoPollo) :
/ Allow double shortcut tap to work as well (currently only mouseclick works)
*/
if (this.wGame.gui.fightManager.fightState === 0) {
return;
}

selectedSpell.tap();

setTimeout(() => {
this.wGame.isoEngine._castSpellImmediately(this.wGame.isoEngine.actorManager.userActor.cellId);
}, 150);
});
});

// Item
Expand Down Expand Up @@ -127,6 +143,12 @@ export class Shortcuts extends Mods {
break;
}
}
if (this.wGame.gui.notificationBar._elementIsVisible) {
const dialogName = this.wGame.gui.notificationBar.currentOpenedId;
// If notifiaction is openened, allow to close it with ESC
this.wGame.gui.notificationBar.dialogs[dialogName]._childrenList[0]._childrenList[1].tap();
winClosed++;
}
if (this.params.diver.active_open_menu && !winClosed) {
// If no window closed open menu
this.wGame.gui.mainControls.buttonBox._childrenList[14].tap()
Expand Down