mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-04 07:17:26 +07:00
Added support for charges label
Added support for charges label Adjusted component placement Refactored label to hotkey
This commit is contained in:
@ -10,7 +10,8 @@ import com.riiablo.key.MappedKey;
|
|||||||
|
|
||||||
public class HotkeyButton extends Button {
|
public class HotkeyButton extends Button {
|
||||||
MappedKey mapping;
|
MappedKey mapping;
|
||||||
Label label;
|
Label hotkey;
|
||||||
|
Label charges;
|
||||||
int skillId;
|
int skillId;
|
||||||
|
|
||||||
public HotkeyButton(final DC dc, final int index, int skillId) {
|
public HotkeyButton(final DC dc, final int index, int skillId) {
|
||||||
@ -22,8 +23,11 @@ public class HotkeyButton extends Button {
|
|||||||
}});
|
}});
|
||||||
|
|
||||||
this.skillId = skillId;
|
this.skillId = skillId;
|
||||||
add(label = new Label("", Riiablo.fonts.font16, Riiablo.colors.gold));
|
add(hotkey = new Label("", Riiablo.fonts.font16, Riiablo.colors.gold)).align(Align.topRight);
|
||||||
align(Align.topRight);
|
row();
|
||||||
|
add().grow();
|
||||||
|
row();
|
||||||
|
add(charges = new Label("", Riiablo.fonts.font16, Riiablo.colors.blue)).align(Align.bottomLeft);
|
||||||
pad(2);
|
pad(2);
|
||||||
pack();
|
pack();
|
||||||
|
|
||||||
@ -32,7 +36,7 @@ public class HotkeyButton extends Button {
|
|||||||
|
|
||||||
public void map(MappedKey mapping) {
|
public void map(MappedKey mapping) {
|
||||||
this.mapping = mapping;
|
this.mapping = mapping;
|
||||||
label.setText(Input.Keys.toString(mapping.getPrimaryAssignment()));
|
hotkey.setText(Input.Keys.toString(mapping.getPrimaryAssignment()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MappedKey getMapping() {
|
public MappedKey getMapping() {
|
||||||
@ -48,7 +52,7 @@ public class HotkeyButton extends Button {
|
|||||||
setBlendMode(other.blendMode, other.color);
|
setBlendMode(other.blendMode, other.color);
|
||||||
setDisabledBlendMode(other.disabledBlendMode, other.disabledColor);
|
setDisabledBlendMode(other.disabledBlendMode, other.disabledColor);
|
||||||
setHighlightedBlendMode(other.highlightedBlendMode, other.highlightedColor);
|
setHighlightedBlendMode(other.highlightedBlendMode, other.highlightedColor);
|
||||||
label.setText(other.label.getText());
|
hotkey.setText(other.hotkey.getText());
|
||||||
skillId = other.skillId;
|
skillId = other.skillId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user