From 8d526cb50e0771f7e03c498f04d1e1221466e24f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 28 Apr 2021 19:56:12 -0400 Subject: [PATCH] v0.9.3: final quickslot visual fix this ditches the 'text only' update in favor of just always doing the full update (as before) and re-assigned whether the slots are enabled --- .../actors/buffs/Degrade.java | 4 ++-- .../actors/buffs/ScrollEmpower.java | 2 +- .../shatteredpixeldungeon/items/Item.java | 8 ++------ .../shatteredpixeldungeon/items/Waterskin.java | 2 +- .../items/armor/ClassArmor.java | 2 +- .../items/artifacts/AlchemistsToolkit.java | 6 +++--- .../items/artifacts/CapeOfThorns.java | 6 +++--- .../items/artifacts/CloakOfShadows.java | 12 ++++++------ .../items/artifacts/DriedRose.java | 12 ++++++------ .../items/artifacts/EtherealChains.java | 8 ++++---- .../items/artifacts/HornOfPlenty.java | 6 +++--- .../items/artifacts/LloydsBeacon.java | 4 ++-- .../items/artifacts/MasterThievesArmband.java | 2 +- .../items/artifacts/SandalsOfNature.java | 4 ++-- .../items/artifacts/TalismanOfForesight.java | 6 +++--- .../items/artifacts/TimekeepersHourglass.java | 10 +++++----- .../items/artifacts/UnstableSpellbook.java | 6 +++--- .../items/potions/Potion.java | 2 +- .../items/potions/exotic/ExoticPotion.java | 2 +- .../items/quest/Pickaxe.java | 2 +- .../shatteredpixeldungeon/items/wands/Wand.java | 6 +++--- .../items/wands/WandOfBlastWave.java | 4 ++-- .../items/wands/WandOfMagicMissile.java | 3 +-- .../shatteredpixeldungeon/ui/QuickSlotButton.java | 15 ++++----------- 24 files changed, 61 insertions(+), 73 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Degrade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Degrade.java index 784b5728f..9b232013d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Degrade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Degrade.java @@ -39,7 +39,7 @@ public class Degrade extends FlavourBuff { @Override public boolean attachTo(Char target) { if (super.attachTo(target)){ - Item.updateQuickslot(false); + Item.updateQuickslot(); if (target instanceof Hero) ((Hero) target).updateHT(false); return true; } @@ -50,7 +50,7 @@ public class Degrade extends FlavourBuff { public void detach() { super.detach(); if (target instanceof Hero) ((Hero) target).updateHT(false); - Item.updateQuickslot(false); + Item.updateQuickslot(); } //called in Item.buffedLevel() diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ScrollEmpower.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ScrollEmpower.java index 06a2b6b7f..9205127f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ScrollEmpower.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ScrollEmpower.java @@ -37,7 +37,7 @@ public class ScrollEmpower extends Buff { @Override public void detach() { super.detach(); - Item.updateQuickslot(false); + Item.updateQuickslot(); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java index f69ca2147..4514f9972 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java @@ -471,13 +471,9 @@ public class Item implements Bundlable { public String status() { return quantity != 1 ? Integer.toString( quantity ) : null; } - - public static void updateQuickslot() { - updateQuickslot(true); - } - public static void updateQuickslot(boolean full) { - QuickSlotButton.refresh(full); + public static void updateQuickslot() { + QuickSlotButton.refresh(); } private static final String QUANTITY = "quantity"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Waterskin.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Waterskin.java index fc568851c..bed28114f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Waterskin.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Waterskin.java @@ -168,7 +168,7 @@ public class Waterskin extends Item { GLog.p( Messages.get(this, "full") ); } - updateQuickslot(false); + updateQuickslot(); } public void fill() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java index 769aa0a30..3af33bd4f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java @@ -207,7 +207,7 @@ abstract public class ClassArmor extends Armor { LockedFloor lock = target.buff(LockedFloor.class); if (lock == null || lock.regenOn()) { charge += 100 / 500f; //500 turns to full charge - updateQuickslot(false); + updateQuickslot(); if (charge > 100) { charge = 100; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java index 9571d0d94..2f916a221 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java @@ -96,7 +96,7 @@ public class AlchemistsToolkit extends Artifact { if (partialCharge >= 1){ partialCharge--; charge++; - updateQuickslot(false); + updateQuickslot(); } } } @@ -126,7 +126,7 @@ public class AlchemistsToolkit extends Artifact { break; } } - updateQuickslot(false); + updateQuickslot(); } @@ -195,7 +195,7 @@ public class AlchemistsToolkit extends Artifact { partialCharge = 0; } - updateQuickslot(false); + updateQuickslot(); } } else partialCharge = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java index 4d0e4666d..a69a52736 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java @@ -53,7 +53,7 @@ public class CapeOfThorns extends Artifact { public void charge(Hero target, float amount) { if (cooldown == 0) { charge += Math.round(4*amount); - updateQuickslot(false); + updateQuickslot(); } if (charge >= chargeCap){ target.buff(Thorns.class).proc(0, null, null); @@ -83,7 +83,7 @@ public class CapeOfThorns extends Artifact { if (cooldown == 0) { GLog.w( Messages.get(this, "inert") ); } - updateQuickslot(false); + updateQuickslot(); } spend(TICK); return true; @@ -116,7 +116,7 @@ public class CapeOfThorns extends Artifact { } } - updateQuickslot(false); + updateQuickslot(); return damage; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java index ca88a7ad0..d9560d570 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java @@ -169,14 +169,14 @@ public class CloakOfShadows extends Artifact { if (partialCharge >= 1){ partialCharge--; charge++; - updateQuickslot(false); + updateQuickslot(); } } } public void overCharge(int amount){ charge = Math.min(charge+amount, chargeCap+amount); - updateQuickslot(false); + updateQuickslot(); } @Override @@ -239,7 +239,7 @@ public class CloakOfShadows extends Artifact { if (cooldown > 0) cooldown --; - updateQuickslot(false); + updateQuickslot(); spend( TICK ); @@ -325,7 +325,7 @@ public class CloakOfShadows extends Artifact { } turnsToCost = 4; } - updateQuickslot(false); + updateQuickslot(); } spend( TICK ); @@ -334,7 +334,7 @@ public class CloakOfShadows extends Artifact { } public void dispel(){ - updateQuickslot(false); + updateQuickslot(); detach(); } @@ -360,7 +360,7 @@ public class CloakOfShadows extends Artifact { if (target.invisible > 0) target.invisible--; - updateQuickslot(false); + updateQuickslot(); super.detach(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 5365f5620..1e9c0fd79 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -174,7 +174,7 @@ public class DriedRose extends Artifact { Talent.onArtifactUsed(hero); charge = 0; partialCharge = 0; - updateQuickslot(false); + updateQuickslot(); } else GLog.i( Messages.get(this, "no_space") ); @@ -282,12 +282,12 @@ public class DriedRose extends Artifact { partialCharge = 0; GLog.p(Messages.get(DriedRose.class, "charged")); } - updateQuickslot(false); + updateQuickslot(); } } else { int heal = Math.round((1 + level()/3f)*amount); ghost.HP = Math.min( ghost.HT, ghost.HP + heal); - updateQuickslot(false); + updateQuickslot(); } } @@ -376,7 +376,7 @@ public class DriedRose extends Artifact { LockedFloor lock = target.buff(LockedFloor.class); if (ghost.HP < ghost.HT && (lock == null || lock.regenOn())) { partialCharge += (ghost.HT / 1000f) * RingOfEnergy.artifactChargeMultiplier(target); - updateQuickslot(false); + updateQuickslot(); if (partialCharge > 1) { ghost.HP++; @@ -421,7 +421,7 @@ public class DriedRose extends Artifact { } - updateQuickslot(false); + updateQuickslot(); return true; } @@ -667,7 +667,7 @@ public class DriedRose extends Artifact { super.damage( dmg, src ); //for the rose status indicator - Item.updateQuickslot(false); + Item.updateQuickslot(); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java index cdcf41d9f..ef7dc40ed 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java @@ -171,7 +171,7 @@ public class EtherealChains extends Artifact { } else { charge -= chargeUse; Talent.onArtifactUsed(hero); - updateQuickslot(false); + updateQuickslot(); } hero.busy(); @@ -228,7 +228,7 @@ public class EtherealChains extends Artifact { } else { charge -= chargeUse; Talent.onArtifactUsed(hero); - updateQuickslot(false); + updateQuickslot(); } hero.busy(); @@ -261,7 +261,7 @@ public class EtherealChains extends Artifact { if (partialCharge >= 1){ partialCharge--; charge++; - updateQuickslot(false); + updateQuickslot(); } } } @@ -300,7 +300,7 @@ public class EtherealChains extends Artifact { charge ++; } - updateQuickslot(false); + updateQuickslot(); spend( TICK ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java index 1f9924d6d..4b279d960 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java @@ -128,7 +128,7 @@ public class HornOfPlenty extends Artifact { else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2; else image = ItemSpriteSheet.ARTIFACT_HORN1; - updateQuickslot( image != oldImage ); + updateQuickslot(); } } else if (action.equals(AC_STORE)){ @@ -162,7 +162,7 @@ public class HornOfPlenty extends Artifact { else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2; else image = ItemSpriteSheet.ARTIFACT_HORN1; - updateQuickslot( image != oldImage ); + updateQuickslot(); } } } @@ -259,7 +259,7 @@ public class HornOfPlenty extends Artifact { else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2; else image = ItemSpriteSheet.ARTIFACT_HORN1; - updateQuickslot( image != oldImage ); + updateQuickslot(); if (charge == chargeCap){ GLog.p( Messages.get(HornOfPlenty.class, "full") ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java index 50c581417..abec3c331 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java @@ -201,7 +201,7 @@ public class LloydsBeacon extends Artifact { Invisibility.dispel(); charge -= Dungeon.depth > 20 ? 2 : 1; - updateQuickslot(false); + updateQuickslot(); if (Actor.findChar(target) == curUser){ ScrollOfTeleportation.teleportHero(curUser); @@ -330,7 +330,7 @@ public class LloydsBeacon extends Artifact { } } - updateQuickslot(false); + updateQuickslot(); spend( TICK ); return true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java index 5f332936a..d47ab2e42 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java @@ -49,7 +49,7 @@ public class MasterThievesArmband extends Artifact { @Override public void charge(Hero target, float amount) { charge += Math.round(10*amount); - updateQuickslot(false); + updateQuickslot(); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java index f9f8835ef..be4d757bf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java @@ -93,7 +93,7 @@ public class SandalsOfNature extends Artifact { Camera.main.shake(1, 0.4f); charge = 0; Talent.onArtifactUsed(Dungeon.hero); - updateQuickslot(false); + updateQuickslot(); } } } @@ -185,7 +185,7 @@ public class SandalsOfNature extends Artifact { charge++; partialCharge--; } - updateQuickslot(false); + updateQuickslot(); } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java index 547529031..ce32f5e35 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java @@ -197,7 +197,7 @@ public class TalismanOfForesight extends Artifact { upgrade(); GLog.p( Messages.get(TalismanOfForesight.class, "levelup") ); } - updateQuickslot(false); + updateQuickslot(); //5 charge at 2 tiles, up to 30 charge at 25 tiles charge -= 3 + dist*1.08f; @@ -211,7 +211,7 @@ public class TalismanOfForesight extends Artifact { partialCharge--; } Talent.onArtifactUsed(Dungeon.hero); - updateQuickslot(false); + updateQuickslot(); Dungeon.observe(); Dungeon.hero.checkVisibleMobs(); GameScene.updateFog(); @@ -311,7 +311,7 @@ public class TalismanOfForesight extends Artifact { if (partialCharge > 1 && charge < chargeCap) { partialCharge--; charge++; - updateQuickslot(false); + updateQuickslot(); } else if (charge >= chargeCap) { partialCharge = 0; GLog.p( Messages.get(TalismanOfForesight.class, "full_charge") ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index f7bbc4ad1..32379fc86 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -150,7 +150,7 @@ public class TimekeepersHourglass extends Artifact { if (partialCharge >= 1){ partialCharge--; charge++; - updateQuickslot(false); + updateQuickslot(); } } } @@ -234,7 +234,7 @@ public class TimekeepersHourglass extends Artifact { } else if (cursed && Random.Int(10) == 0) ((Hero) target).spend( TICK ); - updateQuickslot(false); + updateQuickslot(); spend( TICK ); @@ -267,7 +267,7 @@ public class TimekeepersHourglass extends Artifact { target.invisible++; - updateQuickslot(false); + updateQuickslot(); Dungeon.observe(); @@ -318,7 +318,7 @@ public class TimekeepersHourglass extends Artifact { charge --; } - updateQuickslot(false); + updateQuickslot(); if (charge < 0){ charge = 0; @@ -341,7 +341,7 @@ public class TimekeepersHourglass extends Artifact { @Override public void detach(){ - updateQuickslot(false); + updateQuickslot(); super.detach(); activeBuff = null; triggerPresses(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java index 31a22cac5..dff6da662 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java @@ -168,7 +168,7 @@ public class UnstableSpellbook extends Artifact { scroll.doRead(); Talent.onArtifactUsed(Dungeon.hero); } - updateQuickslot(false); + updateQuickslot(); } } else if (action.equals( AC_ADD )) { @@ -222,7 +222,7 @@ public class UnstableSpellbook extends Artifact { if (partialCharge >= 1){ partialCharge--; charge++; - updateQuickslot(false); + updateQuickslot(); } } } @@ -297,7 +297,7 @@ public class UnstableSpellbook extends Artifact { } } - updateQuickslot(false); + updateQuickslot(); spend( TICK ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java index 1a6590123..40908cb61 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java @@ -334,7 +334,7 @@ public class Potion extends Item { if (!anonymous) { if (!isKnown()) { handler.know(this); - updateQuickslot(false); + updateQuickslot(); Potion p = Dungeon.hero.belongings.getItem(getClass()); if (p != null) p.setAction(); if (ExoticPotion.regToExo.get(getClass()) != null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java index 1f79ac9fc..17c849c4e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java @@ -98,7 +98,7 @@ public class ExoticPotion extends Potion { public void setKnown() { if (!isKnown()) { handler.know(exoToReg.get(this.getClass())); - updateQuickslot(false); + updateQuickslot(); Potion p = Dungeon.hero.belongings.getItem(getClass()); if (p != null) p.setAction(); p = Dungeon.hero.belongings.getItem(exoToReg.get(this.getClass())); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java index 7db8394fc..bd2abf14e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java @@ -162,7 +162,7 @@ public class Pickaxe extends Weapon { protected boolean act() { if (!defender.isAlive()){ bloodStained = true; - updateQuickslot(true); + updateQuickslot(); } Actor.remove(this); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 1c9d3a499..4d0047edb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -160,7 +160,7 @@ public abstract class Wand extends Item { if (overcharge) curCharges = Math.min(maxCharges+(int)amt, curCharges+1); else curCharges = Math.min(maxCharges, curCharges+1); partialCharge--; - updateQuickslot(false); + updateQuickslot(); } } @@ -581,7 +581,7 @@ public abstract class Wand extends Item { while (partialCharge >= 1 && curCharges < maxCharges) { partialCharge--; curCharges++; - updateQuickslot(false); + updateQuickslot(); } if (curCharges == maxCharges){ @@ -623,7 +623,7 @@ public abstract class Wand extends Item { partialCharge--; } curCharges = Math.min(curCharges, maxCharges); - updateQuickslot(false); + updateQuickslot(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java index c36f3d4d1..10d2c5187 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java @@ -84,7 +84,7 @@ public class WandOfBlastWave extends DamageWand { processSoulMark(ch, chargesPerCast()); if (ch.alignment != Char.Alignment.ALLY) ch.damage(damageRoll(), this); - if (ch.isAlive() && ch.pos == bolt.collisionPos + i) { + if (ch.pos == bolt.collisionPos + i) { Ballistica trajectory = new Ballistica(ch.pos, ch.pos + i, Ballistica.MAGIC_BOLT); int strength = 1 + Math.round(buffedLvl() / 2f); throwChar(ch, trajectory, strength, false); @@ -101,7 +101,7 @@ public class WandOfBlastWave extends DamageWand { processSoulMark(ch, chargesPerCast()); ch.damage(damageRoll(), this); - if (ch.isAlive() && bolt.path.size() > bolt.dist+1 && ch.pos == bolt.collisionPos) { + if (bolt.path.size() > bolt.dist+1 && ch.pos == bolt.collisionPos) { Ballistica trajectory = new Ballistica(ch.pos, bolt.path.get(bolt.dist + 1), Ballistica.MAGIC_BOLT); int strength = buffedLvl() + 3; throwChar(ch, trajectory, strength, false); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java index 530c23241..6e01fd089 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java @@ -33,7 +33,6 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; -import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; import com.watabou.noosa.Image; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; @@ -111,7 +110,7 @@ public class WandOfMagicMissile extends DamageWand { @Override public void detach() { super.detach(); - QuickSlotButton.refresh(false); + updateQuickslot(); } public int level(){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java index d49ba655c..c65f08736 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java @@ -183,7 +183,7 @@ public class QuickSlotButton extends Button implements WndBag.Listener { public void onSelect( Item item ) { if (item != null) { Dungeon.quickslot.setSlot( slotNum , item ); - refresh(false); + refresh(); } } @@ -255,19 +255,12 @@ public class QuickSlotButton extends Button implements WndBag.Listener { //couldn't find a cell, give up. return -1; } - - public static void refresh() { - refresh(true); - } - public static void refresh( boolean full ) { + public static void refresh() { for (int i = 0; i < instance.length; i++) { if (instance[i] != null) { - if (full) { - instance[i].item(select(i)); - } else { - instance[i].slot.updateText(); - } + instance[i].item(select(i)); + instance[i].enable(instance[i].active); } } }