diff options
Diffstat (limited to 'apworld')
-rw-r--r-- | apworld/client/manager.gd | 5 | ||||
-rw-r--r-- | apworld/client/pauseMenu.gd | 20 | ||||
-rw-r--r-- | apworld/client/player.gd | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/apworld/client/manager.gd b/apworld/client/manager.gd index 2c25269..e7765dd 100644 --- a/apworld/client/manager.gd +++ b/apworld/client/manager.gd | |||
@@ -15,6 +15,7 @@ var ap_pass = "" | |||
15 | var connection_history = [] | 15 | var connection_history = [] |
16 | var show_compass = false | 16 | var show_compass = false |
17 | var show_locations = false | 17 | var show_locations = false |
18 | var show_minimap = false | ||
18 | 19 | ||
19 | var client | 20 | var client |
20 | var keyboard | 21 | var keyboard |
@@ -93,6 +94,9 @@ func _init(): | |||
93 | if data.size() > 5: | 94 | if data.size() > 5: |
94 | show_locations = data[5] | 95 | show_locations = data[5] |
95 | 96 | ||
97 | if data.size() > 6: | ||
98 | show_minimap = data[6] | ||
99 | |||
96 | 100 | ||
97 | func _ready(): | 101 | func _ready(): |
98 | client = SCRIPT_client.new() | 102 | client = SCRIPT_client.new() |
@@ -128,6 +132,7 @@ func saveSettings(): | |||
128 | connection_history, | 132 | connection_history, |
129 | show_compass, | 133 | show_compass, |
130 | show_locations, | 134 | show_locations, |
135 | show_minimap, | ||
131 | ] | 136 | ] |
132 | file.store_var(data, true) | 137 | file.store_var(data, true) |
133 | file.close() | 138 | file.close() |
diff --git a/apworld/client/pauseMenu.gd b/apworld/client/pauseMenu.gd index d1b4bb3..72b45e8 100644 --- a/apworld/client/pauseMenu.gd +++ b/apworld/client/pauseMenu.gd | |||
@@ -2,6 +2,7 @@ extends "res://scripts/ui/pauseMenu.gd" | |||
2 | 2 | ||
3 | var compass_button | 3 | var compass_button |
4 | var locations_button | 4 | var locations_button |
5 | var minimap_button | ||
5 | 6 | ||
6 | 7 | ||
7 | func _ready(): | 8 | func _ready(): |
@@ -29,6 +30,15 @@ func _ready(): | |||
29 | locations_button.pressed.connect(_toggle_locations) | 30 | locations_button.pressed.connect(_toggle_locations) |
30 | ap_panel.add_child(locations_button) | 31 | ap_panel.add_child(locations_button) |
31 | 32 | ||
33 | minimap_button = CheckBox.new() | ||
34 | minimap_button.text = "show minimap" | ||
35 | minimap_button.button_pressed = ap.show_minimap | ||
36 | minimap_button.position = Vector2(65, 300) | ||
37 | minimap_button.theme = preload("res://assets/themes/baseUI.tres") | ||
38 | minimap_button.add_theme_font_size_override("font_size", 60) | ||
39 | minimap_button.pressed.connect(_toggle_minimap) | ||
40 | ap_panel.add_child(minimap_button) | ||
41 | |||
32 | super._ready() | 42 | super._ready() |
33 | 43 | ||
34 | 44 | ||
@@ -69,3 +79,13 @@ func _toggle_locations(): | |||
69 | 79 | ||
70 | var textclient = global.get_node("Textclient") | 80 | var textclient = global.get_node("Textclient") |
71 | textclient.update_locations_visibility() | 81 | textclient.update_locations_visibility() |
82 | |||
83 | |||
84 | func _toggle_minimap(): | ||
85 | var ap = global.get_node("Archipelago") | ||
86 | ap.show_minimap = minimap_button.button_pressed | ||
87 | ap.saveSettings() | ||
88 | |||
89 | var minimap = get_tree().get_root().get_node("scene/Minimap") | ||
90 | if minimap != null: | ||
91 | minimap.visible = ap.show_minimap | ||
diff --git a/apworld/client/player.gd b/apworld/client/player.gd index fb88880..366c3b0 100644 --- a/apworld/client/player.gd +++ b/apworld/client/player.gd | |||
@@ -330,6 +330,7 @@ func _ready(): | |||
330 | 330 | ||
331 | var minimap = ap.SCRIPT_minimap.new() | 331 | var minimap = ap.SCRIPT_minimap.new() |
332 | minimap.name = "Minimap" | 332 | minimap.name = "Minimap" |
333 | minimap.visible = ap.show_minimap | ||
333 | get_parent().add_child.call_deferred(minimap) | 334 | get_parent().add_child.call_deferred(minimap) |
334 | 335 | ||
335 | super._ready() | 336 | super._ready() |