diff options
Diffstat (limited to 'apworld/client/manager.gd')
| -rw-r--r-- | apworld/client/manager.gd | 38 |
1 files changed, 38 insertions, 0 deletions
| diff --git a/apworld/client/manager.gd b/apworld/client/manager.gd index 727d17a..8c981f9 100644 --- a/apworld/client/manager.gd +++ b/apworld/client/manager.gd | |||
| @@ -29,6 +29,8 @@ 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 = [] | ||
| 33 | var _map_scripts = {} | ||
| 32 | 34 | ||
| 33 | const kSHUFFLE_LETTERS_VANILLA = 0 | 35 | const kSHUFFLE_LETTERS_VANILLA = 0 |
| 34 | const kSHUFFLE_LETTERS_UNLOCKED = 1 | 36 | const kSHUFFLE_LETTERS_UNLOCKED = 1 |
| @@ -144,6 +146,8 @@ func _ready(): | |||
| 144 | client.hint_received.connect(_process_hint_received) | 146 | client.hint_received.connect(_process_hint_received) |
| 145 | client.accessible_locations_updated.connect(_on_accessible_locations_updated) | 147 | client.accessible_locations_updated.connect(_on_accessible_locations_updated) |
| 146 | client.checked_locations_updated.connect(_on_checked_locations_updated) | 148 | client.checked_locations_updated.connect(_on_checked_locations_updated) |
| 149 | client.ignored_locations_updated.connect(_on_ignored_locations_updated) | ||
| 150 | client.hinted_locations_updated.connect(_on_hinted_locations_updated) | ||
| 147 | client.checked_worldports_updated.connect(_on_checked_worldports_updated) | 151 | client.checked_worldports_updated.connect(_on_checked_worldports_updated) |
| 148 | client.door_latched.connect(_on_door_latched) | 152 | client.door_latched.connect(_on_door_latched) |
| 149 | 153 | ||
| @@ -384,6 +388,20 @@ func _on_checked_worldports_updated(): | |||
| 384 | textclient_node.update_worldports() | 388 | textclient_node.update_worldports() |
| 385 | 389 | ||
| 386 | 390 | ||
| 391 | func _on_ignored_locations_updated(locations): | ||
| 392 | _ignored_locations = locations | ||
| 393 | |||
| 394 | var textclient_node = global.get_node("Textclient") | ||
| 395 | if textclient_node != null: | ||
| 396 | textclient_node.update_locations() | ||
| 397 | |||
| 398 | |||
| 399 | func _on_hinted_locations_updated(): | ||
| 400 | var textclient_node = global.get_node("Textclient") | ||
| 401 | if textclient_node != null: | ||
| 402 | textclient_node.update_locations() | ||
| 403 | |||
| 404 | |||
| 387 | func _on_door_latched(door_id): | 405 | func _on_door_latched(door_id): |
| 388 | var gamedata = global.get_node("Gamedata") | 406 | var gamedata = global.get_node("Gamedata") |
| 389 | if gamedata.get_door_map_name(door_id) != global.map: | 407 | if gamedata.get_door_map_name(door_id) != global.map: |
| @@ -677,3 +695,23 @@ func update_job_well_done_sign(): | |||
| 677 | 695 | ||
| 678 | sign2.get_node("MeshInstance3D").mesh.text = sign2.text | 696 | sign2.get_node("MeshInstance3D").mesh.text = sign2.text |
| 679 | sign3.get_node("MeshInstance3D").mesh.text = sign3.text | 697 | sign3.get_node("MeshInstance3D").mesh.text = sign3.text |
| 698 | |||
| 699 | |||
| 700 | func toggle_ignored_location(loc_id): | ||
| 701 | if loc_id in _ignored_locations: | ||
| 702 | client.removeIgnoredLocation(loc_id) | ||
| 703 | else: | ||
| 704 | client.addIgnoredLocation(loc_id) | ||
| 705 | |||
| 706 | |||
| 707 | func get_map_script(map_name): | ||
| 708 | if !_map_scripts.has(map_name): | ||
| 709 | var runtime = global.get_node("Runtime") | ||
| 710 | var script_path = "maps/%s.gd" % map_name | ||
| 711 | if runtime.path_exists(script_path): | ||
| 712 | var script = runtime.load_script(script_path) | ||
| 713 | _map_scripts[map_name] = script.new() | ||
| 714 | else: | ||
| 715 | _map_scripts[map_name] = null | ||
| 716 | |||
| 717 | return _map_scripts[map_name] | ||
