From feb89a44ddf5f93bc476ca29cd02257aea47dc06 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 27 Sep 2025 11:59:17 -0400 Subject: Make minimap toggleable --- apworld/client/manager.gd | 5 +++++ apworld/client/pauseMenu.gd | 20 ++++++++++++++++++++ apworld/client/player.gd | 1 + 3 files changed, 26 insertions(+) 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 = "" var connection_history = [] var show_compass = false var show_locations = false +var show_minimap = false var client var keyboard @@ -93,6 +94,9 @@ func _init(): if data.size() > 5: show_locations = data[5] + if data.size() > 6: + show_minimap = data[6] + func _ready(): client = SCRIPT_client.new() @@ -128,6 +132,7 @@ func saveSettings(): connection_history, show_compass, show_locations, + show_minimap, ] file.store_var(data, true) 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" var compass_button var locations_button +var minimap_button func _ready(): @@ -29,6 +30,15 @@ func _ready(): locations_button.pressed.connect(_toggle_locations) ap_panel.add_child(locations_button) + minimap_button = CheckBox.new() + minimap_button.text = "show minimap" + minimap_button.button_pressed = ap.show_minimap + minimap_button.position = Vector2(65, 300) + minimap_button.theme = preload("res://assets/themes/baseUI.tres") + minimap_button.add_theme_font_size_override("font_size", 60) + minimap_button.pressed.connect(_toggle_minimap) + ap_panel.add_child(minimap_button) + super._ready() @@ -69,3 +79,13 @@ func _toggle_locations(): var textclient = global.get_node("Textclient") textclient.update_locations_visibility() + + +func _toggle_minimap(): + var ap = global.get_node("Archipelago") + ap.show_minimap = minimap_button.button_pressed + ap.saveSettings() + + var minimap = get_tree().get_root().get_node("scene/Minimap") + if minimap != null: + 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(): var minimap = ap.SCRIPT_minimap.new() minimap.name = "Minimap" + minimap.visible = ap.show_minimap get_parent().add_child.call_deferred(minimap) super._ready() -- cgit 1.4.1