Initial work on the new in game wiki
This commit is contained in:
parent
4f01850616
commit
9e107c849f
10 changed files with 268 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
package techreborn.manual.designer;
|
||||
|
||||
import javafx.scene.control.TreeItem;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class ManualCatergories {
|
||||
|
||||
//Top level
|
||||
public static TreeItem<String> contents;
|
||||
public static TreeItem<String> blocks;
|
||||
public static TreeItem<String> items;
|
||||
}
|
72
src/main/java/techreborn/manual/designer/ManualDesigner.java
Normal file
72
src/main/java/techreborn/manual/designer/ManualDesigner.java
Normal file
|
@ -0,0 +1,72 @@
|
|||
package techreborn.manual.designer;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.JavaFXBuilderFactory;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.TreeItem;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.stage.Stage;
|
||||
import techreborn.manual.designer.windows.MainWindowController;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class ManualDesigner extends Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
URL fxmlUrl = classLoader.getResource("assets/techreborn/designer/mainWindow.fxml");
|
||||
|
||||
FXMLLoader fxmlLoader = new FXMLLoader();
|
||||
fxmlLoader.setLocation(fxmlUrl);
|
||||
fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
|
||||
|
||||
Parent root = fxmlLoader.load(fxmlUrl.openStream());
|
||||
Scene scene = new Scene(root,900, 550);
|
||||
primaryStage.setTitle("TechReborn Manual Designer");
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
MainWindowController controller = fxmlLoader.getController();
|
||||
|
||||
ManualCatergories.contents = new TreeItem<>("Contents");
|
||||
ManualCatergories.contents.setExpanded(true);
|
||||
|
||||
ManualCatergories.blocks = new TreeItem<>("Blocks");
|
||||
|
||||
ManualCatergories.contents.getChildren().add(ManualCatergories.blocks);
|
||||
|
||||
ManualCatergories.items = new TreeItem<>("Items");
|
||||
ManualCatergories.contents.getChildren().add(ManualCatergories.items);
|
||||
|
||||
controller.treeList.setRoot(ManualCatergories.contents);
|
||||
|
||||
controller.treeList.getSelectionModel().selectedItemProperty().addListener( new ChangeListener() {
|
||||
|
||||
@Override
|
||||
public void changed(ObservableValue observable, Object oldValue,
|
||||
Object newValue) {
|
||||
TreeItem<String> selectedItem = (TreeItem<String>) newValue;
|
||||
//TODO things if needed
|
||||
}
|
||||
});
|
||||
|
||||
controller.image.setImage(new Image("assets/techreborn/textures/manual/gui/manual.png"));
|
||||
controller.image.setPreserveRatio(true);
|
||||
controller.image.setSmooth(true);
|
||||
controller.image.setCache(true);
|
||||
controller.image.setFitHeight(1000);
|
||||
controller.image.setFitWidth(1000);
|
||||
controller.image.fitWidthProperty().bind(controller.renderPane.widthProperty());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package techreborn.manual.designer.exporter;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class Exporter {
|
||||
|
||||
public static void export(){
|
||||
|
||||
//TODO things
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.manual.designer.windows;
|
||||
|
||||
import javafx.event.Event;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.MenuBar;
|
||||
import javafx.scene.control.SplitPane;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.control.TreeItem;
|
||||
import javafx.scene.control.TreeView;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class MainWindowController {
|
||||
public MenuBar menuBar;
|
||||
public SplitPane splitPane;
|
||||
public TreeView treeList;
|
||||
public ImageView image;
|
||||
public AnchorPane renderPane;
|
||||
public Button buttonNew;
|
||||
public TextArea textInput;
|
||||
|
||||
public void newItem(Event event) {
|
||||
if(treeList.getSelectionModel().getSelectedItem() instanceof TreeItem){
|
||||
TreeItem item = (TreeItem) treeList.getSelectionModel().getSelectedItem();
|
||||
item.getChildren().add(new TreeItem<String>("hi"));
|
||||
item.setExpanded(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
20
src/main/java/techreborn/manual/saveFormat/Entry.java
Normal file
20
src/main/java/techreborn/manual/saveFormat/Entry.java
Normal file
|
@ -0,0 +1,20 @@
|
|||
package techreborn.manual.saveFormat;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class Entry {
|
||||
|
||||
String registryName;
|
||||
|
||||
MetaData meta;
|
||||
|
||||
/**
|
||||
* This says what type of page it is, crafting, image, ect
|
||||
*
|
||||
* //TODO use class name?
|
||||
*/
|
||||
String type;
|
||||
|
||||
EntryData data;
|
||||
}
|
15
src/main/java/techreborn/manual/saveFormat/EntryData.java
Normal file
15
src/main/java/techreborn/manual/saveFormat/EntryData.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package techreborn.manual.saveFormat;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class EntryData {
|
||||
|
||||
/**
|
||||
* Use this to store data for a page
|
||||
*/
|
||||
HashMap<String, String> data;
|
||||
|
||||
}
|
17
src/main/java/techreborn/manual/saveFormat/ManualFormat.java
Normal file
17
src/main/java/techreborn/manual/saveFormat/ManualFormat.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package techreborn.manual.saveFormat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class ManualFormat {
|
||||
|
||||
String name;
|
||||
|
||||
String modId;
|
||||
|
||||
List<Entry> blocks;
|
||||
|
||||
List<Entry> items;
|
||||
}
|
12
src/main/java/techreborn/manual/saveFormat/MetaData.java
Normal file
12
src/main/java/techreborn/manual/saveFormat/MetaData.java
Normal file
|
@ -0,0 +1,12 @@
|
|||
package techreborn.manual.saveFormat;
|
||||
|
||||
/**
|
||||
* Created by Mark on 05/04/2016.
|
||||
*/
|
||||
public class MetaData {
|
||||
|
||||
int startMeta;
|
||||
|
||||
int endMeta;
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
Save pages as json files:
|
||||
List page, that has a list of sub pages
|
||||
Crafting page
|
||||
Picture Page
|
||||
Language support
|
||||
Automatic deploy from a git repo
|
||||
Versioning to allow diffrent mod versions, also dev version
|
||||
Basic validator on save and deploy
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.Menu?>
|
||||
<?import javafx.scene.control.MenuBar?>
|
||||
<?import javafx.scene.control.MenuItem?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.control.TextArea?>
|
||||
<?import javafx.scene.control.TreeView?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="techreborn.manual.designer.windows.MainWindowController">
|
||||
<children>
|
||||
<MenuBar fx:id="menuBar">
|
||||
<menus>
|
||||
<Menu mnemonicParsing="false" text="File">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Save" />
|
||||
<MenuItem mnemonicParsing="false" text="Close" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Edit">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="New" />
|
||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
||||
</items>
|
||||
</Menu>
|
||||
</menus>
|
||||
</MenuBar>
|
||||
<SplitPane fx:id="splitPane" dividerPositions="0.29797979797979796" prefHeight="388.0" prefWidth="600.0" VBox.vgrow="ALWAYS">
|
||||
<items>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
|
||||
<children>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<TreeView fx:id="treeList" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
|
||||
<AnchorPane prefHeight="49.0" prefWidth="175.0">
|
||||
<children>
|
||||
<Button fx:id="buttonNew" layoutX="8.0" layoutY="12.0" mnemonicParsing="false" onMouseClicked="#newItem" text="New" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane fx:id="renderPane" minHeight="0.0" minWidth="0.0" prefHeight="358.0" prefWidth="417.0">
|
||||
<children>
|
||||
<ImageView fx:id="image" fitHeight="298.0" fitWidth="417.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="75.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
<AnchorPane prefHeight="75.0" prefWidth="417.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
||||
<children>
|
||||
<Label layoutY="6.0" text="Settings" />
|
||||
<TextArea fx:id="textInput" layoutX="43.0" layoutY="8.0" maxWidth="250.0" prefHeight="59.0" prefWidth="250.0" AnchorPane.bottomAnchor="8.0" AnchorPane.rightAnchor="8.0" AnchorPane.topAnchor="8.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</items>
|
||||
</SplitPane>
|
||||
</children>
|
||||
</VBox>
|
Loading…
Reference in a new issue