Explorar o código

Fixing various issues's leftover code that was not correctly merged

Sam Jaffe %!s(int64=8) %!d(string=hai) anos
pai
achega
4099baeb44

+ 1 - 0
src/main/lombok/org/leumasjaffe/charsheet/model/magic/impl/Spontaneous.java

@@ -79,6 +79,7 @@ public class Spontaneous extends DDSpellbook {
 
 	@Override
 	public void prepareSpells(int level, Collection<DDSpell> spells) {
+		if (spells == null) return;
 		final Level lInfo = get(level);
 		lInfo.spellsPerDayRemaining = lInfo.spellsPerDay = spells.size();
 	}

+ 0 - 1
src/main/lombok/org/leumasjaffe/charsheet/view/magic/SelectPreparedSpellsPanel.java

@@ -1,6 +1,5 @@
 package org.leumasjaffe.charsheet.view.magic;
 
-import org.leumasjaffe.charsheet.model.Ability.Scores;
 import org.leumasjaffe.charsheet.model.DDCharacter;
 import org.leumasjaffe.charsheet.model.DDCharacterClass;
 import org.leumasjaffe.charsheet.model.magic.impl.Prepared;

+ 2 - 4
src/main/lombok/org/leumasjaffe/charsheet/view/magic/SelectSpellsPanel.java

@@ -104,7 +104,7 @@ public class SelectSpellsPanel extends JPanel {
 		final List<DDSpell> known = new ArrayList<>(avail);
 		this.modelPrepared = new SelectSpellModel(createPrepareModel(prepared, toPrepare));
 		this.modelKnown = new SelectSpellModel(known.stream().map(DDSpell::getName).toArray());
-		putClientProperty(READY, countNone() == 0);
+		gate.set(countNone() == 0);
 		sharedValue.value(sharedValue.value() - this.modelPrepared.data.length + countNone());
 		
 		GridBagLayout gridBagLayout = new GridBagLayout();
@@ -195,9 +195,7 @@ public class SelectSpellsPanel extends JPanel {
 			}
 			tablePrepared.getSelectionModel().clearSelection();
 			tablePrepared.repaint();
-			if ((Boolean) getClientProperty(READY)) {
-				putClientProperty(READY, false);
-			}
+			gate.set(false);
 		});
 		
 		JButton button_1 = new JButton("<<");