|
|
@@ -36,7 +36,9 @@ import javax.swing.JLabel;
|
|
|
@SuppressWarnings("serial")
|
|
|
@FieldDefaults(level=AccessLevel.PRIVATE, makeFinal=true)
|
|
|
class UpdateClassWithLevelPanel extends JPanel {
|
|
|
+ static int CHOOSE_SKILL_INDEX = 0;
|
|
|
static int LEARN_SPELL_INDEX = 1;
|
|
|
+ static int PREPARE_SPELL_INDEX = 2;
|
|
|
|
|
|
BoolGate readyCount = new BoolGate(3);
|
|
|
ObservableListener<Consumer<Boolean>, BoolGate> listener;
|
|
|
@@ -70,7 +72,7 @@ class UpdateClassWithLevelPanel extends JPanel {
|
|
|
|
|
|
JPanel skills = new SkillLevelUpPanel(info.ddCharacter, info.ddClass) {
|
|
|
@Override public void setIsReady(boolean b) {
|
|
|
- readyCount.set(0, b);
|
|
|
+ readyCount.set(CHOOSE_SKILL_INDEX, b);
|
|
|
ObserverDispatch.notifySubscribers(readyCount, null);
|
|
|
}
|
|
|
};
|
|
|
@@ -82,7 +84,7 @@ class UpdateClassWithLevelPanel extends JPanel {
|
|
|
if (sb.learnsSpells()) {
|
|
|
LevelUpSpellPanel spells = new LevelUpSpellPanel(LEARN,
|
|
|
new SelectSpellsPanel.Info(info.ddCharacter, info.ddClass),
|
|
|
- readyCount, LEARN_SPELL_INDEX);
|
|
|
+ readyCount.handle(LEARN_SPELL_INDEX));
|
|
|
tabbedPane.addTab("Learn Spells", null, spells, null);
|
|
|
if (sb.preparesSpells()) {
|
|
|
learnAndPrepareListener = new ObservableListener<>(this, (c, v) -> {
|
|
|
@@ -99,7 +101,7 @@ class UpdateClassWithLevelPanel extends JPanel {
|
|
|
else if (sb.preparesSpells()) {
|
|
|
LevelUpSpellPanel spells = new LevelUpSpellPanel(PREPARE,
|
|
|
new SelectSpellsPanel.Info(info.ddCharacter, info.ddClass),
|
|
|
- readyCount, 2);
|
|
|
+ readyCount.handle(PREPARE_SPELL_INDEX));
|
|
|
tabbedPane.addTab("Prepare Spells", null, spells, null);
|
|
|
}
|
|
|
});
|
|
|
@@ -156,7 +158,7 @@ class UpdateClassWithLevelPanel extends JPanel {
|
|
|
|
|
|
learnSpells = new LevelUpSpellPanel(pick,
|
|
|
new SelectSpellsPanel.Info(info.ddCharacter, info.ddClass),
|
|
|
- readyCount, 2);
|
|
|
+ readyCount.handle(PREPARE_SPELL_INDEX));
|
|
|
tabbedPane.addTab("Prepare Spells", null, learnSpells, null);
|
|
|
}
|
|
|
|