From 29f730f21fc168a25b7a160f0064f68e4710af16 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 10 Jul 2020 00:35:41 -0400 Subject: [PATCH] v0.8.2: Player can now equip 3 misc items, but not all of the same type --- .../assets/messages/items/items.properties | 2 +- .../shatteredpixeldungeon/Bones.java | 11 +- .../shatteredpixeldungeon/Rankings.java | 6 +- .../actors/buffs/ArtifactRecharge.java | 8 +- .../actors/hero/Belongings.java | 102 ++++++++++++------ .../actors/hero/HeroClass.java | 4 +- .../items/KindofMisc.java | 50 ++++++--- .../items/artifacts/Artifact.java | 4 +- .../items/spells/WildEnergy.java | 4 +- .../shatteredpixeldungeon/windows/WndBag.java | 41 ++++--- .../windows/WndRanking.java | 29 ++--- 11 files changed, 172 insertions(+), 89 deletions(-) diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 5f4b47683..c8d71661b 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1661,7 +1661,7 @@ items.item.rankings_desc=Killed by: %s items.item.curse=curse items.kindofmisc.unequip_title=Unequip one item -items.kindofmisc.unequip_message=You can only wear two misc items at a time. +items.kindofmisc.unequip_message=You must unequip one of these items first. Select an item to swap with. items.kindofweapon.equip_cursed=Your grip involuntarily tightens around the weapon. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java index 3d9d8b663..8dc9a7922 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Bones.java @@ -72,7 +72,7 @@ public class Bones { private static Item pickItem(Hero hero){ Item item = null; if (Random.Int(3) != 0) { - switch (Random.Int(6)) { + switch (Random.Int(7)) { case 0: item = hero.belongings.weapon; break; @@ -80,12 +80,15 @@ public class Bones { item = hero.belongings.armor; break; case 2: - item = hero.belongings.misc1; + item = hero.belongings.artifact; break; case 3: - item = hero.belongings.misc2; + item = hero.belongings.misc; break; - case 4: case 5: + case 4: + item = hero.belongings.ring; + break; + case 5: case 6: item = Dungeon.quickslot.randomNonePlaceholder(); break; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java index 5c4292e47..23ded1983 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java @@ -154,9 +154,9 @@ public enum Rankings { Bundle handler = new Bundle(); Scroll.saveSelectively(handler, belongings.backpack.items); Potion.saveSelectively(handler, belongings.backpack.items); - //include worn rings - if (belongings.misc1 != null) belongings.backpack.items.add(belongings.misc1); - if (belongings.misc2 != null) belongings.backpack.items.add(belongings.misc2); + //include potentially worn rings + if (belongings.misc != null) belongings.backpack.items.add(belongings.misc); + if (belongings.ring != null) belongings.backpack.items.add(belongings.ring); Ring.saveSelectively(handler, belongings.backpack.items); rec.gameData.put( HANDLERS, handler); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java index 328b4d50b..8a898c43b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java @@ -45,11 +45,11 @@ public class ArtifactRecharge extends Buff { if (target instanceof Hero){ Belongings b = ((Hero) target).belongings; - if (b.misc1 instanceof Artifact){ - ((Artifact)b.misc1).charge((Hero)target); + if (b.artifact instanceof Artifact){ + ((Artifact)b.artifact).charge((Hero)target); } - if (b.misc2 instanceof Artifact){ - ((Artifact)b.misc2).charge((Hero)target); + if (b.misc instanceof Artifact){ + ((Artifact)b.misc).charge((Hero)target); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java index 60210fba0..c422ef10a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java @@ -28,8 +28,10 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -47,8 +49,9 @@ public class Belongings implements Iterable { public KindOfWeapon weapon = null; public Armor armor = null; - public KindofMisc misc1 = null; - public KindofMisc misc2 = null; + public Artifact artifact = null; + public KindofMisc misc = null; + public Ring ring = null; public Belongings( Hero owner ) { this.owner = owner; @@ -72,8 +75,9 @@ public class Belongings implements Iterable { private static final String WEAPON = "weapon"; private static final String ARMOR = "armor"; - private static final String MISC1 = "misc1"; - private static final String MISC2 = "misc2"; + private static final String ARTIFACT = "artifact"; + private static final String MISC = "misc"; + private static final String RING = "ring"; public void storeInBundle( Bundle bundle ) { @@ -81,8 +85,9 @@ public class Belongings implements Iterable { bundle.put( WEAPON, weapon ); bundle.put( ARMOR, armor ); - bundle.put( MISC1, misc1); - bundle.put( MISC2, misc2); + bundle.put( ARTIFACT, artifact ); + bundle.put( MISC, misc ); + bundle.put( RING, ring ); } public void restoreFromBundle( Bundle bundle ) { @@ -99,16 +104,38 @@ public class Belongings implements Iterable { if (armor != null){ armor.activate( owner ); } - - misc1 = (KindofMisc)bundle.get(MISC1); - if (misc1 != null) { - misc1.activate( owner ); - } - - misc2 = (KindofMisc)bundle.get(MISC2); - if (misc2 != null) { - misc2.activate( owner ); + + //pre-0.8.2 + if (bundle.contains("misc1") || bundle.contains("misc2")){ + artifact = null; + misc = null; + ring = null; + + KindofMisc m = (KindofMisc)bundle.get("misc1"); + if (m instanceof Artifact){ + artifact = (Artifact) m; + } else if (m instanceof Ring) { + ring = (Ring) m; + } + + m = (KindofMisc)bundle.get("misc2"); + if (m instanceof Artifact){ + if (artifact == null) artifact = (Artifact) m; + else misc = (Artifact) m; + } else if (m instanceof Ring) { + if (ring == null) ring = (Ring) m; + else misc = (Ring) m; + } + + } else { + artifact = (Artifact) bundle.get(ARTIFACT); + misc = (KindofMisc) bundle.get(MISC); + ring = (Ring) bundle.get(RING); } + + if (artifact != null) artifact.activate(owner); + if (misc != null) misc.activate( owner ); + if (ring != null) ring.activate( owner ); } public static void preview( GamesInProgress.Info info, Bundle bundle ) { @@ -180,13 +207,17 @@ public class Belongings implements Iterable { armor.identify(); Badges.validateItemLevelAquired( armor ); } - if (misc1 != null) { - misc1.identify(); - Badges.validateItemLevelAquired(misc1); + if (artifact != null) { + artifact.identify(); + Badges.validateItemLevelAquired(artifact); } - if (misc2 != null) { - misc2.identify(); - Badges.validateItemLevelAquired(misc2); + if (misc != null) { + misc.identify(); + Badges.validateItemLevelAquired(misc); + } + if (ring != null) { + ring.identify(); + Badges.validateItemLevelAquired(ring); } for (Item item : backpack) { if (item instanceof EquipableItem || item instanceof Wand) { @@ -196,7 +227,7 @@ public class Belongings implements Iterable { } public void uncurseEquipped() { - ScrollOfRemoveCurse.uncurse( owner, armor, weapon, misc1, misc2); + ScrollOfRemoveCurse.uncurse( owner, armor, weapon, artifact, misc, ring); } public Item randomUnequipped() { @@ -231,14 +262,18 @@ public class Belongings implements Iterable { armor.cursed = false; armor.activate( owner ); } - - if (misc1 != null) { - misc1.cursed = false; - misc1.activate( owner ); + + if (artifact != null) { + artifact.cursed = false; + artifact.activate( owner ); } - if (misc2 != null) { - misc2.cursed = false; - misc2.activate( owner ); + if (misc != null) { + misc.cursed = false; + misc.activate( owner ); + } + if (ring != null) { + ring.cursed = false; + ring.activate( owner ); } } @@ -265,7 +300,7 @@ public class Belongings implements Iterable { private Iterator backpackIterator = backpack.iterator(); - private Item[] equipped = {weapon, armor, misc1, misc2}; + private Item[] equipped = {weapon, armor, artifact, misc, ring}; private int backpackIndex = equipped.length; @Override @@ -303,10 +338,13 @@ public class Belongings implements Iterable { equipped[1] = armor = null; break; case 2: - equipped[2] = misc1 = null; + equipped[2] = artifact = null; break; case 3: - equipped[3] = misc2 = null; + equipped[3] = misc = null; + break; + case 4: + equipped[4] = ring = null; break; default: backpackIterator.remove(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index c62d9e846..93458f6ab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -163,8 +163,8 @@ public enum HeroClass { (hero.belongings.weapon = new Dagger()).identify(); CloakOfShadows cloak = new CloakOfShadows(); - (hero.belongings.misc1 = cloak).identify(); - hero.belongings.misc1.activate( hero ); + (hero.belongings.artifact = cloak).identify(); + hero.belongings.artifact.activate( hero ); ThrowingKnife knives = new ThrowingKnife(); knives.quantity(3).collect(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java index cc9e40a1c..d9ac14616 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java @@ -23,6 +23,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -36,10 +38,28 @@ public abstract class KindofMisc extends EquipableItem { @Override public boolean doEquip(final Hero hero) { - if (hero.belongings.misc1 != null && hero.belongings.misc2 != null) { + boolean equipFull = false; + if ( this instanceof Artifact + && hero.belongings.artifact != null + && hero.belongings.misc != null){ + equipFull = true; + } else if (this instanceof Ring + && hero.belongings.misc != null + && hero.belongings.ring != null){ + equipFull = true; + } - final KindofMisc m1 = hero.belongings.misc1; - final KindofMisc m2 = hero.belongings.misc2; + if (equipFull) { + + final KindofMisc m1; + final KindofMisc m2; + if (this instanceof Artifact){ + m1 = hero.belongings.artifact; + m2 = hero.belongings.misc; + } else { + m1 = hero.belongings.misc; + m2 = hero.belongings.ring; + } GameScene.show( new WndOptions(Messages.get(KindofMisc.class, "unequip_title"), @@ -66,10 +86,12 @@ public abstract class KindofMisc extends EquipableItem { } else { - if (hero.belongings.misc1 == null) { - hero.belongings.misc1 = this; - } else { - hero.belongings.misc2 = this; + if (this instanceof Artifact){ + if (hero.belongings.artifact == null) hero.belongings.artifact = (Artifact) this; + else hero.belongings.misc = (Artifact) this; + } else if (this instanceof Ring){ + if (hero.belongings.ring == null) hero.belongings.ring = (Ring) this; + else hero.belongings.misc = (Ring) this; } detach( hero.belongings.backpack ); @@ -93,10 +115,12 @@ public abstract class KindofMisc extends EquipableItem { public boolean doUnequip(Hero hero, boolean collect, boolean single) { if (super.doUnequip(hero, collect, single)){ - if (hero.belongings.misc1 == this) { - hero.belongings.misc1 = null; - } else { - hero.belongings.misc2 = null; + if (hero.belongings.artifact == this) { + hero.belongings.artifact = null; + } else if (hero.belongings.misc == this) { + hero.belongings.misc = null; + } else if (hero.belongings.ring == this){ + hero.belongings.ring = null; } return true; @@ -110,7 +134,9 @@ public abstract class KindofMisc extends EquipableItem { @Override public boolean isEquipped( Hero hero ) { - return hero.belongings.misc1 == this || hero.belongings.misc2 == this; + return hero.belongings.artifact == this + || hero.belongings.misc == this + || hero.belongings.ring == this; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 48afc5cb1..dc43a8c29 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -58,8 +58,8 @@ public class Artifact extends KindofMisc { @Override public boolean doEquip( final Hero hero ) { - if ((hero.belongings.misc1 != null && hero.belongings.misc1.getClass() == this.getClass()) - || (hero.belongings.misc2 != null && hero.belongings.misc2.getClass() == this.getClass())){ + if ((hero.belongings.artifact != null && hero.belongings.artifact.getClass() == this.getClass()) + || (hero.belongings.misc != null && hero.belongings.misc.getClass() == this.getClass())){ GLog.w( Messages.get(Artifact.class, "cannot_wear_two") ); return false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java index 3f6dd203d..9a68b9b55 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java @@ -59,8 +59,8 @@ public class WildEnergy extends TargetedSpell { hero.belongings.charge(1f); for (int i = 0; i < 4; i++){ - if (hero.belongings.misc1 instanceof Artifact) ((Artifact) hero.belongings.misc1).charge(hero); - if (hero.belongings.misc2 instanceof Artifact) ((Artifact) hero.belongings.misc2).charge(hero); + if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero); + if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero); } Buff.affect(hero, Recharging.class, 8f); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java index bd95d547d..f41852261 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.windows; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.SPDAction; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; @@ -94,11 +95,15 @@ public class WndBag extends WndTabbed { NOT_EQUIPPED } - protected static final int COLS_P = 4; - protected static final int COLS_L = 6; + protected static final int COLS_P = 5; + protected static final int COLS_L = 5; - protected static final int SLOT_WIDTH = 28; - protected static final int SLOT_HEIGHT = 28; + protected static int SLOT_WIDTH_P = 24; + protected static int SLOT_WIDTH_L = 28; + + protected static int SLOT_HEIGHT_P = 28; + protected static int SLOT_HEIGHT_L = 24; + protected static final int SLOT_MARGIN = 1; protected static final int TITLE_HEIGHT = 14; @@ -109,6 +114,9 @@ public class WndBag extends WndTabbed { private int nCols; + private int slotWidth; + private int slotHeight; + protected int count; protected int col; protected int row; @@ -132,14 +140,17 @@ public class WndBag extends WndTabbed { lastMode = mode; lastBag = bag; + slotWidth = PixelScene.landscape() ? SLOT_WIDTH_L : SLOT_WIDTH_P; + slotHeight = PixelScene.landscape() ? SLOT_HEIGHT_L : SLOT_HEIGHT_P; + nCols = PixelScene.landscape() ? COLS_L : COLS_P; - int slotsWidth = SLOT_WIDTH * nCols + SLOT_MARGIN * (nCols - 1); + int slotsWidth = slotWidth * nCols + SLOT_MARGIN * (nCols - 1); placeTitle( bag, slotsWidth ); placeItems( bag ); - int slotsHeight = SLOT_HEIGHT * row + SLOT_MARGIN * (row - 1); + int slotsHeight = slotHeight * row + SLOT_MARGIN * (row - 1); resize( slotsWidth, slotsHeight + TITLE_HEIGHT ); @@ -217,8 +228,9 @@ public class WndBag extends WndTabbed { Belongings stuff = Dungeon.hero.belongings; placeItem( stuff.weapon != null ? stuff.weapon : new Placeholder( ItemSpriteSheet.WEAPON_HOLDER ) ); placeItem( stuff.armor != null ? stuff.armor : new Placeholder( ItemSpriteSheet.ARMOR_HOLDER ) ); - placeItem( stuff.misc1 != null ? stuff.misc1 : new Placeholder( ItemSpriteSheet.RING_HOLDER ) ); - placeItem( stuff.misc2 != null ? stuff.misc2 : new Placeholder( ItemSpriteSheet.RING_HOLDER ) ); + placeItem( stuff.artifact != null ? stuff.artifact : new Placeholder( ItemSpriteSheet.ARTIFACT_HOLDER ) ); + placeItem( stuff.misc != null ? stuff.misc : new Placeholder( ItemSpriteSheet.SOMETHING ) ); + placeItem( stuff.ring != null ? stuff.ring : new Placeholder( ItemSpriteSheet.RING_HOLDER ) ); //the container itself if it's not the root backpack if (container != Dungeon.hero.belongings.backpack){ @@ -236,7 +248,7 @@ public class WndBag extends WndTabbed { } // Free Space - while ((count - 4) < container.capacity()) { + while ((count - 5) < container.capacity()) { placeItem( null ); } } @@ -245,8 +257,8 @@ public class WndBag extends WndTabbed { count++; - int x = col * (SLOT_WIDTH + SLOT_MARGIN); - int y = TITLE_HEIGHT + row * (SLOT_HEIGHT + SLOT_MARGIN); + int x = col * (slotWidth + SLOT_MARGIN); + int y = TITLE_HEIGHT + row * (slotHeight + SLOT_MARGIN); add( new ItemButton( item ).setPos( x, y ) ); @@ -357,13 +369,13 @@ public class WndBag extends WndTabbed { bg.visible = false; } - width = SLOT_WIDTH; - height = SLOT_HEIGHT; + width = slotWidth; + height = slotHeight; } @Override protected void createChildren() { - bg = new ColorBlock( SLOT_WIDTH, SLOT_HEIGHT, NORMAL ); + bg = new ColorBlock( 1, 1, NORMAL ); add( bg ); super.createChildren(); @@ -371,6 +383,7 @@ public class WndBag extends WndTabbed { @Override protected void layout() { + bg.size(width, height); bg.x = x; bg.y = y; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java index a80086f0e..de619996b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java @@ -238,11 +238,14 @@ public class WndRanking extends WndTabbed { if (stuff.armor != null) { addItem( stuff.armor ); } - if (stuff.misc1 != null) { - addItem( stuff.misc1); + if (stuff.artifact != null) { + addItem( stuff.artifact ); } - if (stuff.misc2 != null) { - addItem( stuff.misc2); + if (stuff.misc != null) { + addItem( stuff.misc ); + } + if (stuff.ring != null) { + addItem( stuff.ring ); } pos = 0; @@ -250,14 +253,14 @@ public class WndRanking extends WndTabbed { if (Dungeon.quickslot.getItem(i) != null){ QuickSlotButton slot = new QuickSlotButton(Dungeon.quickslot.getItem(i)); - slot.setRect( pos, 116, 28, 28 ); + slot.setRect( pos, 120, 28, 23 ); add(slot); } else { - ColorBlock bg = new ColorBlock( 28, 28, 0x9953564D ); + ColorBlock bg = new ColorBlock( 28, 23, 0x9953564D ); bg.x = pos; - bg.y = 116; + bg.y = 120; add(bg); } pos += 29; @@ -286,10 +289,10 @@ public class WndRanking extends WndTabbed { list.setSize( WIDTH, HEIGHT ); } } - + private class ItemButton extends Button { - public static final int HEIGHT = 28; + public static final int HEIGHT = 23; private Item item; @@ -316,7 +319,7 @@ public class WndRanking extends WndTabbed { @Override protected void createChildren() { - bg = new ColorBlock( HEIGHT, HEIGHT, 0x9953564D ); + bg = new ColorBlock( 28, HEIGHT, 0x9953564D ); add( bg ); slot = new ItemSlot(); @@ -333,7 +336,7 @@ public class WndRanking extends WndTabbed { bg.x = x; bg.y = y; - slot.setRect( x, y, HEIGHT, HEIGHT ); + slot.setRect( x, y, 28, HEIGHT ); PixelScene.align(slot); name.maxWidth((int)(width - slot.width() - 2)); @@ -365,7 +368,7 @@ public class WndRanking extends WndTabbed { private class QuickSlotButton extends ItemSlot{ - public static final int HEIGHT = 28; + public static final int HEIGHT = 23; private Item item; private ColorBlock bg; @@ -377,7 +380,7 @@ public class WndRanking extends WndTabbed { @Override protected void createChildren() { - bg = new ColorBlock( HEIGHT, HEIGHT, 0x9953564D ); + bg = new ColorBlock( 28, HEIGHT, 0x9953564D ); add( bg ); super.createChildren();