From 17d481b141eefdc378ad6b7548d255aca3a5ad9c Mon Sep 17 00:00:00 2001 From: sowgro Date: Thu, 8 Jun 2023 01:05:44 -0400 Subject: add level, fix a few things, add jar stuff --- src/assets/style.css | 236 +++++++++++++++++++++++++++++++++++++++++++++ src/devmenu/LevelList.java | 5 +- src/gui/Driver.java | 2 +- src/gui/style.css | 236 --------------------------------------------- 4 files changed, 239 insertions(+), 240 deletions(-) create mode 100644 src/assets/style.css delete mode 100644 src/gui/style.css (limited to 'src') diff --git a/src/assets/style.css b/src/assets/style.css new file mode 100644 index 0000000..dd1de55 --- /dev/null +++ b/src/assets/style.css @@ -0,0 +1,236 @@ +@import url('https://fonts.googleapis.com/css2?family=Space+Mono&display=swap'); + +/* global */ + +.root{ + -fx-font-family: "space mono"; +} + +/* button */ + +.button { + -fx-background-color: rgba(0, 0, 0, 0.5); + -fx-text-fill: white; + -fx-border-color: transparent; + -fx-border-width: 3; + -fx-border-radius: 5; + -fx-font-size: 25; + -fx-background-radius: 5; +} + +.button:hover { + -fx-background-color: rgb(50, 50, 50, 0.5); +} + +.button:focused { + -fx-background-color: rgb(50, 50, 50, 0.5); + -fx-border-color: rgb(255, 255, 255); +} + +.button:selected { + -fx-background-color: rgb(255, 255, 255); + -fx-text-fill: rgb(0, 0, 0); + +} + +.button:pressed{ + -fx-background-color: rgb(231, 231, 231); + -fx-border-color: transparent; + -fx-text-fill: rgb(0, 0, 0); +} + +/* table */ + +TableView { + -fx-background-color: rgba(0, 0, 0, 0.5); + -fx-background-radius: 5; + -fx-padding: 5; +} + +.table-view .column-header-background .filler { + -fx-background-color: transparent; +} + +.table-view .table-cell{ + -fx-border-color: transparent; +} + +.table-view .column-header-background{ + -fx-background-color: transparent; +} + +.table-cell { + -fx-padding: .5em; +} + +.table-view .column-header { + -fx-text-background-color: rgb(168, 168, 168); + -fx-background-color: transparent; +} + +.table-row-cell { + -fx-cell-size: 40; + -fx-background-color: transparent; + -fx-background-radius: 3; + -fx-text-background-color: rgb(255, 255, 255); + /* -fx-border-width: 3; */ + /* -fx-border-radius: 5; */ + /* -fx-border-color: transparent; */ +} + +.table-row-cell:hover { + -fx-background-color: rgba(100, 100, 100, 0.5); + +} + +TableView:focused { + -fx-effect: null; +} + +TableView:focused .list-cell:focused { + -fx-background-color: rgb(50, 50, 50, 0.5); + /* -fx-border-color: rgb(255, 255, 255); */ +} + +.table-view .corner { + -fx-background-color: transparent; + -fx-border-color: transparent; +} + +.table-row-cell:selected { + -fx-background-color: rgb(255, 255, 255); + -fx-text-background-color: rgb(0, 0, 0); +} + +.table-row-cell:pressed { + -fx-background-color: rgb(231, 231, 231); + /* -fx-border-color: transparent; */ +} + +.table-row-cell:empty { + -fx-background-color: transparent; + /* -fx-border-color: transparent; */ + -fx-text-background-color: white; +} + +.unselectable .table-row-cell{ + -fx-background-color: transparent; + /* -fx-border-color: transparent; */ + -fx-text-background-color: white; +} + +/* slider */ + +Slider { + -fx-padding: 1em; +} + +.track { + + -fx-padding: 3; + -fx-background-color: rgba(0, 0, 0, 0.5); + -fx-background-radius: 5; +} + +.thumb { + -fx-pref-height: 30; + -fx-prefer-width: 30; + -fx-background-color: rgba(0, 0, 0, 0.5); + -fx-size: 25; + -fx-border-radius: 5; + -fx-border-color: rgb(231, 231, 231); + -fx-border-width: 3; +} + +.thumb:hover { + -fx-background-color: rgb(50, 50, 50, 0.5); +} + +Slider:focused .thumb{ + -fx-background-color: rgb(255,255,255); + -fx-border-color: white; +} + +.thumb:pressed { + -fx-background-color: rgb(231, 231, 231); + -fx-border-color: rgb(231, 231, 231); +} + +/* scroll bars */ + +.scroll-bar:horizontal , +.scroll-bar:vertical{ + -fx-font-size: 5px; + -fx-background-color :transparent; + -fx-border-color :transparent; + -fx-background-radius : 0.0em; + -fx-border-radius :2.0em; +} + +.increment-button ,.decrement-button { + -fx-background-color:transparent; + -fx-border-color:transparent; +} + +.scroll-bar:horizontal .track , +.scroll-bar:vertical .track{ + -fx-background-color: rgba(0, 0, 0, 0.5); + -fx-background-radius: 5em; +} + +.scroll-bar:horizontal .thumb, +.scroll-bar:vertical .thumb { + -fx-background-color:white; + -fx-background-radius: 5em; + -fx-border-width: 0; + +} + +.scroll-bar .thumb:pressed { + -fx-background-color: rgb(231, 231, 231); +} + +/* text */ + +.t0 { + -fx-font-size: 125; + -fx-fill: black; +} + +.t1 { + -fx-font-size: 50; + -fx-fill: white; +} + +.t11 { + -fx-font-size: 50; + -fx-fill: black; +} + +.t2 { + -fx-font-size: 30; + -fx-fill: white; +} + +.t3 { + -fx-fill: white; +} + +/* text box */ + +.box { + -fx-background-radius: 5; + -fx-background-color: rgba(0, 0, 0, 0.5); + -fx-text-fill: white; +} + +/* debug */ + +.debug { + /* -fx-background-radius: 5; */ + -fx-background-color: rgb(255, 0, 0); + /* -fx-border-color: red; */ + /* -fx-text-fill: white; */ + /* -fx-border-width: 20; */ +} + diff --git a/src/devmenu/LevelList.java b/src/devmenu/LevelList.java index 7087472..f9b4207 100644 --- a/src/devmenu/LevelList.java +++ b/src/devmenu/LevelList.java @@ -15,8 +15,6 @@ import main.LevelController; public class LevelList { - Stage primaryStage = new Stage(); - /* * this class is a layout class, most of its purpose is to place UI elements like Buttons within Panes like VBoxes. * the creation of these UI elements are mostly not commented due to their repetitive and self explanatory nature. @@ -65,7 +63,8 @@ public class LevelList VBox main = new VBox(); main.getChildren().addAll(levels,buttons,newLevelBox); - Scene scene = new Scene(main); + Scene scene = new Scene(main, 400, 400); + Stage primaryStage = new Stage(); primaryStage.setScene(scene); primaryStage.show(); } diff --git a/src/gui/Driver.java b/src/gui/Driver.java index fd18933..4f840e8 100644 --- a/src/gui/Driver.java +++ b/src/gui/Driver.java @@ -50,7 +50,7 @@ public class Driver extends Application primaryStage = newPrimaryStage; Scene primaryScene = new Scene(primaryPane, 800,600); - primaryScene.getStylesheets().add("gui/style.css"); + primaryScene.getStylesheets().add("assets/style.css"); primaryStage.setScene(primaryScene); primaryStage.setTitle("NPE Hero"); diff --git a/src/gui/style.css b/src/gui/style.css deleted file mode 100644 index dd1de55..0000000 --- a/src/gui/style.css +++ /dev/null @@ -1,236 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Space+Mono&display=swap'); - -/* global */ - -.root{ - -fx-font-family: "space mono"; -} - -/* button */ - -.button { - -fx-background-color: rgba(0, 0, 0, 0.5); - -fx-text-fill: white; - -fx-border-color: transparent; - -fx-border-width: 3; - -fx-border-radius: 5; - -fx-font-size: 25; - -fx-background-radius: 5; -} - -.button:hover { - -fx-background-color: rgb(50, 50, 50, 0.5); -} - -.button:focused { - -fx-background-color: rgb(50, 50, 50, 0.5); - -fx-border-color: rgb(255, 255, 255); -} - -.button:selected { - -fx-background-color: rgb(255, 255, 255); - -fx-text-fill: rgb(0, 0, 0); - -} - -.button:pressed{ - -fx-background-color: rgb(231, 231, 231); - -fx-border-color: transparent; - -fx-text-fill: rgb(0, 0, 0); -} - -/* table */ - -TableView { - -fx-background-color: rgba(0, 0, 0, 0.5); - -fx-background-radius: 5; - -fx-padding: 5; -} - -.table-view .column-header-background .filler { - -fx-background-color: transparent; -} - -.table-view .table-cell{ - -fx-border-color: transparent; -} - -.table-view .column-header-background{ - -fx-background-color: transparent; -} - -.table-cell { - -fx-padding: .5em; -} - -.table-view .column-header { - -fx-text-background-color: rgb(168, 168, 168); - -fx-background-color: transparent; -} - -.table-row-cell { - -fx-cell-size: 40; - -fx-background-color: transparent; - -fx-background-radius: 3; - -fx-text-background-color: rgb(255, 255, 255); - /* -fx-border-width: 3; */ - /* -fx-border-radius: 5; */ - /* -fx-border-color: transparent; */ -} - -.table-row-cell:hover { - -fx-background-color: rgba(100, 100, 100, 0.5); - -} - -TableView:focused { - -fx-effect: null; -} - -TableView:focused .list-cell:focused { - -fx-background-color: rgb(50, 50, 50, 0.5); - /* -fx-border-color: rgb(255, 255, 255); */ -} - -.table-view .corner { - -fx-background-color: transparent; - -fx-border-color: transparent; -} - -.table-row-cell:selected { - -fx-background-color: rgb(255, 255, 255); - -fx-text-background-color: rgb(0, 0, 0); -} - -.table-row-cell:pressed { - -fx-background-color: rgb(231, 231, 231); - /* -fx-border-color: transparent; */ -} - -.table-row-cell:empty { - -fx-background-color: transparent; - /* -fx-border-color: transparent; */ - -fx-text-background-color: white; -} - -.unselectable .table-row-cell{ - -fx-background-color: transparent; - /* -fx-border-color: transparent; */ - -fx-text-background-color: white; -} - -/* slider */ - -Slider { - -fx-padding: 1em; -} - -.track { - - -fx-padding: 3; - -fx-background-color: rgba(0, 0, 0, 0.5); - -fx-background-radius: 5; -} - -.thumb { - -fx-pref-height: 30; - -fx-prefer-width: 30; - -fx-background-color: rgba(0, 0, 0, 0.5); - -fx-size: 25; - -fx-border-radius: 5; - -fx-border-color: rgb(231, 231, 231); - -fx-border-width: 3; -} - -.thumb:hover { - -fx-background-color: rgb(50, 50, 50, 0.5); -} - -Slider:focused .thumb{ - -fx-background-color: rgb(255,255,255); - -fx-border-color: white; -} - -.thumb:pressed { - -fx-background-color: rgb(231, 231, 231); - -fx-border-color: rgb(231, 231, 231); -} - -/* scroll bars */ - -.scroll-bar:horizontal , -.scroll-bar:vertical{ - -fx-font-size: 5px; - -fx-background-color :transparent; - -fx-border-color :transparent; - -fx-background-radius : 0.0em; - -fx-border-radius :2.0em; -} - -.increment-button ,.decrement-button { - -fx-background-color:transparent; - -fx-border-color:transparent; -} - -.scroll-bar:horizontal .track , -.scroll-bar:vertical .track{ - -fx-background-color: rgba(0, 0, 0, 0.5); - -fx-background-radius: 5em; -} - -.scroll-bar:horizontal .thumb, -.scroll-bar:vertical .thumb { - -fx-background-color:white; - -fx-background-radius: 5em; - -fx-border-width: 0; - -} - -.scroll-bar .thumb:pressed { - -fx-background-color: rgb(231, 231, 231); -} - -/* text */ - -.t0 { - -fx-font-size: 125; - -fx-fill: black; -} - -.t1 { - -fx-font-size: 50; - -fx-fill: white; -} - -.t11 { - -fx-font-size: 50; - -fx-fill: black; -} - -.t2 { - -fx-font-size: 30; - -fx-fill: white; -} - -.t3 { - -fx-fill: white; -} - -/* text box */ - -.box { - -fx-background-radius: 5; - -fx-background-color: rgba(0, 0, 0, 0.5); - -fx-text-fill: white; -} - -/* debug */ - -.debug { - /* -fx-background-radius: 5; */ - -fx-background-color: rgb(255, 0, 0); - /* -fx-border-color: red; */ - /* -fx-text-fill: white; */ - /* -fx-border-width: 20; */ -} - -- cgit v1.2.3