A huge amount of work on GUI
This commit is contained in:
55
src/main/resources/assets/jfx/main.css
Normal file
55
src/main/resources/assets/jfx/main.css
Normal file
@@ -0,0 +1,55 @@
|
||||
Button.green {
|
||||
-fx-background-color: #56893b;
|
||||
}
|
||||
Button.green:pressed {
|
||||
-fx-background-color: #457229;
|
||||
}
|
||||
Button.red {
|
||||
-fx-background-color: #ff4848;
|
||||
}
|
||||
Button.red:pressed {
|
||||
-fx-background-color: #9c2121;
|
||||
}
|
||||
|
||||
ScrollPane {
|
||||
-fx-background-color: inherit;
|
||||
}
|
||||
|
||||
Label.red {
|
||||
-fx-text-fill: #9c2121;
|
||||
}
|
||||
Label.green {
|
||||
-fx-text-fill: #457229;
|
||||
}
|
||||
|
||||
.align-right {
|
||||
-fx-alignment: center-right;
|
||||
}
|
||||
|
||||
.side-pane {
|
||||
-fx-border-width: 0 1;
|
||||
-fx-border-color: #aaaaaa;
|
||||
-fx-background-color: linear-gradient(to bottom, #dddddd, #aaaaaa);
|
||||
}
|
||||
|
||||
.quest-container {
|
||||
-fx-border-width: 1 0 0 0;
|
||||
-fx-border-color: #aaaaaa;
|
||||
-fx-background-color: #eeeeee;
|
||||
}
|
||||
.quest-reward {
|
||||
-fx-text-fill: #457229;
|
||||
}
|
||||
|
||||
.tab-info-bar {
|
||||
-fx-border-width: 0 0 1 0;
|
||||
-fx-border-color: #aaaaaa;
|
||||
}
|
||||
|
||||
.table-column {
|
||||
-fx-padding: 0 5;
|
||||
}
|
||||
|
||||
#main {
|
||||
-fx-background-color: #dddddd;
|
||||
}
|
||||
@@ -1,9 +1,163 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
|
||||
<VBox>
|
||||
<children>
|
||||
<Label text="Hello world FXML"/>
|
||||
</children>
|
||||
</VBox>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.chart.LineChart?>
|
||||
<?import javafx.scene.chart.NumberAxis?>
|
||||
<?import javafx.scene.control.Accordion?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.Tab?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.ToolBar?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?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?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="450.0" prefWidth="850.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="250.0" percentWidth="30.0" prefWidth="250.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" percentWidth="70.0" prefWidth="380.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints fillHeight="false" vgrow="NEVER" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<GridPane styleClass="side-pane" GridPane.rowIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints fillHeight="false" minHeight="-Infinity" vgrow="NEVER" />
|
||||
<RowConstraints fillHeight="false" vgrow="NEVER" />
|
||||
<RowConstraints maxHeight="1.7976931348623157E308" vgrow="SOMETIMES" />
|
||||
<RowConstraints fillHeight="false" maxHeight="-Infinity" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<ScrollPane id="quest-pane" fitToWidth="true" hbarPolicy="NEVER" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2">
|
||||
<content>
|
||||
<VBox fx:id="questBox" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
<Label text="%game.trash" GridPane.halignment="CENTER" GridPane.rowIndex="3" GridPane.valignment="BOTTOM">
|
||||
<font>
|
||||
<Font name="System Bold" size="19.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ImageView fx:id="trash" fitHeight="80.0" pickOnBounds="true" preserveRatio="true" GridPane.halignment="CENTER" GridPane.rowIndex="3" GridPane.valignment="TOP">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="35.0" top="10.0" />
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Label text="%game.quests" GridPane.rowIndex="1">
|
||||
<font>
|
||||
<Font size="23.0" />
|
||||
</font>
|
||||
<padding>
|
||||
<Insets left="10.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
<Button fx:id="nextQuestButton" mnemonicParsing="false" onAction="#nextQuest" styleClass="green" text="%game.quests.next" textFill="WHITE" GridPane.halignment="RIGHT" GridPane.rowIndex="1" GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets right="5.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<Accordion GridPane.rowIndex="1" />
|
||||
</children>
|
||||
</GridPane>
|
||||
<TabPane tabClosingPolicy="UNAVAILABLE" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets />
|
||||
</GridPane.margin>
|
||||
<tabs>
|
||||
<Tab text="%game.storage">
|
||||
<content>
|
||||
<GridPane>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab text="%game.balance.history">
|
||||
<content>
|
||||
<TableView fx:id="balanceHistoryTable" prefHeight="200.0" prefWidth="200.0">
|
||||
<columns>
|
||||
<TableColumn prefWidth="50.666626400416135" styleClass="align-right" text="%game.balance.history.index" />
|
||||
<TableColumn maxWidth="500.0" prefWidth="149.77776718139648" styleClass="align-right" text="%game.balance.history.change" />
|
||||
<TableColumn maxWidth="1.7976931348623157E308" prefWidth="400.0" text="%game.balance.history.type" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab text="%game.balance.chart">
|
||||
<content>
|
||||
<VBox>
|
||||
<children>
|
||||
<HBox fillHeight="false" maxWidth="1.7976931348623157E308" styleClass="tab-info-bar">
|
||||
<children>
|
||||
<Label fx:id="totalIncomeLabel" styleClass="green" text="Label">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
<HBox.margin>
|
||||
<Insets right="20.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Label fx:id="totalLossLabel" styleClass="red" text="Label">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="20.0" right="20.0" top="5.0" />
|
||||
</padding>
|
||||
</HBox>
|
||||
<LineChart fx:id="budgetChart" verticalGridLinesVisible="false">
|
||||
<xAxis>
|
||||
<NumberAxis minorTickVisible="false" side="BOTTOM" tickLabelsVisible="false" tickMarkVisible="false" />
|
||||
</xAxis>
|
||||
<yAxis>
|
||||
<NumberAxis side="LEFT" />
|
||||
</yAxis>
|
||||
</LineChart>
|
||||
</children>
|
||||
</VBox>
|
||||
</content>
|
||||
</Tab>
|
||||
</tabs>
|
||||
</TabPane>
|
||||
<ToolBar prefHeight="40.0" prefWidth="200.0" GridPane.columnSpan="2147483647">
|
||||
<items>
|
||||
<Label fx:id="budgetLabel" text="%game.budget">
|
||||
<font>
|
||||
<Font size="19.0" />
|
||||
</font>
|
||||
<padding>
|
||||
<Insets left="5.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
</items>
|
||||
</ToolBar>
|
||||
<Button mnemonicParsing="false" onMouseClicked="#scheduleStop" styleClass="red" text="%game.quit" textFill="WHITE" GridPane.columnSpan="2147483647" GridPane.halignment="RIGHT" GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets right="10.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
</children>
|
||||
</GridPane>
|
||||
|
||||
62
src/main/resources/assets/jfx/quest_widget.fxml
Normal file
62
src/main/resources/assets/jfx/quest_widget.fxml
Normal file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<GridPane fx:id="questContainer" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="250.0" prefHeight="80.0" styleClass="quest-container" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="80.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="50.0" prefWidth="50.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<ImageView fx:id="image" fitHeight="80.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets />
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#abandon" prefHeight="0.0" prefWidth="0.0" styleClass="red" text="X" textFill="WHITE" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
|
||||
<font>
|
||||
<Font name="System Bold" size="19.0" />
|
||||
</font>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<VBox prefWidth="100.0" GridPane.columnIndex="1">
|
||||
<children>
|
||||
<Label fx:id="title" maxWidth="1.7976931348623157E308" styleClass="quest-title" text="Label">
|
||||
<font>
|
||||
<Font name="System Bold" size="21.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="description" styleClass="quest-desc" text="Label">
|
||||
<font>
|
||||
<Font size="13.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="reward" styleClass="quest-reward" text="Label">
|
||||
<font>
|
||||
<Font size="13.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets left="5.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
</GridPane>
|
||||
@@ -1,5 +1,28 @@
|
||||
test.hello-world = Hello World!
|
||||
|
||||
game.budget = Budget: %d$
|
||||
game.quit = Quit Game
|
||||
game.quests = Quests
|
||||
game.quests.next = Next Quest
|
||||
game.quest.reward = %d$
|
||||
game.trash = Recycle Bin
|
||||
game.trash.hover = Destroy\n%d$
|
||||
game.storage = Storage
|
||||
game.balance.history = Transactions
|
||||
game.balance.history.index =
|
||||
game.balance.history.change = Change in $
|
||||
game.balance.history.type = Description
|
||||
game.balance.history.type.abandon = Quest abandoned
|
||||
game.balance.history.type.destroy = Product destroy
|
||||
game.balance.history.type.move = Product moved
|
||||
game.balance.history.type.noop = NOOP
|
||||
game.balance.history.type.sell = Product sold
|
||||
game.balance.history.type.store = Product stored
|
||||
game.balance.chart = Balance
|
||||
game.balance.chart.line = Budget
|
||||
game.balance.total-income = Total Income: %d$
|
||||
game.balance.total-loss = Total Loss: %d$
|
||||
|
||||
quests.normal = Normal
|
||||
|
||||
products.paper = Paper
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
properties = color, format
|
||||
color.variants =white, green, blue
|
||||
color.variants = white, green, blue
|
||||
format.variants = a3, a4, a5
|
||||
|
||||
@@ -2,3 +2,4 @@ properties = type, form
|
||||
type.variants = pine, beech, oak
|
||||
form.variants = boards, pieces, beams
|
||||
form.beams.depth = 3
|
||||
type.oak.weight = 1
|
||||
|
||||
Reference in New Issue
Block a user