diff --git a/src/main/kotlin/sc/gui/AppStyle.kt b/src/main/kotlin/sc/gui/AppStyle.kt index a51734c..6208725 100644 --- a/src/main/kotlin/sc/gui/AppStyle.kt +++ b/src/main/kotlin/sc/gui/AppStyle.kt @@ -42,9 +42,6 @@ class AppStyle: Stylesheet() { val statusLabel by cssclass() val plainLabel by cssclass() - val gridHover by csspseudoclass() - val gridLock by csspseudoclass() - fun background() = StackPane( Region().apply { @@ -164,33 +161,6 @@ class AppStyle: Stylesheet() { } } - fun ostseeschachStyles() { - val colorBackground = c("#36d2ff") - - Team.values().forEach { team -> - ".${team.color}" { - val color = team.color - backgroundColor += c(color, 0.6).desaturate() - and(gridHover) { - backgroundColor += c(color, 0.6) - } - and(gridLock) { - backgroundColor += c(color, 0.8) - } - } - } - - CssRule.c("grid").theme { - borderStyle += BorderStrokeStyle.DOTTED - borderColor += box(if(it.isDark) colorBackground.brighter() else colorBackground.darker()) - } - - background { - opacity = 0.7 - backgroundColor += colorBackground - } - } - fun mqStyles() { background { opacity = 0.7 @@ -258,4 +228,35 @@ class AppStyle: Stylesheet() { select(CssRule.c("coal$it")) { image = resources.url("/mq/boats/coal/coal_$it.png").toURI() } } } -} + + val gridHover by csspseudoclass() + val gridLock by csspseudoclass() + + fun ostseeschachStyles() { + val colorBackground = c("#36d2ff") + + Team.values().forEach { team -> + ".${team.color}" { + val color = team.color + backgroundColor += c(color, 0.6).desaturate() + and(gridHover) { + backgroundColor += c(color, 0.6) + } + and(gridLock) { + backgroundColor += c(color, 0.8) + } + } + } + + CssRule.c("grid").theme { + borderStyle += BorderStrokeStyle.DOTTED + borderColor += box(if(it.isDark) colorBackground.brighter() else colorBackground.darker()) + } + + background { + opacity = 0.7 + backgroundColor += colorBackground + } + } + +} \ No newline at end of file diff --git a/src/main/kotlin/sc/gui/penguins/PenguinsStyle.kt b/src/main/kotlin/sc/gui/penguins/PenguinsStyle.kt index da9c8fb..29f439b 100644 --- a/src/main/kotlin/sc/gui/penguins/PenguinsStyle.kt +++ b/src/main/kotlin/sc/gui/penguins/PenguinsStyle.kt @@ -3,7 +3,6 @@ package sc.gui.penguins import javafx.geometry.Side import javafx.scene.layout.BackgroundPosition import javafx.scene.layout.BackgroundSize -import sc.gui.AppStyle import sc.gui.AppStyle.Companion.background import tornadofx.* @@ -21,13 +20,6 @@ class PenguinsStyle: Stylesheet() { } // Game - AppStyle.gridHover { - backgroundColor += c("#222", 0.3) - and(hover) { - backgroundColor += c("#222", 0.5) - } - } - arrayOf("fish", "ice").forEach { select(CssRule.c(it)) { image = resources.url("/penguins/$it.png").toURI() } } diff --git a/src/main/kotlin/sc/gui/view/ControlView.kt b/src/main/kotlin/sc/gui/view/ControlView.kt index a9cab05..22e45c8 100644 --- a/src/main/kotlin/sc/gui/view/ControlView.kt +++ b/src/main/kotlin/sc/gui/view/ControlView.kt @@ -13,7 +13,6 @@ import sc.gui.AppStyle import sc.gui.GamePausedEvent import sc.gui.GameReadyEvent import sc.gui.events.* -import sc.gui.model.AppModel import sc.gui.model.GameModel import sc.gui.util.binding import sc.gui.util.booleanBinding @@ -131,7 +130,7 @@ class ControlView: View() { // TODO unfocus on normal character typed prefWidthProperty().bind(fontSize.multiply(6)) } - checkbox("Animationen", AppModel.animate) + // TODO depend on game: checkbox("Animationen", AppModel.animate) } init { diff --git a/src/main/kotlin/sc/gui/view/PenguinsBoard.kt b/src/main/kotlin/sc/gui/view/PenguinsBoard.kt index 026004a..5460585 100644 --- a/src/main/kotlin/sc/gui/view/PenguinsBoard.kt +++ b/src/main/kotlin/sc/gui/view/PenguinsBoard.kt @@ -243,12 +243,10 @@ class PenguinBoard: View() { } private fun Node.removeHover() { - //removeClass(AppStyle.gridHover, AppStyle.gridLock) effect = null } private fun Node.addHover(lock: Boolean = false, team: Team? = null): Node { - //addClass(if(lock) AppStyle.gridLock else AppStyle.gridHover) effect = if(team == null) Glow(if(lock) 0.7 else 0.4) else ColorAdjust(team.colorAdjust, -0.6, 0.0, 0.0)