diff options
Diffstat (limited to 'apworld/client/client.gd')
| -rw-r--r-- | apworld/client/client.gd | 26 |
1 files changed, 26 insertions, 0 deletions
| diff --git a/apworld/client/client.gd b/apworld/client/client.gd index ce5ac7e..c149482 100644 --- a/apworld/client/client.gd +++ b/apworld/client/client.gd | |||
| @@ -26,6 +26,7 @@ var _accessible_locations = [] | |||
| 26 | var _accessible_worldports = [] | 26 | var _accessible_worldports = [] |
| 27 | var _goal_accessible = false | 27 | var _goal_accessible = false |
| 28 | var _latched_doors = [] | 28 | var _latched_doors = [] |
| 29 | var _hinted_locations = [] | ||
| 29 | 30 | ||
| 30 | signal could_not_connect | 31 | signal could_not_connect |
| 31 | signal connect_status | 32 | signal connect_status |
| @@ -38,8 +39,10 @@ signal hint_received(message) | |||
| 38 | signal door_latched(id) | 39 | signal door_latched(id) |
| 39 | signal accessible_locations_updated | 40 | signal accessible_locations_updated |
| 40 | signal checked_locations_updated | 41 | signal checked_locations_updated |
| 42 | signal ignored_locations_updated(locations) | ||
| 41 | signal checked_worldports_updated | 43 | signal checked_worldports_updated |
| 42 | signal keyboard_update_received | 44 | signal keyboard_update_received |
| 45 | signal hinted_locations_updated | ||
| 43 | 46 | ||
| 44 | 47 | ||
| 45 | func _init(): | 48 | func _init(): |
| @@ -199,6 +202,21 @@ func _on_web_socket_server_message_received(_peer_id: int, packet: String) -> vo | |||
| 199 | 202 | ||
| 200 | door_latched.emit(iid) | 203 | door_latched.emit(iid) |
| 201 | 204 | ||
| 205 | elif cmd == "SetIgnoredLocations": | ||
| 206 | var locs = [] | ||
| 207 | for id in message["locations"]: | ||
| 208 | locs.append(int(id)) | ||
| 209 | |||
| 210 | ignored_locations_updated.emit(locs) | ||
| 211 | |||
| 212 | elif cmd == "UpdateHintedLocations": | ||
| 213 | for id in message["locations"]: | ||
| 214 | var iid = int(id) | ||
| 215 | if !_hinted_locations.has(iid): | ||
| 216 | _hinted_locations.append(iid) | ||
| 217 | |||
| 218 | hinted_locations_updated.emit() | ||
| 219 | |||
| 202 | 220 | ||
| 203 | func connectToServer(server, un, pw): | 221 | func connectToServer(server, un, pw): |
| 204 | sendMessage([{"cmd": "Connect", "server": server, "player": un, "password": pw}]) | 222 | sendMessage([{"cmd": "Connect", "server": server, "player": un, "password": pw}]) |
| @@ -280,6 +298,14 @@ func getLogicalPath(object_type, object_id): | |||
| 280 | sendMessage([msg]) | 298 | sendMessage([msg]) |
| 281 | 299 | ||
| 282 | 300 | ||
| 301 | func addIgnoredLocation(loc_id): | ||
| 302 | sendMessage([{"cmd": "IgnoreLocation", "id": loc_id}]) | ||
| 303 | |||
| 304 | |||
| 305 | func removeIgnoredLocation(loc_id): | ||
| 306 | sendMessage([{"cmd": "UnignoreLocation", "id": loc_id}]) | ||
| 307 | |||
| 308 | |||
| 283 | func sendQuit(): | 309 | func sendQuit(): |
| 284 | sendMessage([{"cmd": "Quit"}]) | 310 | sendMessage([{"cmd": "Quit"}]) |
| 285 | 311 | ||
