From e24ceb625b8abf1bc93040425bd46d887c7a7181 Mon Sep 17 00:00:00 2001 From: Shemplo Date: Sat, 2 Sep 2017 17:11:50 +0300 Subject: [PATCH] Borders changed --- .../me/shemplo/game/mankals/core/MankalsMain.java | 13 +++++++++---- .../game/mankals/engine/schemas/game-frame.fxml | 7 ++++++- .../mankals/engine/schemas/main-menu-frame.fxml | 5 +++++ .../shemplo/game/mankals/engine/styles/borders.css | 8 ++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 Mankals-game/src/me/shemplo/game/mankals/engine/styles/borders.css diff --git a/Mankals-game/src/me/shemplo/game/mankals/core/MankalsMain.java b/Mankals-game/src/me/shemplo/game/mankals/core/MankalsMain.java index e5d09c3..f729ae4 100644 --- a/Mankals-game/src/me/shemplo/game/mankals/core/MankalsMain.java +++ b/Mankals-game/src/me/shemplo/game/mankals/core/MankalsMain.java @@ -7,6 +7,7 @@ import javafx.application.Application; import javafx.fxml.FXMLLoader; +import javafx.scene.Cursor; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; @@ -23,6 +24,7 @@ public class MankalsMain extends Application { public static final String MAIN_MENU_MARKUP_FILE = "me/shemplo/game/mankals/engine/schemas/main-menu-frame.fxml"; public static final String GAME_FRAME_MARKUP_FILE = "me/shemplo/game/mankals/engine/schemas/game-frame.fxml"; + public static final String BORDERS_STYLES_FILE = "me/shemplo/game/mankals/engine/styles/borders.css"; public static final String BUTTONS_STYLES_FILE = "me/shemplo/game/mankals/engine/styles/buttons.css"; public static final String HAND_ICON_IMAGE_FILE = "me/shemplo/game/mankals/about/hold.png"; @@ -44,11 +46,13 @@ public static void fatalStop (int code) { /* ===| APPLICATION AREA |=== */ private Stage stage; - private String css; + private String cssBorders, + cssButtons; public void start (Stage stage) { this.stage = stage; - this.css = ClassLoader.getSystemResource (BUTTONS_STYLES_FILE).toExternalForm (); + this.cssBorders = ClassLoader.getSystemResource (BORDERS_STYLES_FILE).toExternalForm (); + this.cssButtons = ClassLoader.getSystemResource (BUTTONS_STYLES_FILE).toExternalForm (); switchScenes (stage, MAIN_MENU_MARKUP_FILE); Log.message ("Main frame launched - OK"); @@ -87,10 +91,11 @@ public void switchScenes (Stage stage, String markupFile) { } Scene scene = loadedScenes.get (markupFile); - scene.getStylesheets ().add (css); + scene.getStylesheets ().add (cssBorders); + scene.getStylesheets ().add (cssButtons); if (scene != null) { - stage.setScene (scene); + stage.setScene (scene); switch (markupFile) { case MAIN_MENU_MARKUP_FILE: diff --git a/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/game-frame.fxml b/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/game-frame.fxml index 437e23b..0a333f8 100644 --- a/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/game-frame.fxml +++ b/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/game-frame.fxml @@ -9,10 +9,12 @@ - + + + + + diff --git a/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/main-menu-frame.fxml b/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/main-menu-frame.fxml index 39226b6..23a687c 100644 --- a/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/main-menu-frame.fxml +++ b/Mankals-game/src/me/shemplo/game/mankals/engine/schemas/main-menu-frame.fxml @@ -9,6 +9,8 @@ + + + diff --git a/Mankals-game/src/me/shemplo/game/mankals/engine/styles/borders.css b/Mankals-game/src/me/shemplo/game/mankals/engine/styles/borders.css new file mode 100644 index 0000000..7d687ec --- /dev/null +++ b/Mankals-game/src/me/shemplo/game/mankals/engine/styles/borders.css @@ -0,0 +1,8 @@ +.root_border_pane { + -fx-border-color: rgb(230,210,174); + -fx-border-width: 5; +} + +#window_menu_box { + -fx-cursor: move; +} \ No newline at end of file