Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/style/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@
background-image: url('~assets/icons/next.svg') !important;
}

&.cancelIcon {
background-image: url('~assets/icons/cancel.svg') !important;
}

&.upgraded.noclick:hover:before {
opacity: 1;
}
Expand Down
22 changes: 18 additions & 4 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,21 +273,35 @@ export class UI {
return false;
}

// Show cancel icon if the button is either diabled or hidden or noclick
if (['disabled', 'hidden', 'noclick'].includes(b.state)) {
b.cssTransition('cancelIcon', 500);
}

const ability = game.activeCreature.abilities[i];
// Passive ability icon can cycle between usable abilities
if (i == 0) {
// Show cancel icon first
b.cssTransition('cancelIcon', 500);

// Then, move to next icon
const selectedAbility = this.selectNextAbility();
if (selectedAbility > 0) {
setTimeout(() => {
if (selectedAbility > 0) {
b.cssTransition('nextIcon', 1000);
}
}
}, 500);
return;
}
// Colored frame around selected ability
if (ability.require() == true && i != 0) {
this.selectAbility(i);
}
// Activate Ability
game.activeCreature.abilities[i].use();
// Activate Ability | Delay the use to make cancel and next icons detectable
setTimeout(() => {
game.activeCreature.abilities[i].use();
}, 1000);

} else {
// Cancel Ability
this.closeDash();
Expand Down