about summary refs log tree commit diff stats
path: root/apworld/client/manager.gd
diff options
context:
space:
mode:
Diffstat (limited to 'apworld/client/manager.gd')
-rw-r--r--apworld/client/manager.gd33
1 files changed, 33 insertions, 0 deletions
diff --git a/apworld/client/manager.gd b/apworld/client/manager.gd index 955d470..3facfba 100644 --- a/apworld/client/manager.gd +++ b/apworld/client/manager.gd
@@ -14,6 +14,8 @@ var ap_user = ""
14var ap_pass = "" 14var ap_pass = ""
15var connection_history = [] 15var connection_history = []
16var show_compass = false 16var show_compass = false
17var show_locations = false
18var show_minimap = false
17 19
18var client 20var client
19var keyboard 21var keyboard
@@ -89,6 +91,12 @@ func _init():
89 if data.size() > 4: 91 if data.size() > 4:
90 show_compass = data[4] 92 show_compass = data[4]
91 93
94 if data.size() > 5:
95 show_locations = data[5]
96
97 if data.size() > 6:
98 show_minimap = data[6]
99
92 100
93func _ready(): 101func _ready():
94 client = SCRIPT_client.new() 102 client = SCRIPT_client.new()
@@ -99,6 +107,9 @@ func _ready():
99 client.text_message_received.connect(_process_text_message) 107 client.text_message_received.connect(_process_text_message)
100 client.item_sent_notification.connect(_process_item_sent_notification) 108 client.item_sent_notification.connect(_process_item_sent_notification)
101 client.hint_received.connect(_process_hint_received) 109 client.hint_received.connect(_process_hint_received)
110 client.accessible_locations_updated.connect(_on_accessible_locations_updated)
111 client.checked_locations_updated.connect(_on_checked_locations_updated)
112 client.checked_worldports_updated.connect(_on_checked_worldports_updated)
102 113
103 client.could_not_connect.connect(_client_could_not_connect) 114 client.could_not_connect.connect(_client_could_not_connect)
104 client.connect_status.connect(_client_connect_status) 115 client.connect_status.connect(_client_connect_status)
@@ -108,6 +119,7 @@ func _ready():
108 119
109 keyboard = SCRIPT_keyboard.new() 120 keyboard = SCRIPT_keyboard.new()
110 add_child(keyboard) 121 add_child(keyboard)
122 client.keyboard_update_received.connect(keyboard.remote_keyboard_updated)
111 123
112 124
113func saveSettings(): 125func saveSettings():
@@ -121,6 +133,8 @@ func saveSettings():
121 ap_pass, 133 ap_pass,
122 connection_history, 134 connection_history,
123 show_compass, 135 show_compass,
136 show_locations,
137 show_minimap,
124 ] 138 ]
125 file.store_var(data, true) 139 file.store_var(data, true)
126 file.close() 140 file.close()
@@ -182,6 +196,7 @@ func _process_item(item, amount):
182 if gamedata.get_door_map_name(lock[0]) != global.map: 196 if gamedata.get_door_map_name(lock[0]) != global.map:
183 continue 197 continue
184 198
199 # TODO: fix doors opening from door groups
185 var receivers = gamedata.get_door_receivers(lock[0]) 200 var receivers = gamedata.get_door_receivers(lock[0])
186 var scene = get_tree().get_root().get_node_or_null("scene") 201 var scene = get_tree().get_root().get_node_or_null("scene")
187 if scene != null: 202 if scene != null:
@@ -302,6 +317,24 @@ func _process_location_scout(location_id, item_name, player_name, flags, for_sel
302 collectable.setScoutedText(item_name) 317 collectable.setScoutedText(item_name)
303 318
304 319
320func _on_accessible_locations_updated():
321 var textclient_node = global.get_node("Textclient")
322 if textclient_node != null:
323 textclient_node.update_locations()
324
325
326func _on_checked_locations_updated():
327 var textclient_node = global.get_node("Textclient")
328 if textclient_node != null:
329 textclient_node.update_locations()
330
331
332func _on_checked_worldports_updated():
333 var textclient_node = global.get_node("Textclient")
334 if textclient_node != null:
335 textclient_node.update_locations()
336
337
305func _client_could_not_connect(message): 338func _client_could_not_connect(message):
306 could_not_connect.emit(message) 339 could_not_connect.emit(message)
307 340