Added workaround for invalid spell cast modes

SQ defaults to SC when encountered until implemented
SpellsQuickPanel changes CharData actions for the time being
This commit is contained in:
Collin Smith 2020-08-20 22:47:26 -07:00
parent 8a820effc8
commit 0159615dba
2 changed files with 9 additions and 1 deletions

View File

@ -26,6 +26,10 @@ public class Actioneer extends PassiveSystem {
byte mode = (byte) mClass.get(entityId).type.getMode(skill.anim);
log.trace("mode: {}", mode);
if (mode == -1) { // TODO: replace -1 with some const INVALID_SKILL
mode = (byte) mClass.get(entityId).type.getMode("SC");
log.trace("changed mode to {} because it was invalid", mode);
}
mSequence.create(entityId).sequence(mode, mMovementModes.get(entityId).NU);
}

View File

@ -106,8 +106,12 @@ public class SpellsQuickPanel extends Table implements Disposable, CharData.Skil
public void onPressed(MappedKey key, int keycode) {
HotkeyButton button = keyMappings.get(key);
if (button == null) return;
// TODO: Replace Riiablo.charData.action with this button's action
observer.copy(button);
// FIXME: it isn't appropriate to have this call here -- should separate into a controller
Riiablo.charData.setAction(
Riiablo.charData.getItems().getAlternate(),
leftSkills ? Input.Buttons.LEFT : Input.Buttons.RIGHT,
button.getSkill());
}
};
for (MappedKey Skill : Keys.Skill) Skill.addStateListener(mappedKeyListener);