Fix item bar hover logic

This commit is contained in:
Flashfyre 2024-03-25 12:33:35 -04:00
parent 892d99a4f9
commit a1b09f3aeb
2 changed files with 6 additions and 2 deletions

View File

@ -12,8 +12,11 @@ export const splashMessages = [
'Infinite Fusion at Home!',
'Broken Egg Moves!',
'Mubstitute!',
'That\'s Crazy!',
'Questionable Balancing!',
'Sudden Difficulty Spikes!',
'Based on an Unfinished Flash Game!',
'More Addictive than Intended!',
'Eevee Expo!',
'YNOproject!'
];

View File

@ -57,7 +57,7 @@ export class ModifierBar extends Phaser.GameObjects.Container {
icon.setVisible(false);
this.add(icon);
this.setModifierIconPosition(icon, visibleIconModifiers.length);
icon.setInteractive(new Phaser.Geom.Rectangle(0, 0, 32, 32), Phaser.Geom.Rectangle.Contains);
icon.setInteractive(new Phaser.Geom.Rectangle(0, 0, 32, 24), Phaser.Geom.Rectangle.Contains);
icon.on('pointerover', () => {
(this.scene as BattleScene).ui.showTooltip(modifier.type.name, modifier.type.getDescription(this.scene as BattleScene));
if (this.modifierCache && this.modifierCache.length > iconOverflowIndex)
@ -77,7 +77,8 @@ export class ModifierBar extends Phaser.GameObjects.Container {
}
updateModifierOverflowVisibility(ignoreLimit: boolean) {
for (let modifier of this.getAll().map(m => m as Phaser.GameObjects.Container).slice(0, this.getAll().length - iconOverflowIndex))
const modifierIcons = this.getAll().reverse();
for (let modifier of modifierIcons.map(m => m as Phaser.GameObjects.Container).slice(iconOverflowIndex))
modifier.setVisible(ignoreLimit);
}