mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-13 18:30:38 +00:00
Merge branch 'master' of https://github.com/badvision/lawless-legends
This commit is contained in:
commit
994205c842
@ -0,0 +1,76 @@
|
||||
package org.badvision.outlaweditor;
|
||||
|
||||
import javafx.scene.layout.Pane;
|
||||
import org.badvision.outlaweditor.data.xml.Global;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
import org.badvision.outlaweditor.data.xml.Scripts;
|
||||
|
||||
public class GlobalEditor extends Editor<Global, Void>{
|
||||
|
||||
@Override
|
||||
public void addScript(Script script) {
|
||||
Scripts scripts = Application.gameData.getGlobal().getScripts();
|
||||
if (scripts == null) {
|
||||
Application.gameData.getGlobal().setScripts(new Scripts());
|
||||
scripts = Application.gameData.getGlobal().getScripts();
|
||||
}
|
||||
scripts.getScript().add(script);
|
||||
}
|
||||
|
||||
|
||||
public void removeScript(Script script) {
|
||||
Scripts scripts = Application.gameData.getGlobal().getScripts();
|
||||
scripts.getScript().remove(script);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDrawMode(Void drawMode) {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showShiftUI() {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildEditorUI(Pane targetPane) {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregister() {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copy() {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paste() {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void select() {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectNone() {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redraw() {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void observedObjectChanged(Global object) {
|
||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
}
|
@ -36,6 +36,7 @@ import org.badvision.outlaweditor.data.TileMap;
|
||||
import org.badvision.outlaweditor.data.TileUtils;
|
||||
import org.badvision.outlaweditor.data.xml.Map;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
import org.badvision.outlaweditor.data.xml.Scripts;
|
||||
import org.badvision.outlaweditor.data.xml.Tile;
|
||||
import org.badvision.outlaweditor.ui.ToolType;
|
||||
import org.badvision.outlaweditor.ui.UIAction;
|
||||
@ -143,7 +144,7 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
||||
@Override
|
||||
public void addScript(Script script) {
|
||||
if (getCurrentMap().getBackingMap().getScripts() == null) {
|
||||
getCurrentMap().getBackingMap().setScripts(new Map.Scripts());
|
||||
getCurrentMap().getBackingMap().setScripts(new Scripts());
|
||||
}
|
||||
getCurrentMap().getBackingMap().getScripts().getScript().add(script);
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package org.badvision.outlaweditor.data;
|
||||
|
||||
import org.badvision.outlaweditor.Application;
|
||||
import org.badvision.outlaweditor.data.xml.Global;
|
||||
import org.badvision.outlaweditor.data.xml.Scripts;
|
||||
|
||||
public class DataUtilities {
|
||||
public static void sortScripts(Scripts s) {
|
||||
if (s == null || s.getScript() == null) {
|
||||
return;
|
||||
}
|
||||
s.getScript().sort((a, b) -> {
|
||||
if (a.getName().equalsIgnoreCase("init")) {
|
||||
return -1;
|
||||
} else if (b.getName().equalsIgnoreCase("init")) {
|
||||
return 1;
|
||||
}
|
||||
return a.getName().compareTo(b.getName());
|
||||
});
|
||||
}
|
||||
|
||||
public static void ensureGlobalExists() {
|
||||
if (Application.gameData.getGlobal() == null) {
|
||||
Application.gameData.setGlobal(new Global());
|
||||
}
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ import org.badvision.outlaweditor.data.xml.Map.Chunk;
|
||||
import org.badvision.outlaweditor.data.xml.ObjectFactory;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
import org.badvision.outlaweditor.data.xml.Script.LocationTrigger;
|
||||
import org.badvision.outlaweditor.data.xml.Scripts;
|
||||
import org.badvision.outlaweditor.data.xml.Tile;
|
||||
import org.badvision.outlaweditor.ui.UIAction;
|
||||
|
||||
@ -165,7 +166,7 @@ public class TileMap extends ArrayList<ArrayList<Tile>> implements Serializable
|
||||
width = 0;
|
||||
height = 0;
|
||||
Set<Tile> unknownTiles = new HashSet<>();
|
||||
Map.Scripts scripts = m.getScripts();
|
||||
Scripts scripts = m.getScripts();
|
||||
if (scripts != null) {
|
||||
scripts.getScript().forEach(
|
||||
s -> s.getLocationTrigger().forEach(
|
||||
|
@ -31,6 +31,8 @@ public abstract class ApplicationUIController {
|
||||
protected MapEditorTabController mapController;
|
||||
@FXML
|
||||
protected ImageEditorTabController imageController;
|
||||
@FXML
|
||||
protected GlobalEditorTabController globalController;
|
||||
|
||||
@FXML // URL location of the FXML file that was given to the FXMLLoader
|
||||
protected URL location;
|
||||
@ -47,7 +49,7 @@ public abstract class ApplicationUIController {
|
||||
abstract public void imageTabActivated(Event event);
|
||||
|
||||
@FXML
|
||||
abstract public void scriptTabActivated(Event event);
|
||||
abstract public void globalTabActivated(Event event);
|
||||
|
||||
@FXML // This method is called by the FXMLLoader when initialization is complete
|
||||
public void initialize() {
|
||||
|
@ -0,0 +1,45 @@
|
||||
package org.badvision.outlaweditor.ui;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.ListView;
|
||||
import org.badvision.outlaweditor.GlobalEditor;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
|
||||
public abstract class GlobalEditorTabController {
|
||||
private final GlobalEditor currentEditor = new GlobalEditor();
|
||||
|
||||
public GlobalEditor getCurrentEditor() {
|
||||
return currentEditor;
|
||||
}
|
||||
@FXML
|
||||
protected ListView<Script> globalScriptList;
|
||||
@FXML
|
||||
protected ListView<?> dataTypeList;
|
||||
@FXML
|
||||
protected ListView<?> variableList;
|
||||
|
||||
@FXML
|
||||
abstract protected void onScriptAddPressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onScriptDeletePressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onScriptClonePressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onDataTypeAddPressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onDataTypeDeletePressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onDeleteClonePressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onVariableAddPressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onVariableDeletePressed(ActionEvent event);
|
||||
@FXML
|
||||
abstract protected void onVariableClonePressed(ActionEvent event);
|
||||
|
||||
abstract public void redrawGlobalScripts();
|
||||
public void initialize() {
|
||||
redrawGlobalScripts();
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@ import static org.badvision.outlaweditor.Application.currentPlatform;
|
||||
import org.badvision.outlaweditor.FileUtils;
|
||||
import org.badvision.outlaweditor.MythosEditor;
|
||||
import org.badvision.outlaweditor.apple.ImageDitherEngine;
|
||||
import org.badvision.outlaweditor.data.DataUtilities;
|
||||
import org.badvision.outlaweditor.data.TileUtils;
|
||||
import org.badvision.outlaweditor.data.TilesetUtils;
|
||||
import org.badvision.outlaweditor.data.xml.GameData;
|
||||
@ -110,6 +111,7 @@ public class UIAction {
|
||||
ApplicationUIController.getController().clearData();
|
||||
TilesetUtils.clear();
|
||||
Application.gameData = newData;
|
||||
DataUtilities.ensureGlobalExists();
|
||||
ApplicationUIController.getController().updateSelectors();
|
||||
break;
|
||||
case Quit:
|
||||
|
@ -26,6 +26,7 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
|
||||
tileController.initalize();
|
||||
mapController.initalize();
|
||||
imageController.initalize();
|
||||
globalController.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,7 +66,11 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
|
||||
|
||||
@Override
|
||||
public void redrawScripts() {
|
||||
mapController.redrawMapScripts();
|
||||
if (currentTab == TABS.map) {
|
||||
mapController.redrawMapScripts();
|
||||
} else {
|
||||
globalController.redrawGlobalScripts();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,7 +89,7 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
|
||||
}
|
||||
|
||||
public static enum TABS {
|
||||
image, map, tile, scripting
|
||||
image, map, tile, global
|
||||
};
|
||||
TABS currentTab;
|
||||
|
||||
@ -104,8 +109,8 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scriptTabActivated(Event event) {
|
||||
currentTab = TABS.scripting;
|
||||
public void globalTabActivated(Event event) {
|
||||
currentTab = TABS.global;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -117,6 +122,8 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
|
||||
return mapController.getCurrentEditor();
|
||||
case tile:
|
||||
return tileController.getCurrentTileEditor();
|
||||
case global:
|
||||
return globalController.getCurrentEditor();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -0,0 +1,121 @@
|
||||
package org.badvision.outlaweditor.ui.impl;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.control.ListCell;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
import javafx.util.Callback;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import org.badvision.outlaweditor.Application;
|
||||
import org.badvision.outlaweditor.TransferHelper;
|
||||
import org.badvision.outlaweditor.data.DataUtilities;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
import org.badvision.outlaweditor.ui.GlobalEditorTabController;
|
||||
import org.badvision.outlaweditor.ui.UIAction;
|
||||
import static org.badvision.outlaweditor.ui.UIAction.editScript;
|
||||
|
||||
public class GlobalEditorTabControllerImpl extends GlobalEditorTabController {
|
||||
|
||||
@Override
|
||||
protected void onScriptAddPressed(ActionEvent event) {
|
||||
UIAction.createAndEditScript();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onScriptDeletePressed(ActionEvent event) {
|
||||
Script script = globalScriptList.getSelectionModel().getSelectedItem();
|
||||
if (script != null) {
|
||||
getCurrentEditor().removeScript(script);
|
||||
redrawGlobalScripts();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onScriptClonePressed(ActionEvent event) {
|
||||
Script source = globalScriptList.getSelectionModel().getSelectedItem();
|
||||
if (source == null) {
|
||||
String message = "First select a script and then press Clone";
|
||||
UIAction.alert(message);
|
||||
} else {
|
||||
try {
|
||||
Script script = TransferHelper.cloneObject(source, Script.class, "script");
|
||||
script.setName(source.getName() + " CLONE");
|
||||
getCurrentEditor().addScript(script);
|
||||
editScript(script);
|
||||
} catch (JAXBException ex) {
|
||||
Logger.getLogger(MapEditorTabControllerImpl.class.getName()).log(Level.SEVERE, null, ex);
|
||||
UIAction.alert("Error occured when attempting clone operation:\n" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDataTypeAddPressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDataTypeDeletePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeleteClonePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onVariableAddPressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onVariableDeletePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onVariableClonePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redrawGlobalScripts() {
|
||||
DataUtilities.ensureGlobalExists();
|
||||
globalScriptList.setOnEditStart((ListView.EditEvent<Script> event) -> {
|
||||
UIAction.editScript(event.getSource().getItems().get(event.getIndex()));
|
||||
});
|
||||
globalScriptList.setCellFactory(new Callback<ListView<Script>, ListCell<Script>>() {
|
||||
@Override
|
||||
public ListCell<Script> call(ListView<Script> param) {
|
||||
final ListCell<Script> cell = new ListCell<Script>() {
|
||||
|
||||
@Override
|
||||
protected void updateItem(Script item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
if (empty || item == null) {
|
||||
setText("");
|
||||
} else {
|
||||
// ImageView visibleIcon = getVisibleIcon(item);
|
||||
// visibleIcon.setOnMouseClicked((e) -> {
|
||||
// toggleVisibility(visibleIcon, item);
|
||||
// mapScriptsList.getSelectionModel().clearSelection();
|
||||
// });
|
||||
// setGraphic(visibleIcon);
|
||||
// getCurrentEditor().getCurrentMap().getScriptColor(item).ifPresent(this::setTextFill);
|
||||
setText(item.getName());
|
||||
setFont(Font.font(null, FontWeight.BOLD, 12.0));
|
||||
// scriptDragDrop.registerDragSupport(this, item);
|
||||
// visibleIcon.setMouseTransparent(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
return cell;
|
||||
}
|
||||
});
|
||||
if (globalScriptList.getItems() != null && Application.gameData.getGlobal().getScripts() != null) {
|
||||
DataUtilities.sortScripts(Application.gameData.getGlobal().getScripts());
|
||||
globalScriptList.getItems().setAll(Application.gameData.getGlobal().getScripts().getScript());
|
||||
} else {
|
||||
globalScriptList.getItems().clear();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package org.badvision.outlaweditor.ui.impl;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.ListView;
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
*
|
||||
* @author blurry
|
||||
*/
|
||||
public class GlobalScriptTabControllerImpl implements Initializable {
|
||||
@FXML
|
||||
private ListView<?> globalScriptList;
|
||||
@FXML
|
||||
private ListView<?> dataTypeList;
|
||||
@FXML
|
||||
private ListView<?> variableList;
|
||||
|
||||
/**
|
||||
* Initializes the controller class.
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onScriptAddPressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onScriptDeletePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onScriptClonePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onDataTypeAddPressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onDataTypeDeletePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onDeleteClonePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onVariableAddPressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onVariableDeletePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onVariableClonePressed(ActionEvent event) {
|
||||
}
|
||||
|
||||
}
|
@ -22,11 +22,13 @@ import static org.badvision.outlaweditor.Application.currentPlatform;
|
||||
import static org.badvision.outlaweditor.Application.gameData;
|
||||
import org.badvision.outlaweditor.MapEditor;
|
||||
import org.badvision.outlaweditor.TransferHelper;
|
||||
import org.badvision.outlaweditor.data.DataUtilities;
|
||||
import static org.badvision.outlaweditor.data.PropertyHelper.bind;
|
||||
import static org.badvision.outlaweditor.data.PropertyHelper.stringProp;
|
||||
import org.badvision.outlaweditor.data.TileUtils;
|
||||
import org.badvision.outlaweditor.data.xml.Map;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
import org.badvision.outlaweditor.data.xml.Scripts;
|
||||
import org.badvision.outlaweditor.data.xml.Tile;
|
||||
import org.badvision.outlaweditor.ui.EntitySelectorCell;
|
||||
import org.badvision.outlaweditor.ui.MapEditorTabController;
|
||||
@ -267,7 +269,7 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
||||
mapWrapAround.setDisable(true);
|
||||
setCurrentEditor(null);
|
||||
} else {
|
||||
sortScripts(m);
|
||||
DataUtilities.sortScripts(m.getScripts());
|
||||
if (m.getHeight() == null) {
|
||||
m.setHeight(512);
|
||||
}
|
||||
@ -412,7 +414,7 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
||||
mapScriptsList.getItems().clear();
|
||||
} else {
|
||||
if (mapScriptsList.getItems() != null && getCurrentMap().getScripts() != null) {
|
||||
sortScripts(getCurrentMap());
|
||||
DataUtilities.sortScripts(getCurrentMap().getScripts());
|
||||
mapScriptsList.getItems().setAll(getCurrentMap().getScripts().getScript());
|
||||
} else {
|
||||
mapScriptsList.getItems().clear();
|
||||
@ -443,18 +445,4 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
||||
visibilityIcon.setImage(VISIBLE_IMAGE);
|
||||
}
|
||||
}
|
||||
|
||||
private void sortScripts(Map m) {
|
||||
if (m == null || m.getScripts() == null || m.getScripts().getScript() == null) {
|
||||
return;
|
||||
}
|
||||
m.getScripts().getScript().sort((a, b) -> {
|
||||
if (a.getName().equalsIgnoreCase("init")) {
|
||||
return -1;
|
||||
} else if (b.getName().equalsIgnoreCase("init")) {
|
||||
return 1;
|
||||
}
|
||||
return a.getName().compareTo(b.getName());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,9 @@
|
||||
<fx:include fx:id="image" source="imageEditorTab.fxml" />
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab onSelectionChanged="#scriptTabActivated" text="Scripting">
|
||||
<Tab onSelectionChanged="#globalTabActivated" text="Scripting">
|
||||
<content>
|
||||
<fx:include fx:id="scripting" source="globalScriptEditorTab.fxml" />
|
||||
<fx:include fx:id="global" source="globalEditorTab.fxml" />
|
||||
</content>
|
||||
</Tab>
|
||||
</tabs>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<AnchorPane id="mapsTab" minHeight="0.0" minWidth="0.0" prefHeight="480.0" prefWidth="677.0" stylesheets="@styles/applicationui.css" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.badvision.outlaweditor.ui.impl.GlobalScriptTabControllerImpl">
|
||||
<AnchorPane id="mapsTab" minHeight="0.0" minWidth="0.0" prefHeight="480.0" prefWidth="677.0" stylesheets="@styles/applicationui.css" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.badvision.outlaweditor.ui.impl.GlobalEditorTabControllerImpl">
|
||||
<children>
|
||||
<HBox prefHeight="438.0" prefWidth="677.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
@ -42,10 +42,10 @@
|
||||
</xs:element>
|
||||
<xs:element name="intervalTrigger" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="start" type="xs:int" use="optional"/>
|
||||
<xs:attribute name="end" type="xs:int" use="optional"/>
|
||||
<xs:attribute name="period" type="xs:int" use="optional"/>
|
||||
<xs:attribute name="ifTrue" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="start" type="xs:int" use="optional"/>
|
||||
<xs:attribute name="end" type="xs:int" use="optional"/>
|
||||
<xs:attribute name="period" type="xs:int" use="optional"/>
|
||||
<xs:attribute name="ifTrue" type="xs:string" use="optional"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
@ -61,13 +61,7 @@
|
||||
<xs:attribute name="y" type="xs:int"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="scripts">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="script" type="tns:script" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="scripts" type="tns:scripts"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string"/>
|
||||
<xs:attribute name="width" type="xs:int"/>
|
||||
@ -77,6 +71,16 @@
|
||||
<xs:attribute name="startX" type="xs:int" default="0"/>
|
||||
<xs:attribute name="startY" type="xs:int" default="0"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="global">
|
||||
<xs:sequence>
|
||||
<xs:element name="scripts" type="tns:scripts"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="scripts">
|
||||
<xs:sequence>
|
||||
<xs:element name="script" type="tns:script" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="block">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="next" type="tns:next"/>
|
||||
@ -132,6 +136,7 @@
|
||||
<xs:element name="gameData">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="global" minOccurs="0" maxOccurs="1" type="tns:global"/>
|
||||
<xs:element name="image" minOccurs="0" maxOccurs="unbounded" type="tns:image"/>
|
||||
<xs:element name="tile" minOccurs="0" maxOccurs="unbounded" type="tns:tile"/>
|
||||
<xs:element name="map" minOccurs="0" maxOccurs="unbounded" type="tns:map"/>
|
||||
|
@ -9,7 +9,7 @@ import javax.xml.bind.Marshaller;
|
||||
import org.badvision.outlaweditor.data.xml.Block;
|
||||
import org.badvision.outlaweditor.data.xml.GameData;
|
||||
import org.badvision.outlaweditor.data.xml.Map;
|
||||
import org.badvision.outlaweditor.data.xml.Map.Scripts;
|
||||
import org.badvision.outlaweditor.data.xml.Scripts;
|
||||
import org.badvision.outlaweditor.data.xml.Script;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
Loading…
x
Reference in New Issue
Block a user