Penciled out a FormeBuilder
This commit is contained in:
parent
7c9942066f
commit
d78b873de0
112
Builder/src/fmon/builder/FormeBuilder.fxml
Normal file
112
Builder/src/fmon/builder/FormeBuilder.fxml
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.ComboBox?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.ListView?>
|
||||||
|
<?import javafx.scene.control.Spinner?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
|
||||||
|
|
||||||
|
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fmon.builder.FormeBuilder">
|
||||||
|
<left>
|
||||||
|
<VBox prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<ListView fx:id="formes" prefWidth="200.0" />
|
||||||
|
<HBox prefHeight="16.0" prefWidth="100.0">
|
||||||
|
<children>
|
||||||
|
<Button mnemonicParsing="false" onAction="#addForme" text="+" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</left>
|
||||||
|
<center>
|
||||||
|
<GridPane BorderPane.alignment="CENTER">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="78.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="135.0" minWidth="10.0" prefWidth="98.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="127.0" minWidth="10.0" prefWidth="62.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="162.0" minWidth="10.0" prefWidth="125.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="137.0" minWidth="10.0" prefWidth="137.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<Label text="Name:" />
|
||||||
|
<TextField fx:id="name" promptText="Name" GridPane.columnIndex="1" />
|
||||||
|
<TextField fx:id="height" promptText="Height (m)" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||||
|
<TextField fx:id="weight" promptText="Weight (kg)" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||||
|
<Label text="Height:" GridPane.rowIndex="1" />
|
||||||
|
<Label text="Weight:" GridPane.rowIndex="2" />
|
||||||
|
<Label text="Level Rate:" GridPane.rowIndex="3" />
|
||||||
|
<ComboBox fx:id="levelRate" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||||
|
<Label text="Catch Rate:" GridPane.rowIndex="4" />
|
||||||
|
<ComboBox fx:id="genderRatio" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="5" />
|
||||||
|
<Label text="Gender Ratio:" GridPane.rowIndex="5" />
|
||||||
|
<ListView fx:id="abilities" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" />
|
||||||
|
<Label text="Abilities:" GridPane.columnIndex="2" />
|
||||||
|
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="1">
|
||||||
|
<children>
|
||||||
|
<ComboBox fx:id="abilityList" prefHeight="25.0" prefWidth="100.0" />
|
||||||
|
<Button mnemonicParsing="false" onAction="#addAbility" text="+" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="3">
|
||||||
|
<children>
|
||||||
|
<ComboBox fx:id="hiddenAbilityList" prefHeight="25.0" prefWidth="100.0" />
|
||||||
|
<Button mnemonicParsing="false" onAction="#addHiddenAbility" text="+" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<ListView fx:id="hiddenAbilities" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||||
|
<Label text="Hidden:" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||||
|
<Label text="Egg Group:" GridPane.columnIndex="2" GridPane.rowIndex="4" />
|
||||||
|
<ListView fx:id="eggGroup" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="4" />
|
||||||
|
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="5">
|
||||||
|
<children>
|
||||||
|
<ComboBox fx:id="eggGroupList" prefHeight="25.0" prefWidth="100.0" />
|
||||||
|
<Button mnemonicParsing="false" onAction="#addEggGroup" text="+" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<ListView fx:id="movePool" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="4" GridPane.rowIndex="3" GridPane.rowSpan="8" />
|
||||||
|
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="4" GridPane.rowIndex="11">
|
||||||
|
<children>
|
||||||
|
<ComboBox fx:id="moveList" prefHeight="25.0" prefWidth="110.0" />
|
||||||
|
<Button mnemonicParsing="false" onAction="#addMove" text="+" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<Spinner fx:id="catchRate" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||||
|
<Spinner fx:id="hp" GridPane.columnIndex="1" GridPane.rowIndex="6" />
|
||||||
|
<Spinner fx:id="spd" GridPane.columnIndex="1" GridPane.rowIndex="11" />
|
||||||
|
<Spinner fx:id="patk" GridPane.columnIndex="1" GridPane.rowIndex="7" />
|
||||||
|
<Spinner fx:id="mdef" GridPane.columnIndex="1" GridPane.rowIndex="10" />
|
||||||
|
<Spinner fx:id="pdef" GridPane.columnIndex="1" GridPane.rowIndex="8" />
|
||||||
|
<Spinner fx:id="matk" GridPane.columnIndex="1" GridPane.rowIndex="9" />
|
||||||
|
<Label text="Hp" GridPane.rowIndex="6" />
|
||||||
|
<Label text="Phys Atk" GridPane.rowIndex="7" />
|
||||||
|
<Label text="Phys Def" GridPane.rowIndex="8" />
|
||||||
|
<Label text="Mag Atk" GridPane.rowIndex="9" />
|
||||||
|
<Label text="Mag Def" GridPane.rowIndex="10" />
|
||||||
|
<Label text="Speed" GridPane.rowIndex="11" />
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
</center>
|
||||||
|
</BorderPane>
|
98
Builder/src/fmon/builder/FormeBuilder.scala
Normal file
98
Builder/src/fmon/builder/FormeBuilder.scala
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
package fmon.builder
|
||||||
|
|
||||||
|
import java.io._
|
||||||
|
|
||||||
|
import javafx.application.Application
|
||||||
|
import javafx.fxml.FXML
|
||||||
|
import javafx.fxml.FXMLLoader
|
||||||
|
import javafx.fxml.JavaFXBuilderFactory
|
||||||
|
import javafx.scene.{control => jfxsc, Parent, Scene}
|
||||||
|
import javafx.stage.Stage
|
||||||
|
|
||||||
|
import scalafx.Includes._
|
||||||
|
import scalafx.beans.property._
|
||||||
|
import scalafx.collections.ObservableBuffer
|
||||||
|
import scalafx.scene.control._
|
||||||
|
import scalafx.scene.paint.Color
|
||||||
|
import scalafx.scene.layout._
|
||||||
|
|
||||||
|
import fmon.stat.FormToken
|
||||||
|
|
||||||
|
class FormeBuilder extends Savable {
|
||||||
|
@FXML var formes: jfxsc.ListView[FormToken] = _
|
||||||
|
@FXML var name: jfxsc.TextField = _
|
||||||
|
@FXML var height: jfxsc.TextField = _
|
||||||
|
@FXML var weight: jfxsc.TextField = _
|
||||||
|
@FXML var levelRate: jfxsc.ComboBox[_] = _
|
||||||
|
@FXML var catchRate: jfxsc.Spinner[Int] = _
|
||||||
|
@FXML var genderRatio: jfxsc.ComboBox[_] = _
|
||||||
|
|
||||||
|
|
||||||
|
@FXML var abilities: jfxsc.ListView[_] = _
|
||||||
|
@FXML var abilityList: jfxsc.ComboBox[_] = _
|
||||||
|
@FXML var hiddenAbilities: jfxsc.ListView[_] = _
|
||||||
|
@FXML var hiddenAbilityList: jfxsc.ComboBox[_] = _
|
||||||
|
@FXML var eggGroup: jfxsc.ListView[_] = _
|
||||||
|
@FXML var eggGroupList: jfxsc.ComboBox[_] = _
|
||||||
|
|
||||||
|
@FXML var movePool: jfxsc.ListView[_] = _
|
||||||
|
@FXML var moveList: jfxsc.ComboBox[_] = _
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
def initialize(): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
def addForme(): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
def addAbility(): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
def addHiddenAbility(): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
def addEggGroup(): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
def addMove(): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override def saveTo(file: File): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override def openFrom(file: File): Unit = {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object FormeBuilder {
|
||||||
|
class FBA extends Application {
|
||||||
|
override def start(primaryStage: Stage): Unit = {
|
||||||
|
val frameLoader = new FXMLLoader(getClass.getResource("App.fxml"))
|
||||||
|
val root: Parent = frameLoader.load()
|
||||||
|
val controller = frameLoader.getController[App]()
|
||||||
|
|
||||||
|
val builderLoader = new FXMLLoader(getClass.getResource("FormeBuilder.fxml"))
|
||||||
|
val builder: Parent = builderLoader.load()
|
||||||
|
val builderController = builderLoader.getController[FormeBuilder]()
|
||||||
|
|
||||||
|
controller.pane.children = builder
|
||||||
|
controller.builder = builderController
|
||||||
|
|
||||||
|
val scene: Scene = new Scene(root)
|
||||||
|
primaryStage.setScene(scene)
|
||||||
|
primaryStage.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def main(args: Array[String]): Unit = {
|
||||||
|
Application.launch(classOf[FBA], args: _*)
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user