From 058803664387cb5666e96304f25b21f98d57a30e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 4 Aug 2017 23:23:00 -0400 Subject: [PATCH] v0.6.1: fixed quickslots not updating properly when item glow changes --- .../shatteredpixeldungeon/sprites/ItemSprite.java | 9 ++++++--- .../shatteredpixeldungeon/ui/ItemSlot.java | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java index 52a78802e..b4d0ce80a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java @@ -195,9 +195,7 @@ public class ItemSprite extends MovieClip { if (this.emitter != null) this.emitter.killAndErase(); emitter = null; frame( image ); - if ((this.glowing = glowing) == null) { - resetColor(); - } + glow( glowing ); return this; } @@ -210,6 +208,11 @@ public class ItemSprite extends MovieClip { perspectiveRaise = (5 + 8 - height) / 16f; } } + + public void glow( Glowing glowing ){ + this.glowing = glowing; + if (glowing == null) resetColor(); + } @Override public void kill() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java index be992f8b7..f80cefdfd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java @@ -154,7 +154,10 @@ public class ItemSlot extends Button { public void item( Item item ) { if (this.item == item) { - if (item != null) icon.frame(item.image()); + if (item != null) { + icon.frame(item.image()); + icon.glow(item.glowing()); + } updateText(); return; }