From 8eddc6ed98218a01706a5df4f761a09d231ff06e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 5 Jan 2024 12:33:45 -0500 Subject: Use the autoload messages node This fixes overlapping text when guided mode is on. --- Archipelago/client.gd | 16 ++++++---------- Archipelago/load.gd | 3 +-- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'Archipelago') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 5d8b1b0..814b431 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -380,13 +380,12 @@ func _on_data(): var item_color = colorForItemType(message["item"]["flags"]) - var messages_node = get_tree().get_root().get_node("Spatial/Messages") if message["type"] == "Hint": var is_for = "" if message["receiving"] != _slot: is_for = " for %s" % player_name if !message.has("found") || !message["found"]: - messages_node.showMessage( + messages.showMessage( ( "Hint: [color=%s]%s[/color]%s is on %s" % [item_color, item_name, is_for, location_name] @@ -394,7 +393,7 @@ func _on_data(): ) else: if message["receiving"] != _slot: - messages_node.showMessage( + messages.showMessage( "Sent [color=%s]%s[/color] to %s" % [item_color, item_name, player_name] ) @@ -405,14 +404,13 @@ func _on_data(): and message.has("data") and message["tags"].has("DeathLink") ): - var messages_node = get_tree().get_root().get_node("Spatial/Messages") var first_sentence = "Received Death" var second_sentence = "" if message["data"].has("source"): first_sentence = "Received Death from %s" % message["data"]["source"] if message["data"].has("cause") and message["data"]["cause"] != "": second_sentence = ". Reason: %s" % message["data"]["cause"] - messages_node.showMessage(first_sentence + second_sentence) + messages.showMessage(first_sentence + second_sentence) # Return the player home. get_tree().get_root().get_node("Spatial/player/pause_menu")._reload() @@ -568,8 +566,7 @@ func setValue(key, value): func completedGoal(): sendMessage([{"cmd": "StatusUpdate", "status": 30}]) # CLIENT_GOAL - var messages_node = get_tree().get_root().get_node("Spatial/Messages") - messages_node.showMessage("You have completed your goal!") + messages.showMessage("You have completed your goal!") func mapFinishedLoading(): @@ -655,11 +652,10 @@ func processItem(item, index, from, flags): var item_color = colorForItemType(flags) - var messages_node = get_tree().get_root().get_node("Spatial/Messages") if from == _slot: - messages_node.showMessage("Found [color=%s]%s[/color]" % [item_color, item_name]) + messages.showMessage("Found [color=%s]%s[/color]" % [item_color, item_name]) else: - messages_node.showMessage( + messages.showMessage( "Received [color=%s]%s[/color] from %s" % [item_color, item_name, player_name] ) diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 409b8c8..ddbee53 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -589,5 +589,4 @@ func set_small_gridmap_tile(x, y, z, tile): func archipelago_disconnected(reason): - var messages_node = self.get_node("Messages") - messages_node.showMessage(reason) + messages.showMessage(reason) -- cgit 1.4.1