help
This commit is contained in:
@@ -2,12 +2,14 @@ extends Button
|
||||
|
||||
const HISTORY = preload("res://Scenes/BrowserMenus/history.tscn")
|
||||
const SETTINGS = preload("res://Scenes/BrowserMenus/settings.tscn")
|
||||
const HELP = preload("res://Scenes/BrowserMenus/help.tscn")
|
||||
|
||||
@onready var tab_container: TabManager = $"../../TabContainer"
|
||||
@onready var main: Main = $"../../../"
|
||||
|
||||
var history_scene: PopupPanel = null
|
||||
var settings_scene: PopupPanel = null
|
||||
var help_scene: PopupPanel = null
|
||||
|
||||
func _on_pressed() -> void:
|
||||
%OptionsMenu.show()
|
||||
@@ -44,6 +46,8 @@ func _on_options_menu_id_pressed(id: int) -> void:
|
||||
show_history()
|
||||
if id == 5: # downloads
|
||||
show_downloads()
|
||||
if id == 8: # help
|
||||
show_help()
|
||||
if id == 9: # settings
|
||||
show_settings()
|
||||
if id == 10: # exit
|
||||
@@ -67,6 +71,19 @@ func _on_history_closed() -> void:
|
||||
func show_downloads() -> void:
|
||||
main.download_manager.show_downloads_history()
|
||||
|
||||
func show_help() -> void:
|
||||
if help_scene == null:
|
||||
help_scene = HELP.instantiate()
|
||||
main.add_child(help_scene)
|
||||
|
||||
help_scene.connect("popup_hide", _on_help_closed)
|
||||
else:
|
||||
help_scene.show()
|
||||
|
||||
func _on_help_closed() -> void:
|
||||
if help_scene:
|
||||
help_scene.hide()
|
||||
|
||||
func show_settings() -> void:
|
||||
if settings_scene == null:
|
||||
settings_scene = SETTINGS.instantiate()
|
||||
|
||||
Reference in New Issue
Block a user