From b29d71d2d87610b6ac82cb4d2a4bf0706443c019 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 8 Jan 2016 01:52:56 -0500 Subject: [PATCH] v0.3.4: changed potion/scroll initials into icons --- assets/consumable_icons.png | Bin 0 -> 1020 bytes .../shatteredpixeldungeon/Assets.java | 1 + .../items/potions/Potion.java | 4 +-- .../items/potions/PotionOfExperience.java | 2 ++ .../items/potions/PotionOfFrost.java | 4 +++ .../items/potions/PotionOfHealing.java | 2 ++ .../items/potions/PotionOfInvisibility.java | 6 +++- .../items/potions/PotionOfLevitation.java | 4 +++ .../items/potions/PotionOfLiquidFlame.java | 6 +++- .../items/potions/PotionOfMight.java | 2 ++ .../items/potions/PotionOfMindVision.java | 6 +++- .../items/potions/PotionOfParalyticGas.java | 6 +++- .../items/potions/PotionOfPurity.java | 6 +++- .../items/potions/PotionOfStrength.java | 2 ++ .../items/potions/PotionOfToxicGas.java | 4 +++ .../items/scrolls/Scroll.java | 4 +-- .../items/scrolls/ScrollOfIdentify.java | 1 + .../items/scrolls/ScrollOfLullaby.java | 6 +++- .../items/scrolls/ScrollOfMagicMapping.java | 4 +++ .../scrolls/ScrollOfMagicalInfusion.java | 1 + .../items/scrolls/ScrollOfMirrorImage.java | 4 +++ .../items/scrolls/ScrollOfPsionicBlast.java | 2 ++ .../items/scrolls/ScrollOfRage.java | 6 +++- .../items/scrolls/ScrollOfRecharging.java | 6 +++- .../items/scrolls/ScrollOfRemoveCurse.java | 6 +++- .../items/scrolls/ScrollOfTeleportation.java | 6 +++- .../items/scrolls/ScrollOfTerror.java | 6 +++- .../items/scrolls/ScrollOfUpgrade.java | 1 + .../shatteredpixeldungeon/ui/ItemSlot.java | 32 +++++++++++++----- 29 files changed, 116 insertions(+), 24 deletions(-) create mode 100644 assets/consumable_icons.png diff --git a/assets/consumable_icons.png b/assets/consumable_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..3b370591e59fdc4416d7460617de282f99d86e7e GIT binary patch literal 1020 zcmeAS@N?(olHy`uVBq!ia0vp^4L~fw!3-o{wzcm9Qk(@Ik;M!Q+`=Ht$S`Y;1W=H@ z#M9T6{Q)Bf8>f5~a}`jY;aGrAh%1n02wBEZ{hwjMe>Mhdb)yFNl({|)Qog>vVI@0L z<p<%lI%*~rOpSdh}=Kuev=VRVaKKEaX;s24R|8J-M|IhFr zh^v7F2rPc|AK7r5{T^PM%>w=>WGO!^R4zs_Q||xF|Hg~|zu3$mw|%1fj#!2RWlIlC z{s*+>?A#sqUi=5y!ocufO6vbChX1RKLDpUMh1r+}v`c?iTrSWu`H~>NV34Ia0HZ_0 zf!>NfkmnhbyxmH&1&e!~Tc@_Pm7}e>ihE{FVnV_;dQH(H6@T>m%Qd!=5#~`&3(Z z>6H2cUiMoV4y;G_t=G4*X85NkDf*#%1rKBDt=27z3$AxX^|b!$H(|bU{Lujq*&X|% zSd0StU!QPb#>Dt-Gal3Ui=%IcAVzCc30|4_J{KUhxSK25j()cxH|lx*N=q|}nomFvagDfY{m1Px^Per}DLI{$*dnsC45x$0%@%Wac? znTpuU@VT^aX80Hr)6SZ&EAZ=M#hmB^{B6uvLq+)xG[] potions = { PotionOfHealing.class, @@ -270,7 +270,7 @@ public class Potion extends Item { Messages.get(Potion.class, "unknown_desc", color()); } - public String initials(){ + public Integer initials(){ return isKnown() ? initials : null; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java index 9f11522fa..c22de13f8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java @@ -25,6 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; public class PotionOfExperience extends Potion { { + initials = 0; + bones = true; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java index ceaf673ed..cea995d4a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java @@ -32,6 +32,10 @@ import com.watabou.utils.PathFinder; public class PotionOfFrost extends Potion { private static final int DISTANCE = 2; + + { + initials = 1; + } @Override public void shatter( int cell ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java index b30228c1c..3add9f473 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java @@ -34,6 +34,8 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfHealing extends Potion { { + initials = 2; + bones = true; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java index f089ac8cd..d9c38b7c6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java @@ -33,7 +33,11 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfInvisibility extends Potion { private static final float ALPHA = 0.4f; - + + { + initials = 3; + } + @Override public void apply( Hero hero ) { setKnown(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java index 2b5fca2c2..5409ae3bf 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java @@ -34,6 +34,10 @@ import com.watabou.noosa.audio.Sample; public class PotionOfLevitation extends Potion { + { + initials = 4; + } + @Override public void shatter( int cell ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java index b2f8ff85b..bfc0eab8e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java @@ -32,7 +32,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; public class PotionOfLiquidFlame extends Potion { - + + { + initials = 5; + } + @Override public void shatter( int cell ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java index 63d8a7e67..c137f6064 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java @@ -29,6 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfMight extends Potion { { + initials = 6; + bones = true; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java index 7bdc94b03..234f1fd8b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java @@ -28,7 +28,11 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfMindVision extends Potion { - + + { + initials = 7; + } + @Override public void apply( Hero hero ) { setKnown(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java index ac9914260..87492342e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java @@ -28,7 +28,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; public class PotionOfParalyticGas extends Potion { - + + { + initials = 8; + } + @Override public void shatter( int cell ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java index 0ea4274d6..ad5d2f724 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java @@ -43,7 +43,11 @@ import com.watabou.utils.PathFinder; public class PotionOfPurity extends Potion { private static final int DISTANCE = 5; - + + { + initials = 9; + } + @Override public void shatter( int cell ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java index 943588877..f12ec4ce4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java @@ -29,6 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfStrength extends Potion { { + initials = 10; + bones = true; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java index aaf503efc..9b5de07d5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java @@ -29,6 +29,10 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; public class PotionOfToxicGas extends Potion { + { + initials = 11; + } + @Override public void shatter( int cell ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java index b67d60c1c..77e15928d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java @@ -41,7 +41,7 @@ public abstract class Scroll extends Item { protected static final float TIME_TO_READ = 1f; - protected String initials = Messages.get(this, "initials"); + protected int initials; private static final Class[] scrolls = { ScrollOfIdentify.class, @@ -181,7 +181,7 @@ public abstract class Scroll extends Item { Messages.get(this, "unknown_desc", rune()); } - public String initials(){ + public Integer initials(){ return isKnown() ? initials : null; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java index 72f36b3c2..ea46895c1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; public class ScrollOfIdentify extends InventoryScroll { { + initials = 0; mode = WndBag.Mode.UNIDENTIFED; bones = true; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java index e6d0be69d..929656c86 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java @@ -33,7 +33,11 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class ScrollOfLullaby extends Scroll { - + + { + initials = 1; + } + @Override protected void doRead() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java index 8df5274fc..e4a23f2a5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java @@ -35,6 +35,10 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class ScrollOfMagicMapping extends Scroll { + { + initials = 3; + } + @Override protected void doRead() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java index ba49db442..aec7aefcf 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicalInfusion.java @@ -34,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; public class ScrollOfMagicalInfusion extends InventoryScroll { { + initials = 2; mode = WndBag.Mode.ENCHANTABLE; bones = true; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java index 30edf6b6b..678d49c59 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java @@ -33,6 +33,10 @@ import com.watabou.utils.Random; public class ScrollOfMirrorImage extends Scroll { + { + initials = 4; + } + private static final int NIMAGES = 3; @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java index 566964308..222ed1f8e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfPsionicBlast.java @@ -39,6 +39,8 @@ import com.watabou.utils.Random; public class ScrollOfPsionicBlast extends Scroll { { + initials = 5; + bones = true; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java index 5a2878e6f..cbf041861 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java @@ -35,7 +35,11 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class ScrollOfRage extends Scroll { - + + { + initials = 6; + } + @Override protected void doRead() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java index 6f3dc84e8..dbc3e39c6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java @@ -34,7 +34,11 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class ScrollOfRecharging extends Scroll { public static final float BUFF_DURATION = 30f; - + + { + initials = 7; + } + @Override protected void doRead() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java index 214fd6338..2556dd98f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java @@ -33,7 +33,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class ScrollOfRemoveCurse extends Scroll { - + + { + initials = 8; + } + @Override protected void doRead() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java index 99b427180..5ff9e2a06 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java @@ -32,7 +32,11 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.tweeners.AlphaTweener; public class ScrollOfTeleportation extends Scroll { - + + { + initials = 9; + } + @Override protected void doRead() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java index 56d877e2b..bb92069cb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java @@ -33,7 +33,11 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class ScrollOfTerror extends Scroll { - + + { + initials = 10; + } + @Override protected void doRead() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java index 0b770208c..05fc5fbdf 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java @@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; public class ScrollOfUpgrade extends InventoryScroll { { + initials = 11; mode = WndBag.Mode.UPGRADEABLE; bones = true; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java index f94a6624c..70ba65dce 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java @@ -20,6 +20,7 @@ */ package com.shatteredpixel.shatteredpixeldungeon.ui; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; @@ -38,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.watabou.noosa.BitmapText; +import com.watabou.noosa.Image; import com.watabou.noosa.ui.Button; public class ItemSlot extends Button { @@ -54,6 +56,7 @@ public class ItemSlot extends Button { protected BitmapText topLeft; protected BitmapText topRight; protected BitmapText bottomRight; + protected Image bottomRightIcon; private static final String TXT_STRENGTH = ":%d"; private static final String TXT_TYPICAL_STR = "%d?"; @@ -130,6 +133,11 @@ public class ItemSlot extends Button { bottomRight.x = x + (width - bottomRight.width()); bottomRight.y = y + (height - bottomRight.height()); } + + if (bottomRightIcon != null) { + bottomRightIcon.x = x + (width - bottomRightIcon.width()) -1; + bottomRightIcon.y = y + (height - bottomRightIcon.height()); + } } public void item( Item item ) { @@ -189,16 +197,21 @@ public class ItemSlot extends Button { bottomRight.measure(); bottomRight.hardlight( level > 0 ? UPGRADED : DEGRADED ); } else if (item instanceof Scroll || item instanceof Potion) { - if (item instanceof Scroll) bottomRight.text(((Scroll) item).initials()); - else bottomRight.text(((Potion) item).initials()); + bottomRight.text( null ); - bottomRight.measure(); - - if (item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion - || item instanceof PotionOfStrength || item instanceof PotionOfMight) - bottomRight.hardlight( UPGRADED ); - else - bottomRight.hardlight( FADED ); + Integer iconInt; + if (item instanceof Scroll){ + iconInt = ((Scroll) item).initials(); + } else { + iconInt = ((Potion) item).initials(); + } + if (iconInt != null) { + bottomRightIcon = new Image(Assets.CONS_ICONS); + int left = iconInt*7; + int top = item instanceof Potion ? 0 : 8; + bottomRightIcon.frame(left, top, 7, 8); + add(bottomRightIcon); + } } else { bottomRight.text( null ); @@ -217,6 +230,7 @@ public class ItemSlot extends Button { topLeft.alpha( alpha ); topRight.alpha( alpha ); bottomRight.alpha( alpha ); + if (bottomRightIcon != null) bottomRightIcon.alpha( alpha ); } public void showParams( boolean TL, boolean TR, boolean BR ) {