about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Archipelago/client.gd6
-rw-r--r--Archipelago/settings_screen.gd31
-rw-r--r--archipelago.tscn25
3 files changed, 53 insertions, 9 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index f15afe6..489fdb9 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -15,6 +15,7 @@ var ap_pass = ""
15var confusify_world = false 15var confusify_world = false
16var enable_multiplayer = false 16var enable_multiplayer = false
17var track_player = false 17var track_player = false
18var connection_history = []
18 19
19const my_version = "2.1.1" 20const my_version = "2.1.1"
20const ap_version = {"major": 0, "minor": 4, "build": 5, "class": "Version"} 21const ap_version = {"major": 0, "minor": 4, "build": 5, "class": "Version"}
@@ -161,6 +162,8 @@ func _init():
161 enable_multiplayer = data[5] 162 enable_multiplayer = data[5]
162 if data.size() > 6: 163 if data.size() > 6:
163 track_player = data[6] 164 track_player = data[6]
165 if data.size() > 7:
166 connection_history = data[7]
164 167
165 processDatapackages() 168 processDatapackages()
166 169
@@ -485,7 +488,8 @@ func saveSettings():
485 _datapackages, 488 _datapackages,
486 confusify_world, 489 confusify_world,
487 enable_multiplayer, 490 enable_multiplayer,
488 track_player 491 track_player,
492 connection_history
489 ] 493 ]
490 file.store_var(data, true) 494 file.store_var(data, true)
491 file.close() 495 file.close()
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index de64214..453e3bf 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd
@@ -67,6 +67,19 @@ func _ready():
67 self.get_node("Panel/multiplayer_box").pressed = apclient.enable_multiplayer 67 self.get_node("Panel/multiplayer_box").pressed = apclient.enable_multiplayer
68 self.get_node("Panel/position_box").pressed = apclient.track_player 68 self.get_node("Panel/position_box").pressed = apclient.track_player
69 69
70 var history_box = get_node("Panel/connection_history")
71 if apclient.connection_history.empty():
72 history_box.disabled = true
73 else:
74 history_box.disabled = false
75
76 var i = 0
77 for details in apclient.connection_history:
78 history_box.get_popup().add_item("%s (%s)" % [details[1], details[0]], i)
79 i += 1
80
81 history_box.get_popup().connect("id_pressed", self, "historySelected")
82
70 # Show client version. 83 # Show client version.
71 self.get_node("Panel/title").text = "ARCHIPELAGO (%s)" % apclient.my_version 84 self.get_node("Panel/title").text = "ARCHIPELAGO (%s)" % apclient.my_version
72 85
@@ -109,6 +122,15 @@ func connectionStatus(message):
109func connectionSuccessful(): 122func connectionSuccessful():
110 var apclient = global.get_node("Archipelago") 123 var apclient = global.get_node("Archipelago")
111 124
125 # Save connection details
126 var connection_details = [apclient.ap_server, apclient.ap_user, apclient.ap_pass]
127 if apclient.connection_history.has(connection_details):
128 apclient.connection_history.erase(connection_details)
129 apclient.connection_history.push_front(connection_details)
130 if apclient.connection_history.size() > 10:
131 apclient.connection_history.resize(10)
132 apclient.saveSettings()
133
112 # Switch to LL1 134 # Switch to LL1
113 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 135 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
114 global.save_file = apclient.getSaveFileName() 136 global.save_file = apclient.getSaveFileName()
@@ -130,3 +152,12 @@ func connectionUnsuccessful(error_message):
130 popup.popup_exclusive = true 152 popup.popup_exclusive = true
131 popup.get_ok().visible = true 153 popup.get_ok().visible = true
132 popup.popup_centered() 154 popup.popup_centered()
155
156
157func historySelected(index):
158 var apclient = global.get_node("Archipelago")
159 var details = apclient.connection_history[index]
160
161 self.get_node("Panel/server_box").text = details[0]
162 self.get_node("Panel/player_box").text = details[1]
163 self.get_node("Panel/password_box").text = details[2]
diff --git a/archipelago.tscn b/archipelago.tscn index f0b8ab9..f063af9 100644 --- a/archipelago.tscn +++ b/archipelago.tscn
@@ -86,9 +86,9 @@ align = 2
86 86
87[node name="credit5" parent="Panel" instance=ExtResource( 1 )] 87[node name="credit5" parent="Panel" instance=ExtResource( 1 )]
88margin_left = 1239.0 88margin_left = 1239.0
89margin_top = 271.0 89margin_top = 422.0
90margin_right = 1829.0 90margin_right = 1829.0
91margin_bottom = 335.0 91margin_bottom = 486.0
92custom_fonts/font = ExtResource( 2 ) 92custom_fonts/font = ExtResource( 2 )
93custom_styles/normal = SubResource( 1 ) 93custom_styles/normal = SubResource( 1 )
94text = "OPTIONS" 94text = "OPTIONS"
@@ -155,9 +155,9 @@ margin_bottom = 58.0
155 155
156[node name="confusing_box" type="CheckBox" parent="Panel"] 156[node name="confusing_box" type="CheckBox" parent="Panel"]
157margin_left = 1227.0 157margin_left = 1227.0
158margin_top = 351.0 158margin_top = 502.0
159margin_right = 1832.0 159margin_right = 1832.0
160margin_bottom = 439.0 160margin_bottom = 590.0
161custom_fonts/font = ExtResource( 6 ) 161custom_fonts/font = ExtResource( 6 )
162custom_icons/checked = ExtResource( 8 ) 162custom_icons/checked = ExtResource( 8 )
163custom_icons/unchecked = ExtResource( 7 ) 163custom_icons/unchecked = ExtResource( 7 )
@@ -165,9 +165,9 @@ text = "Make world more confusing"
165 165
166[node name="multiplayer_box" type="CheckBox" parent="Panel"] 166[node name="multiplayer_box" type="CheckBox" parent="Panel"]
167margin_left = 1227.0 167margin_left = 1227.0
168margin_top = 461.0 168margin_top = 612.0
169margin_right = 1832.0 169margin_right = 1832.0
170margin_bottom = 549.0 170margin_bottom = 700.0
171custom_fonts/font = ExtResource( 6 ) 171custom_fonts/font = ExtResource( 6 )
172custom_icons/checked = ExtResource( 8 ) 172custom_icons/checked = ExtResource( 8 )
173custom_icons/unchecked = ExtResource( 7 ) 173custom_icons/unchecked = ExtResource( 7 )
@@ -175,13 +175,22 @@ text = "Show other players"
175 175
176[node name="position_box" type="CheckBox" parent="Panel"] 176[node name="position_box" type="CheckBox" parent="Panel"]
177margin_left = 1227.0 177margin_left = 1227.0
178margin_top = 571.0 178margin_top = 722.0
179margin_right = 1832.0 179margin_right = 1832.0
180margin_bottom = 654.0 180margin_bottom = 810.0
181custom_fonts/font = ExtResource( 6 ) 181custom_fonts/font = ExtResource( 6 )
182custom_icons/checked = ExtResource( 8 ) 182custom_icons/checked = ExtResource( 8 )
183custom_icons/unchecked = ExtResource( 7 ) 183custom_icons/unchecked = ExtResource( 7 )
184text = "Send position to tracker" 184text = "Send position to tracker"
185 185
186[node name="connection_history" type="MenuButton" parent="Panel"]
187margin_left = 1239.0
188margin_top = 276.0
189margin_right = 1829.0
190margin_bottom = 372.0
191custom_fonts/font = ExtResource( 6 )
192text = "connection history"
193flat = false
194
186[connection signal="pressed" from="Panel/connect_button" to="Panel/connect_button" method="_connect_pressed"] 195[connection signal="pressed" from="Panel/connect_button" to="Panel/connect_button" method="_connect_pressed"]
187[connection signal="pressed" from="Panel/quit_button" to="Panel/quit_button" method="_back_pressed"] 196[connection signal="pressed" from="Panel/quit_button" to="Panel/quit_button" method="_back_pressed"]