From d45bad230e5ef49dc1bb36037a70ec41f92ce2e7 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 18 Apr 2019 16:25:45 -0700 Subject: [PATCH] Added support for charges label Added support for charges label Adjusted component placement Refactored label to hotkey --- core/src/com/riiablo/widget/HotkeyButton.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/src/com/riiablo/widget/HotkeyButton.java b/core/src/com/riiablo/widget/HotkeyButton.java index c980fb22..8bd2cd27 100644 --- a/core/src/com/riiablo/widget/HotkeyButton.java +++ b/core/src/com/riiablo/widget/HotkeyButton.java @@ -10,7 +10,8 @@ import com.riiablo.key.MappedKey; public class HotkeyButton extends Button { MappedKey mapping; - Label label; + Label hotkey; + Label charges; int skillId; public HotkeyButton(final DC dc, final int index, int skillId) { @@ -22,8 +23,11 @@ public class HotkeyButton extends Button { }}); this.skillId = skillId; - add(label = new Label("", Riiablo.fonts.font16, Riiablo.colors.gold)); - align(Align.topRight); + add(hotkey = new Label("", Riiablo.fonts.font16, Riiablo.colors.gold)).align(Align.topRight); + row(); + add().grow(); + row(); + add(charges = new Label("", Riiablo.fonts.font16, Riiablo.colors.blue)).align(Align.bottomLeft); pad(2); pack(); @@ -32,7 +36,7 @@ public class HotkeyButton extends Button { public void map(MappedKey mapping) { this.mapping = mapping; - label.setText(Input.Keys.toString(mapping.getPrimaryAssignment())); + hotkey.setText(Input.Keys.toString(mapping.getPrimaryAssignment())); } public MappedKey getMapping() { @@ -48,7 +52,7 @@ public class HotkeyButton extends Button { setBlendMode(other.blendMode, other.color); setDisabledBlendMode(other.disabledBlendMode, other.disabledColor); setHighlightedBlendMode(other.highlightedBlendMode, other.highlightedColor); - label.setText(other.label.getText()); + hotkey.setText(other.hotkey.getText()); skillId = other.skillId; } }