diff options
Diffstat (limited to 'apworld/client/manager.gd')
| -rw-r--r-- | apworld/client/manager.gd | 28 |
1 files changed, 27 insertions, 1 deletions
| diff --git a/apworld/client/manager.gd b/apworld/client/manager.gd index aa07559..830ebb8 100644 --- a/apworld/client/manager.gd +++ b/apworld/client/manager.gd | |||
| @@ -29,6 +29,7 @@ var _inverse_item_locks = {} | |||
| 29 | var _held_letters = {} | 29 | var _held_letters = {} |
| 30 | var _letters_setup = false | 30 | var _letters_setup = false |
| 31 | var _already_connected = false | 31 | var _already_connected = false |
| 32 | var _ignored_locations = [] | ||
| 32 | 33 | ||
| 33 | const kSHUFFLE_LETTERS_VANILLA = 0 | 34 | const kSHUFFLE_LETTERS_VANILLA = 0 |
| 34 | const kSHUFFLE_LETTERS_UNLOCKED = 1 | 35 | const kSHUFFLE_LETTERS_UNLOCKED = 1 |
| @@ -144,6 +145,8 @@ func _ready(): | |||
| 144 | client.hint_received.connect(_process_hint_received) | 145 | client.hint_received.connect(_process_hint_received) |
| 145 | client.accessible_locations_updated.connect(_on_accessible_locations_updated) | 146 | client.accessible_locations_updated.connect(_on_accessible_locations_updated) |
| 146 | client.checked_locations_updated.connect(_on_checked_locations_updated) | 147 | client.checked_locations_updated.connect(_on_checked_locations_updated) |
| 148 | client.ignored_locations_updated.connect(_on_ignored_locations_updated) | ||
| 149 | client.hinted_locations_updated.connect(_on_hinted_locations_updated) | ||
| 147 | client.checked_worldports_updated.connect(_on_checked_worldports_updated) | 150 | client.checked_worldports_updated.connect(_on_checked_worldports_updated) |
| 148 | client.door_latched.connect(_on_door_latched) | 151 | client.door_latched.connect(_on_door_latched) |
| 149 | 152 | ||
| @@ -384,6 +387,20 @@ func _on_checked_worldports_updated(): | |||
| 384 | textclient_node.update_worldports() | 387 | textclient_node.update_worldports() |
| 385 | 388 | ||
| 386 | 389 | ||
| 390 | func _on_ignored_locations_updated(locations): | ||
| 391 | _ignored_locations = locations | ||
| 392 | |||
| 393 | var textclient_node = global.get_node("Textclient") | ||
| 394 | if textclient_node != null: | ||
| 395 | textclient_node.update_locations() | ||
| 396 | |||
| 397 | |||
| 398 | func _on_hinted_locations_updated(): | ||
| 399 | var textclient_node = global.get_node("Textclient") | ||
| 400 | if textclient_node != null: | ||
| 401 | textclient_node.update_locations() | ||
| 402 | |||
| 403 | |||
| 387 | func _on_door_latched(door_id): | 404 | func _on_door_latched(door_id): |
| 388 | var gamedata = global.get_node("Gamedata") | 405 | var gamedata = global.get_node("Gamedata") |
| 389 | if gamedata.get_door_map_name(door_id) != global.map: | 406 | if gamedata.get_door_map_name(door_id) != global.map: |
| @@ -472,7 +489,9 @@ func _client_connected(slot_data): | |||
| 472 | var raw_pp = slot_data.get("port_pairings") | 489 | var raw_pp = slot_data.get("port_pairings") |
| 473 | 490 | ||
| 474 | for p1 in raw_pp.keys(): | 491 | for p1 in raw_pp.keys(): |
| 475 | port_pairings[int(p1)] = int(raw_pp[p1]) | 492 | port_pairings[gamedata.port_id_by_ap_id[int(p1)]] = gamedata.port_id_by_ap_id[int( |
| 493 | raw_pp[p1] | ||
| 494 | )] | ||
| 476 | 495 | ||
| 477 | # Set up item locks. | 496 | # Set up item locks. |
| 478 | _item_locks = {} | 497 | _item_locks = {} |
| @@ -675,3 +694,10 @@ func update_job_well_done_sign(): | |||
| 675 | 694 | ||
| 676 | sign2.get_node("MeshInstance3D").mesh.text = sign2.text | 695 | sign2.get_node("MeshInstance3D").mesh.text = sign2.text |
| 677 | sign3.get_node("MeshInstance3D").mesh.text = sign3.text | 696 | sign3.get_node("MeshInstance3D").mesh.text = sign3.text |
| 697 | |||
| 698 | |||
| 699 | func toggle_ignored_location(loc_id): | ||
| 700 | if loc_id in _ignored_locations: | ||
| 701 | client.removeIgnoredLocation(loc_id) | ||
| 702 | else: | ||
| 703 | client.addIgnoredLocation(loc_id) | ||
