From 9d313d51763fd604b36b5aea13ac4bdb2d7f22b1 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Sun, 29 Jan 2017 09:23:58 -0800 Subject: [PATCH] Added order field to maps. Fixed some loader bugs. --- .../ui/MapEditorTabController.java | 15 +++++------ .../ui/impl/MapEditorTabControllerImpl.java | 25 +++++++++---------- .../jaxb/OutlawSchema/OutlawSchema.xsd | 2 ++ .../src/main/resources/mapEditorTab.fxml | 15 ++++++----- .../src/org/badvision/A2PackPartitions.groovy | 20 ++++++++------- Platform/Apple/virtual/src/core/loader.s | 1 + 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/MapEditorTabController.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/MapEditorTabController.java index 6e50b983..043dc69f 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/MapEditorTabController.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/MapEditorTabController.java @@ -50,8 +50,6 @@ public abstract class MapEditorTabController { @FXML // fx:id="mapEditorAnchorPane" protected AnchorPane mapEditorAnchorPane; // Value injected by FXMLLoader - @FXML // fx:id="mapHeightField" - protected TextField mapHeightField; // Value injected by FXMLLoader @FXML // fx:id="mapNameField" protected TextField mapNameField; // Value injected by FXMLLoader @FXML // fx:id="mapScriptsList" @@ -60,10 +58,10 @@ public abstract class MapEditorTabController { protected ComboBox mapSelect; // Value injected by FXMLLoader @FXML protected Menu mapSelectTile; - @FXML // fx:id="mapWidthField" - protected TextField mapWidthField; // Value injected by FXMLLoader - @FXML // fx:id="mapWrapAround" - protected CheckBox mapWrapAround; // Value injected by FXMLLoader + @FXML // fx:id="mapOrderField" + protected TextField mapOrderField; // Value injected by FXMLLoader + @FXML // fx:id="mapDisplay3dField" + protected CheckBox mapDisplay3dField; // Value injected by FXMLLoader @FXML protected Button scriptEraseTool; @FXML @@ -151,14 +149,13 @@ public abstract class MapEditorTabController { public void initalize() { assert mapEditorAnchorPane != null : "fx:id=\"mapEditorAnchorPane\" was not injected: check your FXML file 'mapEditorTab.fxml'."; - assert mapHeightField != null : "fx:id=\"mapHeightField\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapNameField != null : "fx:id=\"mapNameField\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapScriptsList != null : "fx:id=\"mapScriptsList\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapSelect != null : "fx:id=\"mapSelect\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapSelectTile != null : "fx:id=\"mapSelectTile\" was not injected: check your FXML file 'mapEditorTab.fxml'."; - assert mapWidthField != null : "fx:id=\"mapWidthField\" was not injected: check your FXML file 'mapEditorTab.fxml'."; - assert mapWrapAround != null : "fx:id=\"mapWrapAround\" was not injected: check your FXML file 'mapEditorTab.fxml'."; + assert mapOrderField != null : "fx:id=\"mapOrderField\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert cursorInfo != null : "fx:id=\"cursorInfo\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert mapDisplay3dField != null : "fx:id=\"mapDisplay3dField\" was not injected: check your FXML file 'mapEditorTab.fxml'."; } abstract public void rebuildTileSelectors(); diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java index 66bd9c23..914c7421 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java @@ -12,6 +12,8 @@ package org.badvision.outlaweditor.ui.impl; import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; @@ -35,6 +37,7 @@ import org.badvision.outlaweditor.api.ApplicationState; import org.badvision.outlaweditor.data.DataUtilities; import static org.badvision.outlaweditor.data.PropertyHelper.bind; import static org.badvision.outlaweditor.data.PropertyHelper.stringProp; +import static org.badvision.outlaweditor.data.PropertyHelper.boolProp; import org.badvision.outlaweditor.data.TileUtils; import org.badvision.outlaweditor.data.xml.Map; import org.badvision.outlaweditor.data.xml.Script; @@ -288,14 +291,12 @@ public class MapEditorTabControllerImpl extends MapEditorTabController { getCurrentEditor().unregister(); } if (m == null) { - bind(mapHeightField.textProperty(), null); bind(mapNameField.textProperty(), null); - bind(mapWidthField.textProperty(), null); - bind(mapWrapAround.selectedProperty(), null); - mapHeightField.setDisable(true); + bind(mapOrderField.textProperty(), null); + bind(mapDisplay3dField.selectedProperty(), null); mapNameField.setDisable(true); - mapWidthField.setDisable(true); - mapWrapAround.setDisable(true); + mapOrderField.setDisable(true); + mapDisplay3dField.setDisable(true); setCurrentEditor(null); } else { if (m.getScripts() != null) { @@ -311,15 +312,13 @@ public class MapEditorTabControllerImpl extends MapEditorTabController { m.setName("Untitled"); } try { - mapHeightField.setDisable(false); mapNameField.setDisable(false); - mapWidthField.setDisable(false); - mapWrapAround.setDisable(false); -// bind(mapHeightField.textProperty(), intProp(m, "height")); + mapOrderField.setDisable(false); + mapDisplay3dField.setDisable(false); bind(mapNameField.textProperty(), stringProp(m, "name")); -// bind(mapWidthField.textProperty(), intProp(m, "width")); -// bind(mapWrapAround.selectedProperty(),boolProp(m, "wrap")); - + bind(mapOrderField.textProperty(), stringProp(m, "order")); + // Currently broken due to code generation bug in jaxb: + //bind(mapDisplay3dField.selectedProperty(), boolProp(m, "display3d")); } catch (NoSuchMethodException ex) { Logger.getLogger(ApplicationUIControllerImpl.class .getName()).log(Level.SEVERE, null, ex); diff --git a/OutlawEditor/src/main/resources/jaxb/OutlawSchema/OutlawSchema.xsd b/OutlawEditor/src/main/resources/jaxb/OutlawSchema/OutlawSchema.xsd index 2e1aea07..ebf9454f 100644 --- a/OutlawEditor/src/main/resources/jaxb/OutlawSchema/OutlawSchema.xsd +++ b/OutlawEditor/src/main/resources/jaxb/OutlawSchema/OutlawSchema.xsd @@ -94,8 +94,10 @@ + + diff --git a/OutlawEditor/src/main/resources/mapEditorTab.fxml b/OutlawEditor/src/main/resources/mapEditorTab.fxml index 841e1e64..9fc932ea 100644 --- a/OutlawEditor/src/main/resources/mapEditorTab.fxml +++ b/OutlawEditor/src/main/resources/mapEditorTab.fxml @@ -4,7 +4,7 @@ - + @@ -42,14 +42,9 @@