about summary refs log tree commit diff stats
path: root/Archipelago/client.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-01-05 12:33:45 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-01-05 12:33:45 -0500
commit8eddc6ed98218a01706a5df4f761a09d231ff06e (patch)
tree0f63b46f1990058ae0dfa83550018a84f407daf6 /Archipelago/client.gd
parentd9d5ccf24b682af7bf537b6817e3da51e42e7a05 (diff)
downloadlingo-archipelago-8eddc6ed98218a01706a5df4f761a09d231ff06e.tar.gz
lingo-archipelago-8eddc6ed98218a01706a5df4f761a09d231ff06e.tar.bz2
lingo-archipelago-8eddc6ed98218a01706a5df4f761a09d231ff06e.zip
Use the autoload messages node v1.0.1
This fixes overlapping text when guided mode is on.
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r--Archipelago/client.gd16
1 files changed, 6 insertions, 10 deletions
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():
380 380
381 var item_color = colorForItemType(message["item"]["flags"]) 381 var item_color = colorForItemType(message["item"]["flags"])
382 382
383 var messages_node = get_tree().get_root().get_node("Spatial/Messages")
384 if message["type"] == "Hint": 383 if message["type"] == "Hint":
385 var is_for = "" 384 var is_for = ""
386 if message["receiving"] != _slot: 385 if message["receiving"] != _slot:
387 is_for = " for %s" % player_name 386 is_for = " for %s" % player_name
388 if !message.has("found") || !message["found"]: 387 if !message.has("found") || !message["found"]:
389 messages_node.showMessage( 388 messages.showMessage(
390 ( 389 (
391 "Hint: [color=%s]%s[/color]%s is on %s" 390 "Hint: [color=%s]%s[/color]%s is on %s"
392 % [item_color, item_name, is_for, location_name] 391 % [item_color, item_name, is_for, location_name]
@@ -394,7 +393,7 @@ func _on_data():
394 ) 393 )
395 else: 394 else:
396 if message["receiving"] != _slot: 395 if message["receiving"] != _slot:
397 messages_node.showMessage( 396 messages.showMessage(
398 "Sent [color=%s]%s[/color] to %s" % [item_color, item_name, player_name] 397 "Sent [color=%s]%s[/color] to %s" % [item_color, item_name, player_name]
399 ) 398 )
400 399
@@ -405,14 +404,13 @@ func _on_data():
405 and message.has("data") 404 and message.has("data")
406 and message["tags"].has("DeathLink") 405 and message["tags"].has("DeathLink")
407 ): 406 ):
408 var messages_node = get_tree().get_root().get_node("Spatial/Messages")
409 var first_sentence = "Received Death" 407 var first_sentence = "Received Death"
410 var second_sentence = "" 408 var second_sentence = ""
411 if message["data"].has("source"): 409 if message["data"].has("source"):
412 first_sentence = "Received Death from %s" % message["data"]["source"] 410 first_sentence = "Received Death from %s" % message["data"]["source"]
413 if message["data"].has("cause") and message["data"]["cause"] != "": 411 if message["data"].has("cause") and message["data"]["cause"] != "":
414 second_sentence = ". Reason: %s" % message["data"]["cause"] 412 second_sentence = ". Reason: %s" % message["data"]["cause"]
415 messages_node.showMessage(first_sentence + second_sentence) 413 messages.showMessage(first_sentence + second_sentence)
416 414
417 # Return the player home. 415 # Return the player home.
418 get_tree().get_root().get_node("Spatial/player/pause_menu")._reload() 416 get_tree().get_root().get_node("Spatial/player/pause_menu")._reload()
@@ -568,8 +566,7 @@ func setValue(key, value):
568func completedGoal(): 566func completedGoal():
569 sendMessage([{"cmd": "StatusUpdate", "status": 30}]) # CLIENT_GOAL 567 sendMessage([{"cmd": "StatusUpdate", "status": 30}]) # CLIENT_GOAL
570 568
571 var messages_node = get_tree().get_root().get_node("Spatial/Messages") 569 messages.showMessage("You have completed your goal!")
572 messages_node.showMessage("You have completed your goal!")
573 570
574 571
575func mapFinishedLoading(): 572func mapFinishedLoading():
@@ -655,11 +652,10 @@ func processItem(item, index, from, flags):
655 652
656 var item_color = colorForItemType(flags) 653 var item_color = colorForItemType(flags)
657 654
658 var messages_node = get_tree().get_root().get_node("Spatial/Messages")
659 if from == _slot: 655 if from == _slot:
660 messages_node.showMessage("Found [color=%s]%s[/color]" % [item_color, item_name]) 656 messages.showMessage("Found [color=%s]%s[/color]" % [item_color, item_name])
661 else: 657 else:
662 messages_node.showMessage( 658 messages.showMessage(
663 "Received [color=%s]%s[/color] from %s" % [item_color, item_name, player_name] 659 "Received [color=%s]%s[/color] from %s" % [item_color, item_name, player_name]
664 ) 660 )
665 661