Replaced ControlPanel specific code with an observer copy

This commit is contained in:
Collin Smith 2020-08-20 22:03:34 -07:00
parent 392889b030
commit 8d7677cf50

View File

@ -116,16 +116,9 @@ public class SpellsQuickPanel extends Table implements Disposable, CharData.Skil
Riiablo.charData.getItems().addAlternateListener(new ItemData.AlternateListener() {
@Override
public void onAlternated(ItemData items, int alternate, Item LH, Item RH) {
ControlPanel controlPanel = Riiablo.game.controlPanel;
if (leftSkills) {
int leftSkillId = Riiablo.charData.getAction(Input.Buttons.LEFT);
HotkeyButton button = buttons.get(leftSkillId);
controlPanel.getLeftSkill().copy(button);
} else {
int rightSkillId = Riiablo.charData.getAction(Input.Buttons.RIGHT);
HotkeyButton button = buttons.get(rightSkillId);
controlPanel.getRightSkill().copy(button);
}
int skillId = Riiablo.charData.getAction(leftSkills ? Input.Buttons.LEFT : Input.Buttons.RIGHT);
HotkeyButton button = buttons.get(skillId);
observer.copy(button);
}
});
}