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;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue