about summary refs log tree commit diff stats
path: root/apworld/client/pauseMenu.gd
blob: 72b45e80e54b0861768ccf9da5d76f2b9ee4068d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
generated by cgit-pink 1.4.1 (git 2.36.1) at 2025-12-16 05:08:30 +0000
 


t-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
extends "res://scripts/ui/pauseMenu.gd"

var compass_button
var locations_button
var minimap_button


func _ready():
	var ap_panel = Panel.new()
	ap_panel.name = "Archipelago"
	get_node("menu/settings/settingsInner/TabContainer").add_child(ap_panel)

	var ap = global.get_node("Archipelago")

	compass_button = CheckBox.new()
	compass_button.text = "show compass"
	compass_button.button_pressed = ap.show_compass
	compass_button.position = Vector2(65, 100)
	compass_button.theme = preload("res://assets/themes/baseUI.tres")
	compass_button.add_theme_font_size_override("font_size", 60)
	compass_button.pressed.connect(_toggle_compass)
	ap_panel.add_child(compass_button)

	locations_button = CheckBox.new()
	locations_button.text = "show locations overlay"
	locations_button.button_pressed = ap.show_locations
	locations_button.position = Vector2(65, 200)
	locations_button.theme = preload("res://assets/themes/baseUI.tres")
	locations_button.add_theme_font_size_override("font_size", 60)
	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()


func _pause_game():
	global.get_node("Textclient").dismiss()
	super._pause_game()


func _main_menu():
	global.loaded = false
	global.get_node("Archipelago").disconnect_from_ap()
	global.get_node("Messages").clear()
	global.get_node("Compass").visible = false
	global.get_node("Textclient").reset()

	autosplitter.reset()
	_unpause_game()
	Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
	musicPlayer.stop()

	var runtime = global.get_node("Runtime")
	runtime.load_script_as_scene.call_deferred("settings_screen.gd", "settings_screen")


func _toggle_compass():
	var ap = global.get_node("Archipelago")
	ap.show_compass = compass_button.button_pressed
	ap.saveSettings()

	var compass = global.get_node("Compass")
	compass.visible = compass_button.button_pressed


func _toggle_locations():
	var ap = global.get_node("Archipelago")
	ap.show_locations = locations_button.button_pressed
	ap.saveSettings()

	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