Skip to content

Commit

Permalink
Merge pull request #12 from Shemplo/shemplo
Browse files Browse the repository at this point in the history
Shemplo
  • Loading branch information
Shemplo authored Sep 2, 2017
2 parents 1565575 + e24ceb6 commit 23a133a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
13 changes: 9 additions & 4 deletions Mankals-game/src/me/shemplo/game/mankals/core/MankalsMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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";
Expand All @@ -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");
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
<?import javafx.scene.control.Button?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.Background?>
<?import javafx.scene.layout.Background?>
<?import javafx.scene.layout.Border?>

<BorderPane
fx:id="game_border_pane"
styleClass="root_border_pane"
xmlns:fx="http://javafx.com/fxml/1">
<top>
<HBox
Expand All @@ -23,6 +25,9 @@
fx:id="exit_button"
styleClass="top_menu_button"
text="">
<HBox.margin>
<Insets top="0" right="0" bottom="5" left="0" />
</HBox.margin>
</Button>
</children>
</HBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<?import javafx.scene.layout.HBox?>

<BorderPane
fx:id="main_menu_border_pane"
styleClass="root_border_pane"
xmlns:fx="http://javafx.com/fxml/1">
<top>
<HBox
Expand All @@ -19,6 +21,9 @@
fx:id="exit_button"
styleClass="top_menu_button"
text="">
<HBox.margin>
<Insets top="0" right="0" bottom="5" left="0" />
</HBox.margin>
</Button>
</children>
</HBox>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.root_border_pane {
-fx-border-color: rgb(230,210,174);
-fx-border-width: 5;
}

#window_menu_box {
-fx-cursor: move;
}

0 comments on commit 23a133a

Please sign in to comment.