mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-01-22 11:15:29 +01:00
Fixed two bugs reported by MrMouette
- NPE when adding first stage to a newly created quest - Chance serialization issues.
This commit is contained in:
@@ -18,7 +18,7 @@ import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
||||
public class ATContentStudio {
|
||||
|
||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||
public static final String APP_VERSION = "v0.3.3";
|
||||
public static final String APP_VERSION = "v0.3.4.dev";
|
||||
|
||||
public static boolean STARTED = false;
|
||||
public static StudioFrame frame = null;
|
||||
|
||||
@@ -160,7 +160,8 @@ public abstract class JSONElement extends GameDataElement {
|
||||
else if (chance.equals(0.1d)) return "1/1000";
|
||||
else if (chance.equals(0.01d)) return "1/10000";
|
||||
else {
|
||||
//TODO Better handling of fractions. Chance description need a complete rehaul in AT.
|
||||
if (chance.intValue() == chance) return Integer.toString(chance.intValue());
|
||||
//TODO Better handling of fractions. Chance description need a complete overhaul in AT.
|
||||
//This part does not output the input content of parseDouble(String s) in the case of fractions.
|
||||
return chance.toString();
|
||||
}
|
||||
|
||||
@@ -263,6 +263,7 @@ public class QuestEditor extends JSONElementEditor {
|
||||
}
|
||||
|
||||
public void createStage() {
|
||||
if (quest.stages == null) quest.stages = new ArrayList<Quest.QuestStage>();
|
||||
quest.stages.add(new Quest.QuestStage());
|
||||
for (TableModelListener l: listeners) {
|
||||
l.tableChanged(new TableModelEvent(this, quest.stages.size() - 1));
|
||||
@@ -283,6 +284,7 @@ public class QuestEditor extends JSONElementEditor {
|
||||
for (TableModelListener l: listeners) {
|
||||
l.tableChanged(new TableModelEvent(this, rowNumber, quest.stages.size()));
|
||||
}
|
||||
if (quest.stages.isEmpty()) quest.stages = null;
|
||||
}
|
||||
|
||||
public List<TableModelListener> listeners = new ArrayList<TableModelListener>();
|
||||
|
||||
Reference in New Issue
Block a user