about summary refs log tree commit diff stats
path: root/Archipelago/client.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r--Archipelago/client.gd31
1 files changed, 29 insertions, 2 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 5840550..19fcee1 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -116,6 +116,7 @@ var _cached_slowness = 0
116var _cached_iceland = 0 116var _cached_iceland = 0
117var _cached_atbash = 0 117var _cached_atbash = 0
118var _geronimo_skip = false 118var _geronimo_skip = false
119var _checked_paintings = []
119 120
120signal could_not_connect 121signal could_not_connect
121signal connect_status 122signal connect_status
@@ -366,6 +367,18 @@ func _on_data():
366 367
367 requestSync() 368 requestSync()
368 369
370 sendMessage(
371 [
372 {
373 "cmd": "Set",
374 "key": "Lingo_%d_Paintings" % [_slot],
375 "default": [],
376 "want_reply": true,
377 "operations": [{"operation": "default", "value": []}]
378 }
379 ]
380 )
381
369 emit_signal("client_connected") 382 emit_signal("client_connected")
370 383
371 elif cmd == "ConnectionRefused": 384 elif cmd == "ConnectionRefused":
@@ -483,6 +496,10 @@ func _on_data():
483 # Return the player home. 496 # Return the player home.
484 get_tree().get_root().get_node("Spatial/player/pause_menu")._reload() 497 get_tree().get_root().get_node("Spatial/player/pause_menu")._reload()
485 498
499 elif cmd == "SetReply":
500 if message.has("key") and message["key"] == ("Lingo_%d_Paintings" % _slot):
501 _checked_paintings = message["value"]
502
486 503
487func _process(_delta): 504func _process(_delta):
488 if _should_process: 505 if _should_process:
@@ -641,13 +658,14 @@ func sendLocation(loc_id):
641 _held_locations.append(loc_id) 658 _held_locations.append(loc_id)
642 659
643 660
644func setValue(key, value): 661func setValue(key, value, operation = "replace"):
645 sendMessage( 662 sendMessage(
646 [ 663 [
647 { 664 {
648 "cmd": "Set", 665 "cmd": "Set",
649 "key": "Lingo_%d_%s" % [_slot, key], 666 "key": "Lingo_%d_%s" % [_slot, key],
650 "operations": [{"operation": "replace", "value": value}] 667 "want_reply": false,
668 "operations": [{"operation": operation, "value": value}]
651 } 669 }
652 ] 670 ]
653 ) 671 )
@@ -803,6 +821,15 @@ func geronimo():
803 saveLocaldata() 821 saveLocaldata()
804 822
805 823
824func checkPainting(painting_id):
825 if _checked_paintings.has(painting_id):
826 return
827
828 _checked_paintings.append(painting_id)
829
830 setValue("Paintings", [painting_id], "add")
831
832
806func colorForItemType(flags): 833func colorForItemType(flags):
807 var int_flags = int(flags) 834 var int_flags = int(flags)
808 if int_flags & 1: # progression 835 if int_flags & 1: # progression
id='n716' href='#n716'>716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849