mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-08-09 16:28:57 +00:00
Merge branch 'master' of https://github.com/badvision/lawless-legends
This commit is contained in:
commit
e07b7ac078
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.badvision.outlaweditor.ui;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javafx.scene.control.ListCell;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
import javafx.scene.control.cell.ComboBoxListCell;
|
||||||
|
import org.badvision.outlaweditor.data.PropertyHelper;
|
||||||
|
import org.badvision.outlaweditor.ui.impl.ApplicationUIControllerImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author blurry
|
||||||
|
*/
|
||||||
|
public abstract class EntitySelectorCell<T> extends ComboBoxListCell<T> {
|
||||||
|
static Map<TextField, Object> lastSelected = new HashMap<>();
|
||||||
|
TextField nameField;
|
||||||
|
|
||||||
|
public EntitySelectorCell(TextField tileNameField) {
|
||||||
|
super.setPrefWidth(125);
|
||||||
|
nameField = tileNameField;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSelected(boolean sel) {
|
||||||
|
if (sel) {
|
||||||
|
Object o = lastSelected.get(nameField);
|
||||||
|
if (o != null && !o.equals(getItem())) {
|
||||||
|
((ListCell) o).updateSelected(false);
|
||||||
|
}
|
||||||
|
textProperty().unbind();
|
||||||
|
textProperty().bind(nameField.textProperty());
|
||||||
|
lastSelected.put(nameField, this);
|
||||||
|
} else {
|
||||||
|
updateItem(getItem(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateItem(T item, boolean empty) {
|
||||||
|
textProperty().unbind();
|
||||||
|
super.updateItem(item, empty);
|
||||||
|
if (item != null && !(item instanceof String)) {
|
||||||
|
try {
|
||||||
|
textProperty().bind(PropertyHelper.stringProp(item, "name"));
|
||||||
|
} catch (NoSuchMethodException ex) {
|
||||||
|
Logger.getLogger(ApplicationUIControllerImpl.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
finishUpdate(item);
|
||||||
|
} else {
|
||||||
|
setText(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void finishUpdate(T item) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -127,7 +127,7 @@ public abstract class MapEditorTabController {
|
|||||||
@FXML
|
@FXML
|
||||||
abstract public void scrollMapUp(ActionEvent event);
|
abstract public void scrollMapUp(ActionEvent event);
|
||||||
|
|
||||||
protected void initalize() {
|
public void initalize() {
|
||||||
assert mapEditorAnchorPane != null : "fx:id=\"mapEditorAnchorPane\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
|
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 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 mapNameField != null : "fx:id=\"mapNameField\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
|
||||||
|
@ -85,4 +85,7 @@ public abstract class TileEditorTabController {
|
|||||||
|
|
||||||
abstract public void rebuildTileSelectors();
|
abstract public void rebuildTileSelectors();
|
||||||
|
|
||||||
|
public void initalize() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,9 @@
|
|||||||
package org.badvision.outlaweditor.ui.impl;
|
package org.badvision.outlaweditor.ui.impl;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javafx.event.Event;
|
import javafx.event.Event;
|
||||||
import javafx.scene.control.ListCell;
|
|
||||||
import javafx.scene.control.TextField;
|
|
||||||
import javafx.scene.control.cell.ComboBoxListCell;
|
|
||||||
import javafx.scene.input.DataFormat;
|
import javafx.scene.input.DataFormat;
|
||||||
import org.badvision.outlaweditor.Application;
|
import org.badvision.outlaweditor.Application;
|
||||||
import org.badvision.outlaweditor.Editor;
|
import org.badvision.outlaweditor.Editor;
|
||||||
import static org.badvision.outlaweditor.data.PropertyHelper.*;
|
|
||||||
import org.badvision.outlaweditor.data.TileUtils;
|
import org.badvision.outlaweditor.data.TileUtils;
|
||||||
import org.badvision.outlaweditor.data.TilesetUtils;
|
import org.badvision.outlaweditor.data.TilesetUtils;
|
||||||
import org.badvision.outlaweditor.data.xml.Tile;
|
import org.badvision.outlaweditor.data.xml.Tile;
|
||||||
@ -34,6 +26,9 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
|
|||||||
rebuildTileSelectors();
|
rebuildTileSelectors();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
tileController.initalize();
|
||||||
|
mapController.initalize();
|
||||||
|
imageController.initalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -127,51 +122,6 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
|
|||||||
|
|
||||||
public static final DataFormat SCRIPT_DATA_FORMAT = new DataFormat("MythosScript");
|
public static final DataFormat SCRIPT_DATA_FORMAT = new DataFormat("MythosScript");
|
||||||
|
|
||||||
abstract public static class EntitySelectorCell<T> extends ComboBoxListCell<T> {
|
|
||||||
|
|
||||||
static Map<TextField, Object> lastSelected = new HashMap<>();
|
|
||||||
TextField nameField;
|
|
||||||
|
|
||||||
public EntitySelectorCell(TextField tileNameField) {
|
|
||||||
super.setPrefWidth(125);
|
|
||||||
nameField = tileNameField;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateSelected(boolean sel) {
|
|
||||||
if (sel) {
|
|
||||||
Object o = lastSelected.get(nameField);
|
|
||||||
if (o != null && !o.equals(getItem())) {
|
|
||||||
((ListCell) o).updateSelected(false);
|
|
||||||
}
|
|
||||||
textProperty().unbind();
|
|
||||||
textProperty().bind(nameField.textProperty());
|
|
||||||
lastSelected.put(nameField, this);
|
|
||||||
} else {
|
|
||||||
updateItem(getItem(), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateItem(T item, boolean empty) {
|
|
||||||
textProperty().unbind();
|
|
||||||
super.updateItem(item, empty);
|
|
||||||
if (item != null && !(item instanceof String)) {
|
|
||||||
try {
|
|
||||||
textProperty().bind(stringProp(item, "name"));
|
|
||||||
} catch (NoSuchMethodException ex) {
|
|
||||||
Logger.getLogger(ApplicationUIControllerImpl.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
finishUpdate(item);
|
|
||||||
} else {
|
|
||||||
setText(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finishUpdate(T item) {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearData() {
|
public void clearData() {
|
||||||
tileController.setCurrentTile(null);
|
tileController.setCurrentTile(null);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.badvision.outlaweditor.ui.impl;
|
package org.badvision.outlaweditor.ui.impl;
|
||||||
|
|
||||||
|
import org.badvision.outlaweditor.ui.EntitySelectorCell;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
@ -52,7 +53,7 @@ public class ImageEditorTabControllerImpl extends ImageEditorTabController {
|
|||||||
imageSelector.setCellFactory(new Callback<ListView<Image>, ListCell<Image>>() {
|
imageSelector.setCellFactory(new Callback<ListView<Image>, ListCell<Image>>() {
|
||||||
@Override
|
@Override
|
||||||
public ListCell<Image> call(ListView<Image> param) {
|
public ListCell<Image> call(ListView<Image> param) {
|
||||||
return new ApplicationUIControllerImpl.EntitySelectorCell<Image>(imageNameField) {
|
return new EntitySelectorCell<Image>(imageNameField) {
|
||||||
@Override
|
@Override
|
||||||
public void finishUpdate(Image item) {
|
public void finishUpdate(Image item) {
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.badvision.outlaweditor.ui.impl;
|
package org.badvision.outlaweditor.ui.impl;
|
||||||
|
|
||||||
|
import org.badvision.outlaweditor.ui.EntitySelectorCell;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
@ -185,6 +186,7 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void completeInflightOperations() {
|
public void completeInflightOperations() {
|
||||||
if (getCurrentEditor() != null) {
|
if (getCurrentEditor() != null) {
|
||||||
getCurrentEditor().getCurrentMap().updateBackingMap();
|
getCurrentEditor().getCurrentMap().updateBackingMap();
|
||||||
@ -248,7 +250,7 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initalize() {
|
public void initalize() {
|
||||||
super.initalize();
|
super.initalize();
|
||||||
mapSelect.setButtonCell(new ComboBoxListCell<org.badvision.outlaweditor.data.xml.Map>() {
|
mapSelect.setButtonCell(new ComboBoxListCell<org.badvision.outlaweditor.data.xml.Map>() {
|
||||||
{
|
{
|
||||||
@ -256,7 +258,7 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(org.badvision.outlaweditor.data.xml.Map item, boolean empty) {
|
public void updateItem(Map item, boolean empty) {
|
||||||
textProperty().unbind();
|
textProperty().unbind();
|
||||||
super.updateItem(item, empty);
|
super.updateItem(item, empty);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
@ -266,13 +268,13 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mapSelect.setCellFactory(new Callback<ListView<org.badvision.outlaweditor.data.xml.Map>, ListCell<org.badvision.outlaweditor.data.xml.Map>>() {
|
mapSelect.setCellFactory(new Callback<ListView<Map>, ListCell<Map>>() {
|
||||||
@Override
|
@Override
|
||||||
public ListCell<org.badvision.outlaweditor.data.xml.Map> call(ListView<org.badvision.outlaweditor.data.xml.Map> param) {
|
public ListCell<org.badvision.outlaweditor.data.xml.Map> call(ListView<Map> param) {
|
||||||
return new ApplicationUIControllerImpl.EntitySelectorCell<org.badvision.outlaweditor.data.xml.Map>(mapNameField) {
|
return new EntitySelectorCell<Map>(mapNameField) {
|
||||||
@Override
|
@Override
|
||||||
public void finishUpdate(org.badvision.outlaweditor.data.xml.Map item) {
|
public void finishUpdate(Map item) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.badvision.outlaweditor.ui.impl;
|
package org.badvision.outlaweditor.ui.impl;
|
||||||
|
|
||||||
|
import org.badvision.outlaweditor.ui.EntitySelectorCell;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@ -156,7 +157,7 @@ public class TileEditorTabControllerImpl extends TileEditorTabController {
|
|||||||
tileSelector.setCellFactory(new Callback<ListView<Tile>, ListCell<Tile>>() {
|
tileSelector.setCellFactory(new Callback<ListView<Tile>, ListCell<Tile>>() {
|
||||||
@Override
|
@Override
|
||||||
public ListCell<Tile> call(ListView<Tile> param) {
|
public ListCell<Tile> call(ListView<Tile> param) {
|
||||||
return new ApplicationUIControllerImpl.EntitySelectorCell<Tile>(tileNameField) {
|
return new EntitySelectorCell<Tile>(tileNameField) {
|
||||||
@Override
|
@Override
|
||||||
public void finishUpdate(Tile item) {
|
public void finishUpdate(Tile item) {
|
||||||
setGraphic(new ImageView(TileUtils.getImage(item, Application.currentPlatform)));
|
setGraphic(new ImageView(TileUtils.getImage(item, Application.currentPlatform)));
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<?import javafx.scene.web.*?>
|
<?import javafx.scene.web.*?>
|
||||||
|
|
||||||
<AnchorPane id="AnchorPane" prefHeight="748.0" prefWidth="1024.0" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="org.badvision.outlaweditor.MythosScriptEditorController">
|
<AnchorPane id="AnchorPane" prefHeight="748.0" prefWidth="1024.0" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="org.badvision.outlaweditor.ui.MythosScriptEditorController">
|
||||||
<!-- <stylesheets>
|
<!-- <stylesheets>
|
||||||
<URL value="@/styles/mythosscripteditor.css"/>
|
<URL value="@/styles/mythosscripteditor.css"/>
|
||||||
</stylesheets>-->
|
</stylesheets>-->
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import java.lang.*?>
|
<?import java.lang.*?>
|
||||||
<?import java.util.*?>
|
|
||||||
<?import javafx.scene.*?>
|
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
<AnchorPane id="mapsTab" minHeight="0.0" minWidth="0.0" prefHeight="420.0000999999975" prefWidth="677.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.badvision.outlaweditor.ui.impl.MapEditorTabControllerImpl">
|
<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" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.badvision.outlaweditor.ui.impl.MapEditorTabControllerImpl">
|
||||||
<children>
|
<children>
|
||||||
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
<ToolBar prefWidth="677.0">
|
<ToolBar prefWidth="677.0">
|
||||||
<items>
|
<items>
|
||||||
<Label text="Map:" />
|
<Label text="Map:" />
|
||||||
<ComboBox fx:id="mapSelect" minWidth="125.0" onAction="#onMapSelected"/>
|
<ComboBox fx:id="mapSelect" minWidth="125.0" onAction="#onMapSelected" />
|
||||||
<Button mnemonicParsing="false" onAction="#onMapCreatePressed" text="Create new" />
|
<Button mnemonicParsing="false" onAction="#onMapCreatePressed" text="Create new" />
|
||||||
<Button mnemonicParsing="false" onAction="#onMapClonePressed" text="Clone" />
|
<Button mnemonicParsing="false" onAction="#onMapClonePressed" text="Clone" />
|
||||||
<Button mnemonicParsing="false" onAction="#onMapExportPressed" text="Export" />
|
<Button mnemonicParsing="false" onAction="#onMapExportPressed" text="Export" />
|
||||||
@ -35,35 +33,35 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
</items>
|
</items>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<HBox prefHeight="389.0" prefWidth="677.0" VBox.vgrow="ALWAYS">
|
<HBox prefHeight="438.0" prefWidth="677.0" VBox.vgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
<AnchorPane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="NEVER">
|
<AnchorPane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<Label text="Name" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="14.0" />
|
<Label text="Name" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="14.0" />
|
||||||
<TextField id="mapNameFiled" fx:id="mapNameField" layoutX="53.0" layoutY="11.0" prefWidth="147.0" />
|
<TextField id="mapNameFiled" fx:id="mapNameField" layoutX="53.0" layoutY="11.0" prefWidth="147.0" />
|
||||||
<TextField fx:id="mapWidthField" layoutX="53.0" layoutY="33.0" prefWidth="147.0" />
|
<TextField fx:id="mapWidthField" layoutX="53.0" layoutY="45.0" prefWidth="147.0" />
|
||||||
<Label layoutX="4.0" layoutY="36.0" text="Width" />
|
<Label layoutX="4.0" layoutY="50.0" prefHeight="16.0" prefWidth="42.0" text="Width" />
|
||||||
<TextField fx:id="mapHeightField" layoutX="53.0" layoutY="55.0" prefWidth="147.0" />
|
<TextField fx:id="mapHeightField" layoutX="53.0" layoutY="79.0" prefWidth="147.0" />
|
||||||
<Label layoutX="4.0" layoutY="58.0" text="Height" />
|
<Label layoutX="4.0" layoutY="84.0" prefHeight="16.0" prefWidth="42.0" text="Height" />
|
||||||
<CheckBox fx:id="mapWrapAround" contentDisplay="RIGHT" layoutX="4.0" layoutY="77.0" mnemonicParsing="false" text="Wrap at edges" />
|
<CheckBox fx:id="mapWrapAround" contentDisplay="RIGHT" layoutX="25.0" layoutY="111.0" mnemonicParsing="false" text="Wrap at edges" />
|
||||||
<Separator layoutX="4.0" layoutY="101.0" prefWidth="189.0" />
|
<Separator layoutX="6.0" layoutY="140.0" prefWidth="189.0" />
|
||||||
<Label layoutX="4.0" layoutY="108.0" text="Scripts" />
|
<Label layoutX="4.0" layoutY="141.0" text="Scripts" />
|
||||||
<ScrollPane fitToHeight="true" fitToWidth="true" prefHeight="232.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="157.0">
|
<ScrollPane fitToHeight="true" fitToWidth="true" layoutY="171.0" prefHeight="133.0" prefWidth="201.0" AnchorPane.bottomAnchor="114.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="195.0">
|
||||||
<content>
|
<content>
|
||||||
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="200.0">
|
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="95.0" prefWidth="198.0">
|
||||||
<children>
|
<children>
|
||||||
<ListView fx:id="mapScriptsList" editable="true" prefHeight="217.0" prefWidth="199.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
<ListView fx:id="mapScriptsList" editable="true" prefHeight="130.0" prefWidth="199.0" AnchorPane.bottomAnchor="-2.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
</content>
|
</content>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
<ToolBar layoutY="124.0" prefWidth="200.0">
|
<ToolBar layoutX="1.0" layoutY="157.0" prefWidth="200.0">
|
||||||
<items>
|
<items>
|
||||||
<Button mnemonicParsing="false" onAction="#onMapScriptAddPressed" text="+" />
|
<Button mnemonicParsing="false" onAction="#onMapScriptAddPressed" text="+" />
|
||||||
<Button mnemonicParsing="false" onAction="#onMapScriptDeletePressed" text="-" />
|
<Button mnemonicParsing="false" onAction="#onMapScriptDeletePressed" text="-" />
|
||||||
<Button mnemonicParsing="false" onAction="#onMapScriptClonePressed" text="Clone" />
|
<Button mnemonicParsing="false" onAction="#onMapScriptClonePressed" text="Clone" />
|
||||||
</items>
|
</items>
|
||||||
</ToolBar>
|
</ToolBar><TextArea fx:id="scriptInfo" editable="false" layoutY="340.0" prefHeight="100.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
<AnchorPane fx:id="mapEditorAnchorPane" prefHeight="389.0" prefWidth="477.0000999999975" HBox.hgrow="SOMETIMES">
|
<AnchorPane fx:id="mapEditorAnchorPane" prefHeight="389.0" prefWidth="477.0000999999975" HBox.hgrow="SOMETIMES">
|
||||||
@ -81,4 +79,4 @@
|
|||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
@ -167,11 +167,9 @@ asm syscall
|
|||||||
INX
|
INX
|
||||||
LDA ESTKL,X
|
LDA ESTKL,X
|
||||||
STA CMD
|
STA CMD
|
||||||
STX ESP
|
|
||||||
JSR $BF00
|
JSR $BF00
|
||||||
CMD: !BYTE 00
|
CMD: !BYTE 00
|
||||||
PARAMS: !WORD 0000
|
PARAMS: !WORD 0000
|
||||||
LDX ESP
|
|
||||||
STA ESTKL,X
|
STA ESTKL,X
|
||||||
LDY #$00
|
LDY #$00
|
||||||
STY ESTKH,X
|
STY ESTKH,X
|
||||||
@ -1018,7 +1016,7 @@ def adddef(bank, addr, deflast)
|
|||||||
end
|
end
|
||||||
def loadmod(mod)
|
def loadmod(mod)
|
||||||
word refnum, rdlen, modsize, bytecode, defofst, defcnt, init, fixup
|
word refnum, rdlen, modsize, bytecode, defofst, defcnt, init, fixup
|
||||||
word addr, defaddr, modaddr, modfix
|
word addr, defaddr, modaddr, modfix, modend
|
||||||
word deftbl, deflast
|
word deftbl, deflast
|
||||||
word moddep, rld, esd, sym
|
word moddep, rld, esd, sym
|
||||||
byte defbank, str[16], filename[64]
|
byte defbank, str[16], filename[64]
|
||||||
@ -1048,7 +1046,7 @@ def loadmod(mod)
|
|||||||
; Load module dependencies.
|
; Load module dependencies.
|
||||||
;
|
;
|
||||||
while ^moddep
|
while ^moddep
|
||||||
if lookupmod(moddep) == 0
|
if !lookupmod(moddep)
|
||||||
close(refnum)
|
close(refnum)
|
||||||
refnum = 0
|
refnum = 0
|
||||||
if loadmod(moddep) < 0
|
if loadmod(moddep) < 0
|
||||||
@ -1063,7 +1061,7 @@ def loadmod(mod)
|
|||||||
deftbl = allocheap(defcnt * 5 + 1)
|
deftbl = allocheap(defcnt * 5 + 1)
|
||||||
deflast = deftbl
|
deflast = deftbl
|
||||||
^deflast = 0
|
^deflast = 0
|
||||||
if refnum == 0
|
if !refnum
|
||||||
;
|
;
|
||||||
; Reset read pointer.
|
; Reset read pointer.
|
||||||
;
|
;
|
||||||
@ -1094,9 +1092,10 @@ def loadmod(mod)
|
|||||||
;
|
;
|
||||||
modfix = modaddr - modfix
|
modfix = modaddr - modfix
|
||||||
bytecode = defofst + modfix - MODADDR
|
bytecode = defofst + modfix - MODADDR
|
||||||
rld = modaddr + modsize ; Re-Locatable Directory
|
modend = modaddr + modsize
|
||||||
esd = rld ; Extern+Entry Symbol Directory
|
rld = modend ; Re-Locatable Directory
|
||||||
while ^esd <> $00 ; Scan to end of ESD
|
esd = rld ; Extern+Entry Symbol Directory
|
||||||
|
while !^esd ; Scan to end of ESD
|
||||||
esd = esd + 4
|
esd = esd + 4
|
||||||
loop
|
loop
|
||||||
esd = esd + 1
|
esd = esd + 1
|
||||||
@ -1106,6 +1105,7 @@ def loadmod(mod)
|
|||||||
if ^MACHID & $30 == $30
|
if ^MACHID & $30 == $30
|
||||||
defbank = 1
|
defbank = 1
|
||||||
defaddr = allocxheap(rld - bytecode)
|
defaddr = allocxheap(rld - bytecode)
|
||||||
|
modend = bytecode
|
||||||
else
|
else
|
||||||
defbank = 0
|
defbank = 0
|
||||||
defaddr = bytecode
|
defaddr = bytecode
|
||||||
@ -1173,11 +1173,11 @@ def loadmod(mod)
|
|||||||
; Move bytecode to AUX bank.
|
; Move bytecode to AUX bank.
|
||||||
;
|
;
|
||||||
memxcpy(0, defaddr, bytecode, modsize - (bytecode - modaddr))
|
memxcpy(0, defaddr, bytecode, modsize - (bytecode - modaddr))
|
||||||
;
|
|
||||||
; Free up the bytecode in main memory.
|
|
||||||
;
|
|
||||||
releaseheap(bytecode)
|
|
||||||
fin
|
fin
|
||||||
|
;
|
||||||
|
; Free up the end-of-module in main memory.
|
||||||
|
;
|
||||||
|
releaseheap(modend)
|
||||||
else
|
else
|
||||||
perr = perr | 0x100
|
perr = perr | 0x100
|
||||||
return -perr
|
return -perr
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
INTERP = $03D0
|
||||||
;*
|
;*
|
||||||
;* MOVE CMD DOWN TO $1000-$2000
|
;* MOVE CMD DOWN TO $1000-$2000
|
||||||
;*
|
;*
|
||||||
|
@ -509,7 +509,7 @@ void emit_def(char *name, int is_bytecode)
|
|||||||
{
|
{
|
||||||
//printf("%s%c\n", name, LBL);
|
//printf("%s%c\n", name, LBL);
|
||||||
if (is_bytecode)
|
if (is_bytecode)
|
||||||
printf("\tJSR $03D0\n");
|
printf("\tJSR\tINTERP\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void emit_codetag(int tag)
|
void emit_codetag(int tag)
|
||||||
|
@ -209,8 +209,8 @@ PAGE3 = *
|
|||||||
;*
|
;*
|
||||||
;* PAGE 3 VECTORS INTO INTERPRETER
|
;* PAGE 3 VECTORS INTO INTERPRETER
|
||||||
;*
|
;*
|
||||||
BIT LCRDEN+LCBNK2 ; $03D0 - DIRECT INTERP ENTRY
|
INTERP BIT LCRDEN+LCBNK2 ; $03D0 - DIRECT INTERP ENTRY
|
||||||
JMP INTERP
|
JMP DINTERP
|
||||||
BIT LCRDEN+LCBNK2 ; $03D6 - INDIRECT INTERP ENTRY
|
BIT LCRDEN+LCBNK2 ; $03D6 - INDIRECT INTERP ENTRY
|
||||||
JMP IINTRP
|
JMP IINTRP
|
||||||
BIT LCRDEN+LCBNK2 ; $03DC - INDIRECT INTERPX ENTRY
|
BIT LCRDEN+LCBNK2 ; $03DC - INDIRECT INTERPX ENTRY
|
||||||
@ -306,7 +306,7 @@ DISABLE80 !BYTE 21, 13, '1', 26, 13
|
|||||||
;*
|
;*
|
||||||
;* ENTER INTO BYTECODE INTERPRETER
|
;* ENTER INTO BYTECODE INTERPRETER
|
||||||
;*
|
;*
|
||||||
INTERP BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
|
DINTERP BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
|
||||||
BIT LCRWEN+LCBNK2
|
BIT LCRWEN+LCBNK2
|
||||||
PLA
|
PLA
|
||||||
STA IPL
|
STA IPL
|
||||||
@ -384,10 +384,6 @@ TIMER JSR JMPTMR
|
|||||||
;*
|
;*
|
||||||
JMPTMR JMP (TMRVEC)
|
JMPTMR JMP (TMRVEC)
|
||||||
;*
|
;*
|
||||||
;* INDIRECT JUMP TO (TMP)
|
|
||||||
;*
|
|
||||||
JMPTMP JMP (TMP)
|
|
||||||
;*
|
|
||||||
;* ADD TOS TO TOS-1
|
;* ADD TOS TO TOS-1
|
||||||
;*
|
;*
|
||||||
ADD LDA ESTKL,X
|
ADD LDA ESTKL,X
|
||||||
@ -1818,17 +1814,17 @@ IBRNCHX LDA IPL
|
|||||||
;*
|
;*
|
||||||
CALL +INC_IP
|
CALL +INC_IP
|
||||||
LDA (IP),Y
|
LDA (IP),Y
|
||||||
STA TMPL
|
STA CALLADR+1
|
||||||
+INC_IP
|
+INC_IP
|
||||||
LDA (IP),Y
|
LDA (IP),Y
|
||||||
STA TMPH
|
STA CALLADR+2
|
||||||
LDA IPH
|
LDA IPH
|
||||||
PHA
|
PHA
|
||||||
LDA IPL
|
LDA IPL
|
||||||
PHA
|
PHA
|
||||||
TYA
|
TYA
|
||||||
PHA
|
PHA
|
||||||
JSR JMPTMP
|
CALLADR JSR $FFFF
|
||||||
PLA
|
PLA
|
||||||
TAY
|
TAY
|
||||||
PLA
|
PLA
|
||||||
@ -1841,10 +1837,10 @@ CALL +INC_IP
|
|||||||
;
|
;
|
||||||
CALLX +INC_IP
|
CALLX +INC_IP
|
||||||
LDA (IP),Y
|
LDA (IP),Y
|
||||||
STA TMPL
|
STA CALXADR+1
|
||||||
+INC_IP
|
+INC_IP
|
||||||
LDA (IP),Y
|
LDA (IP),Y
|
||||||
STA TMPH
|
STA CALXADR+2
|
||||||
LDA IPH
|
LDA IPH
|
||||||
PHA
|
PHA
|
||||||
LDA IPL
|
LDA IPL
|
||||||
@ -1853,7 +1849,7 @@ CALLX +INC_IP
|
|||||||
PHA
|
PHA
|
||||||
STA ALTRDOFF
|
STA ALTRDOFF
|
||||||
CLI
|
CLI
|
||||||
JSR JMPTMP
|
CALXADR JSR $FFFF
|
||||||
SEI
|
SEI
|
||||||
STA ALTRDON
|
STA ALTRDON
|
||||||
PLA
|
PLA
|
||||||
@ -1869,9 +1865,9 @@ CALLX +INC_IP
|
|||||||
;* INDIRECT CALL TO ADDRESS (NATIVE CODE)
|
;* INDIRECT CALL TO ADDRESS (NATIVE CODE)
|
||||||
;*
|
;*
|
||||||
ICAL LDA ESTKL,X
|
ICAL LDA ESTKL,X
|
||||||
STA TMPL
|
STA ICALADR+1
|
||||||
LDA ESTKH,X
|
LDA ESTKH,X
|
||||||
STA TMPH
|
STA ICALADR+2
|
||||||
INX
|
INX
|
||||||
LDA IPH
|
LDA IPH
|
||||||
PHA
|
PHA
|
||||||
@ -1879,7 +1875,7 @@ ICAL LDA ESTKL,X
|
|||||||
PHA
|
PHA
|
||||||
TYA
|
TYA
|
||||||
PHA
|
PHA
|
||||||
JSR JMPTMP
|
ICALADR JSR $FFFF
|
||||||
PLA
|
PLA
|
||||||
TAY
|
TAY
|
||||||
PLA
|
PLA
|
||||||
@ -1891,9 +1887,9 @@ ICAL LDA ESTKL,X
|
|||||||
JMP NEXTOP
|
JMP NEXTOP
|
||||||
;
|
;
|
||||||
ICALX LDA ESTKL,X
|
ICALX LDA ESTKL,X
|
||||||
STA TMPL
|
STA ICLXADR+1
|
||||||
LDA ESTKH,X
|
LDA ESTKH,X
|
||||||
STA TMPH
|
STA ICLXADR+2
|
||||||
INX
|
INX
|
||||||
LDA IPH
|
LDA IPH
|
||||||
PHA
|
PHA
|
||||||
@ -1903,7 +1899,7 @@ ICALX LDA ESTKL,X
|
|||||||
PHA
|
PHA
|
||||||
STA ALTRDOFF
|
STA ALTRDOFF
|
||||||
CLI
|
CLI
|
||||||
JSR JMPTMP
|
ICLXADR JSR $FFFF
|
||||||
SEI
|
SEI
|
||||||
STA ALTRDON
|
STA ALTRDON
|
||||||
PLA
|
PLA
|
||||||
@ -1952,7 +1948,7 @@ ENTER4 LDA ESTKH,X
|
|||||||
STA (IFP),Y
|
STA (IFP),Y
|
||||||
DEY
|
DEY
|
||||||
INX
|
INX
|
||||||
DEC TMPL
|
DEC NPARMS
|
||||||
BNE ENTER4
|
BNE ENTER4
|
||||||
ENTER5 LDY IPY
|
ENTER5 LDY IPY
|
||||||
JMP NEXTOP
|
JMP NEXTOP
|
||||||
@ -1992,7 +1988,7 @@ ENTERX4 LDA ESTKH,X
|
|||||||
STA (IFP),Y
|
STA (IFP),Y
|
||||||
DEY
|
DEY
|
||||||
INX
|
INX
|
||||||
DEC TMPL
|
DEC NPARMS
|
||||||
BNE ENTERX4
|
BNE ENTERX4
|
||||||
ENTERX5 STA ALTRDON
|
ENTERX5 STA ALTRDON
|
||||||
LDY IPY
|
LDY IPY
|
||||||
|
Loading…
Reference in New Issue
Block a user