diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | client/menu/book/book.gd | 5 | ||||
-rw-r--r-- | client/menu/book/book.tscn | 23 | ||||
-rw-r--r-- | makefile | 10 | ||||
-rw-r--r-- | readme.md | 1 | ||||
-rw-r--r-- | server/src/game.rs | 11 | ||||
-rw-r--r-- | server/src/protocol.rs | 1 | ||||
-rw-r--r-- | test-client/protocol.ts | 2 |
8 files changed, 50 insertions, 4 deletions
@@ -4,3 +4,4 @@ .godot undercooked.pot *.mo +/client/menu/book/book_*.svg* diff --git a/client/menu/book/book.gd b/client/menu/book/book.gd new file mode 100644 index 00000000..2dd5a4d2 --- /dev/null +++ b/client/menu/book/book.gd @@ -0,0 +1,5 @@ +extends Menu + + +func _ready(): + pass diff --git a/client/menu/book/book.tscn b/client/menu/book/book.tscn new file mode 100644 index 00000000..d8266ed9 --- /dev/null +++ b/client/menu/book/book.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=2 format=3 uid="uid://bdggwo8un3mys"] + +[ext_resource type="Script" path="res://menu/book/book.gd" id="1_gyisx"] + +[node name="Book" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_gyisx") + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"] +layout_mode = 2 diff --git a/makefile b/makefile new file mode 100644 index 00000000..1eafe733 --- /dev/null +++ b/makefile @@ -0,0 +1,10 @@ +.PHONY: client-assets clean +client-assets: client/menu/book/book_1.svg + +clean: + rm client/menu/book/book_*.svg + +client/menu/book/book_1.svg: + @echo Downloading recipe book... + @mkdir -p client/menu/book + @curl -L https://s.metamuffin.org/static/undercooked/book.svg.tar.zst | tar -xC client/menu/book @@ -6,6 +6,7 @@ A cooperative multiplayer game about cooking. ### Building +- `make client-assets` - `cd client` - Import all assets: `godot --import .` diff --git a/server/src/game.rs b/server/src/game.rs index d8184c1e..7609b965 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -88,8 +88,10 @@ impl Game { } fn unload(&mut self) { - self.packet_out - .push_back(PacketC::SetIngame { state: false }); + self.packet_out.push_back(PacketC::SetIngame { + state: false, + lobby: false, + }); for (id, _) in self.players.drain() { self.packet_out.push_back(PacketC::RemovePlayer { id }) } @@ -209,7 +211,10 @@ impl Game { } } out.push(self.score()); - out.push(PacketC::SetIngame { state: true }); + out.push(PacketC::SetIngame { + state: true, + lobby: self.demand.is_none(), + }); out } diff --git a/server/src/protocol.rs b/server/src/protocol.rs index facfa5ab..49171942 100644 --- a/server/src/protocol.rs +++ b/server/src/protocol.rs @@ -139,6 +139,7 @@ pub enum PacketC { }, SetIngame { state: bool, + lobby: bool, }, Error { message: String, diff --git a/test-client/protocol.ts b/test-client/protocol.ts index ebfd9232..53a53500 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -49,7 +49,7 @@ export type PacketC = | { type: "communicate", player: PlayerID, message?: Message, persist: boolean } // A player wants to communicate something, message is null when cleared | { type: "server_message", text: string } // Text message from the server | { type: "score", points: number, demands_failed: number, demands_completed: number, time_remaining?: number } // Supplies information for score OSD - | { type: "set_ingame", state: boolean } // Set to false when entering the game or switching maps + | { type: "set_ingame", state: boolean, lobby: boolean } // Set to false when entering the game or switching maps | { type: "error", message: string } // Your client did something wrong. export type Message = |