diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/chat/Message.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/chat/Message.java index 4e3147b..b03540c 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/chat/Message.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/chat/Message.java @@ -144,7 +144,6 @@ public class Message { case "WHISPER": return new Message( ChatType.WHISPER, - -1, m.group("user"), m.group("target"), m.group("time"), diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/GameClient.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/GameClient.java index ad23539..9f8afda 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/GameClient.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/network/GameClient.java @@ -4,6 +4,7 @@ import ch.unibas.dmi.dbis.cs108.casono.client.game.Card; import ch.unibas.dmi.dbis.cs108.casono.client.game.GameState; import ch.unibas.dmi.dbis.cs108.casono.client.game.Player; +import java.util.ArrayList; import java.util.List; /** @@ -42,10 +43,13 @@ public class GameClient { * @param input The raw response string from the server. * @return A GameState object representing the current state of the game. */ + private GameState parseGameState(String input) { private GameState parseGameState(List input) { GameState state = new GameState(); + String[] lines = input.split("\n"); + Player currentPlayer = null; Card currentCard = null; diff --git a/src/main/resources/ui-structure/Casinogameui.fxml b/src/main/resources/ui-structure/Casinogameui.fxml index 73832cb..db6ecca 100644 --- a/src/main/resources/ui-structure/Casinogameui.fxml +++ b/src/main/resources/ui-structure/Casinogameui.fxml @@ -5,37 +5,37 @@ - + + stylesheets="@casinogameui.css"> - + - + - + - + - + - + - + - + @@ -52,7 +52,7 @@ - + - + - + - + - + - + - + - + @@ -99,11 +99,11 @@ - + - + @@ -114,11 +114,11 @@ - + - + @@ -129,7 +129,7 @@ - + diff --git a/src/main/resources/ui-structure/gameuicomponents/chatui/chatui.css b/src/main/resources/ui-structure/gameuicomponents/chatui/chatui.css new file mode 100644 index 0000000..826aa7b --- /dev/null +++ b/src/main/resources/ui-structure/gameuicomponents/chatui/chatui.css @@ -0,0 +1,155 @@ +.chat-box { + -fx-background-color: #0d9e3b; + -fx-background-radius: 58; + -fx-border-radius: 50; + -fx-border-color: #5c3d10 #3d260a #3d260a #5c3d10; + -fx-border-width: 12; + -fx-padding: 20; + -fx-effect: dropshadow(one-pass-box, rgba(0,0,0,1), 0, 0, 15, 15); +} + +.chat-header { + -fx-text-fill: #ffffff; + -fx-font-size: 22px; + -fx-font-weight: bold; + -fx-padding: 0 0 10 0; + -fx-effect: dropshadow(one-pass-box, #000000, 0, 0, 3, 3); +} + +.chat-separator { + -fx-background-color: #ffffff; + -fx-min-height: 4px; + -fx-effect: dropshadow(one-pass-box, #000000, 0, 0, 3, 3); +} + +.black-input-field { + -fx-background-color: #1a1a1a; + -fx-text-fill: #ffffff; + -fx-font-family: "Courier New"; + -fx-font-weight: bold; + -fx-background-radius: 8; + -fx-border-radius: 8; + -fx-border-color: #444444; + -fx-border-width: 2; + -fx-padding: 5 12; +} + +.black-input-field:hover { + -fx-translate-y: -3; + -fx-effect: dropshadow(one-pass-box, rgba(0, 0, 0, 0.8), 0, 0, 3, 3); +} + + +.black-input-field:focused { + -fx-border-color: #ffffff; + -fx-background-color: #000000; +} + +.gray-input-field { + -fx-background-color: #333333; + -fx-text-fill: #ffffff; + -fx-font-family: "Courier New"; + -fx-font-weight: bold; + -fx-background-radius: 8; + -fx-border-radius: 8; + -fx-border-color: #666666; + -fx-color-color: #cccccc; + -fx-border-width: 2; + -fx-padding: 5 12; +} + +.gray-input-field:hover { + -fx-translate-y: -3; + -fx-effect: dropshadow(one-pass-box, rgba(0, 0, 0, 0.8), 0, 0, 3, 3); +} + +.gray-input-field:focused { + -fx-border-color: #ffffff; + -fx-background-color: #333333; +} + +.yellow-button { + -fx-background-color: #b8860b; + -fx-border-color: #ffd700; + -fx-text-fill: #ffffff; +} + +.red-button { + -fx-background-color: #8b0000; + -fx-border-color: #ff4444; + -fx-text-fill: #ffffff; +} + +.gray-button { + -fx-background-color: #333333; + -fx-border-color: #666666; + -fx-text-fill: #cccccc; +} + +.gray-button, .yellow-button, .red-button { + -fx-background-radius: 12; + -fx-border-radius: 12; + -fx-font-family: "Courier New"; + -fx-font-weight: bold; + -fx-border-width: 2; + -fx-padding: 6 15; + -fx-cursor: hand; +} + +.gray-button:hover, .yellow-button:hover, .red-button:hover { + -fx-translate-y: -3; + -fx-effect: dropshadow(one-pass-box, rgba(0, 0, 0, 0.8), 0, 0, 3, 3); +} + +.chat-scroll-pane { + -fx-background-color: transparent; + -fx-background: transparent; + -fx-border-color: transparent; +} + +.chat-VBox { + -fx-background-color: transparent; + -fx-background: transparent; +} +.scroll-pane { + -fx-background-color: transparent; + -fx-border-color: transparent; +} + +.scroll-pane .scroll-bar:vertical { + -fx-background-color: transparent; +} + +.scroll-pane .scroll-bar .track { + -fx-background-color: #5c3d10; + -fx-background-insets: 0; + -fx-background-radius: 5; +} + +.scroll-pane .scroll-bar .thumb { + -fx-background-color: #3d260a; + -fx-background-insets: 0; + -fx-background-radius: 5; + -fx-pref-width: 6; + -fx-pref-height: 6; + -fx-padding: 0; +} + +.scroll-pane .scroll-bar:horizontal { + -fx-background-color: transparent; +} + +.scroll-pane .scroll-bar:horizontal .track { + -fx-background-color: #5c3d10; + -fx-background-radius: 5; +} + +.scroll-pane .scroll-bar:horizontal .thumb { + -fx-background-color: #3d260a; + -fx-background-radius: 5; + -fx-pref-height: 6; +} + +.scroll-pane .scroll-bar:horizontal .thumb:hover { + -fx-pref-height: 10; +}