diff --git a/addons/popochiu/editor/config/config.gd b/addons/popochiu/editor/config/config.gd index 6374a3346..f4f0ddf5e 100644 --- a/addons/popochiu/editor/config/config.gd +++ b/addons/popochiu/editor/config/config.gd @@ -6,8 +6,8 @@ enum DialogStyle { ABOVE_CHARACTER, PORTRAIT, CAPTION, - PORTRAIT_ABOVE_CHARACTER, - BUBBLE_ABOVE_CHARACTER, + #PORTRAIT_ABOVE_CHARACTER, # TODO: Create a GUI node to make this option available + #BUBBLE_ABOVE_CHARACTER, # TODO: Create a GUI node to make this option available } # Thanks to @drbloop for providing the bases of the new approach for moving the popochiu settings to @@ -84,14 +84,14 @@ static func initialize_project_settings(): # ---- Dialogs --------------------------------------------------------------------------------- _initialize_project_setting(TEXT_SPEED, TYPE_FLOAT, PROPERTY_HINT_RANGE, "0.0,0.1") _initialize_project_setting(AUTO_CONTINUE_TEXT, TYPE_BOOL) - _initialize_project_setting(USE_TRANSLATIONS, TYPE_BOOL) - _initialize_project_setting( - DIALOG_STYLE, - TYPE_INT, - PROPERTY_HINT_ENUM, - # TODO: Add other options: Portrait Above Character, Bubble Above Character - "Above Character,Portrait,Caption" - ) + #_initialize_project_setting(USE_TRANSLATIONS, TYPE_BOOL) + #_initialize_project_setting( + #DIALOG_STYLE, + #TYPE_INT, + #PROPERTY_HINT_ENUM, + ## TODO: Add other options: Portrait Above Character, Bubble Above Character + #"Above Character,Portrait,Caption" + #) # ---- Inventory ------------------------------------------------------------------------------- _initialize_project_setting(INVENTORY_LIMIT, TYPE_INT) diff --git a/addons/popochiu/editor/helpers/popochiu_gui_templates_helper.gd b/addons/popochiu/editor/helpers/popochiu_gui_templates_helper.gd index 2d252c374..fe8d93718 100644 --- a/addons/popochiu/editor/helpers/popochiu_gui_templates_helper.gd +++ b/addons/popochiu/editor/helpers/popochiu_gui_templates_helper.gd @@ -44,28 +44,29 @@ static func copy_gui_template( # ---- Make a copy of the selected GUI template ------------------------------------------------ if _create_scene(scene_path) != OK: - # TODO: Delete the graphic_interface folder and all its contents? PopochiuUtils.print_error("Couldn't create %s file" % PopochiuResources.GUI_GAME_SCENE) return await _wait(2.0) on_progress.call(10, "Copying a bunch of components") - # Copy the components used by the GUI template to the res://game/graphic_interface/components + # Copy the components used by the GUI template to the res://game/gui/components # folder so devs can play with them freely ----------------------------------------------------- await copy_components(scene_path, true) on_progress.call(60, "Creating scripts") # Create a copy of the corresponding commands template ----------------------------------------- - _copy_scripts(commands_template_path, PopochiuResources.GUI_COMMANDS, script_path, scene_path) + _copy_commands_and_gui_scripts( + commands_template_path, PopochiuResources.GUI_COMMANDS, script_path, scene_path + ) await _wait(1.5) on_progress.call(80, "Assigning scripts") - # Update the script of the created graphic_interface.tscn so it uses the copy created above ---- + # Update the script of the created gui.tscn so it uses the copy created above ------------------ if _update_scene_script(script_path) != OK: - PopochiuUtils.print_error("Couldn't update graphic_interface.tscn script") + PopochiuUtils.print_error("Couldn't update gui.tscn script") return await _wait() @@ -78,8 +79,9 @@ static func copy_gui_template( on_progress.call(100, "All in place. Thanks for your patience.") PopochiuUtils.print_normal("[wave]Selected GUI template successfully applied[/wave]") - await _wait() + await PopochiuEditorHelper.filesystem_scanned() + on_complete.call() @@ -120,7 +122,7 @@ static func copy_component(source_scene_path: String) -> String: ## Makes a copy of the components used by the original GUI template to the -## **res://game/graphic_interface/components/** folder so devs can play with those scenes without +## **res://game/gui/components/** folder so devs can play with those scenes without ## affecting the ones in the plugin's folder. static func copy_components(source_scene_path: String, is_gui_game_scene := false) -> void: var dependencies_to_update: Array[Dictionary] = [] @@ -160,7 +162,7 @@ static func copy_components(source_scene_path: String, is_gui_game_scene := fals if is_gui_game_scene and _template_theme_path.is_empty(): # Change the name of the GUI template theme so it differs from the original one dependency_data.target_path = "%s/%s" % [ - target_folder, "graphic_interface_theme.tres" + target_folder, "gui_theme.tres" ] _template_theme_path = dependency_data.target_path elif not is_gui_game_scene: @@ -177,7 +179,7 @@ static func copy_components(source_scene_path: String, is_gui_game_scene := fals # --- Make a copy of the original file ----------------------------------------------------- if source_file_path.get_extension() == "gd": - _copy_script(source_file_path, target_folder, dependency_data.target_path) + _copy_component_script(source_file_path, dependency_data.target_path) else: _copy_file(source_file_path, target_folder, dependency_data.target_path) @@ -204,15 +206,15 @@ static func copy_components(source_scene_path: String, is_gui_game_scene := fals #endregion #region Private #################################################################################### -## Create the **graphic_interface.tscn** file as a copy of the selected GUI template scene. +## Create the **gui.tscn** file as a copy of the selected GUI template scene. ## If a template change is being made, all components of the previous template are removed along ## with the **.tscn** file before copying the new one. static func _create_scene(scene_path: String) -> int: - # Create the res://game/graphic_interface/ folder + # Create the res://game/gui/ folder if not FileAccess.file_exists(PopochiuResources.GUI_GAME_SCENE): DirAccess.make_dir_recursive_absolute(PopochiuResources.GUI_GAME_FOLDER) else: - # Remove the graphic_interface.tscn file + # Remove the gui.tscn file DirAccess.remove_absolute(PopochiuResources.GUI_GAME_SCENE) EditorInterface.get_resource_filesystem().scan() @@ -220,7 +222,7 @@ static func _create_scene(scene_path: String) -> int: _remove_components(PopochiuResources.GUI_GAME_FOLDER + dir_name) # Make a copy of the selected GUI template (.tscn) and save it in - # res://game/graphic_interface/graphic_interface.tscn ------------------------------------------ + # res://game/gui/gui.tscn ------------------------------------------ var gi_scene := load(scene_path).duplicate(true) gi_scene.resource_path = PopochiuResources.GUI_GAME_SCENE @@ -241,22 +243,33 @@ static func _remove_components(dir_path: String) -> void: EditorInterface.get_resource_filesystem().scan() -static func _copy_script( - source_file_path: String, _target_folder: String, target_file_path: String +## Makes a copy of a GUI component's script. +static func _copy_component_script( + source_file_path: String, target_file_path: String ) -> void: - var file_write = FileAccess.open(target_file_path, FileAccess.WRITE) + # Make a copy of the original script ----------------------------------------------------------- + var source_file := FileAccess.open(source_file_path, FileAccess.READ) + var source_code := source_file.get_as_text() + source_file.close() - if load(source_file_path).is_tool(): - file_write.store_string("@tool\n") + if "class_name " in source_code: + source_code = source_code.replace("class_name Popochiu", "class_name GUI") - file_write.store_string('extends "%s"' % source_file_path) + var file_write := FileAccess.open(target_file_path, FileAccess.WRITE) + file_write.store_string(source_code) file_write.close() + + # Create a script for devs to overwrite the functionality of the original's copy script -------- + file_write = FileAccess.open(target_file_path.replace(".gd", "_custom.gd"), FileAccess.WRITE) + if "@tool" in source_code: + file_write.store_string("@tool\n") + file_write.store_string('extends "%s"' % target_file_path.get_file()) static func _copy_file( source_file_path: String, target_folder: String, target_file_path: String ) -> void: - # ---- Create a copy of the scene file ----------------------------------------------------- + # ---- Create a copy of the scene file --------------------------------------------------------- if source_file_path.get_extension() in ["tscn", "tres"]: var file_resource := load(source_file_path).duplicate(true) file_resource.resource_path = target_file_path @@ -278,11 +291,14 @@ static func _update_dependencies(scene_path: String, dependencies_to_update: Arr file_read.close() for dic: Dictionary in dependencies_to_update: - text = text.replace(dic.source_path, dic.target_path) + var target_path: String = dic.target_path - var target_uid := ResourceUID.id_to_text( - ResourceLoader.get_resource_uid(dic.target_path) - ) + if ".gd" in target_path: + target_path = target_path.replace(".gd", "_custom.gd") + + text = text.replace(dic.source_path, target_path) + + var target_uid := ResourceUID.id_to_text(ResourceLoader.get_resource_uid(target_path)) if "invalid" in target_uid: continue @@ -296,14 +312,14 @@ static func _update_dependencies(scene_path: String, dependencies_to_update: Arr ## Copy the commands and graphic interface scripts of the chosen GUI template. The new graphic ## interface scripts inherits from the one originally assigned to the .tscn file of the selected ## template. -static func _copy_scripts( +static func _copy_commands_and_gui_scripts( commands_template_path: String, commands_path: String, script_path: String, scene_path: String ) -> void: DirAccess.copy_absolute(commands_template_path, commands_path) # Create a copy of the graphic interface script template --------------------------------------- var template_path := ( - PopochiuResources.GUI_SCRIPT_TEMPLATES_FOLDER + "graphic_interface_template.gd" + PopochiuResources.GUI_SCRIPT_TEMPLATES_FOLDER + "gui_template.gd" ) var script_file := FileAccess.open(template_path, FileAccess.READ) var source_code := script_file.get_as_text() @@ -317,8 +333,8 @@ static func _copy_scripts( script_file.close() -## Updates the script of the created **res://game/graphic_interface/graphic_interface.tscn** file so -## it uses the one created in `_copy_scripts(...)`. +## Updates the script of the created [b]res://game/gui/gui.tscn[/b] file so it uses the one created +## in [method _copy_commands_and_gui_scripts]. static func _update_scene_script(script_path: String) -> int: # Update the script of the GUI ----------------------------------------------------------------- var scene := (load( @@ -327,7 +343,7 @@ static func _update_scene_script(script_path: String) -> int: scene.set_script(load(script_path)) # Set the name of the root node - scene.name = "GraphicInterface" + scene.name = "GUI" var packed_scene: PackedScene = PackedScene.new() packed_scene.pack(scene) @@ -337,7 +353,7 @@ static func _update_scene_script(script_path: String) -> int: static func _wait(max := 1.0) -> void: - await EditorInterface.get_base_control().get_tree().create_timer(randf_range(0.5, max)).timeout + await PopochiuEditorHelper.secs_passed(randf_range(0.5, max)) #endregion diff --git a/addons/popochiu/editor/main_dock/popochiu_dock.gd b/addons/popochiu/editor/main_dock/popochiu_dock.gd index 7152e939e..e8e6cd249 100644 --- a/addons/popochiu/editor/main_dock/popochiu_dock.gd +++ b/addons/popochiu/editor/main_dock/popochiu_dock.gd @@ -7,7 +7,7 @@ signal move_folders_pressed @onready var tab_main: VBoxContainer = %Main @onready var tab_room: VBoxContainer = %Room @onready var tab_audio: VBoxContainer = %Audio -@onready var tab_ui: VBoxContainer = %UI +@onready var tab_gui: VBoxContainer = %GUI # ---- FOOTER -------------------------------------------------------------------------------------- @onready var version: Label = %Version @onready var btn_setup: Button = %BtnSetup @@ -23,6 +23,9 @@ func _ready() -> void: # Set the Main tab selected by default tab_container.current_tab = 0 + # Hide the GUI tab while we decide how it will work based on devs feedback + tab_container.set_tab_hidden(tab_gui.get_index(), true) + # Connect to childrens' signals tab_container.tab_changed.connect(_on_tab_changed) btn_setup.pressed.connect(open_setup) @@ -44,14 +47,16 @@ func scene_changed(scene_root: Node) -> void: if not is_instance_valid(tab_room): return tab_room.scene_changed(scene_root) - if not is_instance_valid(tab_ui): return - tab_ui.on_scene_changed(scene_root) + # TODO: Uncomment these lines when working on the GUI tab again + #if not is_instance_valid(tab_gui): return + #tab_gui.on_scene_changed(scene_root) if ( not scene_root or ( not scene_root is PopochiuRoom - and not scene_root.scene_file_path == PopochiuResources.GUI_GAME_SCENE + # TODO: Uncomment this line when working on the GUI tab again + #and not scene_root.scene_file_path == PopochiuResources.GUI_GAME_SCENE ) ): # Open the Popochiu Main tab if the opened scene in the Editor2D is not a PopochiuRoom nor @@ -81,8 +86,8 @@ func _on_tab_changed(tab: int) -> void: if tab == tab_main.get_index(): tab_main.check_data() - if tab == tab_ui.get_index(): - tab_ui.open_gui_scene() + if tab == tab_gui.get_index(): + tab_gui.open_gui_scene() func _check_node(node: Node) -> void: diff --git a/addons/popochiu/editor/main_dock/popochiu_dock.tscn b/addons/popochiu/editor/main_dock/popochiu_dock.tscn index 90ef7afaa..705f050e1 100644 --- a/addons/popochiu/editor/main_dock/popochiu_dock.tscn +++ b/addons/popochiu/editor/main_dock/popochiu_dock.tscn @@ -2,11 +2,11 @@ [ext_resource type="PackedScene" uid="uid://bynwdds8o3tcx" path="res://addons/popochiu/editor/main_dock/tab_main/tab_main.tscn" id="2_oxyje"] [ext_resource type="Script" path="res://addons/popochiu/editor/main_dock/popochiu_dock.gd" id="7"] -[ext_resource type="PackedScene" uid="uid://4etgd0rwjgct" path="res://addons/popochiu/editor/main_dock/tab_ui/tab_ui.tscn" id="10_82goo"] +[ext_resource type="PackedScene" uid="uid://4etgd0rwjgct" path="res://addons/popochiu/editor/main_dock/tab_gui/tab_gui.tscn" id="10_82goo"] [ext_resource type="PackedScene" uid="uid://q1bjkxavt2ay" path="res://addons/popochiu/editor/main_dock/tab_room/tab_room.tscn" id="12"] [ext_resource type="PackedScene" uid="uid://bpj8jlet25coy" path="res://addons/popochiu/editor/main_dock/tab_audio/tab_audio.tscn" id="13"] -[sub_resource type="Image" id="Image_dpguj"] +[sub_resource type="Image" id="Image_q4a6k"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -15,12 +15,12 @@ data = { "width": 16 } -[sub_resource type="ImageTexture" id="ImageTexture_gerh2"] -image = SubResource("Image_dpguj") +[sub_resource type="ImageTexture" id="ImageTexture_e4obm"] +image = SubResource("Image_q4a6k") [node name="Popochiu" type="Panel"] clip_contents = true -custom_minimum_size = Vector2(408, 0) +custom_minimum_size = Vector2(320, 0) anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -45,6 +45,7 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +current_tab = 0 [node name="Main" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("2_oxyje")] unique_name_in_owner = true @@ -64,7 +65,7 @@ layout_mode = 2 focus_mode = 2 metadata/_tab_index = 2 -[node name="UI" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("10_82goo")] +[node name="GUI" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("10_82goo")] unique_name_in_owner = true visible = false layout_mode = 2 @@ -89,11 +90,11 @@ unique_name_in_owner = true layout_mode = 2 tooltip_text = "Opens wiki in web browser" text = "Setup" -icon = SubResource("ImageTexture_gerh2") +icon = SubResource("ImageTexture_e4obm") [node name="BtnDocs" type="Button" parent="MarginContainer/VBoxContainer/FooterPanel/HBoxContainer"] unique_name_in_owner = true layout_mode = 2 tooltip_text = "Opens wiki in web browser" text = "Documentation" -icon = SubResource("ImageTexture_gerh2") +icon = SubResource("ImageTexture_e4obm") diff --git a/addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.gd b/addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.gd similarity index 86% rename from addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.gd rename to addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.gd index 8bd04282f..d19a0b6fb 100644 --- a/addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.gd +++ b/addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.gd @@ -2,10 +2,10 @@ extends AcceptDialog const POPOCHIU_POPUP_SCENE :=\ -"res://addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.tscn" +"res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.tscn" const POPOCHIU_POPUP_SCRIPT :=\ -"res://addons/popochiu/engine/templates/graphic_interface/popup_template.gd" -const POPUPS_FOLDER := "res://game/graphic_interface/popups/%s/" +"res://addons/popochiu/engine/templates/gui/popup_template.gd" +const POPUPS_FOLDER := "res://game/gui/popups/%s/" var _popup_id := "" var _scene_path := POPUPS_FOLDER + "%s.tscn" @@ -75,10 +75,10 @@ func _create_popup() -> void: # Add the popup to the Popups node in the graphic interface scene ------------------------------ var popup_node: PopochiuPopup = load(scene_path).instantiate() - var graphic_interface_node := EditorInterface.get_edited_scene_root() + var gui_node := EditorInterface.get_edited_scene_root() - graphic_interface_node.get_node("Popups").add_child(popup_node) - popup_node.owner = graphic_interface_node + gui_node.get_node("Popups").add_child(popup_node) + popup_node.owner = gui_node EditorInterface.save_scene() # Open the scene of the created popup for edition ---------------------------------------------- diff --git a/addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.tscn b/addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.tscn similarity index 95% rename from addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.tscn rename to addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.tscn index b981da68f..bd6278a15 100644 --- a/addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.tscn +++ b/addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://bu77q250wow5g"] -[ext_resource type="Script" path="res://addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.gd" id="1_4ujlk"] +[ext_resource type="Script" path="res://addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.gd" id="1_4ujlk"] [node name="CreatePopupWindow" type="AcceptDialog"] title = "Create Popup" diff --git a/addons/popochiu/editor/main_dock/tab_ui/tab_ui.gd b/addons/popochiu/editor/main_dock/tab_gui/tab_gui.gd similarity index 98% rename from addons/popochiu/editor/main_dock/tab_ui/tab_ui.gd rename to addons/popochiu/editor/main_dock/tab_gui/tab_gui.gd index ccec4ee6e..a0fc7f61f 100644 --- a/addons/popochiu/editor/main_dock/tab_ui/tab_ui.gd +++ b/addons/popochiu/editor/main_dock/tab_gui/tab_gui.gd @@ -1,13 +1,13 @@ @tool extends VBoxContainer -const COMPONENTS_PATH := "res://addons/popochiu/engine/objects/graphic_interface/components/" +const COMPONENTS_PATH := "res://addons/popochiu/engine/objects/gui/components/" var _opened_scene: Control = null var _components_basedir := [] var _script_path := PopochiuResources.GUI_GAME_SCENE.replace(".tscn", ".gd") var _commands_path := PopochiuResources.GUI_GAME_SCENE.replace( - "graphic_interface.tscn", "commands.gd" + "gui.tscn", "gui_commands.gd" ) var _gui_templates_helper := preload( "res://addons/popochiu/editor/helpers/popochiu_gui_templates_helper.gd" diff --git a/addons/popochiu/editor/main_dock/tab_ui/tab_ui.tscn b/addons/popochiu/editor/main_dock/tab_gui/tab_gui.tscn similarity index 98% rename from addons/popochiu/editor/main_dock/tab_ui/tab_ui.tscn rename to addons/popochiu/editor/main_dock/tab_gui/tab_gui.tscn index eee66833c..4183f13a2 100644 --- a/addons/popochiu/editor/main_dock/tab_ui/tab_ui.tscn +++ b/addons/popochiu/editor/main_dock/tab_gui/tab_gui.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=3 uid="uid://4etgd0rwjgct"] -[ext_resource type="Script" path="res://addons/popochiu/editor/main_dock/tab_ui/tab_ui.gd" id="1_xmvtx"] +[ext_resource type="Script" path="res://addons/popochiu/editor/main_dock/tab_gui/tab_gui.gd" id="1_xmvtx"] [ext_resource type="PackedScene" uid="uid://b55ialbvpilxv" path="res://addons/popochiu/editor/main_dock/popochiu_group/popochiu_group.tscn" id="2_uc7il"] -[ext_resource type="PackedScene" uid="uid://bu77q250wow5g" path="res://addons/popochiu/editor/main_dock/tab_ui/create_popup_window/create_popup_window.tscn" id="3_3a7ix"] +[ext_resource type="PackedScene" uid="uid://bu77q250wow5g" path="res://addons/popochiu/editor/main_dock/tab_gui/create_popup_window/create_popup_window.tscn" id="3_3a7ix"] [sub_resource type="Image" id="Image_j7yy0"] data = { diff --git a/addons/popochiu/editor/popups/setup/setup.gd b/addons/popochiu/editor/popups/setup/setup.gd index dcbc36d51..1a7f5c893 100644 --- a/addons/popochiu/editor/popups/setup/setup.gd +++ b/addons/popochiu/editor/popups/setup/setup.gd @@ -11,7 +11,7 @@ enum GameTypes { } const SCALE_MESSAGE =\ -"[center]▶ Base size = 320x180 | [b]scale = ( %.2f, %.2f )[/b] ◀[/center]\n\ +"[center]▶ Base size = 356x200 | [b]scale = ( %.2f, %.2f )[/b] ◀[/center]\n\ By default the GUI will match your native game resolution. You can change this with the\ [code]Project Settings > Popochiu > GUI > Experimental Scale Gui[/code] checkbox." const COPY_ALPHA = 0.1 @@ -34,7 +34,7 @@ var _es := EditorInterface.get_editor_settings() @onready var test_height: SpinBox = %TestHeight @onready var game_type: OptionButton = %GameType # ---- GUI templates section ----------------------------------------------------------------------- -@onready var gui_templates: GridContainer = %GUITemplates +@onready var gui_templates: HBoxContainer = %GUITemplates @onready var gui_templates_title: Label = %GUITemplatesTitle @onready var gui_templates_description: Label = %GUITemplatesDescription @onready var template_description_container: PanelContainer = %TemplateDescriptionContainer @@ -167,7 +167,7 @@ func _update_scale(_value: float) -> void: func _get_scale_message() -> String: - var scale := Vector2(game_width.value, game_height.value) / Vector2(320.0, 180.0) + var scale := Vector2(game_width.value, game_height.value) / PopochiuResources.RETRO_RESOLUTION return SCALE_MESSAGE % [scale.x, scale.y] @@ -206,7 +206,7 @@ func _select_config_template() -> void: _on_gui_template_selected(btn) if not _selected_template: - _on_gui_template_selected(gui_templates.get_child(0)) + _on_gui_template_selected(gui_templates.get_child(3)) func _show_gui_warning() -> void: @@ -214,8 +214,8 @@ func _show_gui_warning() -> void: _setup_inner_dialog( warning_dialog, "GUI template warning", - "The GUI scene (graphic_interface) is currently opened in the Editor.\n\nIn order to change\ - the GUI template please close that scene first." + "The GUI scene (gui.tscn) is currently opened in the Editor.\n\n" +\ + "In order to change the GUI template please close that scene first." ) add_child(warning_dialog) @@ -228,7 +228,7 @@ func _show_template_change_confirmation() -> void: confirmation_dialog, "Confirm GUI template change", "You changed the GUI template, making this will override any changes you made to the files\ - in res://game/graphic_interface/.\n\nAre you sure you want to make the change?" + in res://game/gui/.\n\nAre you sure you want to make the change?" ) confirmation_dialog.confirmed.connect( @@ -273,6 +273,7 @@ func _load_templates() -> void: button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP button.expand_icon = true button.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST + button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND gui_templates.add_child(button) diff --git a/addons/popochiu/editor/popups/setup/setup.tscn b/addons/popochiu/editor/popups/setup/setup.tscn index 684359a04..ef2f0ffce 100644 --- a/addons/popochiu/editor/popups/setup/setup.tscn +++ b/addons/popochiu/editor/popups/setup/setup.tscn @@ -44,8 +44,8 @@ theme_override_constants/separation = 12 unique_name_in_owner = true layout_mode = 2 bbcode_enabled = true -text = "[center]Welcome to [shake]Popochiu \\( o )3(o)/[/shake][/center] - +text = "[center]Welcome to [shake]Popochiu \\( o )3(o)/[/shake][/center] + This popup will appear automatically just this time. You can open it later with the Setup button at the bottom of Popochiu's dock." fit_content = true scroll_active = false @@ -171,10 +171,10 @@ layout_mode = 2 [node name="Type" type="Label" parent="PanelContainer/VBoxContainer/TypeContainer"] layout_mode = 2 size_flags_horizontal = 3 -tooltip_text = "The type of game modifies the stretch mode and the default preset for importing 2D images. - -Default: No stretch. Texture2D import preset set to: 2D. -2D: Stretch mode set to 2D and stretch aspect set to keep. Texture2D import preset set to: 2D. +tooltip_text = "The type of game modifies the stretch mode and the default preset for importing 2D images. + +Default: No stretch. Texture2D import preset set to: 2D. +2D: Stretch mode set to 2D and stretch aspect set to keep. Texture2D import preset set to: 2D. Pixel: Stretch mode set to 2D and stretch aspect set to keep. Texture2D import preset set to: 2D Pixel." mouse_filter = 0 text = "Game type" @@ -184,7 +184,6 @@ unique_name_in_owner = true layout_mode = 2 item_count = 3 popup/item_0/text = "Custom" -popup/item_0/id = 0 popup/item_1/text = "2D" popup/item_1/id = 1 popup/item_2/text = "Pixel" @@ -223,14 +222,13 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_ntnwv") [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/GUITemplatesPanel/GUITemplatesContainer/PanelContainer"] layout_mode = 2 -[node name="GUITemplates" type="GridContainer" parent="PanelContainer/VBoxContainer/GUITemplatesPanel/GUITemplatesContainer/PanelContainer/VBoxContainer"] +[node name="GUITemplates" type="HBoxContainer" parent="PanelContainer/VBoxContainer/GUITemplatesPanel/GUITemplatesContainer/PanelContainer/VBoxContainer"] unique_name_in_owner = true layout_mode = 2 -theme_override_constants/h_separation = 4 -theme_override_constants/v_separation = 4 -columns = 4 +alignment = 1 [node name="Custom" type="Button" parent="PanelContainer/VBoxContainer/GUITemplatesPanel/GUITemplatesContainer/PanelContainer/VBoxContainer/GUITemplates"] +visible = false texture_filter = 1 custom_minimum_size = Vector2(128, 128) layout_mode = 2 diff --git a/addons/popochiu/engine/cursor/cursor.tscn b/addons/popochiu/engine/cursor/cursor.tscn index 8e7cde86c..21826be8c 100644 --- a/addons/popochiu/engine/cursor/cursor.tscn +++ b/addons/popochiu/engine/cursor/cursor.tscn @@ -23,10 +23,6 @@ region = Rect2(96, 0, 32, 32) atlas = ExtResource("1") region = Rect2(128, 0, 32, 32) -[sub_resource type="AtlasTexture" id="9"] -atlas = ExtResource("1") -region = Rect2(160, 0, 32, 32) - [sub_resource type="AtlasTexture" id="4"] atlas = ExtResource("1") region = Rect2(192, 0, 32, 32) @@ -43,6 +39,10 @@ region = Rect2(256, 0, 32, 32) atlas = ExtResource("1") region = Rect2(288, 0, 32, 32) +[sub_resource type="AtlasTexture" id="9"] +atlas = ExtResource("1") +region = Rect2(160, 0, 32, 32) + [sub_resource type="AtlasTexture" id="2"] atlas = ExtResource("1") region = Rect2(320, 0, 32, 32) @@ -110,14 +110,6 @@ animations = [{ }, { "frames": [{ "duration": 1.0, -"texture": SubResource("9") -}], -"loop": false, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, "texture": SubResource("4") }, { "duration": 1.0, @@ -145,6 +137,14 @@ animations = [{ }, { "frames": [{ "duration": 1.0, +"texture": SubResource("9") +}], +"loop": false, +"name": &"normal", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, "texture": SubResource("2") }, { "duration": 1.0, @@ -205,7 +205,7 @@ script = ExtResource("1_n3epl") [node name="MainCursor" type="AnimatedSprite2D" parent="."] texture_filter = 1 sprite_frames = SubResource("1") -animation = &"active" +animation = &"normal" [node name="SecondaryCursor" type="Sprite2D" parent="."] texture_filter = 1 diff --git a/addons/popochiu/engine/cursor/cursor_animations.tres b/addons/popochiu/engine/cursor/cursor_animations.tres index 7ab8b9e51..194b68117 100644 --- a/addons/popochiu/engine/cursor/cursor_animations.tres +++ b/addons/popochiu/engine/cursor/cursor_animations.tres @@ -1,7 +1,7 @@ [gd_resource type="SpriteFrames" load_steps=22 format=3 uid="uid://d0ny3mket72mf"] [ext_resource type="Texture2D" uid="uid://bl3ecai6lvat1" path="res://addons/popochiu/engine/cursor/sprites/cursor.png" id="1_qk45r"] -[ext_resource type="Texture2D" uid="uid://bocign602kxhh" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png" id="2_05hav"] +[ext_resource type="Texture2D" uid="uid://bocign602kxhh" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png" id="2_05hav"] [sub_resource type="AtlasTexture" id="10"] atlas = ExtResource("1_qk45r") diff --git a/addons/popochiu/engine/interfaces/i_graphic_interface.gd b/addons/popochiu/engine/interfaces/i_graphic_interface.gd index a0d3be33a..7b89dfaea 100644 --- a/addons/popochiu/engine/interfaces/i_graphic_interface.gd +++ b/addons/popochiu/engine/interfaces/i_graphic_interface.gd @@ -68,6 +68,8 @@ signal load_requested # TODO: deprecate this ## Emitted to open the popup that allows to change the volume of the audio buses in the game. signal sound_settings_requested +## Emitted to open the popup that allows to change the typing speed and autoadvance in dialogues. +signal text_settings_requested ## Emitted when the dialog options of the running [PopochiuDialog] are shown. signal dialog_options_shown ## Emitted when a game is loaded and the GUI has shown (or not shown) a notification to the player. @@ -187,7 +189,11 @@ func show_load() -> void: func show_sound_settings() -> void: sound_settings_requested.emit() - +## Emits [signal texts_settings_requested] to open the popup that allows changing the text speed +## and toggle the dialogue auto advancement +func show_text_settings() -> void: + text_settings_requested.emit() + ## Returns the name of the cursor texture to show. func get_cursor_name() -> String: if not is_instance_valid(gui): return "" diff --git a/addons/popochiu/engine/interfaces/i_inventory.gd b/addons/popochiu/engine/interfaces/i_inventory.gd index 3f2270773..8b4645b8c 100644 --- a/addons/popochiu/engine/interfaces/i_inventory.gd +++ b/addons/popochiu/engine/interfaces/i_inventory.gd @@ -174,9 +174,14 @@ func is_full() -> bool: and E.settings.inventory_limit == items.size() +## Deselects the [member active] item. +func deselect_active() -> void: + active = null + + #endregion -#region Private #################################################################################### +#region SetGet ##################################################################################### func set_active(value: PopochiuInventoryItem) -> void: if is_instance_valid(active): active.unselected.emit() diff --git a/addons/popochiu/engine/objects/clickable/popochiu_clickable.gd b/addons/popochiu/engine/objects/clickable/popochiu_clickable.gd index c6e2020ac..1ba5e93de 100644 --- a/addons/popochiu/engine/objects/clickable/popochiu_clickable.gd +++ b/addons/popochiu/engine/objects/clickable/popochiu_clickable.gd @@ -370,8 +370,12 @@ func _toggle_input() -> void: func _translate() -> void: - if Engine.is_editor_hint() or not is_inside_tree()\ - or not E.settings.use_translations: return + if ( + Engine.is_editor_hint() + or not is_inside_tree() + or not E.settings.use_translations + ): + return description = E.get_text("%s-%s" % [get_tree().current_scene.name, _description_code]) diff --git a/addons/popochiu/engine/objects/dialog/popochiu_dialog_option.gd b/addons/popochiu/engine/objects/dialog/popochiu_dialog_option.gd index a039b26d9..2bb8fe602 100644 --- a/addons/popochiu/engine/objects/dialog/popochiu_dialog_option.gd +++ b/addons/popochiu/engine/objects/dialog/popochiu_dialog_option.gd @@ -8,7 +8,7 @@ extends Resource ## The text to show on screen for the option. @export var text := "" ## The icon to show on screen for the option. -@export var icon: Texture = null +#@export var icon: Texture = null ## Whether this option is visible. @export var visible := true ## Whether this option is disabled. If [code]true[/code], the option won´t be rendered. diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.tscn b/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.tscn deleted file mode 100644 index 840d15cbd..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.tscn +++ /dev/null @@ -1,32 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://dhsfl8ot4j5fj"] - -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.gd" id="1_3dp72"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_cvsnu"] -[ext_resource type="PackedScene" uid="uid://dcta4urojglil" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn" id="3_0jfsm"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_b2awe"] -bg_color = Color(0, 0, 0, 1) - -[node name="DialogMenu" type="PanelContainer" groups=["popochiu_gui_component"]] -custom_minimum_size = Vector2(0, 53) -anchors_preset = 12 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 0 -theme = ExtResource("1_cvsnu") -theme_override_styles/panel = SubResource("StyleBoxFlat_b2awe") -script = ExtResource("1_3dp72") -option_scene = ExtResource("3_0jfsm") - -[node name="ScrollContainer" type="ScrollContainer" parent="."] -layout_mode = 2 -horizontal_scroll_mode = 0 - -[node name="DialogOptionsContainer" type="VBoxContainer" parent="ScrollContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 8 -theme_override_constants/separation = 1 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.gd b/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.gd deleted file mode 100644 index 89c6b6aaf..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.gd +++ /dev/null @@ -1,349 +0,0 @@ -extends RichTextLabel -# Show dialogue texts char by char using a RichTextLabel. -# An invisibla Label is used to calculate the width of the RichTextLabel node. -# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -# warning-ignore-all:unused_signal -# warning-ignore-all:return_value_discarded - -signal animation_finished -signal text_show_started -signal text_show_finished - -const DFLT_SIZE := "dflt_size" -const DFLT_POSITION := "dflt_position" - -@export var wrap_width := 200.0 -@export var limit_margin := 4.0 -@export_enum("Above Character", "Portrait", "Caption") var used_when := 0 - -var _secs_per_character := 1.0 -var _is_waiting_input := false -var _auto_continue := false -var _dialog_pos := Vector2.ZERO -var _x_limit := 0.0 -var _y_limit := 0.0 - -@onready var _tween: Tween = null -@onready var _continue_icon: TextureProgressBar = $ContinueIcon -@onready var _continue_icon_tween: Tween = null - - -#region Godot ###################################################################################### -func _ready() -> void: - set_meta(DFLT_SIZE, size) - set_meta(DFLT_POSITION, position) - - # Set the default values - clear() - - modulate.a = 0.0 - _secs_per_character = E.text_speed - _x_limit = E.width / (E.scale.x if E.settings.scale_gui else 1.0) - _y_limit = E.height / (E.scale.y if E.settings.scale_gui else 1.0) - - _continue_icon.hide() - - # Connect to singletons events - E.text_speed_changed.connect(change_speed) - E.dialog_style_changed.connect(_on_dialog_style_changed) - C.character_spoke.connect(_show_dialogue) - - _on_dialog_style_changed() - - -func _input(event: InputEvent) -> void: - if ( - not PopochiuUtils.get_click_or_touch_index(event) in [ - MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT - ] - or modulate.a == 0.0 - ): - return - - accept_event() - - if visible_ratio == 1.0: - disappear() - else: - stop() - - -#endregion - -#region Public ##################################################################################### -func play_text(props: Dictionary) -> void: - var msg: String = E.get_text(props.text) - _is_waiting_input = false - _dialog_pos = props.position - - # ==== Calculate the size of the node ========================================================== - # Create a RichTextLabel to calculate the resulting size of this node once - # the whole text is shown - var rt := RichTextLabel.new() - rt.add_theme_font_override( - "normal_font", - get_theme_font("normal_font") - ) - rt.bbcode_enabled = true - rt.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART - rt.text = msg - rt.size = get_meta(DFLT_SIZE) - add_child(rt) - - # Create a Label to check if the text exceeds the wrap_width - var lbl := Label.new() - lbl.add_theme_font_override( - "normal_font", - get_theme_font("normal_font") - ) - - match E.current_dialog_style: - 0: - lbl.size.y = get_meta(DFLT_SIZE).y - _: - lbl.size = get_meta(DFLT_SIZE) - - lbl.text = rt.get_parsed_text() - add_child(lbl) - - rt.clear() - rt.text = "" - - await get_tree().process_frame - - var _size := lbl.size - - if _size.x > wrap_width: - # This node will have the width of the wrap_width - _size.x = wrap_width - rt.fit_content = true - rt.size.x = _size.x - rt.text = msg - - await get_tree().process_frame - - _size = rt.size - elif _size.x < get_meta(DFLT_SIZE).x: - # This node will have the minimum width - _size.x = get_meta(DFLT_SIZE).x - else: - # This node will have the width of the text - _size.y = get_meta(DFLT_SIZE).y - - var characters_count := lbl.get_total_character_count() - - lbl.free() - rt.free() - # ========================================================== Calculate the size of the node ==== - - match E.current_dialog_style: - 0: - # Define size and position (before calculating overflow) - size = _size - position = props.position - size / 2.0 - position.y -= size.y / 2.0 - - # Calculate overflow and reposition - if position.x < 0.0: - position.x = limit_margin - elif position.x + size.x > _x_limit: - position.x = _x_limit - limit_margin - size.x - if position.y < 0.0: - position.y = limit_margin - elif position.y + size.y > _y_limit: - position.y = _y_limit - limit_margin - size.y - 2: - # Define size and position (before calculating overflow) - size.y = _size.y - position.y = ( - get_meta(DFLT_POSITION).y - (_size.y - get_meta(DFLT_SIZE).y) - ) - - # Assign text and align mode - push_color(props.color) - - match E.current_dialog_style: - 0: - var center := floor(position.x + (size.x / 2)) - if center == props.position.x: - append_text("[center]%s[/center]" % msg) - elif center < props.position.x: - append_text("[right]%s[/right]" % msg) - else: - append_text(msg) - 1: - append_text(msg) - 2: - text = "[center][color=%s]%s[/color][/center]" % [ - props.color.to_html(), msg - ] - - if _secs_per_character > 0.0: - # The text will appear with an animation - if is_instance_valid(_tween) and _tween.is_running(): - _tween.kill() - - _tween = create_tween() - _tween.tween_property( - self, "visible_ratio", - 1, - _secs_per_character * get_total_character_count() - ).from(0.0) - _tween.finished.connect(_wait_input) - else: - _wait_input() - - modulate.a = 1.0 - - -func stop() ->void: - if modulate.a == 0.0: - return - - if _is_waiting_input: - _notify_completion() - else: - # Skip tweens - if is_instance_valid(_tween) and _tween.is_running(): - _tween.kill() - - visible_ratio = 1.0 - - _wait_input() - - -func disappear() -> void: - if modulate.a == 0.0: return - - _auto_continue = false - modulate.a = 0.0 - _is_waiting_input = false - - if is_instance_valid(_tween) and _tween.is_running(): - _tween.kill() - - clear() - text = "" - - _continue_icon.hide() - _continue_icon.modulate.a = 1.0 - - if is_instance_valid(_continue_icon_tween)\ - and _continue_icon_tween.is_running(): - _continue_icon_tween.kill() - - size = get_meta(DFLT_SIZE) - - set_process_input(false) - text_show_finished.emit() - G.dialog_line_finished.emit() - - -func change_speed() -> void: - _secs_per_character = E.text_speed - - -#endregion - -#region Private #################################################################################### -func _show_dialogue(chr: PopochiuCharacter, msg := "") -> void: - if not visible: return - - play_text({ - text = msg, - color = chr.text_color, - position = PopochiuUtils.get_screen_coords_for(chr, chr.dialog_pos).floor() / ( - E.scale if E.settings.scale_gui else Vector2.ONE - ), - }) - - G.dialog_line_started.emit() - - set_process_input(true) - text_show_started.emit() - - -func _wait_input() -> void: - _is_waiting_input = true - - if is_instance_valid(_tween) and _tween.finished.is_connected(_wait_input): - _tween.finished.disconnect(_wait_input) - - if E.auto_continue_after >= 0.0: - _auto_continue = true - await get_tree().create_timer(E.auto_continue_after + 0.2).timeout - - if _auto_continue: - _continue(true) - else: - _show_icon() - - -func _notify_completion() -> void: - disappear() - animation_finished.emit() - - -func _show_icon() -> void: - if is_instance_valid(_continue_icon_tween)\ - and _continue_icon_tween.is_running(): - _continue_icon_tween.kill() - - _continue_icon_tween = create_tween() -# _continue_icon.position.x = size.x - - if not E.settings.auto_continue_text: - # For manual continuation: make the continue icon jump - _continue_icon.value = 100.0 - - var from_pos := 0.0 - var to_pos := 0.0 - - match E.current_dialog_style: - 0: - from_pos = size.y / 2.0 - 1.0 - to_pos = size.y / 2.0 + 3.0 - 1, 2: - to_pos = size.y - _continue_icon.size.y + 2.0 - from_pos = size.y - _continue_icon.size.y - 1.0 - - _continue_icon_tween.tween_property( - _continue_icon, "position:y", to_pos, 0.8 - ).from(from_pos).set_trans(Tween.TRANS_BOUNCE).set_ease(Tween.EASE_OUT) - _continue_icon_tween.set_loops() - else: - # For automatic continuation: Make the icon appear like a progress bar - # the time players wil have to read befor auto-continuing - _continue_icon.value = 0.0 - - match E.current_dialog_style: - 0: - _continue_icon.position.y = size.y / 2.0 - - _continue_icon_tween.tween_property( - _continue_icon, "value", - 100.0, 3.0, - ).from_current().set_ease(Tween.EASE_OUT) - _continue_icon_tween.finished.connect(_continue) - - _continue_icon_tween.pause() - - await get_tree().create_timer(0.2).timeout - - _continue_icon_tween.play() - _continue_icon.show() - - -func _continue(forced_continue := false) -> void: - if E.settings.auto_continue_text or forced_continue: - disappear() - - -func _on_dialog_style_changed() -> void: - visible = E.current_dialog_style == used_when - - if E.current_dialog_style != 0 and E.current_dialog_style == used_when: - wrap_width = size.x - - -#endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.tscn b/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.tscn deleted file mode 100644 index f874eefe7..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.tscn +++ /dev/null @@ -1,178 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://cg18h3icrip1r"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_kxlqu"] -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_njktv"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.gd" id="2"] -[ext_resource type="Texture2D" uid="uid://h156lkhxk5tl" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_continue.png" id="3"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_text/portrait_text_panel.gd" id="5_rqqo1"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cff0b"] -bg_color = Color(0, 0, 0, 1) -draw_center = false - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6snsd"] -bg_color = Color(0, 0, 0, 1) -corner_radius_top_left = 2 -corner_radius_top_right = 2 -corner_radius_bottom_right = 2 -corner_radius_bottom_left = 2 -corner_detail = 1 -expand_margin_left = 2.0 -expand_margin_right = 2.0 -anti_aliasing = false - -[node name="DialogText" type="Control" groups=["popochiu_gui_component"]] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 -theme = ExtResource("1_kxlqu") - -[node name="AboveCharacterText" type="RichTextLabel" parent="."] -visible = false -clip_contents = false -custom_minimum_size = Vector2(16, 16) -layout_mode = 2 -offset_right = 16.0 -offset_bottom = 16.0 -size_flags_horizontal = 0 -mouse_filter = 2 -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 4 -theme_override_fonts/normal_font = ExtResource("1_njktv") -bbcode_enabled = true -fit_content = true -scroll_active = false -meta_underlined = false -script = ExtResource("2") - -[node name="ContinueIcon" type="TextureProgressBar" parent="AboveCharacterText"] -texture_filter = 1 -layout_mode = 1 -anchors_preset = 1 -anchor_left = 1.0 -anchor_right = 1.0 -offset_right = 16.0 -offset_bottom = 16.0 -grow_horizontal = 0 -value = 100.0 -fill_mode = 2 -texture_progress = ExtResource("3") - -[node name="PortraitTextPanel" type="PanelContainer" parent="."] -layout_mode = 1 -anchors_preset = 12 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = 8.0 -offset_top = -56.0 -offset_right = -8.0 -offset_bottom = -4.0 -grow_horizontal = 2 -grow_vertical = 0 -theme_override_styles/panel = SubResource("StyleBoxFlat_cff0b") -script = ExtResource("5_rqqo1") - -[node name="HBoxContainer" type="HBoxContainer" parent="PortraitTextPanel"] -layout_mode = 2 -theme_override_constants/separation = 4 - -[node name="LeftAvatar" type="TextureRect" parent="PortraitTextPanel/HBoxContainer"] -texture_filter = 1 -custom_minimum_size = Vector2(48, 48) -layout_mode = 2 -size_flags_vertical = 4 -stretch_mode = 3 - -[node name="PanelContainer" type="PanelContainer" parent="PortraitTextPanel/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_styles/panel = SubResource("StyleBoxFlat_6snsd") - -[node name="PortraitText" type="RichTextLabel" parent="PortraitTextPanel/HBoxContainer/PanelContainer"] -unique_name_in_owner = true -clip_contents = false -custom_minimum_size = Vector2(16, 16) -layout_mode = 2 -size_flags_horizontal = 3 -mouse_filter = 2 -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 4 -theme_override_fonts/normal_font = ExtResource("1_njktv") -bbcode_enabled = true -text = "[wave]Hi my popochiu!!![/wave]" -scroll_active = false -meta_underlined = false -script = ExtResource("2") -used_when = 1 - -[node name="ContinueIcon" type="TextureProgressBar" parent="PortraitTextPanel/HBoxContainer/PanelContainer/PortraitText"] -texture_filter = 1 -layout_mode = 1 -anchors_preset = 3 -anchor_left = 1.0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = -16.0 -offset_top = -16.0 -grow_horizontal = 0 -grow_vertical = 0 -value = 100.0 -fill_mode = 2 -texture_progress = ExtResource("3") - -[node name="RightAvatar" type="TextureRect" parent="PortraitTextPanel/HBoxContainer"] -texture_filter = 1 -custom_minimum_size = Vector2(48, 48) -layout_mode = 2 -size_flags_vertical = 4 -stretch_mode = 3 - -[node name="CaptionText" type="RichTextLabel" parent="."] -visible = false -clip_contents = false -custom_minimum_size = Vector2(16, 16) -layout_mode = 1 -anchors_preset = 12 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = 20.0 -offset_top = -20.0 -offset_right = -20.0 -offset_bottom = -4.0 -grow_horizontal = 2 -grow_vertical = 0 -size_flags_horizontal = 0 -mouse_filter = 2 -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 4 -theme_override_fonts/normal_font = ExtResource("1_njktv") -bbcode_enabled = true -text = "[center]Hi my friend[/center]" -fit_content = true -scroll_active = false -meta_underlined = false -script = ExtResource("2") -used_when = 2 - -[node name="ContinueIcon" type="TextureProgressBar" parent="CaptionText"] -texture_filter = 1 -layout_mode = 1 -anchors_preset = 3 -anchor_left = 1.0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = -16.0 -offset_right = 16.0 -grow_horizontal = 0 -grow_vertical = 0 -value = 100.0 -fill_mode = 2 -texture_progress = ExtResource("3") diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/portrait_text_panel.gd b/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/portrait_text_panel.gd deleted file mode 100644 index 1d4898e60..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/portrait_text_panel.gd +++ /dev/null @@ -1,32 +0,0 @@ -extends PanelContainer - -@onready var portrait_text: RichTextLabel = %PortraitText -@onready var left_avatar: TextureRect = $HBoxContainer/LeftAvatar -@onready var right_avatar: TextureRect = $HBoxContainer/RightAvatar - - -func _ready() -> void: - # Connect to child signals - portrait_text.text_show_started.connect(show) - portrait_text.text_show_finished.connect(hide) - - # Connect to singletons signals - C.character_spoke.connect(_update_avatar) - - hide() - - -func _update_avatar(chr: PopochiuCharacter, _msg := '') -> void: - if not portrait_text.visible: return - - left_avatar.texture = null - right_avatar.texture = null - - var char_pos: Vector2 = PopochiuUtils.get_screen_coords_for(chr).floor() / ( - E.scale if E.settings.scale_gui else Vector2.ONE - ) - - if char_pos.x <= E.half_width: - left_avatar.texture = chr.get_avatar_for_emotion(chr.emotion) - else: - right_avatar.texture = chr.get_avatar_for_emotion(chr.emotion) diff --git a/addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.gd b/addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.gd deleted file mode 100644 index eb3f21725..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.gd +++ /dev/null @@ -1,19 +0,0 @@ -extends RichTextLabel -class_name PopochiuHoverText - - -#region Godot ###################################################################################### -func _ready() -> void: - text = "" - - G.hover_text_shown.connect(_show_text) - - -#endregion - -#region Virtual #################################################################################### -func _show_text(txt := "") -> void: - text = "[center]%s[/center]" % txt - - -#endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.tscn b/addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.tscn deleted file mode 100644 index babb4c80b..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.tscn +++ /dev/null @@ -1,18 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://esorelppu4hw"] - -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_k4y5q"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_s7kd8"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.gd" id="2_r2ckj"] - -[node name="HoverText" type="RichTextLabel" groups=["popochiu_gui_component"]] -anchors_preset = 10 -anchor_right = 1.0 -offset_bottom = 15.0 -grow_horizontal = 2 -mouse_filter = 2 -theme = ExtResource("1_s7kd8") -theme_override_fonts/normal_font = ExtResource("1_k4y5q") -bbcode_enabled = true -text = "[center]text for hovered objects[/center]" -scroll_active = false -script = ExtResource("2_r2ckj") diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.tscn b/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.tscn deleted file mode 100644 index 2adabd252..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.tscn +++ /dev/null @@ -1,28 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://ciar5j7qm85bc"] - -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.gd" id="1"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_aynoo"] -[ext_resource type="Texture2D" uid="uid://ey7v3mcmfefw" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png" id="1_b8mqs"] - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_75cei"] -content_margin_left = 3.0 -content_margin_top = 1.0 -content_margin_right = 3.0 -content_margin_bottom = 5.0 -texture = ExtResource("1_b8mqs") -texture_margin_left = 11.0 -texture_margin_top = 1.0 -texture_margin_right = 1.0 -region_rect = Rect2(0, 0, 36, 24) - -[node name="InventoryBar" type="PanelContainer" groups=["popochiu_gui_component"]] -texture_filter = 1 -offset_right = 36.0 -offset_bottom = 24.0 -theme = ExtResource("1_aynoo") -theme_override_styles/panel = SubResource("StyleBoxTexture_75cei") -script = ExtResource("1") - -[node name="Box" type="HBoxContainer" parent="."] -layout_mode = 2 -mouse_filter = 2 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png b/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png deleted file mode 100644 index a0b1c272d..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/confirmation_popup/confirmation_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/components/popups/confirmation_popup/confirmation_popup.tscn deleted file mode 100644 index 7fe30cafe..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/confirmation_popup/confirmation_popup.tscn +++ /dev/null @@ -1,70 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://d06okn5i6id2g"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_ck2qk"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/confirmation_popup/confirmation_popup.gd" id="2_2ngwd"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_n4smw"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_4phlw"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_roir4"] -bg_color = Color(0, 0, 0, 0.498039) - -[node name="ConfirmationPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_ck2qk") -theme_override_styles/panel = SubResource("StyleBoxFlat_roir4") -script = ExtResource("2_2ngwd") - -[node name="PopupPanel" type="PanelContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Title" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_n4smw") -texture_pressed = ExtResource("4_4phlw") -texture_hover = ExtResource("4_4phlw") - -[node name="Question" type="Label" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -text = "Yes or No?" -horizontal_alignment = 1 -vertical_alignment = 1 -autowrap_mode = 3 - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.tscn deleted file mode 100644 index d374aa42b..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.tscn +++ /dev/null @@ -1,103 +0,0 @@ -[gd_scene load_steps=11 format=3 uid="uid://dfrsiyyqncspo"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_ktant"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.gd" id="2_bdgcw"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_6f0nr"] -[ext_resource type="PackedScene" uid="uid://b6dm3xvvr7dvi" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/dialog_line.tscn" id="3_8deqt"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_e8jii"] -[ext_resource type="PackedScene" uid="uid://2mnjw3qsi8hc" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/interaction_line.tscn" id="4_ndekf"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_roir4"] -bg_color = Color(0, 0, 0, 0.498039) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pm06l"] -bg_color = Color(1, 1, 1, 1) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gr6a3"] -bg_color = Color(0.768627, 0.423529, 0.443137, 1) -border_width_left = 8 -border_color = Color(0.388235, 0.607843, 1, 1) - -[sub_resource type="Theme" id="Theme_cqgnt"] -VScrollBar/styles/grabber = SubResource("StyleBoxFlat_pm06l") -VScrollBar/styles/grabber_highlight = SubResource("StyleBoxFlat_pm06l") -VScrollBar/styles/grabber_pressed = SubResource("StyleBoxFlat_pm06l") -VScrollBar/styles/scroll = SubResource("StyleBoxFlat_gr6a3") -VScrollBar/styles/scroll_focus = SubResource("StyleBoxFlat_gr6a3") - -[node name="HistoryPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_ktant") -theme_override_styles/panel = SubResource("StyleBoxFlat_roir4") -script = ExtResource("2_bdgcw") -dialog_line = ExtResource("3_8deqt") -interaction_line = ExtResource("4_ndekf") - -[node name="PopupPanel" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(256, 144) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "History" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_6f0nr") -texture_pressed = ExtResource("4_e8jii") -texture_hover = ExtResource("4_e8jii") - -[node name="Empty" type="Label" parent="PopupPanel/VBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_vertical = 3 -text = "Nothing to show yet" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="LinesScroll" type="ScrollContainer" parent="PopupPanel/VBoxContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -size_flags_vertical = 3 -theme = SubResource("Theme_cqgnt") - -[node name="LinesList" type="VBoxContainer" parent="PopupPanel/VBoxContainer/LinesScroll"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -visible = false -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.tscn deleted file mode 100644 index a67e6e1e9..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.tscn +++ /dev/null @@ -1,62 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://c51xplyeuk787"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_4hfpy"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.gd" id="2_yuv82"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_5rk5h"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_4odj8"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_roir4"] -bg_color = Color(0, 0, 0, 0.498039) - -[node name="PopochiuPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_4hfpy") -theme_override_styles/panel = SubResource("StyleBoxFlat_roir4") -script = ExtResource("2_yuv82") - -[node name="PopupPanel" type="PanelContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Title" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_5rk5h") -texture_pressed = ExtResource("4_4odj8") -texture_hover = ExtResource("4_4odj8") - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.tscn deleted file mode 100644 index 4ce8ea056..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.tscn +++ /dev/null @@ -1,72 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://bnjo044fkdcq7"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_3nwvu"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.gd" id="2_nkwwk"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_r2fp8"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_mra7q"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ixl2m"] -bg_color = Color(0, 0, 0, 0.498039) - -[node name="QuitPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_3nwvu") -theme_override_styles/panel = SubResource("StyleBoxFlat_ixl2m") -script = ExtResource("2_nkwwk") -script_name = &"QuitPopup" - -[node name="PopupPanel" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(256, 0) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Quit game" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_r2fp8") -texture_pressed = ExtResource("4_mra7q") -texture_hover = ExtResource("4_mra7q") - -[node name="Question" type="Label" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -text = "Are you sure you want to quit?" -horizontal_alignment = 1 -vertical_alignment = 1 -autowrap_mode = 3 - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.tscn deleted file mode 100644 index fd3ff2f0e..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.tscn +++ /dev/null @@ -1,90 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://cndputybyj57n"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_llqb8"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.gd" id="2_m1ot6"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_n4oyj"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_jqolx"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_u4bt4"] -bg_color = Color(0, 0, 0, 0.498039) - -[node name="SaveAndLoadPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_llqb8") -theme_override_styles/panel = SubResource("StyleBoxFlat_u4bt4") -script = ExtResource("2_m1ot6") -script_name = &"SaveAndLoadPopup" - -[node name="PopupPanel" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(192, 0) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Choose a slot to..." -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_n4oyj") -texture_pressed = ExtResource("4_jqolx") -texture_hover = ExtResource("4_jqolx") - -[node name="Slots" type="VBoxContainer" parent="PopupPanel/VBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_vertical = 3 -alignment = 1 - -[node name="BtnSlot1" type="Button" parent="PopupPanel/VBoxContainer/Slots"] -layout_mode = 2 -toggle_mode = true -text = "slot 1" - -[node name="BtnSlot2" type="Button" parent="PopupPanel/VBoxContainer/Slots"] -layout_mode = 2 -toggle_mode = true -text = "slot 2" - -[node name="BtnSlot3" type="Button" parent="PopupPanel/VBoxContainer/Slots"] -layout_mode = 2 -toggle_mode = true -text = "slot 3" - -[node name="BtnSlot4" type="Button" parent="PopupPanel/VBoxContainer/Slots"] -layout_mode = 2 -toggle_mode = true -text = "slot 4" - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/settings_popup/settings_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/components/popups/settings_popup/settings_popup.tscn deleted file mode 100644 index 4acc8afd3..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/settings_popup/settings_popup.tscn +++ /dev/null @@ -1,94 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://qe2d35bauand"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_51qbu"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/settings_popup/settings_popup.gd" id="2_3ww7r"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_mynrg"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_xc03r"] -[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.tscn" id="5_eq043"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_roir4"] -bg_color = Color(0, 0, 0, 0.498039) - -[node name="SettingsPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_51qbu") -theme_override_styles/panel = SubResource("StyleBoxFlat_roir4") -script = ExtResource("2_3ww7r") - -[node name="PopupPanel" type="PanelContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Settings" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_mynrg") -texture_pressed = ExtResource("4_xc03r") -texture_hover = ExtResource("4_xc03r") - -[node name="OptionsContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="SoundVolumes" parent="PopupPanel/VBoxContainer/OptionsContainer" instance=ExtResource("5_eq043")] -layout_mode = 2 - -[node name="Buttons" type="VBoxContainer" parent="PopupPanel/VBoxContainer/OptionsContainer"] -layout_mode = 2 - -[node name="Save" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Save" - -[node name="Load" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Load" - -[node name="History" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "History" - -[node name="Quit" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Quit game" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Resume game" - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -visible = false -layout_mode = 2 -size_flags_vertical = 10 -alignment = 2 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "ok" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.tscn deleted file mode 100644 index de3deb6e2..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.tscn +++ /dev/null @@ -1,68 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://dwxm2p1iyhpx6"] - -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_rwmoe"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.gd" id="2_qt85i"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_knqsp"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_v7y6x"] -[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.tscn" id="5_lh576"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_roir4"] -bg_color = Color(0, 0, 0, 0.498039) - -[node name="SoundSettingsPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_rwmoe") -theme_override_styles/panel = SubResource("StyleBoxFlat_roir4") -script = ExtResource("2_qt85i") - -[node name="PopupPanel" type="PanelContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Sound Settings" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -visible = false -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_knqsp") -texture_pressed = ExtResource("4_v7y6x") -texture_hover = ExtResource("4_v7y6x") - -[node name="SoundVolumes" parent="PopupPanel/VBoxContainer" instance=ExtResource("5_lh576")] -unique_name_in_owner = true -layout_mode = 2 - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres b/addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres deleted file mode 100644 index 57b9372c9..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres +++ /dev/null @@ -1,77 +0,0 @@ -[gd_resource type="Theme" load_steps=12 format=3 uid="uid://dpequqav4rjaf"] - -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_sgqra"] -[ext_resource type="Texture2D" uid="uid://cqxqfxobqltga" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png" id="2_7mnxi"] -[ext_resource type="Texture2D" uid="uid://pl1ch71kfj72" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png" id="2_ys82w"] -[ext_resource type="Texture2D" uid="uid://dukr75slqli45" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png" id="3_jfo2j"] - -[sub_resource type="StyleBoxFlat" id="8"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.180392, 0.172549, 0.607843, 1) -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -border_color = Color(0.482353, 0.482353, 0.482353, 1) -corner_detail = 4 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jts3x"] - -[sub_resource type="StyleBoxFlat" id="7"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.180392, 0.172549, 0.607843, 1) -draw_center = false -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -border_color = Color(0.439216, 0.427451, 0.921569, 1) -corner_detail = 4 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pr0tq"] -bg_color = Color(0.698039, 0.698039, 0.698039, 1) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mp7ca"] -bg_color = Color(1, 1, 1, 1) - -[sub_resource type="StyleBoxLine" id="StyleBoxLine_1vxxo"] -thickness = 4 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_respd"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.180392, 0.172549, 0.607843, 1) -shadow_color = Color(0, 0, 0, 1) -shadow_size = 4 -shadow_offset = Vector2(0, 2) - -[resource] -default_font = ExtResource("1_sgqra") -default_font_size = 16 -Button/colors/font_color = Color(0.698039, 0.698039, 0.698039, 1) -Button/colors/font_disabled_color = Color(0.482353, 0.482353, 0.482353, 1) -Button/colors/font_hover_color = Color(1, 1, 1, 1) -Button/colors/font_hover_pressed_color = Color(0.929412, 0.945098, 0.443137, 1) -Button/colors/font_pressed_color = Color(0.929412, 0.945098, 0.443137, 1) -Button/fonts/font = ExtResource("1_sgqra") -Button/styles/disabled = SubResource("8") -Button/styles/focus = SubResource("StyleBoxEmpty_jts3x") -Button/styles/hover = SubResource("7") -Button/styles/normal = SubResource("7") -Button/styles/pressed = SubResource("7") -CheckButton/icons/checked = ExtResource("2_ys82w") -CheckButton/icons/unchecked = ExtResource("3_jfo2j") -HSlider/icons/grabber = ExtResource("2_7mnxi") -HSlider/icons/grabber_highlight = ExtResource("2_7mnxi") -HSlider/styles/grabber_area = SubResource("StyleBoxFlat_pr0tq") -HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_mp7ca") -HSlider/styles/slider = SubResource("StyleBoxLine_1vxxo") -PanelContainer/styles/panel = SubResource("StyleBoxFlat_respd") diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png b/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png deleted file mode 100644 index 28e5485c5..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png b/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png deleted file mode 100644 index b2e9997f2..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png b/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png deleted file mode 100644 index b4d3943af..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png b/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png deleted file mode 100644 index 427aa67ee..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png b/addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png deleted file mode 100644 index e174a26b5..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png b/addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png deleted file mode 100644 index 6977f7e71..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn deleted file mode 100644 index 322518990..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn +++ /dev/null @@ -1,8 +0,0 @@ -[gd_scene format=3 uid="uid://b4juyi6em7wja"] - -[node name="9VerbInventorySlot" type="PanelContainer"] -custom_minimum_size = Vector2(40, 24) -offset_right = 40.0 -offset_bottom = 24.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png deleted file mode 100644 index 0bd28ba4e..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png deleted file mode 100644 index eb3429704..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn deleted file mode 100644 index dd9b1ad39..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn +++ /dev/null @@ -1,153 +0,0 @@ -[gd_scene load_steps=10 format=3 uid="uid://cuokybjvunmhq"] - -[ext_resource type="Theme" uid="uid://6vk2wej0sape" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres" id="1_8cwro"] -[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.tscn" id="1_8t0fs"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.gd" id="2_55o6l"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd" id="2_qt1af"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/commands_container/9_verb_commands_container.gd" id="3_q8l3d"] -[ext_resource type="ButtonGroup" uid="uid://y1thfsxxjowe" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_button_group.tres" id="4_6lnif"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/commands_container/9_verb_command_button.gd" id="5_bpewk"] -[ext_resource type="PackedScene" uid="uid://djan6vy0xq8dq" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn" id="6_r1cmu"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_gcqg0"] - -[node name="9VerbPanel" type="PanelContainer"] -anchors_preset = 12 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = -64.0 -grow_horizontal = 2 -grow_vertical = 0 -mouse_filter = 2 -theme = ExtResource("1_8cwro") -theme_override_styles/panel = SubResource("StyleBoxEmpty_gcqg0") -script = ExtResource("2_55o6l") -metadata/_edit_group_ = true - -[node name="VBoxContainer" type="VBoxContainer" parent="."] -layout_mode = 2 -theme_override_constants/separation = 1 -alignment = 2 - -[node name="HoverTextCentered" parent="VBoxContainer" instance=ExtResource("1_8t0fs")] -unique_name_in_owner = true -layout_mode = 2 -size_flags_vertical = 3 -theme = ExtResource("1_8cwro") -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 4 -fit_content = true -script = ExtResource("2_qt1af") -follows_cursor = false - -[node name="Verbs&InventoryContainer" type="PanelContainer" parent="VBoxContainer"] -layout_mode = 2 - -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Verbs&InventoryContainer"] -layout_mode = 2 -size_flags_vertical = 8 -theme_override_constants/separation = 0 - -[node name="CommandsContainer" type="GridContainer" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_constants/h_separation = 0 -theme_override_constants/v_separation = 0 -columns = 3 -script = ExtResource("3_q8l3d") - -[node name="Open" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Open" -script = ExtResource("5_bpewk") -command = 1 - -[node name="PickUp" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Pick Up" -script = ExtResource("5_bpewk") -command = 2 - -[node name="Push" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Push" -script = ExtResource("5_bpewk") -command = 3 - -[node name="Close" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Close" -script = ExtResource("5_bpewk") -command = 4 - -[node name="LookAt" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Look At" -script = ExtResource("5_bpewk") -command = 5 - -[node name="Pull" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Pull" -script = ExtResource("5_bpewk") -command = 6 - -[node name="Give" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Give" -script = ExtResource("5_bpewk") -command = 7 - -[node name="TalkTo" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Talk To" -script = ExtResource("5_bpewk") -command = 8 - -[node name="Use" type="Button" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 15 -toggle_mode = true -button_group = ExtResource("4_6lnif") -text = "Use" -script = ExtResource("5_bpewk") -command = 9 - -[node name="9VerbInventoryGrid" parent="VBoxContainer/Verbs&InventoryContainer/HBoxContainer" instance=ExtResource("6_r1cmu")] -layout_mode = 2 -size_flags_horizontal = 1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn deleted file mode 100644 index 9ec1ec0ed..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn +++ /dev/null @@ -1,20 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://dv1gec8q4h6b7"] - -[ext_resource type="PackedScene" uid="uid://bnjo044fkdcq7" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.tscn" id="1_8vq27"] -[ext_resource type="Theme" uid="uid://6vk2wej0sape" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres" id="2_pq8jb"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i0r24"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 2.0 -bg_color = Color(0.290196, 0.290196, 0.290196, 1) - -[node name="9VerbQuitPopup" instance=ExtResource("1_8vq27")] -theme = ExtResource("2_pq8jb") - -[node name="PopupPanel" parent="." index="0"] -theme_override_styles/panel = SubResource("StyleBoxFlat_i0r24") - -[node name="Title" parent="PopupPanel/VBoxContainer/HeaderContainer" index="0"] -theme_override_colors/font_color = Color(0.768627, 0.423529, 0.443137, 1) diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn deleted file mode 100644 index 59f784de4..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn +++ /dev/null @@ -1,116 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://crla6to4mm0p7"] - -[ext_resource type="Theme" uid="uid://6vk2wej0sape" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres" id="1_toexk"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd" id="2_fpv5p"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_4d6ih"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_duspy"] -[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.tscn" id="5_k2hr6"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_roir4"] -bg_color = Color(0, 0, 0, 0.498039) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ne3b0"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 2.0 -bg_color = Color(0.290196, 0.290196, 0.290196, 1) - -[node name="9VerbSettingsPopup" type="PanelContainer"] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_toexk") -theme_override_styles/panel = SubResource("StyleBoxFlat_roir4") -script = ExtResource("2_fpv5p") - -[node name="PopupPanel" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(264, 0) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_styles/panel = SubResource("StyleBoxFlat_ne3b0") - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Settings" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_4d6ih") -texture_pressed = ExtResource("4_duspy") -texture_hover = ExtResource("4_duspy") - -[node name="OptionsContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel/VBoxContainer/OptionsContainer"] -layout_mode = 2 - -[node name="SoundVolumes" parent="PopupPanel/VBoxContainer/OptionsContainer/VBoxContainer" instance=ExtResource("5_k2hr6")] -layout_mode = 2 - -[node name="ClassicSentence" type="CheckButton" parent="PopupPanel/VBoxContainer/OptionsContainer/VBoxContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -tooltip_text = "Show hover text centered" -text = "Classic sentence" - -[node name="Buttons" type="VBoxContainer" parent="PopupPanel/VBoxContainer/OptionsContainer"] -unique_name_in_owner = true -custom_minimum_size = Vector2(96, 0) -layout_mode = 2 - -[node name="Save" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Save" - -[node name="Load" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Load" - -[node name="History" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "History" - -[node name="Quit" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Quit game" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/OptionsContainer/Buttons"] -unique_name_in_owner = true -layout_mode = 2 -text = "Resume game" - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -visible = false -layout_mode = 2 -size_flags_vertical = 10 -alignment = 2 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "ok" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png deleted file mode 100644 index f3c7f7c7d..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres b/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres deleted file mode 100644 index e9d096f23..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres +++ /dev/null @@ -1,101 +0,0 @@ -[gd_resource type="Theme" load_steps=18 format=3 uid="uid://6vk2wej0sape"] - -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_13dqu"] -[ext_resource type="Texture2D" uid="uid://pl1ch71kfj72" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png" id="2_l1qok"] -[ext_resource type="Texture2D" uid="uid://cqxqfxobqltga" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png" id="2_m8a8v"] -[ext_resource type="Texture2D" uid="uid://dukr75slqli45" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png" id="3_v1wp4"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5x338"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_w1gq5"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_obedf"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_bqsem"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_p66r8"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ud0f1"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2rny4"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vor3l"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3vypu"] -content_margin_left = 4.0 -content_margin_top = 2.0 -content_margin_right = 4.0 -content_margin_bottom = 3.0 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pr0tq"] -bg_color = Color(0.698039, 0.698039, 0.698039, 1) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mp7ca"] -bg_color = Color(1, 1, 1, 1) - -[sub_resource type="StyleBoxLine" id="StyleBoxLine_1vxxo"] -thickness = 4 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_respd"] -bg_color = Color(0, 0, 0, 0.498039) - -[resource] -default_font = ExtResource("1_13dqu") -default_font_size = 16 -Button/colors/font_color = Color(0.698039, 0.698039, 0.698039, 1) -Button/colors/font_disabled_color = Color(0.482353, 0.482353, 0.482353, 1) -Button/colors/font_hover_color = Color(1, 1, 1, 1) -Button/colors/font_hover_pressed_color = Color(0.780392, 0.984314, 0.647059, 1) -Button/colors/font_pressed_color = Color(0.780392, 0.984314, 0.647059, 1) -Button/fonts/font = ExtResource("1_13dqu") -Button/styles/disabled = SubResource("StyleBoxEmpty_5x338") -Button/styles/focus = SubResource("StyleBoxEmpty_w1gq5") -Button/styles/hover = SubResource("StyleBoxEmpty_obedf") -Button/styles/normal = SubResource("StyleBoxEmpty_bqsem") -Button/styles/pressed = SubResource("StyleBoxEmpty_p66r8") -CheckButton/icons/checked = ExtResource("2_l1qok") -CheckButton/icons/unchecked = ExtResource("3_v1wp4") -CheckButton/styles/disabled = SubResource("StyleBoxEmpty_ud0f1") -CheckButton/styles/focus = SubResource("StyleBoxEmpty_2rny4") -CheckButton/styles/hover = SubResource("StyleBoxEmpty_vor3l") -CheckButton/styles/hover_pressed = SubResource("StyleBoxEmpty_3vypu") -CheckButton/styles/normal = null -CheckButton/styles/pressed = null -HSlider/icons/grabber = ExtResource("2_m8a8v") -HSlider/icons/grabber_highlight = ExtResource("2_m8a8v") -HSlider/styles/grabber_area = SubResource("StyleBoxFlat_pr0tq") -HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_mp7ca") -HSlider/styles/slider = SubResource("StyleBoxLine_1vxxo") -PanelContainer/styles/panel = SubResource("StyleBoxFlat_respd") diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.tscn deleted file mode 100644 index 395785cf1..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.tscn +++ /dev/null @@ -1,36 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://cv2o5p3gp1fgx"] - -[ext_resource type="Theme" uid="uid://csr0n32rthycw" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres" id="1_b1kac"] -[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.tscn" id="1_tlpex"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.gd" id="2_u87it"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ecos1"] -content_margin_left = 6.0 -content_margin_right = 6.0 -bg_color = Color(0.596078, 0.796078, 0.784314, 1) - -[node name="SierraBar" type="PanelContainer" groups=["popochiu_gui_component"]] -anchors_preset = 10 -anchor_right = 1.0 -offset_bottom = 15.0 -grow_horizontal = 2 -theme = ExtResource("1_b1kac") -theme_override_styles/panel = SubResource("StyleBoxFlat_ecos1") -script = ExtResource("2_u87it") - -[node name="HBoxContainer" type="HBoxContainer" parent="."] -layout_mode = 2 - -[node name="LblGameName" type="Label" parent="HBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Sierra GUI" - -[node name="HoverText" parent="HBoxContainer" instance=ExtResource("1_tlpex")] -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="LblScore" type="Label" parent="HBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Score: 0" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn deleted file mode 100644 index b6b04cba2..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn +++ /dev/null @@ -1,145 +0,0 @@ -[gd_scene load_steps=20 format=3 uid="uid://dc7crw22yevoo"] - -[ext_resource type="Theme" uid="uid://csr0n32rthycw" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres" id="1_03e3k"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd" id="2_xj17e"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_7aa5u"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_vd0bg"] -[ext_resource type="PackedScene" uid="uid://26dqxcqhmj44" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn" id="5_i15hx"] -[ext_resource type="ButtonGroup" uid="uid://dyskyd66yevlj" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_button_group.tres" id="6_gcms1"] -[ext_resource type="Texture2D" uid="uid://mbfkdny6pub7" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png" id="7_ietfy"] -[ext_resource type="Texture2D" uid="uid://57nl6xfjetoe" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png" id="8_m3ulb"] -[ext_resource type="Texture2D" uid="uid://b5vpolfm4o5f4" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png" id="9_ur807"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_roir4"] -bg_color = Color(0, 0, 0, 0.247059) - -[sub_resource type="AtlasTexture" id="AtlasTexture_t6f3x"] -atlas = ExtResource("7_ietfy") -region = Rect2(0, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2tl6r"] -atlas = ExtResource("7_ietfy") -region = Rect2(0, 32, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_u6es1"] -atlas = ExtResource("7_ietfy") -region = Rect2(0, 32, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_3r3in"] -atlas = ExtResource("8_m3ulb") -region = Rect2(0, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2idn6"] -atlas = ExtResource("8_m3ulb") -region = Rect2(0, 32, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mndsc"] -atlas = ExtResource("8_m3ulb") -region = Rect2(0, 32, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hb12v"] -atlas = ExtResource("9_ur807") -region = Rect2(0, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_b4bqk"] -atlas = ExtResource("9_ur807") -region = Rect2(0, 32, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_w2dlm"] -atlas = ExtResource("9_ur807") -region = Rect2(0, 32, 32, 32) - -[node name="SierraInventoryPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_03e3k") -theme_override_styles/panel = SubResource("StyleBoxFlat_roir4") -script = ExtResource("2_xj17e") -script_name = &"SierraInventoryPopup" - -[node name="PopupPanel" type="PanelContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.180392, 0.172549, 0.607843, 1) -text = "Inventory" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_7aa5u") -texture_pressed = ExtResource("4_vd0bg") -texture_hover = ExtResource("4_vd0bg") - -[node name="SierraInventoryGrid" parent="PopupPanel/VBoxContainer" instance=ExtResource("5_i15hx")] -layout_mode = 2 - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 - -[node name="CommandsContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 - -[node name="Interact" type="TextureButton" parent="PopupPanel/VBoxContainer/FooterContainer/CommandsContainer"] -texture_filter = 1 -layout_mode = 2 -toggle_mode = true -button_group = ExtResource("6_gcms1") -texture_normal = SubResource("AtlasTexture_t6f3x") -texture_pressed = SubResource("AtlasTexture_2tl6r") -texture_hover = SubResource("AtlasTexture_u6es1") - -[node name="Look" type="TextureButton" parent="PopupPanel/VBoxContainer/FooterContainer/CommandsContainer"] -texture_filter = 1 -layout_mode = 2 -toggle_mode = true -button_group = ExtResource("6_gcms1") -texture_normal = SubResource("AtlasTexture_3r3in") -texture_pressed = SubResource("AtlasTexture_2idn6") -texture_hover = SubResource("AtlasTexture_mndsc") - -[node name="Talk" type="TextureButton" parent="PopupPanel/VBoxContainer/FooterContainer/CommandsContainer"] -texture_filter = 1 -layout_mode = 2 -toggle_mode = true -button_group = ExtResource("6_gcms1") -texture_normal = SubResource("AtlasTexture_hb12v") -texture_pressed = SubResource("AtlasTexture_b4bqk") -texture_hover = SubResource("AtlasTexture_w2dlm") - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 10 -size_flags_vertical = 4 -text = "close" - -[connection signal="pressed" from="PopupPanel/VBoxContainer/FooterContainer/CommandsContainer/Interact" to="." method="_on_interact_pressed"] -[connection signal="pressed" from="PopupPanel/VBoxContainer/FooterContainer/CommandsContainer/Look" to="." method="_on_look_pressed"] -[connection signal="pressed" from="PopupPanel/VBoxContainer/FooterContainer/CommandsContainer/Talk" to="." method="_on_talk_pressed"] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png deleted file mode 100644 index ba04bf429..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png.import deleted file mode 100644 index 029974efe..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bctpmd8wh2ket" -path="res://.godot/imported/btn_down.png-5b2bbec8eb1dd3ca55c87af63b01e606.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png" -dest_files=["res://.godot/imported/btn_down.png-5b2bbec8eb1dd3ca55c87af63b01e606.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png deleted file mode 100644 index 48bd29723..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png.import deleted file mode 100644 index ea733e786..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cjairw6sepult" -path="res://.godot/imported/btn_up.png-c161953b7259da1f252bd8ff5f712267.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png" -dest_files=["res://.godot/imported/btn_up.png-c161953b7259da1f252bd8ff5f712267.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn deleted file mode 100644 index 7395ce6d0..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn +++ /dev/null @@ -1,100 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://c24vj4s0u08jr"] - -[ext_resource type="Theme" uid="uid://csr0n32rthycw" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres" id="1_jexgm"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd" id="2_3iqg8"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_65lvt"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_38rye"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_se5fd"] -bg_color = Color(0, 0, 0, 0.247059) - -[node name="SierraSettingsPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_jexgm") -theme_override_styles/panel = SubResource("StyleBoxFlat_se5fd") -script = ExtResource("2_3iqg8") -script_name = &"SierraSettingsPopup" - -[node name="PopupPanel" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(120, 0) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Options" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -visible = false -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_65lvt") -texture_pressed = ExtResource("4_38rye") -texture_hover = ExtResource("4_38rye") - -[node name="BodyContainer" type="VBoxContainer" parent="PopupPanel/VBoxContainer"] -custom_minimum_size = Vector2(112, 0) -layout_mode = 2 - -[node name="HBoxContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer/BodyContainer"] -layout_mode = 2 - -[node name="Save" type="Button" parent="PopupPanel/VBoxContainer/BodyContainer/HBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Save" - -[node name="Load" type="Button" parent="PopupPanel/VBoxContainer/BodyContainer/HBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -text = "Load" - -[node name="Sound" type="Button" parent="PopupPanel/VBoxContainer/BodyContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Sound options" - -[node name="Text" type="Button" parent="PopupPanel/VBoxContainer/BodyContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Text options" - -[node name="Quit" type="Button" parent="PopupPanel/VBoxContainer/BodyContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Quit" - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Back" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sound_popup/sierra_sound_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sound_popup/sierra_sound_popup.tscn deleted file mode 100644 index 3432bd213..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sound_popup/sierra_sound_popup.tscn +++ /dev/null @@ -1,70 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://mh7ymcslp4xv"] - -[ext_resource type="Theme" uid="uid://csr0n32rthycw" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres" id="1_clc2m"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.gd" id="2_mv3ym"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_3cpvg"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_5cjf6"] -[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.tscn" id="5_tjqww"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ygj01"] - -[node name="SierraSoundPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_clc2m") -theme_override_styles/panel = SubResource("StyleBoxEmpty_ygj01") -script = ExtResource("2_mv3ym") -script_name = &"SierraSoundPopup" - -[node name="PopupPanel" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(0, 140) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.180392, 0.172549, 0.607843, 1) -text = "Sound options" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -visible = false -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_3cpvg") -texture_pressed = ExtResource("4_5cjf6") -texture_hover = ExtResource("4_5cjf6") - -[node name="SoundVolumes" parent="PopupPanel/VBoxContainer" instance=ExtResource("5_tjqww")] -layout_mode = 2 - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Back" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.tscn deleted file mode 100644 index b84f98697..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.tscn +++ /dev/null @@ -1,122 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://de68lx1xqv7fb"] - -[ext_resource type="Theme" uid="uid://csr0n32rthycw" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres" id="1_564ah"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.gd" id="2_nmcxa"] -[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" id="3_rckox"] -[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" id="4_gfs8i"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_bh5os"] - -[node name="SierraTextPopup" type="PanelContainer" groups=["popochiu_gui_popup"]] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_564ah") -theme_override_styles/panel = SubResource("StyleBoxEmpty_bh5os") -script = ExtResource("2_nmcxa") -script_name = &"SierraTextPopup" - -[node name="PopupPanel" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(140, 140) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 - -[node name="VBoxContainer" type="VBoxContainer" parent="PopupPanel"] -layout_mode = 2 - -[node name="HeaderContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.180392, 0.172549, 0.607843, 1) -text = "Text options" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Close" type="TextureButton" parent="PopupPanel/VBoxContainer/HeaderContainer"] -unique_name_in_owner = true -visible = false -texture_filter = 1 -layout_mode = 2 -size_flags_vertical = 4 -texture_normal = ExtResource("3_rckox") -texture_pressed = ExtResource("4_gfs8i") -texture_hover = ExtResource("4_gfs8i") - -[node name="BodyContainer" type="VBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 - -[node name="TextSpeedContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer/BodyContainer"] -layout_mode = 2 - -[node name="Label" type="Label" parent="PopupPanel/VBoxContainer/BodyContainer/TextSpeedContainer"] -layout_mode = 2 -text = "Text speed" - -[node name="TextSpeed" type="HSlider" parent="PopupPanel/VBoxContainer/BodyContainer/TextSpeedContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 8 -max_value = 0.1 -step = 0.01 - -[node name="DialogStyleContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer/BodyContainer"] -layout_mode = 2 - -[node name="Label" type="Label" parent="PopupPanel/VBoxContainer/BodyContainer/DialogStyleContainer"] -layout_mode = 2 -text = "Style" -horizontal_alignment = 1 - -[node name="DialogStyle" type="OptionButton" parent="PopupPanel/VBoxContainer/BodyContainer/DialogStyleContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_horizontal = 3 -item_count = 3 -selected = 0 -popup/item_0/text = "Above character" -popup/item_0/id = 0 -popup/item_1/text = "Portrait" -popup/item_1/id = 1 -popup/item_2/text = "Caption" -popup/item_2/id = 2 - -[node name="ContinueModeContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer/BodyContainer"] -layout_mode = 2 - -[node name="Label" type="Label" parent="PopupPanel/VBoxContainer/BodyContainer/ContinueModeContainer"] -layout_mode = 2 -text = "Auto-continue" -horizontal_alignment = 1 - -[node name="ContinueMode" type="CheckBox" parent="PopupPanel/VBoxContainer/BodyContainer/ContinueModeContainer"] -unique_name_in_owner = true -texture_filter = 1 -layout_mode = 2 -size_flags_horizontal = 10 -icon_alignment = 2 - -[node name="FooterContainer" type="HBoxContainer" parent="PopupPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 10 -alignment = 1 - -[node name="Ok" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "ok" - -[node name="Cancel" type="Button" parent="PopupPanel/VBoxContainer/FooterContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Back" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png deleted file mode 100644 index b1e1837f6..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png deleted file mode 100644 index 015e7bf10..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png deleted file mode 100644 index 11fdc29b5..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png deleted file mode 100644 index dd40025da..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png deleted file mode 100644 index ce46d971b..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_select.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_select.png deleted file mode 100644 index 0fa05f6fb..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_select.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png deleted file mode 100644 index a3aae4016..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png deleted file mode 100644 index 5ab95ba0e..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png deleted file mode 100644 index c59bb0ae9..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png.import deleted file mode 100644 index f0c32f877..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cnxdologw7ax8" -path="res://.godot/imported/btn_walk.png-d3ddd841fd79f662e418d72037bf6d1c.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png" -dest_files=["res://.godot/imported/btn_walk.png-d3ddd841fd79f662e418d72037bf6d1c.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png deleted file mode 100644 index 064269b4a..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres b/addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres deleted file mode 100644 index b350efefc..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres +++ /dev/null @@ -1,86 +0,0 @@ -[gd_resource type="Theme" load_steps=16 format=3 uid="uid://csr0n32rthycw"] - -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_nr34n"] -[ext_resource type="Texture2D" uid="uid://d1ywqbehmtuv" path="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png" id="2_cg14b"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bnnre"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.180392, 0.172549, 0.607843, 1) - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_plnae"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r50cx"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.662745, 1, 0.623529, 1) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_00rv3"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.45098, 0.431373, 0.901961, 1) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7awjj"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.662745, 1, 0.623529, 1) - -[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_a32yv"] -load_path = "res://.godot/imported/check_button_checked.png-2468104f5ede624d527af9eda0d5778b.ctex" - -[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_ovawv"] -load_path = "res://.godot/imported/check_button_unchecked.png-dba6c92351c8f844f3056f0ee8b9f7ec.ctex" - -[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_3p6em"] -load_path = "res://.godot/imported/grabber.png-7198537c09dd15d8a4e96515620721f5.ctex" - -[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_18ol6"] -load_path = "res://.godot/imported/grabber.png-7198537c09dd15d8a4e96515620721f5.ctex" - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_v1yct"] -bg_color = Color(0.698039, 0.698039, 0.698039, 1) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_idv6l"] -bg_color = Color(1, 1, 1, 1) - -[sub_resource type="StyleBoxLine" id="StyleBoxLine_3kmsf"] -thickness = 4 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e2cci"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 4.0 -bg_color = Color(0.596078, 0.796078, 0.784314, 1) - -[resource] -default_font = ExtResource("1_nr34n") -default_font_size = 16 -Button/colors/font_color = Color(1, 1, 1, 1) -Button/colors/font_disabled_color = Color(0.698039, 0.698039, 0.698039, 1) -Button/colors/font_hover_color = Color(0.439216, 0.427451, 0.921569, 1) -Button/colors/font_hover_pressed_color = Color(0.439216, 0.427451, 0.921569, 1) -Button/colors/font_pressed_color = Color(0.439216, 0.427451, 0.921569, 1) -Button/fonts/font = ExtResource("1_nr34n") -Button/styles/disabled = SubResource("StyleBoxFlat_bnnre") -Button/styles/focus = SubResource("StyleBoxEmpty_plnae") -Button/styles/hover = SubResource("StyleBoxFlat_r50cx") -Button/styles/normal = SubResource("StyleBoxFlat_00rv3") -Button/styles/pressed = SubResource("StyleBoxFlat_7awjj") -CheckButton/icons/checked = SubResource("CompressedTexture2D_a32yv") -CheckButton/icons/unchecked = SubResource("CompressedTexture2D_ovawv") -HSlider/icons/grabber = SubResource("CompressedTexture2D_3p6em") -HSlider/icons/grabber_highlight = SubResource("CompressedTexture2D_18ol6") -HSlider/styles/grabber_area = SubResource("StyleBoxFlat_v1yct") -HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_idv6l") -HSlider/styles/slider = SubResource("StyleBoxLine_3kmsf") -OptionButton/icons/arrow = ExtResource("2_cg14b") -PanelContainer/styles/panel = SubResource("StyleBoxFlat_e2cci") diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_auto.gd b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_auto.gd deleted file mode 100644 index 8d966d77c..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_auto.gd +++ /dev/null @@ -1,37 +0,0 @@ -extends "settings_bar_button.gd" - -@export var btn_states := [] # (Array, Texture2D) -@export var states_descriptions := ["manual", "auto"] - - -#region Godot ###################################################################################### -func _ready() -> void: - super() - texture_normal = _get_texture() - - -#endregion - -#region Virtual #################################################################################### -func _on_pressed() -> void: - E.settings.auto_continue_text = !E.settings.auto_continue_text - texture_normal = _get_texture() - - G.show_hover_text(self.description) - - -#endregion - -#region SetGet ##################################################################################### -func get_description() -> String: - return "%s: %s" % [description, states_descriptions[1 if E.settings.auto_continue_text else 0]] - - -#endregion - -#region Private #################################################################################### -func _get_texture() -> Texture2D: - return btn_states[1 if E.settings.auto_continue_text else 0] - - -#endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_speed.gd b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_speed.gd deleted file mode 100644 index 635d6da18..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_speed.gd +++ /dev/null @@ -1,72 +0,0 @@ -@tool -extends "settings_bar_button.gd" - -const TextSpeedOption = preload( - PopochiuResources.GUI_TEMPLATES_FOLDER - + "simple_click/components/settings_bar/resources/text_speed_option.gd" -) - -@export var speed_options: Array : set = set_speed_options - -var _speed_idx := 0 - - -#region Godot ###################################################################################### -func _ready() -> void: - if Engine.is_editor_hint(): - return - - super() - - if speed_options.is_empty(): - hide() - - texture_normal = (speed_options[_speed_idx] as TextSpeedOption).icon - - -#endregion - -#region Virtual #################################################################################### -func _on_pressed() -> void: - _change_text_speed() - G.show_hover_text(self.description) - - -#endregion - -#region SetGet ##################################################################################### -func get_description() -> String: - if speed_options.is_empty() or Engine.is_editor_hint(): - return description - - return "%s: %s" % [description, (speed_options[_speed_idx] as TextSpeedOption).description] - - -func set_speed_options(value: Array) -> void: - speed_options = value - - for idx in value.size(): - if not value[idx]: - var x := TextSpeedOption.new() - x.resource_name = "Speed %d" % idx - - value[idx] = x - - if speed_options.is_empty(): - texture_normal = null - else: - texture_normal = speed_options[0].icon - - -#endregion - -#region Private #################################################################################### -## Changes the speed of the text in dialog lines looping through the values in -## [member PopochiuSettings.text_speeds]. -func _change_text_speed() -> void: - _speed_idx = wrapi(_speed_idx + 1, 0, speed_options.size()) - texture_normal = (speed_options[_speed_idx] as TextSpeedOption).icon - E.text_speed = (speed_options[_speed_idx] as TextSpeedOption).speed - - -#endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.tscn b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.tscn deleted file mode 100644 index d12506f5f..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.tscn +++ /dev/null @@ -1,117 +0,0 @@ -[gd_scene load_steps=25 format=3 uid="uid://0cqerawlxb3o"] - -[ext_resource type="Texture2D" uid="uid://c4lgasdx1ow1d" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png" id="1_hwsmr"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.gd" id="2_hk0vm"] -[ext_resource type="Texture2D" uid="uid://bexxkrmqdiemq" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png" id="3_b0ddg"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_save.gd" id="4_q3d3e"] -[ext_resource type="Texture2D" uid="uid://bns33w6nl2qkb" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png" id="5_8xdf1"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_load.gd" id="6_dfxoh"] -[ext_resource type="Texture2D" uid="uid://bkwo41gqhl5ic" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png" id="7_otoev"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_speed.gd" id="8_xj7pu"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/resources/text_speed_option.gd" id="9_81q7g"] -[ext_resource type="Texture2D" uid="uid://dl2gqtc0ay0nk" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png" id="10_kfiam"] -[ext_resource type="Texture2D" uid="uid://cyvd8h2ouw8rg" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png" id="11_id5s2"] -[ext_resource type="Texture2D" uid="uid://s7ksvmp5vkc8" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png" id="11_mkapw"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd" id="12_jqlr0"] -[ext_resource type="Texture2D" uid="uid://brnf51r7xuec4" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png" id="13_n5ueq"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_auto.gd" id="14_e58le"] -[ext_resource type="Texture2D" uid="uid://crsupx5ptsu28" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png" id="15_igyij"] -[ext_resource type="Texture2D" uid="uid://bg1txcy1ofatq" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png" id="16_7j34k"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd" id="17_i76cd"] -[ext_resource type="Texture2D" uid="uid://cxpcw7xvcjcfy" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png" id="18_64yvb"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_quit.gd" id="19_5u3hw"] - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_3b8bi"] -content_margin_left = 3.0 -content_margin_right = 3.0 -texture = ExtResource("1_hwsmr") -texture_margin_left = 1.0 -texture_margin_top = 1.0 -texture_margin_right = 11.0 -texture_margin_bottom = 5.0 -region_rect = Rect2(0, 0, 36, 24) - -[sub_resource type="Resource" id="Resource_ie5nq"] -resource_name = "Speed 0" -script = ExtResource("9_81q7g") -icon = ExtResource("7_otoev") -description = "normal" -speed = 0.1 - -[sub_resource type="Resource" id="Resource_dhkav"] -resource_name = "Speed 1" -script = ExtResource("9_81q7g") -icon = ExtResource("10_kfiam") -description = "fast" -speed = 0.01 - -[sub_resource type="Resource" id="Resource_kqq7u"] -resource_name = "Speed 2" -script = ExtResource("9_81q7g") -icon = ExtResource("11_mkapw") -description = "immediate" -speed = 0.0 - -[node name="SettingsBar" type="PanelContainer" groups=["popochiu_gui_component"]] -texture_filter = 1 -offset_right = 122.0 -offset_bottom = 24.0 -theme_override_styles/panel = SubResource("StyleBoxTexture_3b8bi") -script = ExtResource("2_hk0vm") - -[node name="Box" type="HBoxContainer" parent="."] -layout_mode = 2 -mouse_filter = 2 -alignment = 2 - -[node name="BtnSave" type="TextureButton" parent="Box"] -layout_mode = 2 -texture_normal = ExtResource("3_b0ddg") -script = ExtResource("4_q3d3e") -description = "Save game" -script_name = "SaveGame" - -[node name="BtnLoad" type="TextureButton" parent="Box"] -visible = false -layout_mode = 2 -texture_normal = ExtResource("5_8xdf1") -script = ExtResource("6_dfxoh") -description = "Load game" -script_name = "LoadGame" - -[node name="BtnDialogSpeed" type="TextureButton" parent="Box"] -layout_mode = 2 -texture_normal = ExtResource("7_otoev") -script = ExtResource("8_xj7pu") -speed_options = [SubResource("Resource_ie5nq"), SubResource("Resource_dhkav"), SubResource("Resource_kqq7u")] -description = "Text speed" -script_name = "TextSpeed" - -[node name="BtnSoundSettings" type="TextureButton" parent="Box"] -layout_mode = 2 -texture_normal = ExtResource("11_id5s2") -script = ExtResource("12_jqlr0") -description = "Sound settings" -script_name = "SoundSettings" - -[node name="BtnDialogAuto" type="TextureButton" parent="Box"] -layout_mode = 2 -texture_normal = ExtResource("13_n5ueq") -script = ExtResource("14_e58le") -btn_states = [ExtResource("13_n5ueq"), ExtResource("15_igyij")] -description = "Continue mode" -script_name = "ContinueMode" - -[node name="BtnDialogHistory" type="TextureButton" parent="Box"] -layout_mode = 2 -texture_normal = ExtResource("16_7j34k") -script = ExtResource("17_i76cd") -description = "History" -script_name = "History" - -[node name="BtnQuit" type="TextureButton" parent="Box"] -layout_mode = 2 -texture_normal = ExtResource("18_64yvb") -script = ExtResource("19_5u3hw") -description = "Quit" -script_name = "Quit" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png deleted file mode 100644 index c813f5ede..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png deleted file mode 100644 index d9db65a15..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png.import deleted file mode 100644 index a1e45b6c6..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://brnf51r7xuec4" -path="res://.godot/imported/btn_dialog_auto_01.png-4740381ea0a95878296319b73cd70fbc.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_01.png" -dest_files=["res://.godot/imported/btn_dialog_auto_01.png-4740381ea0a95878296319b73cd70fbc.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png deleted file mode 100644 index 147b148e4..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png.import deleted file mode 100644 index 284128ab7..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://crsupx5ptsu28" -path="res://.godot/imported/btn_dialog_auto_02.png-4e97952d6b91d37ba43e0ce70d7e9b5c.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_auto_02.png" -dest_files=["res://.godot/imported/btn_dialog_auto_02.png-4e97952d6b91d37ba43e0ce70d7e9b5c.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png deleted file mode 100644 index eca6eb4f3..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png deleted file mode 100644 index 8879b20d4..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png.import deleted file mode 100644 index 4b2c120ab..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bkwo41gqhl5ic" -path="res://.godot/imported/btn_dialog_speed_01.png-32a3ef9efe41a83c37d5a8f22f32ea2d.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_01.png" -dest_files=["res://.godot/imported/btn_dialog_speed_01.png-32a3ef9efe41a83c37d5a8f22f32ea2d.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png deleted file mode 100644 index 99b9067df..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png.import deleted file mode 100644 index 3608a3027..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dl2gqtc0ay0nk" -path="res://.godot/imported/btn_dialog_speed_02.png-44c80bcac82dcd77e02cefa4e9d32763.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_02.png" -dest_files=["res://.godot/imported/btn_dialog_speed_02.png-44c80bcac82dcd77e02cefa4e9d32763.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png deleted file mode 100644 index ac6d9dbf9..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png.import deleted file mode 100644 index f49a088ce..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://s7ksvmp5vkc8" -path="res://.godot/imported/btn_dialog_speed_03.png-73b51bc074e27ab2f85862d91c14e081.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_speed_03.png" -dest_files=["res://.godot/imported/btn_dialog_speed_03.png-73b51bc074e27ab2f85862d91c14e081.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png deleted file mode 100644 index 4fb09fc41..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png deleted file mode 100644 index 126944367..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png deleted file mode 100644 index eac23f414..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png deleted file mode 100644 index 9bf99f327..000000000 Binary files a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png and /dev/null differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png.import b/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png.import deleted file mode 100644 index 4792c1b79..000000000 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://c4lgasdx1ow1d" -path="res://.godot/imported/toolbar_bg.png-57ff94a5c0f2e9910d6ccd02d80ee359.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/toolbar_bg.png" -dest_files=["res://.godot/imported/toolbar_bg.png-57ff94a5c0f2e9910d6ccd02d80ee359.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.gd b/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.gd similarity index 91% rename from addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.gd rename to addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.gd index c920e3f03..4f7a391e0 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.gd +++ b/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.gd @@ -1,5 +1,5 @@ class_name PopochiuDialogMenu -extends Container +extends Control @warning_ignore("return_value_discarded") @warning_ignore("unused_signal") @@ -9,7 +9,6 @@ signal shown ## Max height of the menu in pixels. If visible options make the menu to exceed this value, it will ## enable a vertical scroll bar. @export var max_height := 49 -@export var menu_background_color: Color = Color.BLACK @export_category("Option buttons") @export var normal_font_color: Color = Color("706deb") @export var normal_used_font_color: Color = Color("2e2c9b") @@ -20,6 +19,7 @@ signal shown var current_options := [] +@onready var panel_container: PanelContainer = $PanelContainer @onready var dialog_options_container: VBoxContainer = %DialogOptionsContainer @@ -28,8 +28,7 @@ func _ready() -> void: for child in dialog_options_container.get_children(): child.queue_free() - custom_minimum_size = Vector2.ZERO - (get_theme_stylebox("panel") as StyleBoxFlat).bg_color = menu_background_color + panel_container.custom_minimum_size = Vector2.ZERO # Connect to own signals gui_input.connect(_clicked) @@ -106,10 +105,12 @@ func _create_options(options := [], autoshow := false) -> void: options_height += opt.size.y visible_options += 1 - options_height += dialog_options_container.get_theme_constant("separation") * (visible_options - 1) + options_height += ( + dialog_options_container.get_theme_constant("separation") * (visible_options - 1) + ) - size.y = min(options_height, max_height) - position.y = E.height - size.y + panel_container.size.y = min(options_height, max_height) + panel_container.position.y = E.height - panel_container.size.y func remove_options(_dialog: PopochiuDialog = null) -> void: diff --git a/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.tscn b/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.tscn new file mode 100644 index 000000000..dc0adaa71 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=4 format=3 uid="uid://dhsfl8ot4j5fj"] + +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.gd" id="1_3dp72"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_cvsnu"] +[ext_resource type="PackedScene" uid="uid://dcta4urojglil" path="res://addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn" id="3_0jfsm"] + +[node name="DialogMenu" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_cvsnu") +script = ExtResource("1_3dp72") +option_scene = ExtResource("3_0jfsm") + +[node name="PanelContainer" type="PanelContainer" parent="."] +custom_minimum_size = Vector2(0, 53) +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -53.0 +grow_horizontal = 2 +grow_vertical = 0 + +[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer"] +layout_mode = 2 +horizontal_scroll_mode = 0 + +[node name="DialogOptionsContainer" type="VBoxContainer" parent="PanelContainer/ScrollContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 8 +theme_override_constants/separation = 1 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu_option/dialog_menu_option.gd b/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu_option/dialog_menu_option.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu_option/dialog_menu_option.gd rename to addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu_option/dialog_menu_option.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn b/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn similarity index 81% rename from addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn rename to addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn index 0c0c64723..f3f443cfb 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn +++ b/addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu_option/dialog_menu_option.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=6 format=3 uid="uid://dcta4urojglil"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_y0k4l"] -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="2_5iw2f"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu_option/dialog_menu_option.gd" id="2_nywcv"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_y0k4l"] +[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf" id="2_5iw2f"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu_option/dialog_menu_option.gd" id="2_nywcv"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_un1pr"] content_margin_left = 2.0 diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.gd b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.gd new file mode 100644 index 000000000..d036e5c0e --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.gd @@ -0,0 +1,17 @@ +extends PopochiuDialogText + + +#region Private #################################################################################### +func _modify_size(msg: String, target_position: Vector2) -> void: + var _size := await _calculate_size(msg) + + # Define size and position (before calculating overflow) + rich_text_label.size.y = _size.y + rich_text_label.position.y = get_meta(DFLT_POSITION).y - (_size.y - get_meta(DFLT_SIZE).y) + + +func _append_text(msg: String, props: Dictionary) -> void: + rich_text_label.text = "[center][color=%s]%s[/color][/center]" % [props.color.to_html(), msg] + + +#endregion diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.tscn b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.tscn new file mode 100644 index 000000000..2449eed78 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=4 format=3 uid="uid://bpl3qjbxonfpb"] + +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.gd" id="1_17s2p"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_xoamn"] +[ext_resource type="Texture2D" uid="uid://h156lkhxk5tl" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png" id="3_etbl2"] + +[node name="DialogCaption" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_xoamn") +script = ExtResource("1_17s2p") + +[node name="RichTextLabel" type="RichTextLabel" parent="."] +unique_name_in_owner = true +clip_contents = false +custom_minimum_size = Vector2(16, 16) +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 20.0 +offset_top = -20.0 +offset_right = -20.0 +offset_bottom = -4.0 +grow_horizontal = 2 +grow_vertical = 0 +size_flags_horizontal = 0 +mouse_filter = 2 +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 4 +bbcode_enabled = true +text = "[center]A [shake]caption[/shake] dialog text[/center]" +fit_content = true +scroll_active = false +meta_underlined = false + +[node name="ContinueIcon" type="TextureProgressBar" parent="RichTextLabel"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -16.0 +offset_right = 16.0 +grow_horizontal = 0 +grow_vertical = 0 +value = 100.0 +fill_mode = 2 +texture_progress = ExtResource("3_etbl2") diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.gd b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.gd new file mode 100644 index 000000000..2763e265a --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.gd @@ -0,0 +1,46 @@ +extends PopochiuDialogText + + +#region Private #################################################################################### +func _modify_size(msg: String, target_position: Vector2) -> void: + var _size := await _calculate_size(msg) + + # Define size and position (before calculating overflow) + rich_text_label.size = _size + rich_text_label.position = target_position - rich_text_label.size / 2.0 + rich_text_label.position.y -= rich_text_label.size.y / 2.0 + + # Calculate overflow and reposition + if rich_text_label.position.x < 0.0: + rich_text_label.position.x = limit_margin + elif rich_text_label.position.x + rich_text_label.size.x > _x_limit: + rich_text_label.position.x = _x_limit - limit_margin - rich_text_label.size.x + if rich_text_label.position.y < 0.0: + rich_text_label.position.y = limit_margin + elif rich_text_label.position.y + rich_text_label.size.y > _y_limit: + rich_text_label.position.y = _y_limit - limit_margin - rich_text_label.size.y + + +func _set_default_label_size(lbl: Label) -> void: + lbl.size.y = get_meta(DFLT_SIZE).y + + +func _append_text(msg: String, props: Dictionary) -> void: + var center: float = floor(position.x + (rich_text_label.size.x / 2)) + if center == props.position.x: + rich_text_label.append_text("[center]%s[/center]" % msg) + elif center < props.position.x: + rich_text_label.append_text("[right]%s[/right]" % msg) + else: + rich_text_label.append_text(msg) + + +func _get_icon_from_position() -> float: + return rich_text_label.size.y / 2.0 - 1.0 + + +func _get_icon_to_position() -> float: + return rich_text_label.size.y / 2.0 + 3.0 + + +#endregion diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.tscn b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.tscn new file mode 100644 index 000000000..6c0de307c --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=4 format=3 uid="uid://bn7o13nv11ka1"] + +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.gd" id="1_a5mdx"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="2_t336a"] +[ext_resource type="Texture2D" uid="uid://h156lkhxk5tl" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png" id="3_67j10"] + +[node name="DialogOverhead" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("2_t336a") +script = ExtResource("1_a5mdx") + +[node name="RichTextLabel" type="RichTextLabel" parent="."] +unique_name_in_owner = true +clip_contents = false +custom_minimum_size = Vector2(16, 16) +layout_mode = 0 +offset_right = 153.0 +offset_bottom = 16.0 +size_flags_horizontal = 0 +mouse_filter = 2 +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 4 +bbcode_enabled = true +text = "An [shake]overhead[/shake] dialog text" +fit_content = true +scroll_active = false +meta_underlined = false + +[node name="ContinueIcon" type="TextureProgressBar" parent="RichTextLabel"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_right = 16.0 +offset_bottom = 16.0 +grow_horizontal = 0 +value = 100.0 +fill_mode = 2 +texture_progress = ExtResource("3_67j10") diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.gd b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.gd new file mode 100644 index 000000000..ed7bd4f2b --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.gd @@ -0,0 +1,45 @@ +extends PopochiuDialogText + +@onready var left_avatar_container: PanelContainer = %LeftAvatarContainer +@onready var left_avatar: TextureRect = %LeftAvatar +@onready var right_avatar_container: PanelContainer = %RightAvatarContainer +@onready var right_avatar: TextureRect = %RightAvatar + + +#region Godot ###################################################################################### +func _ready() -> void: + super() + + # Connect to singletons signals + C.character_spoke.connect(_update_avatar) + + +#endregion + +#region Private #################################################################################### +func _update_avatar(chr: PopochiuCharacter, _msg := '') -> void: + if not rich_text_label.visible: + return + + left_avatar_container.modulate.a = 0.0 + left_avatar.texture = null + right_avatar_container.modulate.a = 0.0 + right_avatar.texture = null + + var char_pos: Vector2 = PopochiuUtils.get_screen_coords_for(chr).floor() / ( + E.scale if E.settings.scale_gui else Vector2.ONE + ) + + if char_pos.x <= E.half_width: + left_avatar_container.modulate.a = 1.0 + left_avatar.texture = chr.get_avatar_for_emotion(chr.emotion) + else: + right_avatar_container.modulate.a = 1.0 + right_avatar.texture = chr.get_avatar_for_emotion(chr.emotion) + + +func _set_default_size() -> void: + pass + + +#endregion diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.tscn b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.tscn new file mode 100644 index 000000000..8d31e8a72 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.tscn @@ -0,0 +1,106 @@ +[gd_scene load_steps=6 format=3 uid="uid://33wmak2jumqm"] + +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.gd" id="1_ejue5"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_x1xka"] +[ext_resource type="Texture2D" uid="uid://h156lkhxk5tl" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png" id="4_lqu2o"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8fbbc"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mjjs7"] +content_margin_left = 4.0 +content_margin_top = 2.0 +content_margin_right = 4.0 +content_margin_bottom = 2.0 +bg_color = Color(0, 0, 0, 0.705882) + +[node name="DialogPortrait" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_x1xka") +script = ExtResource("1_ejue5") + +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -48.0 +grow_horizontal = 2 +grow_vertical = 0 +mouse_filter = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_8fbbc") + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/separation = 2 + +[node name="LeftAvatarContainer" type="PanelContainer" parent="PanelContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +mouse_filter = 2 + +[node name="LeftAvatar" type="TextureRect" parent="PanelContainer/HBoxContainer/LeftAvatarContainer"] +unique_name_in_owner = true +texture_filter = 1 +custom_minimum_size = Vector2(48, 48) +layout_mode = 2 +size_flags_vertical = 4 +mouse_filter = 2 +stretch_mode = 3 + +[node name="TextContainer" type="PanelContainer" parent="PanelContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +mouse_filter = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_mjjs7") + +[node name="RichTextLabel" type="RichTextLabel" parent="PanelContainer/HBoxContainer/TextContainer"] +unique_name_in_owner = true +clip_contents = false +custom_minimum_size = Vector2(16, 16) +layout_mode = 2 +size_flags_horizontal = 3 +mouse_filter = 2 +bbcode_enabled = true +text = "A [shake]portrait[/shake] dialog text." +scroll_active = false +meta_underlined = false + +[node name="ContinueIcon" type="TextureProgressBar" parent="PanelContainer/HBoxContainer/TextContainer/RichTextLabel"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -16.0 +offset_top = -16.0 +grow_horizontal = 0 +grow_vertical = 0 +mouse_filter = 2 +value = 100.0 +fill_mode = 2 +texture_progress = ExtResource("4_lqu2o") + +[node name="RightAvatarContainer" type="PanelContainer" parent="PanelContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +mouse_filter = 2 + +[node name="RightAvatar" type="TextureRect" parent="PanelContainer/HBoxContainer/RightAvatarContainer"] +unique_name_in_owner = true +texture_filter = 1 +custom_minimum_size = Vector2(48, 48) +layout_mode = 2 +size_flags_vertical = 4 +mouse_filter = 2 +stretch_mode = 3 diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_text.gd b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_text.gd new file mode 100644 index 000000000..182896a8d --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_text.gd @@ -0,0 +1,294 @@ +class_name PopochiuDialogText +extends Control +## Show dialogue texts char by char using a [RichTextLabel]. +## +## An invisible [Label] is used to calculate the width of the [RichTextLabel] node. + +signal animation_finished +signal text_show_started +signal text_show_finished + +const DFLT_SIZE := "dflt_size" +const DFLT_POSITION := "dflt_position" + +@export var wrap_width := 200.0 +@export var limit_margin := 4.0 + +var tween: Tween = null +var continue_icon_tween: Tween = null + +var _secs_per_character := 1.0 +var _is_waiting_input := false +var _auto_continue := false +var _dialog_pos := Vector2.ZERO +var _x_limit := 0.0 +var _y_limit := 0.0 + +@onready var rich_text_label: RichTextLabel = %RichTextLabel +@onready var continue_icon: TextureProgressBar = %ContinueIcon + + +#region Godot ###################################################################################### +func _ready() -> void: + # Set the default values + rich_text_label.text = "" + + set_meta(DFLT_SIZE, rich_text_label.size) + set_meta(DFLT_POSITION, rich_text_label.position) + + modulate.a = 0.0 + _secs_per_character = E.text_speed + _x_limit = E.width / (E.scale.x if E.settings.scale_gui else 1.0) + _y_limit = E.height / (E.scale.y if E.settings.scale_gui else 1.0) + + # Connect to singletons events + E.text_speed_changed.connect(change_speed) + C.character_spoke.connect(_show_dialogue) + + continue_icon.hide() + + +func _input(event: InputEvent) -> void: + if ( + not PopochiuUtils.get_click_or_touch_index(event) in [MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT] + or modulate.a == 0.0 + ): + return + + accept_event() + if rich_text_label.visible_ratio == 1.0: + disappear() + else: + stop() + + +#endregion + +#region Public ##################################################################################### +func play_text(props: Dictionary) -> void: + var msg: String = E.get_text(props.text) + _is_waiting_input = false + _dialog_pos = props.position + + # Call the virtual method that modifies the size of the RichTextLabel in case the dialog style + # requires it. + await _modify_size(msg, props.position) + + rich_text_label.push_color(props.color) + + # Assign the text and align mode + _append_text(msg, props) + + if _secs_per_character > 0.0: + # The text will appear with an animation + if is_instance_valid(tween) and tween.is_running(): + tween.kill() + + tween = create_tween() + tween.tween_property( + rich_text_label, "visible_ratio", + 1, + _secs_per_character * rich_text_label.get_total_character_count() + ).from(0.0) + tween.finished.connect(_wait_input) + else: + _wait_input() + + modulate.a = 1.0 + + +func stop() ->void: + if modulate.a == 0.0: + return + + if _is_waiting_input: + _notify_completion() + else: + # Skip tweens + if is_instance_valid(tween) and tween.is_running(): + tween.kill() + + rich_text_label.visible_ratio = 1.0 + _wait_input() + + +func disappear() -> void: + if modulate.a == 0.0: return + + _auto_continue = false + modulate.a = 0.0 + _is_waiting_input = false + + if is_instance_valid(tween) and tween.is_running(): + tween.kill() + + rich_text_label.clear() + rich_text_label.text = "" + _set_default_size() + + continue_icon.hide() + continue_icon.modulate.a = 1.0 + + if is_instance_valid(continue_icon_tween) and continue_icon_tween.is_running(): + continue_icon_tween.kill() + + set_process_input(false) + text_show_finished.emit() + G.dialog_line_finished.emit() + + +func change_speed() -> void: + _secs_per_character = E.text_speed + + +#endregion + +#region Private #################################################################################### +func _show_dialogue(chr: PopochiuCharacter, msg := "") -> void: + if not visible: return + + play_text({ + text = msg, + color = chr.text_color, + position = PopochiuUtils.get_screen_coords_for(chr, chr.dialog_pos).floor() / ( + E.scale if E.settings.scale_gui else Vector2.ONE + ), + }) + + G.dialog_line_started.emit() + + set_process_input(true) + text_show_started.emit() + + +func _modify_size(_msg: String, _target_position: Vector2) -> void: + await get_tree().process_frame + + +## Creates a RichTextLabel to calculate the resulting size of this node once the whole text is shown. +func _calculate_size(msg: String) -> Vector2: + var rt := RichTextLabel.new() + rt.add_theme_font_override("normal_font", get_theme_font("normal_font")) + rt.bbcode_enabled = true + rt.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + rt.text = msg + rt.size = get_meta(DFLT_SIZE) + rich_text_label.add_child(rt) + + # Create a Label to check if the text exceeds the wrap_width + var lbl := Label.new() + lbl.add_theme_font_override("normal_font", get_theme_font("normal_font")) + + _set_default_label_size(lbl) + + lbl.text = rt.get_parsed_text() + rich_text_label.add_child(lbl) + + rt.clear() + rt.text = "" + + await get_tree().process_frame + + var _size := lbl.size + + if _size.x > wrap_width: + # This node will have the width of the wrap_width + _size.x = wrap_width + rt.fit_content = true + rt.size.x = _size.x + rt.text = msg + + await get_tree().process_frame + + _size = rt.size + else: + # This node will have the width of the text + _size.y = get_meta(DFLT_SIZE).y + + var characters_count := lbl.get_total_character_count() + + lbl.free() + rt.free() + + return _size + + +func _set_default_label_size(lbl: Label) -> void: + lbl.size = get_meta(DFLT_SIZE) + + +func _append_text(msg: String, _props: Dictionary) -> void: + rich_text_label.append_text(msg) + + +func _wait_input() -> void: + _is_waiting_input = true + + if is_instance_valid(tween) and tween.finished.is_connected(_wait_input): + tween.finished.disconnect(_wait_input) + + if E.auto_continue_after >= 0.0: + _auto_continue = true + await get_tree().create_timer(E.auto_continue_after + 0.2).timeout + + if _auto_continue: + _continue(true) + else: + _show_icon() + + +func _show_icon() -> void: + if is_instance_valid(continue_icon_tween) and continue_icon_tween.is_running(): + continue_icon_tween.kill() + + continue_icon_tween = create_tween() + + if not E.settings.auto_continue_text: + # For manual continuation: make the icon jump + continue_icon.value = 100.0 + continue_icon_tween.tween_property( + continue_icon, "position:y", _get_icon_to_position(), 0.8 + ).from(_get_icon_from_position()).set_trans(Tween.TRANS_BOUNCE).set_ease(Tween.EASE_OUT) + continue_icon_tween.set_loops() + else: + # For automatic continuation: Make the icon appear as a progress bar indicating the time + # players have to read before auto-continuing. + continue_icon.value = 0.0 + continue_icon.position.y = size.y / 2.0 + + continue_icon_tween.tween_property( + continue_icon, "value", + 100.0, 3.0, + ).from_current().set_ease(Tween.EASE_OUT) + continue_icon_tween.finished.connect(_continue) + + continue_icon_tween.pause() + await get_tree().create_timer(0.2).timeout + + continue_icon_tween.play() + continue_icon.show() + + +func _get_icon_from_position() -> float: + return rich_text_label.size.y - continue_icon.size.y + 2.0 + + +func _get_icon_to_position() -> float: + return rich_text_label.size.y - continue_icon.size.y - 1.0 + + +func _notify_completion() -> void: + disappear() + animation_finished.emit() + + +func _continue(forced_continue := false) -> void: + if E.settings.auto_continue_text or forced_continue: + disappear() + + +func _set_default_size() -> void: + rich_text_label.size = get_meta(DFLT_SIZE) + + +#endregion diff --git a/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_text.tscn b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_text.tscn new file mode 100644 index 000000000..c77cc8bf0 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/dialog_text.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=4 format=3 uid="uid://cymfte4xe3tnw"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_mrmwc"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/dialog_text.gd" id="2_adpg7"] +[ext_resource type="Texture2D" uid="uid://h156lkhxk5tl" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png" id="3_fqlmr"] + +[node name="DialogText" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_mrmwc") +script = ExtResource("2_adpg7") + +[node name="RichTextLabel" type="RichTextLabel" parent="."] +unique_name_in_owner = true +layout_mode = 0 +offset_right = 74.0 +offset_bottom = 12.0 +text = "Dialog text" +fit_content = true + +[node name="ContinueIcon" type="TextureProgressBar" parent="RichTextLabel"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_right = 16.0 +offset_bottom = 16.0 +grow_horizontal = 0 +value = 100.0 +fill_mode = 2 +texture_progress = ExtResource("3_fqlmr") diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_continue.png b/addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_continue.png rename to addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png diff --git a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_continue.png.import b/addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png.import similarity index 65% rename from addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_continue.png.import rename to addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png.import index b7cb36338..4f0d438e0 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_continue.png.import +++ b/addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://h156lkhxk5tl" -path="res://.godot/imported/dialog_continue.png-b88ef09ddb328dfc3e5edb03c02d5a87.ctex" +path="res://.godot/imported/ico_continue.png-1c56d7b39fdf03dafd5aacca996d24e0.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_continue.png" -dest_files=["res://.godot/imported/dialog_continue.png-b88ef09ddb328dfc3e5edb03c02d5a87.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/components/dialog_text/images/ico_continue.png" +dest_files=["res://.godot/imported/ico_continue.png-1c56d7b39fdf03dafd5aacca996d24e0.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/components/hover_text/hover_text.gd b/addons/popochiu/engine/objects/gui/components/hover_text/hover_text.gd new file mode 100644 index 000000000..526e7d583 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/hover_text/hover_text.gd @@ -0,0 +1,39 @@ +extends Control +class_name PopochiuHoverText + +@export var hide_during_dialogs := false + +@onready var label: RichTextLabel = $Label + + +#region Godot ###################################################################################### +func _ready() -> void: + label.text = "" + + # Connect to autoloads' signals + G.hover_text_shown.connect(_show_text) + G.dialog_line_started.connect(_on_dialog_line_started) + G.dialog_line_finished.connect(_on_dialog_line_finished) + + +#endregion + +#region Virtual #################################################################################### +func _show_text(txt := "") -> void: + label.text = "[center]%s[/center]" % txt + + +#endregion + +#region Private #################################################################################### +func _on_dialog_line_started() -> void: + if hide_during_dialogs: + hide() + + +func _on_dialog_line_finished() -> void: + if hide_during_dialogs: + show() + + +#endregion diff --git a/addons/popochiu/engine/objects/gui/components/hover_text/hover_text.tscn b/addons/popochiu/engine/objects/gui/components/hover_text/hover_text.tscn new file mode 100644 index 000000000..a7557f2ff --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/hover_text/hover_text.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=3 format=3 uid="uid://esorelppu4hw"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_s7kd8"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/hover_text/hover_text.gd" id="2_r2ckj"] + +[node name="HoverText" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_s7kd8") +script = ExtResource("2_r2ckj") + +[node name="Label" type="RichTextLabel" parent="."] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 12.0 +grow_horizontal = 2 +mouse_filter = 2 +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 4 +bbcode_enabled = true +text = "[center]text for hovered objects[/center]" +fit_content = true +scroll_active = false diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.gd b/addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.gd similarity index 61% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.gd rename to addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.gd index e70ec5467..75380d17f 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.gd +++ b/addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.gd @@ -2,24 +2,29 @@ extends Control @export var always_visible := false @export var hide_when_gui_is_blocked := false +## Defines the height in pixels of the zone where moving the mouse in the top of the screen will +## make the bar to show. Note: This value will be affected by the Experimental Scale GUI checkbox +## in Project Settings > Popochiu > GUI. +@export var input_zone_height := 4 var is_disabled := false +var tween: Tween = null var _is_hidden := true -@onready var box: Container = find_child("Box") -@onready var _tween: Tween = null -@onready var _hidden_y := position.y - (size.y - 4) +@onready var panel_container: PanelContainer = %PanelContainer +@onready var box: Container = %Box +@onready var hidden_y := panel_container.position.y - panel_container.size.y #region Godot ###################################################################################### func _ready(): if not always_visible: - position.y = _hidden_y + panel_container.position.y = hidden_y # Connect to singletons signals - G.blocked.connect(_on_graphic_interface_blocked) - G.unblocked.connect(_on_graphic_interface_unblocked) + G.blocked.connect(_on_gui_blocked) + G.unblocked.connect(_on_gui_unblocked) I.item_added.connect(_add_item) I.item_removed.connect(_remove_item) I.item_replaced.connect(_replace_item) @@ -36,17 +41,20 @@ func _ready(): func _input(event: InputEvent) -> void: - if event is InputEventMouseMotion: - var rect := get_rect() - - if E.settings.scale_gui: - rect = Rect2(get_rect().position * E.scale, get_rect().size * E.scale) - - if _is_hidden and rect.has_point(get_global_mouse_position()): - _open() - elif not _is_hidden\ - and not rect.has_point(get_global_mouse_position()): - _close() + if not event is InputEventMouseMotion: return + + var rect := panel_container.get_rect() + rect.size += Vector2(0.0, input_zone_height) + if E.settings.scale_gui: + rect = Rect2( + panel_container.get_rect().position * E.scale, + panel_container.get_rect().size * E.scale + ) + + if _is_hidden and rect.has_point(get_global_mouse_position()): + _open() + elif not _is_hidden and not rect.has_point(get_global_mouse_position()): + _close() #endregion @@ -54,31 +62,30 @@ func _input(event: InputEvent) -> void: #region Private #################################################################################### func _open() -> void: if always_visible: return - if not is_disabled and position.y != _hidden_y: return + if not is_disabled and panel_container.position.y != hidden_y: return - if is_instance_valid(_tween) and _tween.is_running(): - _tween.kill() + if is_instance_valid(tween) and tween.is_running(): + tween.kill() - _tween = create_tween() - _tween.tween_property(self, "position:y", 0.0, 0.5)\ - .from(_hidden_y if not is_disabled else position.y)\ - .set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_OUT) + tween = create_tween().set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_OUT) + tween.tween_property( + panel_container, "position:y", 0.0, 0.5 + ).from(hidden_y if not is_disabled else panel_container.position.y) _is_hidden = false func _close() -> void: if always_visible: return - await get_tree().process_frame - if is_instance_valid(_tween) and _tween.is_running(): - _tween.kill() + if is_instance_valid(tween) and tween.is_running(): + tween.kill() - _tween = create_tween() - _tween.tween_property( - self, "position:y", - _hidden_y if not is_disabled else _hidden_y - 3.5, + tween = create_tween() + tween.tween_property( + panel_container, "position:y", + hidden_y if not is_disabled else hidden_y - 3.5, 0.2 ).from(0.0).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN) @@ -86,21 +93,21 @@ func _close() -> void: func _on_tween_finished() -> void: - _is_hidden = position.y == _hidden_y + _is_hidden = panel_container.position.y == hidden_y func _change_cursor(item: PopochiuInventoryItem) -> void: I.set_active_item(item) -func _on_graphic_interface_blocked() -> void: +func _on_gui_blocked() -> void: set_process_input(false) if hide_when_gui_is_blocked: hide() -func _on_graphic_interface_unblocked() -> void: +func _on_gui_unblocked() -> void: set_process_input(true) if hide_when_gui_is_blocked: @@ -135,7 +142,6 @@ func _add_item(item: PopochiuInventoryItem, animate := true) -> void: func _remove_item(item: PopochiuInventoryItem, animate := true) -> void: item.selected.disconnect(_change_cursor) - box.remove_child(item) if not always_visible: @@ -153,7 +159,6 @@ func _remove_item(item: PopochiuInventoryItem, animate := true) -> void: func _replace_item(item: PopochiuInventoryItem, new_item: PopochiuInventoryItem) -> void: item.replace_by(new_item) - await get_tree().process_frame I.item_replace_done.emit() @@ -161,18 +166,14 @@ func _replace_item(item: PopochiuInventoryItem, new_item: PopochiuInventoryItem) func _show_and_hide(time := 1.0) -> void: set_process_input(false) - _open() - - await _tween.finished + await tween.finished await E.wait(time) _close() - - await _tween.finished + await tween.finished set_process_input(true) - I.inventory_shown.emit() diff --git a/addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.tscn b/addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.tscn new file mode 100644 index 000000000..f132304ca --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=3 format=3 uid="uid://ciar5j7qm85bc"] + +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.gd" id="1"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_aynoo"] + +[node name="InventoryBar" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_aynoo") +script = ExtResource("1") + +[node name="PanelContainer" type="PanelContainer" parent="."] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 0 +offset_right = 36.0 +offset_bottom = 24.0 + +[node name="Box" type="HBoxContainer" parent="PanelContainer"] +unique_name_in_owner = true +layout_mode = 2 +mouse_filter = 2 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_down_button.png b/addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_down_button.png similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_down_button.png rename to addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_down_button.png diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_down_button.png.import b/addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_down_button.png.import similarity index 69% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_down_button.png.import rename to addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_down_button.png.import index 4264eb413..ea8353161 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_down_button.png.import +++ b/addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_down_button.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://s4phlorab5ds" -path="res://.godot/imported/inventory_grid_down_button.png-44398d9028a863c1d9c9a1a5181113f9.ctex" +path="res://.godot/imported/inventory_grid_down_button.png-ffac1afa54860747ab14c6a1f8220bae.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_down_button.png" -dest_files=["res://.godot/imported/inventory_grid_down_button.png-44398d9028a863c1d9c9a1a5181113f9.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_down_button.png" +dest_files=["res://.godot/imported/inventory_grid_down_button.png-ffac1afa54860747ab14c6a1f8220bae.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_up_button.png b/addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_up_button.png similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_up_button.png rename to addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_up_button.png diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_up_button.png.import b/addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_up_button.png.import similarity index 69% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_up_button.png.import rename to addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_up_button.png.import index f2a6012fc..e306e3084 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_up_button.png.import +++ b/addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_up_button.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dfa511cxg31g5" -path="res://.godot/imported/inventory_grid_up_button.png-917a818c48e44fd6cbb7fd189aed5981.ctex" +path="res://.godot/imported/inventory_grid_up_button.png-dd40c7fcb22a7dfc4741c7c1c2d05d54.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_up_button.png" -dest_files=["res://.godot/imported/inventory_grid_up_button.png-917a818c48e44fd6cbb7fd189aed5981.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_up_button.png" +dest_files=["res://.godot/imported/inventory_grid_up_button.png-dd40c7fcb22a7dfc4741c7c1c2d05d54.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.gd b/addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.gd similarity index 93% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.gd rename to addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.gd index ac504791c..3b51c4a1e 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.gd +++ b/addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.gd @@ -1,8 +1,7 @@ @tool -class_name InventoryGrid +class_name PopochiuInventoryGrid extends HBoxContainer -const SLOT := preload("inventory_grid_slot.tscn") const EMPTY_SLOT := "[Empty Slot]00" @export var slot_scene: PackedScene = null : set = set_slot_scene @@ -22,8 +21,8 @@ var slot_size: float = 0.0 @onready var scroll_container: ScrollContainer = $ScrollContainer @onready var box: GridContainer = %Box @onready var scroll_buttons: VBoxContainer = $ScrollButtons -@onready var up: TextureButton = $ScrollButtons/Up -@onready var down: TextureButton = $ScrollButtons/Down +@onready var up: TextureButton = %Up +@onready var down: TextureButton = %Down @onready var gap_size: int = box.get_theme_constant("v_separation") @@ -33,9 +32,9 @@ func _ready(): _update_box() return - scroll_container.mouse_filter = Control.MOUSE_FILTER_PASS\ - if scroll_with_mouse_wheel\ - else Control.MOUSE_FILTER_IGNORE + scroll_container.mouse_filter = ( + Control.MOUSE_FILTER_PASS if scroll_with_mouse_wheel else Control.MOUSE_FILTER_IGNORE + ) _update_box() _calculate_rows_and_scroll() @@ -110,7 +109,7 @@ func _update_box() -> void: child.free() for idx in number_of_slots: - var slot := (SLOT if not slot_scene else slot_scene).instantiate() + var slot := slot_scene.instantiate() box.add_child(slot) slot.name = EMPTY_SLOT @@ -128,6 +127,7 @@ func _calculate_rows_and_scroll() -> void: for slot in box.get_children(): if slot.visible: visible_slots += 1 + @warning_ignore("integer_division") rows = visible_slots / box.columns max_scroll = ((slot_size + gap_size) * int(rows / 2)) diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.tscn b/addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.tscn similarity index 82% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.tscn rename to addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.tscn index 097e5a100..d232b79ce 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.tscn +++ b/addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=14 format=3 uid="uid://cn2b5v8k1lseo"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.gd" id="1_0y5i1"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_kaq1v"] -[ext_resource type="Texture2D" uid="uid://dfa511cxg31g5" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_up_button.png" id="2_6y3so"] -[ext_resource type="PackedScene" uid="uid://db6csk6i4f3un" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid_slot.tscn" id="3_32xup"] -[ext_resource type="Texture2D" uid="uid://s4phlorab5ds" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/sprites/inventory_grid_down_button.png" id="3_yoinj"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.gd" id="1_0y5i1"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_kaq1v"] +[ext_resource type="Texture2D" uid="uid://dfa511cxg31g5" path="res://addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_up_button.png" id="2_6y3so"] +[ext_resource type="PackedScene" uid="uid://db6csk6i4f3un" path="res://addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid_slot.tscn" id="3_ma7vn"] +[ext_resource type="Texture2D" uid="uid://s4phlorab5ds" path="res://addons/popochiu/engine/objects/gui/components/inventory_grid/images/inventory_grid_down_button.png" id="3_yoinj"] [sub_resource type="AtlasTexture" id="AtlasTexture_7tbkh"] atlas = ExtResource("2_6y3so") @@ -46,7 +46,7 @@ size_flags_vertical = 3 mouse_filter = 0 theme = ExtResource("1_kaq1v") script = ExtResource("1_0y5i1") -slot_scene = ExtResource("3_32xup") +slot_scene = ExtResource("3_ma7vn") [node name="ScrollButtons" type="VBoxContainer" parent="."] custom_minimum_size = Vector2(24, 0) diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid_slot.tscn b/addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid_slot.tscn similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid_slot.tscn rename to addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid_slot.tscn diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/confirmation_popup/confirmation_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/confirmation_popup/confirmation_popup.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/confirmation_popup/confirmation_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/confirmation_popup/confirmation_popup.gd diff --git a/addons/popochiu/engine/objects/gui/components/popups/confirmation_popup/confirmation_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/confirmation_popup/confirmation_popup.tscn new file mode 100644 index 000000000..8cc698260 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/confirmation_popup/confirmation_popup.tscn @@ -0,0 +1,82 @@ +[gd_scene load_steps=7 format=3 uid="uid://d06okn5i6id2g"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_ck2qk"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/confirmation_popup/confirmation_popup.gd" id="2_2ngwd"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_jqrxu"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_n4smw"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_4phlw"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x73gy"] + +[node name="ConfirmationPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_ck2qk") +script = ExtResource("2_2ngwd") +script_name = &"ConfirmationPopup" +title = "Confirmation" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_x73gy") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_jqrxu") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Confirmation" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_n4smw") +texture_pressed = ExtResource("4_4phlw") +texture_hover = ExtResource("4_4phlw") + +[node name="Question" type="Label" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Yes or No?" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "ok" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/dialog_line.tscn b/addons/popochiu/engine/objects/gui/components/popups/history_popup/components/dialog_line.tscn similarity index 79% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/dialog_line.tscn rename to addons/popochiu/engine/objects/gui/components/popups/history_popup/components/dialog_line.tscn index 7cf0635ee..bde2a5715 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/dialog_line.tscn +++ b/addons/popochiu/engine/objects/gui/components/popups/history_popup/components/dialog_line.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://b6dm3xvvr7dvi"] -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_o6vvl"] +[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf" id="1_o6vvl"] [node name="DialogLine" type="RichTextLabel"] anchors_preset = 15 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/interaction_line.tscn b/addons/popochiu/engine/objects/gui/components/popups/history_popup/components/interaction_line.tscn similarity index 81% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/interaction_line.tscn rename to addons/popochiu/engine/objects/gui/components/popups/history_popup/components/interaction_line.tscn index acd8cfeb5..97c794e68 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/components/interaction_line.tscn +++ b/addons/popochiu/engine/objects/gui/components/popups/history_popup/components/interaction_line.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://2mnjw3qsi8hc"] -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_i1qxr"] +[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf" id="1_i1qxr"] [node name="InteractionLine" type="RichTextLabel"] anchors_preset = 15 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.gd similarity index 70% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.gd index 08ec8a269..3881ecb28 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.gd +++ b/addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.gd @@ -1,14 +1,6 @@ +@tool extends PopochiuPopup -const DIALOG_LINE := preload( - PopochiuResources.GUI_ADDON_FOLDER + - "components/popups/history_popup/components/dialog_line.tscn" -) -const INTERACTION_LINE := preload( - PopochiuResources.GUI_ADDON_FOLDER + - "components/popups/history_popup/components/interaction_line.tscn" -) - @export var dialog_line: PackedScene = null @export var interaction_line: PackedScene = null @@ -21,6 +13,8 @@ const INTERACTION_LINE := preload( func _ready() -> void: super() + if Engine.is_editor_hint(): return + # Connect to singletons signals G.history_opened.connect(open) @@ -43,17 +37,17 @@ func _open() -> void: var lbl: RichTextLabel if data.has("character"): - lbl = (dialog_line if dialog_line else DIALOG_LINE).instantiate() - lbl.text = "[color=%s]%s:[/color] %s" \ - % [ + lbl = dialog_line.instantiate() + lbl.text = "[color=%s]%s:[/color] %s" % [ (data.character as PopochiuCharacter).text_color.to_html(false), (data.character as PopochiuCharacter).description, data.text ] else: - lbl = (interaction_line if interaction_line else INTERACTION_LINE).instantiate() - lbl.text = "[color=edf171]%s[/color] [color=a9ff9f]%s[/color]"\ - % [data.action, data.target] + lbl = interaction_line.instantiate() + lbl.text = "[color=edf171]%s[/color] [color=a9ff9f]%s[/color]" % [ + data.action, data.target + ] lines_list.add_child(lbl) diff --git a/addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.tscn new file mode 100644 index 000000000..6dd5e0fc6 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.tscn @@ -0,0 +1,115 @@ +[gd_scene load_steps=12 format=3 uid="uid://dfrsiyyqncspo"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_ktant"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.gd" id="2_bdgcw"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_6f0nr"] +[ext_resource type="PackedScene" uid="uid://b6dm3xvvr7dvi" path="res://addons/popochiu/engine/objects/gui/components/popups/history_popup/components/dialog_line.tscn" id="3_8deqt"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_e8jii"] +[ext_resource type="PackedScene" uid="uid://2mnjw3qsi8hc" path="res://addons/popochiu/engine/objects/gui/components/popups/history_popup/components/interaction_line.tscn" id="4_ndekf"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="5_odsj4"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xipc1"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pm06l"] +bg_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gr6a3"] +bg_color = Color(0.768627, 0.423529, 0.443137, 1) +border_width_left = 8 +border_color = Color(0.388235, 0.607843, 1, 1) + +[sub_resource type="Theme" id="Theme_cqgnt"] +VScrollBar/styles/grabber = SubResource("StyleBoxFlat_pm06l") +VScrollBar/styles/grabber_highlight = SubResource("StyleBoxFlat_pm06l") +VScrollBar/styles/grabber_pressed = SubResource("StyleBoxFlat_pm06l") +VScrollBar/styles/scroll = SubResource("StyleBoxFlat_gr6a3") +VScrollBar/styles/scroll_focus = SubResource("StyleBoxFlat_gr6a3") + +[node name="HistoryPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_ktant") +script = ExtResource("2_bdgcw") +dialog_line = ExtResource("3_8deqt") +interaction_line = ExtResource("4_ndekf") +script_name = &"HistoryPopup" +title = "History" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_xipc1") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +custom_minimum_size = Vector2(256, 144) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("5_odsj4") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "History" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_6f0nr") +texture_pressed = ExtResource("4_e8jii") +texture_hover = ExtResource("4_e8jii") + +[node name="Empty" type="Label" parent="Overlay/PanelContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +text = "Nothing to show yet" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="LinesScroll" type="ScrollContainer" parent="Overlay/PanelContainer/VBoxContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +size_flags_vertical = 3 +theme = SubResource("Theme_cqgnt") + +[node name="LinesList" type="VBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/LinesScroll"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +visible = false +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "ok" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.gd similarity index 88% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.gd index 9f887548b..6384df26a 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/popochiu_popup.gd +++ b/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.gd @@ -1,6 +1,6 @@ @tool class_name PopochiuPopup -extends PanelContainer +extends Control ## The base popup node used by Popochiu GUIs. @export var closes_by_clicking_out := true @@ -21,7 +21,7 @@ func _ready() -> void: if Engine.is_editor_hint(): return # Connect to own signals - gui_input.connect(_check_click) + $Overlay.gui_input.connect(_check_click) # Connect to child signals btn_ok.pressed.connect(on_ok_pressed) @@ -66,35 +66,38 @@ func open() -> void: G.block() Cursor.show_cursor("gui", true) - - (E.gui as PopochiuGraphicInterface).popups_stack.append(self) + # Never open a popup on top of another + if not E.gui.popups_stack.is_empty(): + E.gui.popups_stack.back().hide() + E.gui.popups_stack.append(self) show() ## Closes the popup unlocking interactions with the graphic interface. func close() -> void: - (E.gui as PopochiuGraphicInterface).popups_stack.erase(self) + E.gui.popups_stack.erase(self) + hide() - if (E.gui as PopochiuGraphicInterface).popups_stack.is_empty(): + if E.gui.popups_stack.is_empty(): G.unblock() Cursor.unblock() + else: + # Idempotent call, no need to check the mode + E.gui.popups_stack.back().show() _close() - hide() ## Called when the OK button is pressed. It closes the popup afterwards. func on_ok_pressed() -> void: _on_ok() - close() ## Called when the CANCEL button is pressed. It closes the popup afterwards. func on_cancel_pressed() -> void: _on_cancel() - close() @@ -102,7 +105,6 @@ func on_cancel_pressed() -> void: ## afterwards. func on_close_pressed() -> void: _on_cancel() - close() diff --git a/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.tscn new file mode 100644 index 000000000..c221e1dc7 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.tscn @@ -0,0 +1,69 @@ +[gd_scene load_steps=6 format=3 uid="uid://c51xplyeuk787"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_4hfpy"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.gd" id="2_yuv82"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_5rk5h"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_co4j2"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_4odj8"] + +[node name="PopochiuPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_4hfpy") +script = ExtResource("2_yuv82") + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_co4j2") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Title" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_5rk5h") +texture_pressed = ExtResource("4_4odj8") +texture_hover = ExtResource("4_4odj8") + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "ok" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "cancel" diff --git a/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres b/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres new file mode 100644 index 000000000..a175b0ebe --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://dbajakvkltfaj"] + +[resource] +content_margin_left = 4.0 +content_margin_top = 2.0 +content_margin_right = 4.0 +content_margin_bottom = 2.0 +bg_color = Color(0, 0, 0, 0.705882) +expand_margin_left = 2.0 +expand_margin_top = 2.0 +expand_margin_right = 2.0 +expand_margin_bottom = 2.0 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.gd similarity index 94% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.gd index 8f7bc8bd3..ddc0fb5b4 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.gd +++ b/addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.gd @@ -1,4 +1,5 @@ -extends "../popochiu_popup.gd" +@tool +extends PopochiuPopup #region Virtual #################################################################################### diff --git a/addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.tscn new file mode 100644 index 000000000..cd77c8072 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.tscn @@ -0,0 +1,84 @@ +[gd_scene load_steps=7 format=3 uid="uid://bnjo044fkdcq7"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_3nwvu"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.gd" id="2_nkwwk"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_828u5"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_r2fp8"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_mra7q"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_il3mr"] + +[node name="QuitPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_3nwvu") +script = ExtResource("2_nkwwk") +script_name = &"QuitPopup" +title = "Quit game" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_il3mr") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +custom_minimum_size = Vector2(256, 0) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_828u5") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Quit game" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_r2fp8") +texture_pressed = ExtResource("4_mra7q") +texture_hover = ExtResource("4_mra7q") + +[node name="Question" type="Label" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Are you sure you want to quit?" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "OK" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Cancel +" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.gd similarity index 98% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.gd index 355ffb94d..64ff17212 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.gd +++ b/addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.gd @@ -1,3 +1,4 @@ +@tool extends PopochiuPopup signal slot_selected @@ -17,6 +18,8 @@ var _slot := 0 func _ready() -> void: super() + if Engine.is_editor_hint(): return + btn_ok.disabled = true # Connect to singletons signals diff --git a/addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.tscn new file mode 100644 index 000000000..1a71cbcf2 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.tscn @@ -0,0 +1,100 @@ +[gd_scene load_steps=7 format=3 uid="uid://cndputybyj57n"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_llqb8"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.gd" id="2_m1ot6"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_inruf"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_n4oyj"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_jqolx"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_yg86r"] + +[node name="SaveAndLoadPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_llqb8") +script = ExtResource("2_m1ot6") +script_name = &"SaveAndLoadPopup" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_yg86r") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +custom_minimum_size = Vector2(192, 0) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_inruf") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Choose a slot to..." +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_n4oyj") +texture_pressed = ExtResource("4_jqolx") +texture_hover = ExtResource("4_jqolx") + +[node name="Slots" type="VBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +alignment = 1 + +[node name="BtnSlot1" type="Button" parent="Overlay/PanelContainer/VBoxContainer/Slots"] +layout_mode = 2 +toggle_mode = true +text = "slot 1" + +[node name="BtnSlot2" type="Button" parent="Overlay/PanelContainer/VBoxContainer/Slots"] +layout_mode = 2 +toggle_mode = true +text = "slot 2" + +[node name="BtnSlot3" type="Button" parent="Overlay/PanelContainer/VBoxContainer/Slots"] +layout_mode = 2 +toggle_mode = true +text = "slot 3" + +[node name="BtnSlot4" type="Button" parent="Overlay/PanelContainer/VBoxContainer/Slots"] +layout_mode = 2 +toggle_mode = true +text = "slot 4" + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "OK" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/settings_popup/settings_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/settings_popup/settings_popup.gd similarity index 99% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/settings_popup/settings_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/settings_popup/settings_popup.gd index da2cccf64..7a4c8fdb3 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/settings_popup/settings_popup.gd +++ b/addons/popochiu/engine/objects/gui/components/popups/settings_popup/settings_popup.gd @@ -1,3 +1,4 @@ +@tool extends "../popochiu_popup.gd" signal quit_pressed diff --git a/addons/popochiu/engine/objects/gui/components/popups/settings_popup/settings_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/settings_popup/settings_popup.tscn new file mode 100644 index 000000000..90489b3ce --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/settings_popup/settings_popup.tscn @@ -0,0 +1,106 @@ +[gd_scene load_steps=8 format=3 uid="uid://qe2d35bauand"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_51qbu"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/settings_popup/settings_popup.gd" id="2_3ww7r"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_mc25t"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_mynrg"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_xc03r"] +[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.tscn" id="5_eq043"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_myfsm"] + +[node name="SettingsPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_51qbu") +script = ExtResource("2_3ww7r") +script_name = &"SettingsPopup" +title = "Settings" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_myfsm") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_mc25t") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Settings" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_mynrg") +texture_pressed = ExtResource("4_xc03r") +texture_hover = ExtResource("4_xc03r") + +[node name="OptionsContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="SoundVolumes" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer" instance=ExtResource("5_eq043")] +layout_mode = 2 + +[node name="Buttons" type="VBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer"] +layout_mode = 2 + +[node name="Save" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Save" + +[node name="Load" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Load" + +[node name="History" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "History" + +[node name="Quit" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Quit game" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Resume game" + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +visible = false +layout_mode = 2 +size_flags_vertical = 10 +alignment = 2 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "ok" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.gd similarity index 92% rename from addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.gd index 1e694dd50..ff57e94fb 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.gd +++ b/addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.gd @@ -1,3 +1,4 @@ +@tool extends PopochiuPopup @onready var sound_volumes: GridContainer = %SoundVolumes @@ -7,6 +8,8 @@ extends PopochiuPopup func _ready() -> void: super() + if Engine.is_editor_hint(): return + # Connect to singletons signals G.sound_settings_requested.connect(open) diff --git a/addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.tscn new file mode 100644 index 000000000..2b830cbb6 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.tscn @@ -0,0 +1,80 @@ +[gd_scene load_steps=8 format=3 uid="uid://dwxm2p1iyhpx6"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_rwmoe"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.gd" id="2_qt85i"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_knqsp"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_nqnfj"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_v7y6x"] +[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.tscn" id="5_lh576"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6mo8y"] + +[node name="SoundSettingsPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_rwmoe") +script = ExtResource("2_qt85i") +script_name = &"SoundSettingsPopup" +title = "Sound Settings" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_6mo8y") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_nqnfj") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Sound Settings" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +visible = false +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_knqsp") +texture_pressed = ExtResource("4_v7y6x") +texture_hover = ExtResource("4_v7y6x") + +[node name="SoundVolumes" parent="Overlay/PanelContainer/VBoxContainer" instance=ExtResource("5_lh576")] +unique_name_in_owner = true +layout_mode = 2 + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "ok" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "cancel" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.gd b/addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.gd similarity index 85% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.gd rename to addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.gd index 74a6267a6..0da3bba91 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.gd +++ b/addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.gd @@ -1,14 +1,17 @@ +@tool extends PopochiuPopup @onready var text_speed: HSlider = %TextSpeed @onready var dialog_style: OptionButton = %DialogStyle -@onready var continue_mode: CheckBox = %ContinueMode +@onready var continue_mode: CheckButton = %ContinueMode #region Godot ###################################################################################### func _ready() -> void: super() + if Engine.is_editor_hint(): return + text_speed.value = 0.1 - E.text_speed dialog_style.selected = E.settings.dialog_style continue_mode.button_pressed = E.settings.auto_continue_text @@ -18,6 +21,9 @@ func _ready() -> void: dialog_style.item_selected.connect(_on_dialog_style_selected) continue_mode.toggled.connect(_on_continue_mode_toggled) + # Connect to singletons signals + G.text_settings_requested.connect(open) + #endregion diff --git a/addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.tscn b/addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.tscn new file mode 100644 index 000000000..0af445413 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.tscn @@ -0,0 +1,151 @@ +[gd_scene load_steps=13 format=3 uid="uid://de68lx1xqv7fb"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_7sq5d"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.gd" id="2_nmcxa"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_coq7y"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_rckox"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_gfs8i"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_bh5os"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_b5jxw"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rinqp"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vprmd"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_372y7"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_t5skw"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5015x"] + +[node name="TextPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_7sq5d") +script = ExtResource("2_nmcxa") +script_name = &"SierraTextPopup" +title = "Text options" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_bh5os") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +custom_minimum_size = Vector2(160, 140) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_coq7y") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Text options" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +visible = false +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_rckox") +texture_pressed = ExtResource("4_gfs8i") +texture_hover = ExtResource("4_gfs8i") + +[node name="BodyContainer" type="VBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="TextSpeedContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/TextSpeedContainer"] +layout_mode = 2 +text = "Typing speed" + +[node name="TextSpeed" type="HSlider" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/TextSpeedContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_horizontal = 3 +max_value = 0.1 +step = 0.01 + +[node name="DialogStyleContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/DialogStyleContainer"] +layout_mode = 2 +text = "Style" +horizontal_alignment = 1 + +[node name="DialogStyle" type="OptionButton" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/DialogStyleContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_horizontal = 3 +selected = 0 +item_count = 3 +popup/item_0/text = "Above character" +popup/item_1/text = "Portrait" +popup/item_1/id = 1 +popup/item_2/text = "Caption" +popup/item_2/id = 2 + +[node name="ContinueModeContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/ContinueModeContainer"] +layout_mode = 2 +text = "Autoadvance" +horizontal_alignment = 1 + +[node name="ContinueMode" type="CheckButton" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/ContinueModeContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_horizontal = 10 +size_flags_vertical = 0 +theme_override_styles/focus = SubResource("StyleBoxEmpty_b5jxw") +theme_override_styles/disabled = SubResource("StyleBoxEmpty_rinqp") +theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_vprmd") +theme_override_styles/hover = SubResource("StyleBoxEmpty_372y7") +theme_override_styles/pressed = SubResource("StyleBoxEmpty_t5skw") +theme_override_styles/normal = SubResource("StyleBoxEmpty_5015x") +icon_alignment = 2 + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "OK" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Back" diff --git a/addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.gd b/addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.gd rename to addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.tscn b/addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.tscn similarity index 77% rename from addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.tscn rename to addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.tscn index 1be00a8f0..b94880c46 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.tscn +++ b/addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://drx0r8w00ivck"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_37u4o"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/sound_volumes/sound_volumes.gd" id="1_360xl"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_37u4o"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.gd" id="1_360xl"] [node name="SoundVolumes" type="GridContainer" groups=["popochiu_gui_component"]] size_flags_horizontal = 3 diff --git a/addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.gd b/addons/popochiu/engine/objects/gui/components/system_text/system_text.gd similarity index 65% rename from addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.gd rename to addons/popochiu/engine/objects/gui/components/system_text/system_text.gd index d5eb3a33f..f03634b7b 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.gd +++ b/addons/popochiu/engine/objects/gui/components/system_text/system_text.gd @@ -1,4 +1,4 @@ -extends RichTextLabel +extends Control ## Show a text in the form of GUI. Can be used to show game (or narrator) ## messages. @@ -10,10 +10,12 @@ const DFLT_SIZE := "dflt_size" # during a _ready() execution var _can_change_size := false +@onready var rich_text_label: RichTextLabel = %RichTextLabel + #region Godot ###################################################################################### func _ready() -> void: - set_meta(DFLT_SIZE, size) + set_meta(DFLT_SIZE, rich_text_label.size) # Connect to singletons signals G.system_text_shown.connect(_show_text) @@ -23,7 +25,7 @@ func _ready() -> void: func _draw() -> void: - position = get_parent().size / 2.0 - size / 2.0 + rich_text_label.position = get_parent().size / 2.0 - (rich_text_label.size / 2.0) func _input(event: InputEvent) -> void: @@ -46,11 +48,11 @@ func appear() -> void: func close() -> void: set_process_input(false) - clear() - text = "" + rich_text_label.clear() + rich_text_label.text = "" if _can_change_size: - size = get_meta(DFLT_SIZE) + rich_text_label.size = get_meta(DFLT_SIZE) hide() G.system_text_hidden.emit() @@ -60,26 +62,10 @@ func close() -> void: #region Private #################################################################################### func _show_text(msg := "") -> void: - clear() - text = "" - size = get_meta(DFLT_SIZE) - - # ==== Calculate the width of the node ========================================================= - var rt := RichTextLabel.new() - var lbl := Label.new() - rt.append_text(msg) - lbl.text = rt.text - add_child(lbl) - - var lbl_size := lbl.size - if lbl_size.x > get_meta(DFLT_SIZE).x: - lbl_size.x = get_meta(DFLT_SIZE).x - 16.0 - - lbl.free() - rt.free() - # ========================================================= Calculate the width of the node ==== - - append_text("[center]%s[/center]" % msg) + rich_text_label.clear() + rich_text_label.text = "" + rich_text_label.size = get_meta(DFLT_SIZE) + rich_text_label.append_text("[center]%s[/center]" % msg) if msg: appear() diff --git a/addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.tscn b/addons/popochiu/engine/objects/gui/components/system_text/system_text.tscn similarity index 50% rename from addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.tscn rename to addons/popochiu/engine/objects/gui/components/system_text/system_text.tscn index 30808d3a2..64168b920 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.tscn +++ b/addons/popochiu/engine/objects/gui/components/system_text/system_text.tscn @@ -1,24 +1,31 @@ -[gd_scene load_steps=5 format=3 uid="uid://bdgs3xsbq3gdd"] +[gd_scene load_steps=4 format=3 uid="uid://bdgs3xsbq3gdd"] -[ext_resource type="FontFile" uid="uid://dixh1egf7k2fb" path="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" id="1_6ussd"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_7ydn8"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.gd" id="2"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_7ydn8"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/system_text/system_text.gd" id="2"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4eue6"] content_margin_left = 8.0 -content_margin_top = 4.0 +content_margin_top = 6.0 content_margin_right = 8.0 content_margin_bottom = 6.0 -bg_color = Color(0.180392, 0.172549, 0.607843, 1) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -border_color = Color(1, 1, 1, 1) +bg_color = Color(0, 0, 0, 0.705882) corner_detail = 4 anti_aliasing = false -[node name="SystemText" type="RichTextLabel" groups=["popochiu_gui_component"]] +[node name="SystemText" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_7ydn8") +script = ExtResource("2") + +[node name="RichTextLabel" type="RichTextLabel" parent="."] +unique_name_in_owner = true +layout_mode = 1 anchors_preset = 14 anchor_top = 0.5 anchor_right = 1.0 @@ -29,11 +36,8 @@ offset_right = -33.0 offset_bottom = 9.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_7ydn8") -theme_override_fonts/normal_font = ExtResource("1_6ussd") theme_override_styles/normal = SubResource("StyleBoxFlat_4eue6") bbcode_enabled = true text = "[center]Text from the game itself[/center]" fit_content = true scroll_active = false -script = ExtResource("2") diff --git a/addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf b/addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf new file mode 100644 index 000000000..7247ad785 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf differ diff --git a/addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf.import b/addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf.import new file mode 100644 index 000000000..aaf70b32a --- /dev/null +++ b/addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf.import @@ -0,0 +1,34 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://dm6h44ck2nm2b" +path="res://.godot/imported/minecraftia-regular.ttf-aa9f24486e1e8f742a673dd5ce961da5.fontdata" + +[deps] + +source_file="res://addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf" +dest_files=["res://.godot/imported/minecraftia-regular.ttf-aa9f24486e1e8f742a673dd5ce961da5.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf b/addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf rename to addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf diff --git a/addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf.import b/addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf.import rename to addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf.import index e2e31363e..5a5115626 100644 --- a/addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf.import +++ b/addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf.import @@ -3,18 +3,19 @@ importer="font_data_dynamic" type="FontFile" uid="uid://dixh1egf7k2fb" -path="res://.godot/imported/monkeyisland_1991.ttf-c73e6beac0a9d124ceb843719619351a.fontdata" +path="res://.godot/imported/monkeyisland_1991.ttf-48b761f2bda7eabd2ec4c88e22b30ed5.fontdata" [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/fonts/monkeyisland_1991.ttf" -dest_files=["res://.godot/imported/monkeyisland_1991.ttf-c73e6beac0a9d124ceb843719619351a.fontdata"] +source_file="res://addons/popochiu/engine/objects/gui/fonts/monkeyisland_1991.ttf" +dest_files=["res://.godot/imported/monkeyisland_1991.ttf-48b761f2bda7eabd2ec4c88e22b30ed5.fontdata"] [params] Rendering=null antialiasing=0 generate_mipmaps=true +disable_embedded_bitmaps=true multichannel_signed_distance_field=false msdf_pixel_range=8 msdf_size=48 diff --git a/addons/popochiu/engine/objects/graphic_interface/popochiu_commands.gd b/addons/popochiu/engine/objects/gui/popochiu_commands.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/popochiu_commands.gd rename to addons/popochiu/engine/objects/gui/popochiu_commands.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/popochiu_graphic_interface.gd b/addons/popochiu/engine/objects/gui/popochiu_gui.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/popochiu_graphic_interface.gd rename to addons/popochiu/engine/objects/gui/popochiu_gui.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/popochiu_graphic_interface.tscn b/addons/popochiu/engine/objects/gui/popochiu_gui.tscn similarity index 72% rename from addons/popochiu/engine/objects/graphic_interface/popochiu_graphic_interface.tscn rename to addons/popochiu/engine/objects/gui/popochiu_gui.tscn index 7692d4d7e..670a793d6 100644 --- a/addons/popochiu/engine/objects/graphic_interface/popochiu_graphic_interface.tscn +++ b/addons/popochiu/engine/objects/gui/popochiu_gui.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://k35rpa45ngms"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/popochiu_graphic_interface.gd" id="1"] -[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/graphic_interface/resources/popochiu_theme.tres" id="1_lylgs"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/popochiu_gui.gd" id="1"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_lylgs"] [node name="GraphicInterface" type="Control"] layout_mode = 3 diff --git a/addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres b/addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres new file mode 100644 index 000000000..8bce9a687 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres @@ -0,0 +1,73 @@ +[gd_resource type="Theme" load_steps=15 format=3 uid="uid://dpequqav4rjaf"] + +[ext_resource type="Texture2D" uid="uid://pl1ch71kfj72" path="res://addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png" id="2_ldprq"] +[ext_resource type="Texture2D" uid="uid://dukr75slqli45" path="res://addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png" id="3_3rprc"] +[ext_resource type="Texture2D" uid="uid://cqxqfxobqltga" path="res://addons/popochiu/engine/objects/gui/resources/images/grabber.png" id="4_4x0ix"] +[ext_resource type="Texture2D" uid="uid://d1ywqbehmtuv" path="res://addons/popochiu/engine/objects/gui/resources/images/down_arrow.png" id="5_jwcnu"] +[ext_resource type="FontFile" uid="uid://dm6h44ck2nm2b" path="res://addons/popochiu/engine/objects/gui/fonts/minecraftia-regular.ttf" id="6_gx6k1"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jar7r"] +content_margin_left = 2.0 +content_margin_top = 0.0 +content_margin_right = 2.0 +content_margin_bottom = 0.0 +bg_color = Color(0, 0, 0, 0.705882) + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jts3x"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d2wsf"] +content_margin_left = 2.0 +content_margin_top = 0.0 +content_margin_right = 2.0 +content_margin_bottom = 0.0 +bg_color = Color(0, 0, 0, 0.705882) + +[sub_resource type="StyleBoxFlat" id="7"] +content_margin_left = 2.0 +content_margin_top = 0.0 +content_margin_right = 2.0 +content_margin_bottom = 0.0 +bg_color = Color(0, 0, 0, 0.705882) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3mrlf"] +content_margin_left = 2.0 +content_margin_top = 0.0 +content_margin_right = 2.0 +content_margin_bottom = 0.0 +bg_color = Color(0, 0, 0, 0.705882) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pr0tq"] +bg_color = Color(0.698039, 0.698039, 0.698039, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mp7ca"] +bg_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxLine" id="StyleBoxLine_1vxxo"] +thickness = 4 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d8gde"] +bg_color = Color(0, 0, 0, 0.705882) + +[resource] +default_font = ExtResource("6_gx6k1") +default_font_size = 8 +Button/colors/font_color = Color(1, 1, 1, 1) +Button/colors/font_disabled_color = Color(0.482353, 0.482353, 0.482353, 1) +Button/colors/font_focus_color = Color(0.305882, 0.305882, 0.862745, 1) +Button/colors/font_hover_color = Color(0.952941, 0.952941, 0.0627451, 1) +Button/colors/font_hover_pressed_color = Color(0.901961, 0.337255, 0.901961, 1) +Button/colors/font_pressed_color = Color(0.305882, 0.952941, 0.952941, 1) +Button/styles/disabled = SubResource("StyleBoxFlat_jar7r") +Button/styles/focus = SubResource("StyleBoxEmpty_jts3x") +Button/styles/hover = SubResource("StyleBoxFlat_d2wsf") +Button/styles/normal = SubResource("7") +Button/styles/pressed = SubResource("StyleBoxFlat_3mrlf") +CheckButton/icons/checked = ExtResource("2_ldprq") +CheckButton/icons/unchecked = ExtResource("3_3rprc") +HSlider/icons/grabber = ExtResource("4_4x0ix") +HSlider/icons/grabber_highlight = ExtResource("4_4x0ix") +HSlider/styles/grabber_area = SubResource("StyleBoxFlat_pr0tq") +HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_mp7ca") +HSlider/styles/slider = SubResource("StyleBoxLine_1vxxo") +OptionButton/icons/arrow = ExtResource("5_jwcnu") +PanelContainer/styles/panel = SubResource("StyleBoxFlat_d8gde") diff --git a/addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png b/addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png new file mode 100644 index 000000000..6a998315a Binary files /dev/null and b/addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png.import b/addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png.import rename to addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png.import index d832673da..5048cee28 100644 --- a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png.import +++ b/addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://pl1ch71kfj72" -path="res://.godot/imported/check_button_checked.png-2468104f5ede624d527af9eda0d5778b.ctex" +path="res://.godot/imported/check_button_checked.png-b1eb37ae4557b8c54cf724d6ab85b490.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_checked.png" -dest_files=["res://.godot/imported/check_button_checked.png-2468104f5ede624d527af9eda0d5778b.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/resources/images/check_button_checked.png" +dest_files=["res://.godot/imported/check_button_checked.png-b1eb37ae4557b8c54cf724d6ab85b490.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png b/addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png new file mode 100644 index 000000000..373504931 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png.import b/addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png.import rename to addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png.import index d5a9f105f..b22554c9b 100644 --- a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png.import +++ b/addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dukr75slqli45" -path="res://.godot/imported/check_button_unchecked.png-dba6c92351c8f844f3056f0ee8b9f7ec.ctex" +path="res://.godot/imported/check_button_unchecked.png-508dc4a98bf3c725d8ee671c42614a03.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/check_button_unchecked.png" -dest_files=["res://.godot/imported/check_button_unchecked.png-dba6c92351c8f844f3056f0ee8b9f7ec.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/resources/images/check_button_unchecked.png" +dest_files=["res://.godot/imported/check_button_unchecked.png-508dc4a98bf3c725d8ee671c42614a03.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/resources/images/close.png b/addons/popochiu/engine/objects/gui/resources/images/close.png new file mode 100644 index 000000000..6828aae1e Binary files /dev/null and b/addons/popochiu/engine/objects/gui/resources/images/close.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png.import b/addons/popochiu/engine/objects/gui/resources/images/close.png.import similarity index 68% rename from addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png.import rename to addons/popochiu/engine/objects/gui/resources/images/close.png.import index 650ff70e3..1fb999bda 100644 --- a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png.import +++ b/addons/popochiu/engine/objects/gui/resources/images/close.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cmxrewai8t2lm" -path="res://.godot/imported/close.png-af349c9aca2ba5861147cc16b0e0bac2.ctex" +path="res://.godot/imported/close.png-71bc9d1ae7defb5a6b696b588c6e3643.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close.png" -dest_files=["res://.godot/imported/close.png-af349c9aca2ba5861147cc16b0e0bac2.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/resources/images/close.png" +dest_files=["res://.godot/imported/close.png-71bc9d1ae7defb5a6b696b588c6e3643.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/resources/images/close_highlight.png b/addons/popochiu/engine/objects/gui/resources/images/close_highlight.png new file mode 100644 index 000000000..5229eb4d3 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/resources/images/close_highlight.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png.import b/addons/popochiu/engine/objects/gui/resources/images/close_highlight.png.import similarity index 65% rename from addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png.import rename to addons/popochiu/engine/objects/gui/resources/images/close_highlight.png.import index 87e70529a..9a766b807 100644 --- a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png.import +++ b/addons/popochiu/engine/objects/gui/resources/images/close_highlight.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://p32i25numi5e" -path="res://.godot/imported/close_highlight.png-fb66729e99aa5fcd68e944c192986110.ctex" +path="res://.godot/imported/close_highlight.png-d4b65040b9236ee65b9f648f37e721aa.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/close_highlight.png" -dest_files=["res://.godot/imported/close_highlight.png-fb66729e99aa5fcd68e944c192986110.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" +dest_files=["res://.godot/imported/close_highlight.png-d4b65040b9236ee65b9f648f37e721aa.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/resources/images/down_arrow.png b/addons/popochiu/engine/objects/gui/resources/images/down_arrow.png new file mode 100644 index 000000000..5ded7ffab Binary files /dev/null and b/addons/popochiu/engine/objects/gui/resources/images/down_arrow.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png.import b/addons/popochiu/engine/objects/gui/resources/images/down_arrow.png.import similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png.import rename to addons/popochiu/engine/objects/gui/resources/images/down_arrow.png.import index 542d8c5dc..08ea918e4 100644 --- a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png.import +++ b/addons/popochiu/engine/objects/gui/resources/images/down_arrow.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d1ywqbehmtuv" -path="res://.godot/imported/down_arrow.png-b1d07eafde227ba1b9873734c387e980.ctex" +path="res://.godot/imported/down_arrow.png-2e999a09eee9c6832163c2484657c127.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/down_arrow.png" -dest_files=["res://.godot/imported/down_arrow.png-b1d07eafde227ba1b9873734c387e980.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/resources/images/down_arrow.png" +dest_files=["res://.godot/imported/down_arrow.png-2e999a09eee9c6832163c2484657c127.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/resources/images/grabber.png b/addons/popochiu/engine/objects/gui/resources/images/grabber.png new file mode 100644 index 000000000..33ce0d166 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/resources/images/grabber.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png.import b/addons/popochiu/engine/objects/gui/resources/images/grabber.png.import similarity index 67% rename from addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png.import rename to addons/popochiu/engine/objects/gui/resources/images/grabber.png.import index fe52a319f..2342319cd 100644 --- a/addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png.import +++ b/addons/popochiu/engine/objects/gui/resources/images/grabber.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cqxqfxobqltga" -path="res://.godot/imported/grabber.png-7198537c09dd15d8a4e96515620721f5.ctex" +path="res://.godot/imported/grabber.png-270b67486fc72a76c07b8638f890e164.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/resources/sprites/grabber.png" -dest_files=["res://.godot/imported/grabber.png-7198537c09dd15d8a4e96515620721f5.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/resources/images/grabber.png" +dest_files=["res://.godot/imported/grabber.png-270b67486fc72a76c07b8638f890e164.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_commands.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_commands.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_commands.gd rename to addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_commands.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui.gd similarity index 97% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui.gd rename to addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui.gd index 411c11c21..03ba9aa0b 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui.gd +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui.gd @@ -7,13 +7,15 @@ extends PopochiuGraphicInterface ## bottom right corner of the screen, and the settings popup can be opened using the button in the ## top right corner of the sceen. +signal settings_requested + # Used to go back to the WALK_TO command when hovering an inventory item without a verb selected var _return_to_walk_to := false ## Used to access the [b]9VerbSettingsPopup[/b] node. @onready var settings_popup: PopochiuPopup = $"Popups/9VerbSettingsPopup" ## Used to access the [b]9VerbQuitPopup[/b] node. -@onready var quit_popup: PanelContainer = %"9VerbQuitPopup" +@onready var quit_popup: PopochiuPopup = %"9VerbQuitPopup" #region Godot ###################################################################################### @@ -25,8 +27,10 @@ func _ready() -> void: $Cursor.hide() + # Connect to own signals + settings_requested.connect(_on_settings_requested) + # Connect to childs signals - $BtnSettings.pressed.connect(_on_settings_pressed) settings_popup.classic_sentence_toggled.connect(_on_classic_sentence_toggled) settings_popup.quit_pressed.connect(_on_quit_pressed) @@ -209,7 +213,7 @@ func _on_popochiu_ready() -> void: C.player.started_walk_to.connect(_on_player_started_walk) -func _on_settings_pressed() -> void: +func _on_settings_requested() -> void: settings_popup.open() diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui.tscn b/addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui.tscn similarity index 53% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui.tscn rename to addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui.tscn index 1a05d8dbd..e2f93c42d 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui.tscn +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui.tscn @@ -1,19 +1,18 @@ -[gd_scene load_steps=25 format=3 uid="uid://bd0fika4hyhvw"] - -[ext_resource type="Theme" uid="uid://6vk2wej0sape" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres" id="1_kdcwt"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui.gd" id="2_6nea2"] -[ext_resource type="Texture2D" uid="uid://d0fwvj88bhggm" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_cursor.png" id="3_fpt6m"] -[ext_resource type="PackedScene" uid="uid://cg18h3icrip1r" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.tscn" id="4_w78uo"] -[ext_resource type="PackedScene" uid="uid://bdgs3xsbq3gdd" path="res://addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.tscn" id="5_ygb3y"] -[ext_resource type="PackedScene" uid="uid://cuokybjvunmhq" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn" id="6_tiq5g"] -[ext_resource type="PackedScene" uid="uid://dhsfl8ot4j5fj" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.tscn" id="7_ypv20"] -[ext_resource type="Texture2D" uid="uid://dcl6wrqgsdqa1" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png" id="8_u8fnw"] -[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.tscn" id="9_pfhkt"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd" id="10_kg6cq"] -[ext_resource type="PackedScene" uid="uid://crla6to4mm0p7" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn" id="11_etexu"] -[ext_resource type="PackedScene" uid="uid://cndputybyj57n" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.tscn" id="12_q44n2"] -[ext_resource type="PackedScene" uid="uid://dfrsiyyqncspo" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.tscn" id="13_780pa"] -[ext_resource type="PackedScene" uid="uid://dv1gec8q4h6b7" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn" id="14_0vlip"] +[gd_scene load_steps=22 format=3 uid="uid://bd0fika4hyhvw"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_5somw"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui.gd" id="2_6nea2"] +[ext_resource type="Texture2D" uid="uid://d0fwvj88bhggm" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_cursor.png" id="3_fpt6m"] +[ext_resource type="PackedScene" uid="uid://bn7o13nv11ka1" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/dialog_overhead/dialog_overhead.tscn" id="5_gejku"] +[ext_resource type="PackedScene" uid="uid://bdgs3xsbq3gdd" path="res://addons/popochiu/engine/objects/gui/components/system_text/system_text.tscn" id="5_ygb3y"] +[ext_resource type="PackedScene" uid="uid://cuokybjvunmhq" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn" id="6_tiq5g"] +[ext_resource type="PackedScene" uid="uid://dhsfl8ot4j5fj" path="res://addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.tscn" id="7_ypv20"] +[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/gui/components/hover_text/hover_text.tscn" id="9_pfhkt"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd" id="10_kg6cq"] +[ext_resource type="PackedScene" uid="uid://crla6to4mm0p7" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn" id="11_etexu"] +[ext_resource type="PackedScene" uid="uid://cndputybyj57n" path="res://addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.tscn" id="12_q44n2"] +[ext_resource type="PackedScene" uid="uid://dfrsiyyqncspo" path="res://addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.tscn" id="13_780pa"] +[ext_resource type="PackedScene" uid="uid://dv1gec8q4h6b7" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn" id="14_0vlip"] [sub_resource type="AtlasTexture" id="AtlasTexture_0ckh2"] atlas = ExtResource("3_fpt6m") @@ -92,25 +91,7 @@ animations = [{ "speed": 5.0 }] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bfdxb"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 6.0 -bg_color = Color(0, 0, 0, 1) -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 2 -border_color = Color(1, 1, 1, 1) -corner_detail = 4 -anti_aliasing = false - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5sf8c"] -bg_color = Color(0, 0, 0, 1) -anti_aliasing = false - -[node name="9VerbGI" type="Control"] +[node name="9VerbGUI" type="Control"] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -118,7 +99,7 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -theme = ExtResource("1_kdcwt") +theme = ExtResource("1_5somw") script = ExtResource("2_6nea2") [node name="Cursor" type="AnimatedSprite2D" parent="."] @@ -126,54 +107,26 @@ texture_filter = 1 sprite_frames = SubResource("SpriteFrames_xtf0b") animation = &"active" -[node name="DialogText" parent="." instance=ExtResource("4_w78uo")] -layout_mode = 1 -theme = ExtResource("1_kdcwt") - -[node name="SystemText" parent="." instance=ExtResource("5_ygb3y")] +[node name="9VerbPanel" parent="." instance=ExtResource("6_tiq5g")] layout_mode = 1 -offset_left = 39.0 -offset_top = -10.0 -offset_right = -39.0 -offset_bottom = 10.0 -theme = ExtResource("1_kdcwt") -theme_override_styles/normal = SubResource("StyleBoxFlat_bfdxb") -[node name="9VerbPanel" parent="." instance=ExtResource("6_tiq5g")] +[node name="DialogOverhead" parent="." instance=ExtResource("5_gejku")] layout_mode = 1 -offset_top = -51.0 [node name="DialogMenu" parent="." instance=ExtResource("7_ypv20")] visible = false layout_mode = 1 -theme = ExtResource("1_kdcwt") -theme_override_styles/panel = SubResource("StyleBoxFlat_5sf8c") - -[node name="BtnSettings" type="TextureButton" parent="."] -texture_filter = 1 -layout_mode = 1 -anchors_preset = 1 -anchor_left = 1.0 -anchor_right = 1.0 -offset_left = -21.0 -offset_top = 4.0 -offset_right = -4.0 -offset_bottom = 21.0 -grow_horizontal = 0 -texture_normal = ExtResource("8_u8fnw") [node name="HoverTextCursor" parent="." instance=ExtResource("9_pfhkt")] unique_name_in_owner = true layout_mode = 1 -offset_bottom = 9.0 size_flags_vertical = 3 -theme = ExtResource("1_kdcwt") -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 4 -fit_content = true script = ExtResource("10_kg6cq") follows_cursor = true +[node name="SystemText" parent="." instance=ExtResource("5_ygb3y")] +layout_mode = 1 + [node name="Popups" type="Control" parent="."] layout_mode = 1 anchors_preset = 15 @@ -191,12 +144,10 @@ layout_mode = 1 [node name="SaveAndLoadPopup" parent="Popups" instance=ExtResource("12_q44n2")] visible = false layout_mode = 1 -theme = ExtResource("1_kdcwt") [node name="HistoryPopup" parent="Popups" instance=ExtResource("13_780pa")] visible = false layout_mode = 1 -theme = ExtResource("1_kdcwt") [node name="9VerbQuitPopup" parent="Popups" instance=ExtResource("14_0vlip")] unique_name_in_owner = true diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui_info.tres b/addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui_info.tres similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/9_verb_gui_info.tres rename to addons/popochiu/engine/objects/gui/templates/9_verb/9_verb_gui_info.tres diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd similarity index 68% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd index 5a33c21e6..0f04432fb 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd @@ -23,41 +23,43 @@ func _ready() -> void: E.current_command = NineVerbCommands.Commands.WALK_TO set_process(follows_cursor) - autowrap_mode = TextServer.AUTOWRAP_OFF if follows_cursor else TextServer.AUTOWRAP_WORD_SMART + label.autowrap_mode = ( + TextServer.AUTOWRAP_OFF if follows_cursor else TextServer.AUTOWRAP_WORD_SMART + ) _show_text() E.ready.connect(set.bind("_can_change_size", true)) func _process(delta: float) -> void: - position = get_viewport().get_mouse_position() + label.position = get_viewport().get_mouse_position() if E.settings.scale_gui: - position /= E.scale + label.position /= E.scale - position -= size / 2.0 - position.y -= Cursor.get_cursor_height() / 2 + label.position -= label.size / 2.0 + label.position.y -= Cursor.get_cursor_height() / 2 # Check viewport limits - if position.x < 0.0: - position.x = 0.0 - elif position.x + size.x > _gui_width: - position.x = _gui_width - size.x + if label.position.x < 0.0: + label.position.x = 0.0 + elif label.position.x + label.size.x > _gui_width: + label.position.x = _gui_width - label.size.x - if position.y < 0.0: - position.y = 0.0 - elif position.y + size.y > _gui_height: - position.y = _gui_height - size.y + if label.position.y < 0.0: + label.position.y = 0.0 + elif label.position.y + label.size.y > _gui_height: + label.position.y = _gui_height - label.size.y #endregion #region Private #################################################################################### func _show_text(txt := "") -> void: - text = "" + label.text = "" if follows_cursor and _can_change_size: - size = Vector2.ZERO + label.size = Vector2.ZERO if txt.is_empty(): if ( @@ -73,7 +75,7 @@ func _show_text(txt := "") -> void: super(txt) if follows_cursor and _can_change_size: - size += Vector2.ONE * (Cursor.get_cursor_height() / 2) + label.size += Vector2.ONE * (Cursor.get_cursor_height() / 2) #endregion diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.gd new file mode 100644 index 000000000..5259b545c --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.gd @@ -0,0 +1,22 @@ +@tool +extends PopochiuInventoryGrid + +@onready var settings: TextureButton = %Settings + + +#region Godot ###################################################################################### +func _ready(): + super() + + # Connect to child signals + settings.pressed.connect(_on_settings_pressed) + + +#endregion + +#region Private #################################################################################### +func _on_settings_pressed() -> void: + G.gui.settings_requested.emit() + + +#endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn similarity index 52% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn index e74cd5bfd..97a5f2bfa 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=14 format=3 uid="uid://djan6vy0xq8dq"] +[gd_scene load_steps=18 format=3 uid="uid://djan6vy0xq8dq"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.gd" id="1_0wmc7"] -[ext_resource type="Theme" uid="uid://6vk2wej0sape" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_theme.tres" id="1_pyfwu"] -[ext_resource type="PackedScene" uid="uid://b4juyi6em7wja" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn" id="2_goalc"] -[ext_resource type="Texture2D" uid="uid://k5k85xjvtqwc" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png" id="2_i17ns"] -[ext_resource type="Texture2D" uid="uid://co5fkuv4jgfbc" path="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png" id="3_uqfpl"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_7ovtr"] +[ext_resource type="PackedScene" uid="uid://b4juyi6em7wja" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn" id="2_goalc"] +[ext_resource type="Texture2D" uid="uid://k5k85xjvtqwc" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png" id="2_i17ns"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.gd" id="2_vgmo0"] +[ext_resource type="Texture2D" uid="uid://co5fkuv4jgfbc" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png" id="3_uqfpl"] +[ext_resource type="Texture2D" uid="uid://dcl6wrqgsdqa1" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png" id="5_npkld"] [sub_resource type="AtlasTexture" id="AtlasTexture_5xjfw"] atlas = ExtResource("2_i17ns") @@ -22,6 +23,18 @@ region = Rect2(16, 0, 16, 16) atlas = ExtResource("2_i17ns") region = Rect2(48, 0, 16, 16) +[sub_resource type="AtlasTexture" id="AtlasTexture_tx0je"] +atlas = ExtResource("5_npkld") +region = Rect2(0, 0, 16, 15) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4olg0"] +atlas = ExtResource("5_npkld") +region = Rect2(32, 0, 16, 15) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xswvt"] +atlas = ExtResource("5_npkld") +region = Rect2(16, 0, 16, 15) + [sub_resource type="AtlasTexture" id="AtlasTexture_6237a"] atlas = ExtResource("3_uqfpl") region = Rect2(0, 0, 16, 16) @@ -45,8 +58,9 @@ offset_bottom = 49.0 size_flags_horizontal = 3 size_flags_vertical = 3 mouse_filter = 0 -theme = ExtResource("1_pyfwu") -script = ExtResource("1_0wmc7") +theme = ExtResource("1_7ovtr") +theme_override_constants/separation = 1 +script = ExtResource("2_vgmo0") slot_scene = ExtResource("2_goalc") h_separation = 1 v_separation = 1 @@ -54,9 +68,14 @@ v_separation = 1 [node name="ScrollButtons" type="VBoxContainer" parent="."] custom_minimum_size = Vector2(24, 0) layout_mode = 2 -theme_override_constants/separation = 0 +theme_override_constants/separation = 1 -[node name="Up" type="TextureButton" parent="ScrollButtons"] +[node name="UpContainer" type="PanelContainer" parent="ScrollButtons"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Up" type="TextureButton" parent="ScrollButtons/UpContainer"] +unique_name_in_owner = true texture_filter = 1 layout_mode = 2 size_flags_vertical = 3 @@ -66,7 +85,26 @@ texture_hover = SubResource("AtlasTexture_2rabq") texture_disabled = SubResource("AtlasTexture_hw2h8") stretch_mode = 3 -[node name="Down" type="TextureButton" parent="ScrollButtons"] +[node name="SettingsContainer" type="PanelContainer" parent="ScrollButtons"] +layout_mode = 2 + +[node name="Settings" type="TextureButton" parent="ScrollButtons/SettingsContainer"] +unique_name_in_owner = true +texture_filter = 1 +custom_minimum_size = Vector2(24, 15) +layout_mode = 2 +texture_normal = SubResource("AtlasTexture_tx0je") +texture_pressed = SubResource("AtlasTexture_4olg0") +texture_hover = SubResource("AtlasTexture_xswvt") +ignore_texture_size = true +stretch_mode = 5 + +[node name="DownContainer" type="PanelContainer" parent="ScrollButtons"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Down" type="TextureButton" parent="ScrollButtons/DownContainer"] +unique_name_in_owner = true texture_filter = 1 layout_mode = 2 size_flags_vertical = 3 @@ -77,7 +115,7 @@ texture_disabled = SubResource("AtlasTexture_jgd5d") stretch_mode = 3 [node name="ScrollContainer" type="ScrollContainer" parent="."] -custom_minimum_size = Vector2(103, 51) +custom_minimum_size = Vector2(99, 49) layout_mode = 2 size_flags_horizontal = 3 scroll_vertical_custom_step = 27.0 diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn new file mode 100644 index 000000000..432ab3620 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_slot.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=3 uid="uid://b4juyi6em7wja"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_xvh2s"] + +[node name="9VerbInventorySlot" type="PanelContainer"] +custom_minimum_size = Vector2(40, 24) +offset_right = 40.0 +offset_bottom = 24.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = ExtResource("1_xvh2s") diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png new file mode 100644 index 000000000..451d2746f Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png.import b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png.import similarity index 61% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png.import rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png.import index 3fa8932ce..5ff9eb518 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png.import +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://co5fkuv4jgfbc" -path="res://.godot/imported/9verb_inventory_down.png-ec500f5b0f704498105c5ad03791342a.ctex" +path="res://.godot/imported/9verb_inventory_down.png-c2063bc18f3852e55efd1be63481c340.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_down.png" -dest_files=["res://.godot/imported/9verb_inventory_down.png-ec500f5b0f704498105c5ad03791342a.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_down.png" +dest_files=["res://.godot/imported/9verb_inventory_down.png-c2063bc18f3852e55efd1be63481c340.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png new file mode 100644 index 000000000..779f895d7 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png.import b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png.import similarity index 62% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png.import rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png.import index e1be0e191..9b487b956 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png.import +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://k5k85xjvtqwc" -path="res://.godot/imported/9verb_inventory_up.png-1b4e9b2f78ff326ff732a2227418fc71.ctex" +path="res://.godot/imported/9verb_inventory_up.png-65c99e0daf5ad91d8211f30b267d1e5e.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_inventory_grid/sprites/9verb_inventory_up.png" -dest_files=["res://.godot/imported/9verb_inventory_up.png-1b4e9b2f78ff326ff732a2227418fc71.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/images/9verb_inventory_up.png" +dest_files=["res://.godot/imported/9verb_inventory_up.png-65c99e0daf5ad91d8211f30b267d1e5e.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.gd similarity index 75% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.gd rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.gd index 2bf651355..df31129e1 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/9_verb_panel/9_verb_panel.gd +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.gd @@ -1,7 +1,7 @@ -extends PanelContainer +extends Control -@onready var hover_text_centered: RichTextLabel = %HoverTextCentered -@onready var commands_container: GridContainer = %CommandsContainer +@onready var hover_text_centered: Control = %HoverTextCentered +@onready var commands_container: BoxContainer = %CommandsContainer #region Godot ###################################################################################### diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn new file mode 100644 index 000000000..653c2f581 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.tscn @@ -0,0 +1,177 @@ +[gd_scene load_steps=11 format=3 uid="uid://cuokybjvunmhq"] + +[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/gui/components/hover_text/hover_text.tscn" id="1_8t0fs"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_o0fnb"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_panel/9_verb_panel.gd" id="2_55o6l"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_hover_text/9_verb_hover_text.gd" id="2_qt1af"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/commands_container/9_verb_commands_container.gd" id="3_q8l3d"] +[ext_resource type="ButtonGroup" uid="uid://y1thfsxxjowe" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/resources/9_verb_button_group.tres" id="4_6lnif"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/commands_container/9_verb_command_button.gd" id="5_bpewk"] +[ext_resource type="PackedScene" uid="uid://djan6vy0xq8dq" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/9_verb_inventory_grid/9_verb_inventory_grid.tscn" id="6_r1cmu"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_b57cn"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mksfu"] + +[node name="9VerbPanel" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_o0fnb") +script = ExtResource("2_55o6l") + +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -64.0 +grow_horizontal = 2 +grow_vertical = 0 +mouse_filter = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_b57cn") +metadata/_edit_group_ = true + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +layout_mode = 2 +theme_override_constants/separation = 1 +alignment = 2 + +[node name="HoverTextCentered" parent="PanelContainer/VBoxContainer" instance=ExtResource("1_8t0fs")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +theme = null +script = ExtResource("2_qt1af") +follows_cursor = false + +[node name="Verbs&InventoryContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_mksfu") + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer"] +layout_mode = 2 +size_flags_vertical = 8 +theme_override_constants/separation = 1 + +[node name="CommandsContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/separation = 1 +script = ExtResource("3_q8l3d") + +[node name="Row1" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] +custom_minimum_size = Vector2(0, 16) +layout_mode = 2 +theme_override_constants/separation = 1 + +[node name="Open" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row1"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Open" +script = ExtResource("5_bpewk") +command = 1 + +[node name="PickUp" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row1"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Pick Up" +script = ExtResource("5_bpewk") +command = 2 + +[node name="Push" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row1"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Push" +script = ExtResource("5_bpewk") +command = 3 + +[node name="Row2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] +custom_minimum_size = Vector2(0, 15) +layout_mode = 2 +theme_override_constants/separation = 1 + +[node name="Close" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Close" +script = ExtResource("5_bpewk") +command = 4 + +[node name="LookAt" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Look At" +script = ExtResource("5_bpewk") +command = 5 + +[node name="Pull" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Pull" +script = ExtResource("5_bpewk") +command = 6 + +[node name="Row3" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer"] +custom_minimum_size = Vector2(0, 16) +layout_mode = 2 +theme_override_constants/separation = 1 + +[node name="Give" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Give" +script = ExtResource("5_bpewk") +command = 7 + +[node name="TalkTo" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Talk To" +script = ExtResource("5_bpewk") +command = 8 + +[node name="Use" type="Button" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer/CommandsContainer/Row3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +toggle_mode = true +button_group = ExtResource("4_6lnif") +text = "Use" +script = ExtResource("5_bpewk") +command = 9 + +[node name="9VerbInventoryGrid" parent="PanelContainer/VBoxContainer/Verbs&InventoryContainer/HBoxContainer" instance=ExtResource("6_r1cmu")] +layout_mode = 2 +size_flags_horizontal = 1 +theme = null diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/commands_container/9_verb_command_button.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/components/commands_container/9_verb_command_button.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/commands_container/9_verb_command_button.gd rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/commands_container/9_verb_command_button.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/commands_container/9_verb_commands_container.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/components/commands_container/9_verb_commands_container.gd similarity index 87% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/commands_container/9_verb_commands_container.gd rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/commands_container/9_verb_commands_container.gd index 7bee87208..6f496ba19 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/commands_container/9_verb_commands_container.gd +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/commands_container/9_verb_commands_container.gd @@ -1,4 +1,4 @@ -extends GridContainer +extends BoxContainer #region Public ##################################################################################### @@ -10,7 +10,7 @@ func press_command(command: int) -> void: func unpress_commands() -> void: - for btn in get_children() as Array[BaseButton]: + for btn in find_children("*", "BaseButton") as Array[BaseButton]: btn.set_pressed_no_signal(false) if btn.has_focus(): diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn b/addons/popochiu/engine/objects/gui/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn new file mode 100644 index 000000000..50ccf6273 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/quit_popup/9_verb_quit_popup.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://dv1gec8q4h6b7"] + +[ext_resource type="PackedScene" uid="uid://bnjo044fkdcq7" path="res://addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.tscn" id="1_8vq27"] + +[node name="9VerbQuitPopup" instance=ExtResource("1_8vq27")] +script_name = &"9VerbQuitPopup" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd b/addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd similarity index 96% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd rename to addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd index 4b60e286b..eb52e420e 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd @@ -1,3 +1,4 @@ +@tool extends PopochiuPopup signal quit_pressed @@ -14,6 +15,8 @@ signal classic_sentence_toggled(pressed: bool) func _ready() -> void: super() + if Engine.is_editor_hint(): return + # Connect to child signals save.pressed.connect(_on_save_pressed) load.pressed.connect(_on_load_pressed) diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn b/addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn new file mode 100644 index 000000000..cc481499f --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.tscn @@ -0,0 +1,120 @@ +[gd_scene load_steps=8 format=3 uid="uid://crla6to4mm0p7"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_iqhqs"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/9_verb/components/settings_popup/9_verb_settings_popup.gd" id="2_fpv5p"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_4d6ih"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_biwat"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_duspy"] +[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.tscn" id="5_k2hr6"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4bri7"] + +[node name="9VerbSettingsPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_iqhqs") +script = ExtResource("2_fpv5p") +script_name = &"9VerbSettingsPopup" +title = "Settings" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_4bri7") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +custom_minimum_size = Vector2(264, 0) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_biwat") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Settings" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_4d6ih") +texture_pressed = ExtResource("4_duspy") +texture_hover = ExtResource("4_duspy") + +[node name="OptionsContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer"] +layout_mode = 2 + +[node name="SoundVolumes" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/VBoxContainer" instance=ExtResource("5_k2hr6")] +layout_mode = 2 + +[node name="ClassicSentence" type="CheckButton" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/VBoxContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +tooltip_text = "Show hover text centered" +text = "Classic sentence" + +[node name="Buttons" type="VBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(96, 0) +layout_mode = 2 + +[node name="Save" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Save" + +[node name="Load" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Load" + +[node name="History" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "History" + +[node name="Quit" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Quit game" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/OptionsContainer/Buttons"] +unique_name_in_owner = true +layout_mode = 2 +text = "Resume game" + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +visible = false +layout_mode = 2 +size_flags_vertical = 10 +alignment = 2 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "ok" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_cursor.png b/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_cursor.png similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_cursor.png rename to addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_cursor.png diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_cursor.png.import b/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_cursor.png.import similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_cursor.png.import rename to addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_cursor.png.import index 009c95280..925679c25 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_cursor.png.import +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_cursor.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d0fwvj88bhggm" -path="res://.godot/imported/9verb_cursor.png-624364a3c4e1dd0305f36515a8f8e3d2.ctex" +path="res://.godot/imported/9verb_cursor.png-30129414d11ed7d1ed7ef281b7adc46c.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_cursor.png" -dest_files=["res://.godot/imported/9verb_cursor.png-624364a3c4e1dd0305f36515a8f8e3d2.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_cursor.png" +dest_files=["res://.godot/imported/9verb_cursor.png-30129414d11ed7d1ed7ef281b7adc46c.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png b/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png new file mode 100644 index 000000000..1b0f0fa52 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png.import b/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png.import rename to addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png.import index 292c7734a..44a0742b8 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png.import +++ b/addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dcl6wrqgsdqa1" -path="res://.godot/imported/9verb_ico_settings.png-7800f70a6a26171b8ed0b2e9531f39af.ctex" +path="res://.godot/imported/9verb_ico_settings.png-bdd21653f4156bde0b5c01c0675b7fb1.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/9_verb/images/9verb_ico_settings.png" -dest_files=["res://.godot/imported/9verb_ico_settings.png-7800f70a6a26171b8ed0b2e9531f39af.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/9_verb/images/9verb_ico_settings.png" +dest_files=["res://.godot/imported/9verb_ico_settings.png-bdd21653f4156bde0b5c01c0675b7fb1.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_button_group.tres b/addons/popochiu/engine/objects/gui/templates/9_verb/resources/9_verb_button_group.tres similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/9_verb/resources/9_verb_button_group.tres rename to addons/popochiu/engine/objects/gui/templates/9_verb/resources/9_verb_button_group.tres diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.gd b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.gd similarity index 96% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.gd index 67885890b..cc6ec3731 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.gd +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.gd @@ -1,4 +1,4 @@ -extends PanelContainer +extends Control @export var score := 0 @export var max_score := 100 diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.tscn new file mode 100644 index 000000000..f94b9a8ec --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.tscn @@ -0,0 +1,42 @@ +[gd_scene load_steps=4 format=3 uid="uid://cv2o5p3gp1fgx"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_26r7d"] +[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/gui/components/hover_text/hover_text.tscn" id="1_tlpex"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.gd" id="2_u87it"] + +[node name="SierraBar" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_26r7d") +script = ExtResource("2_u87it") + +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 15.0 +grow_horizontal = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"] +layout_mode = 2 +theme_override_constants/separation = 0 + +[node name="LblGameName" type="Label" parent="PanelContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Sierra GUI" + +[node name="HoverText" parent="PanelContainer/HBoxContainer" instance=ExtResource("1_tlpex")] +layout_mode = 2 +size_flags_horizontal = 3 +theme = null + +[node name="LblScore" type="Label" parent="PanelContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Score: 0" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_command_button/sierra_command_button.gd b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_command_button/sierra_command_button.gd similarity index 85% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_command_button/sierra_command_button.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_command_button/sierra_command_button.gd index 65516bf7c..536126f35 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_command_button/sierra_command_button.gd +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_command_button/sierra_command_button.gd @@ -11,8 +11,8 @@ func _ready() -> void: #endregion #region Public ##################################################################################### -func on_toggled(button_pressed: bool) -> void: - if button_pressed: +func on_toggled(is_pressed: bool) -> void: + if is_pressed: E.current_command = command diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png new file mode 100644 index 000000000..451d2746f Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png.import similarity index 69% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png.import index cd61b6361..e26670067 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cxpcw7xvcjcfy" -path="res://.godot/imported/btn_quit.png-cc39710264461214798945da08434ef2.ctex" +uid="uid://cqbvve00a0t28" +path="res://.godot/imported/btn_down.png-12b18f18ccfb54bf98274b28b5007301.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_quit.png" -dest_files=["res://.godot/imported/btn_quit.png-cc39710264461214798945da08434ef2.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png" +dest_files=["res://.godot/imported/btn_down.png-12b18f18ccfb54bf98274b28b5007301.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png new file mode 100644 index 000000000..779f895d7 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png.import similarity index 62% rename from addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png.import index d39bdd277..d4935ea63 100644 --- a/addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://ey7v3mcmfefw" -path="res://.godot/imported/inventory_bg.png-8324c23140c815a704bf82d42fc97558.ctex" +uid="uid://bhhrpk5utqhm7" +path="res://.godot/imported/btn_up.png-696879c6c7b5785fe7036ec4187fb9d5.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bg.png" -dest_files=["res://.godot/imported/inventory_bg.png-8324c23140c815a704bf82d42fc97558.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png" +dest_files=["res://.godot/imported/btn_up.png-696879c6c7b5785fe7036ec4187fb9d5.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_button_group.tres b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_button_group.tres similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_button_group.tres rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_button_group.tres diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn index 0ccdecef3..035bedc0f 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn @@ -1,41 +1,42 @@ -[gd_scene load_steps=13 format=3 uid="uid://26dqxcqhmj44"] +[gd_scene load_steps=14 format=3 uid="uid://26dqxcqhmj44"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_grid/inventory_grid.gd" id="1_3bsof"] -[ext_resource type="PackedScene" uid="uid://yw6qpn52gnp5" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn" id="2_l732n"] -[ext_resource type="Texture2D" uid="uid://cjairw6sepult" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_up.png" id="3_f4xq7"] -[ext_resource type="Texture2D" uid="uid://bctpmd8wh2ket" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sprites/btn_down.png" id="4_ptth4"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/inventory_grid/inventory_grid.gd" id="1_3bsof"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_8acwo"] +[ext_resource type="PackedScene" uid="uid://yw6qpn52gnp5" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn" id="2_l732n"] +[ext_resource type="Texture2D" uid="uid://bhhrpk5utqhm7" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_up.png" id="3_f4xq7"] +[ext_resource type="Texture2D" uid="uid://cqbvve00a0t28" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/images/btn_down.png" id="4_ptth4"] [sub_resource type="AtlasTexture" id="AtlasTexture_f4cmp"] atlas = ExtResource("3_f4xq7") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 16, 16) [sub_resource type="AtlasTexture" id="AtlasTexture_0587n"] atlas = ExtResource("3_f4xq7") -region = Rect2(0, 64, 32, 32) +region = Rect2(32, 0, 16, 16) [sub_resource type="AtlasTexture" id="AtlasTexture_331sn"] atlas = ExtResource("3_f4xq7") -region = Rect2(0, 32, 32, 32) +region = Rect2(16, 0, 16, 16) [sub_resource type="AtlasTexture" id="AtlasTexture_d48vi"] atlas = ExtResource("3_f4xq7") -region = Rect2(0, 96, 32, 32) +region = Rect2(48, 0, 16, 16) [sub_resource type="AtlasTexture" id="AtlasTexture_phqhs"] atlas = ExtResource("4_ptth4") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 16, 16) [sub_resource type="AtlasTexture" id="AtlasTexture_i0t7f"] atlas = ExtResource("4_ptth4") -region = Rect2(0, 64, 32, 32) +region = Rect2(32, 0, 16, 16) [sub_resource type="AtlasTexture" id="AtlasTexture_pyaw7"] atlas = ExtResource("4_ptth4") -region = Rect2(0, 32, 32, 32) +region = Rect2(16, 0, 16, 16) [sub_resource type="AtlasTexture" id="AtlasTexture_wnjlk"] atlas = ExtResource("4_ptth4") -region = Rect2(0, 96, 32, 32) +region = Rect2(48, 0, 16, 16) [node name="SierraInventoryGrid" type="HBoxContainer"] offset_right = 158.0 @@ -43,6 +44,7 @@ offset_bottom = 64.0 size_flags_horizontal = 3 size_flags_vertical = 3 mouse_filter = 0 +theme = ExtResource("1_8acwo") script = ExtResource("1_3bsof") slot_scene = ExtResource("2_l732n") columns = 5 @@ -69,14 +71,15 @@ theme_override_constants/v_separation = 2 columns = 5 [node name="ScrollButtons" type="VBoxContainer" parent="."] -custom_minimum_size = Vector2(24, 0) +custom_minimum_size = Vector2(16, 0) layout_mode = 2 theme_override_constants/separation = 0 [node name="Up" type="TextureButton" parent="ScrollButtons"] +unique_name_in_owner = true texture_filter = 1 layout_mode = 2 -size_flags_vertical = 2 +size_flags_vertical = 3 texture_normal = SubResource("AtlasTexture_f4cmp") texture_pressed = SubResource("AtlasTexture_0587n") texture_hover = SubResource("AtlasTexture_331sn") @@ -84,9 +87,10 @@ texture_disabled = SubResource("AtlasTexture_d48vi") stretch_mode = 3 [node name="Down" type="TextureButton" parent="ScrollButtons"] +unique_name_in_owner = true texture_filter = 1 layout_mode = 2 -size_flags_vertical = 10 +size_flags_vertical = 3 texture_normal = SubResource("AtlasTexture_phqhs") texture_pressed = SubResource("AtlasTexture_i0t7f") texture_hover = SubResource("AtlasTexture_pyaw7") diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd similarity index 75% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd index e487f4275..d41688af2 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd @@ -1,7 +1,23 @@ +@tool extends PopochiuPopup var _command_when_opened: int = -1 +@onready var interact: TextureButton = %Interact +@onready var look: TextureButton = %Look +@onready var talk: TextureButton = %Talk + + +#region Godot ###################################################################################### +func _ready() -> void: + super() + + interact.pressed.connect(_on_interact_pressed) + look.pressed.connect(_on_look_pressed) + talk.pressed.connect(_on_talk_pressed) + + +#endregion #region Virtual #################################################################################### func _open() -> void: diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn new file mode 100644 index 000000000..a2d6c9377 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn @@ -0,0 +1,195 @@ +[gd_scene load_steps=31 format=3 uid="uid://dc7crw22yevoo"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_ok1rg"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.gd" id="2_xj17e"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_7aa5u"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_vd0bg"] +[ext_resource type="PackedScene" uid="uid://26dqxcqhmj44" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_grid.tscn" id="5_i15hx"] +[ext_resource type="ButtonGroup" uid="uid://dyskyd66yevlj" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_button_group.tres" id="6_gcms1"] +[ext_resource type="Texture2D" uid="uid://mbfkdny6pub7" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png" id="7_ietfy"] +[ext_resource type="Texture2D" uid="uid://57nl6xfjetoe" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png" id="8_m3ulb"] +[ext_resource type="Texture2D" uid="uid://b5vpolfm4o5f4" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png" id="9_ur807"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0yihc"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d512i"] +content_margin_left = 0.0 +content_margin_top = 0.0 +content_margin_right = 0.0 +content_margin_bottom = 0.0 +bg_color = Color(0, 0, 0, 0.705882) +expand_margin_left = 4.0 +expand_margin_top = 4.0 +expand_margin_right = 4.0 +expand_margin_bottom = 4.0 + +[sub_resource type="AtlasTexture" id="AtlasTexture_t6f3x"] +atlas = ExtResource("7_ietfy") +region = Rect2(0, 0, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2tl6r"] +atlas = ExtResource("7_ietfy") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u6es1"] +atlas = ExtResource("7_ietfy") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3r3in"] +atlas = ExtResource("8_m3ulb") +region = Rect2(0, 0, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2idn6"] +atlas = ExtResource("8_m3ulb") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mndsc"] +atlas = ExtResource("8_m3ulb") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hb12v"] +atlas = ExtResource("9_ur807") +region = Rect2(0, 0, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b4bqk"] +atlas = ExtResource("9_ur807") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w2dlm"] +atlas = ExtResource("9_ur807") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rqb31"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3xhdb"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vkbfs"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_lha4x"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ba8hg"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ksnpe"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7a16g"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_g5f4c"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7d0vl"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dpu0r"] + +[node name="SierraInventoryPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_ok1rg") +script = ExtResource("2_xj17e") +script_name = &"SierraInventoryPopup" +title = "Inventory" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_0yihc") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = SubResource("StyleBoxFlat_d512i") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Inventory" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_7aa5u") +texture_pressed = ExtResource("4_vd0bg") +texture_hover = ExtResource("4_vd0bg") + +[node name="SierraInventoryGrid" parent="Overlay/PanelContainer/VBoxContainer" instance=ExtResource("5_i15hx")] +layout_mode = 2 + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 + +[node name="CommandsContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 + +[node name="Interact" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer/CommandsContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +toggle_mode = true +button_group = ExtResource("6_gcms1") +texture_normal = SubResource("AtlasTexture_t6f3x") +texture_pressed = SubResource("AtlasTexture_2tl6r") +texture_hover = SubResource("AtlasTexture_u6es1") + +[node name="Look" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer/CommandsContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +toggle_mode = true +button_group = ExtResource("6_gcms1") +texture_normal = SubResource("AtlasTexture_3r3in") +texture_pressed = SubResource("AtlasTexture_2idn6") +texture_hover = SubResource("AtlasTexture_mndsc") + +[node name="Talk" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer/CommandsContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +toggle_mode = true +button_group = ExtResource("6_gcms1") +texture_normal = SubResource("AtlasTexture_hb12v") +texture_pressed = SubResource("AtlasTexture_b4bqk") +texture_hover = SubResource("AtlasTexture_w2dlm") + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +theme_override_styles/focus = SubResource("StyleBoxEmpty_rqb31") +theme_override_styles/disabled = SubResource("StyleBoxEmpty_3xhdb") +theme_override_styles/hover = SubResource("StyleBoxEmpty_vkbfs") +theme_override_styles/pressed = SubResource("StyleBoxEmpty_lha4x") +theme_override_styles/normal = SubResource("StyleBoxEmpty_ba8hg") +text = "OK" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +theme_override_styles/focus = SubResource("StyleBoxEmpty_ksnpe") +theme_override_styles/disabled = SubResource("StyleBoxEmpty_7a16g") +theme_override_styles/hover = SubResource("StyleBoxEmpty_g5f4c") +theme_override_styles/pressed = SubResource("StyleBoxEmpty_7d0vl") +theme_override_styles/normal = SubResource("StyleBoxEmpty_dpu0r") +text = "Back" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd similarity index 90% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd index fe85f3c13..a171361a0 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd @@ -1,5 +1,8 @@ extends PanelContainer +@export var hover_color := Color("ffffff") +@export var selected_color := Color("edf171") + var _is_selected := false @onready var _style_box_flat: StyleBoxFlat = get_theme_stylebox("panel").duplicate() @@ -29,11 +32,11 @@ func get_content_height() -> float: #region Private #################################################################################### func _on_mouse_entered() -> void: - _style_box_flat.border_color = Color("edf171") + _style_box_flat.border_color = hover_color func _on_mouse_exited() -> void: - _style_box_flat.border_color = _dflt_border_color if not _is_selected else Color.BLACK + _style_box_flat.border_color = _dflt_border_color if not _is_selected else selected_color func _on_item_assigned(node: Node) -> void: @@ -61,7 +64,7 @@ func _on_item_removed(node: Node) -> void: func _on_item_selected(item: PopochiuInventoryItem) -> void: - _style_box_flat.border_color = Color.BLACK + _style_box_flat.border_color = selected_color _is_selected = true diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn similarity index 50% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn index ba87a9773..417315bda 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=3 uid="uid://yw6qpn52gnp5"] +[gd_scene load_steps=4 format=3 uid="uid://yw6qpn52gnp5"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd" id="1_ettj2"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_6ds34"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_slot/sierra_inventory_slot.gd" id="1_ettj2"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7pmgd"] draw_center = false @@ -8,9 +9,10 @@ border_width_left = 1 border_width_top = 1 border_width_right = 1 border_width_bottom = 1 -border_color = Color(0.439216, 0.427451, 0.921569, 1) +border_color = Color(0.482353, 0.482353, 0.482353, 1) [node name="SierraInventorySlot" type="PanelContainer"] custom_minimum_size = Vector2(24, 24) +theme = ExtResource("1_6ds34") theme_override_styles/panel = SubResource("StyleBoxFlat_7pmgd") script = ExtResource("1_ettj2") diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_commands_container.gd b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_commands_container.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_commands_container.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_commands_container.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.gd b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.gd similarity index 70% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.gd index 1cf7c8752..f55e10eac 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.gd +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.gd @@ -1,5 +1,11 @@ -extends PanelContainer +extends Control +## Defines the height in pixels of the zone where moving the mouse in the top of the screen will +## make the bar to show. Note: This value will be affected by the Experimental Scale GUI checkbox +## in Project Settings > Popochiu > GUI. +@export var input_zone_height := 4 + +@onready var panel_container: PanelContainer = $PanelContainer @onready var inventory = %Inventory @onready var settings = %Settings @onready var help = %Help @@ -21,14 +27,18 @@ func _input(event: InputEvent) -> void: if G.is_blocked: return if event is InputEventMouseMotion: - var rect := get_rect() + var rect := panel_container.get_rect() + + if not visible: + rect.size.y = input_zone_height if E.settings.scale_gui: rect = Rect2( - get_rect().position * E.scale, + panel_container.get_rect().position * E.scale, (Vector2( - get_rect().size.x, - get_rect().size.y if visible else get_rect().size.y / 2.0 + panel_container.get_rect().size.x, + panel_container.get_rect().size.y if visible + else panel_container.get_rect().size.y / 2.0 )) * E.scale ) @@ -36,13 +46,11 @@ func _input(event: InputEvent) -> void: # Show the top menu if not I.active: Cursor.show_cursor("gui") - show() elif visible and not rect.has_point(get_global_mouse_position()): # Hide the top menu if not I.active: Cursor.show_cursor(E.get_current_command_name().to_snake_case()) - hide() diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.tscn similarity index 57% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.tscn rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.tscn index 9bef3e24a..d37ff42a3 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.tscn +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.tscn @@ -1,130 +1,132 @@ -[gd_scene load_steps=37 format=3 uid="uid://bhx2hkpkjs7dk"] - -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.gd" id="1_8uwkl"] -[ext_resource type="Theme" uid="uid://csr0n32rthycw" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres" id="1_tkpbh"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_commands_container.gd" id="2_3ic0i"] -[ext_resource type="Texture2D" uid="uid://cnxdologw7ax8" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_walk.png" id="2_eg6ow"] -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_command_button/sierra_command_button.gd" id="3_lg2l4"] -[ext_resource type="Texture2D" uid="uid://57nl6xfjetoe" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png" id="4_sthn3"] -[ext_resource type="Texture2D" uid="uid://mbfkdny6pub7" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png" id="5_3vslp"] -[ext_resource type="Texture2D" uid="uid://b5vpolfm4o5f4" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png" id="6_0y8dr"] -[ext_resource type="Texture2D" uid="uid://cqfu38l1h5v8j" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/separator.png" id="7_6jcwd"] -[ext_resource type="Texture2D" uid="uid://binqewyag102g" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png" id="8_uijy7"] -[ext_resource type="Texture2D" uid="uid://d3hyq5v4c2seb" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png" id="9_g1qod"] -[ext_resource type="Texture2D" uid="uid://djve4vu1lpi34" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png" id="10_bvuyo"] -[ext_resource type="Texture2D" uid="uid://c1gik8lkdekx4" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png" id="11_marqj"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6wfxk"] +[gd_scene load_steps=35 format=3 uid="uid://bhx2hkpkjs7dk"] + +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.gd" id="1_8uwkl"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_ocp4m"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_commands_container.gd" id="2_3ic0i"] +[ext_resource type="Texture2D" uid="uid://cnxdologw7ax8" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png" id="2_eg6ow"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_command_button/sierra_command_button.gd" id="3_lg2l4"] +[ext_resource type="Texture2D" uid="uid://57nl6xfjetoe" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png" id="4_sthn3"] +[ext_resource type="Texture2D" uid="uid://mbfkdny6pub7" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png" id="5_3vslp"] +[ext_resource type="Texture2D" uid="uid://b5vpolfm4o5f4" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png" id="6_0y8dr"] +[ext_resource type="Texture2D" uid="uid://binqewyag102g" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png" id="8_uijy7"] +[ext_resource type="Texture2D" uid="uid://d3hyq5v4c2seb" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png" id="9_g1qod"] +[ext_resource type="Texture2D" uid="uid://djve4vu1lpi34" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png" id="10_bvuyo"] +[ext_resource type="Texture2D" uid="uid://c1gik8lkdekx4" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png" id="11_marqj"] [sub_resource type="AtlasTexture" id="AtlasTexture_csu2p"] atlas = ExtResource("2_eg6ow") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_ylk7h"] atlas = ExtResource("2_eg6ow") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_ao1oe"] atlas = ExtResource("2_eg6ow") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_irg4s"] atlas = ExtResource("4_sthn3") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_sijr3"] atlas = ExtResource("4_sthn3") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_msotb"] atlas = ExtResource("4_sthn3") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_u5ilp"] atlas = ExtResource("5_3vslp") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_nkumn"] atlas = ExtResource("5_3vslp") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_ddbjm"] atlas = ExtResource("5_3vslp") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_r0y6q"] atlas = ExtResource("6_0y8dr") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_yyrpv"] atlas = ExtResource("6_0y8dr") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_m2m36"] atlas = ExtResource("6_0y8dr") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ykyyc"] -texture = ExtResource("7_6jcwd") -axis_stretch_horizontal = 1 -axis_stretch_vertical = 1 +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_a3v2b"] [sub_resource type="AtlasTexture" id="AtlasTexture_uvguw"] atlas = ExtResource("8_uijy7") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_mdjye"] atlas = ExtResource("8_uijy7") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_odwa6"] atlas = ExtResource("8_uijy7") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_wy7fm"] atlas = ExtResource("9_g1qod") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_eccvv"] atlas = ExtResource("9_g1qod") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_0ahol"] atlas = ExtResource("9_g1qod") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_f8jt5"] atlas = ExtResource("11_marqj") -region = Rect2(0, 0, 32, 32) +region = Rect2(0, 0, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_c0o1t"] atlas = ExtResource("11_marqj") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_hs767"] atlas = ExtResource("11_marqj") -region = Rect2(0, 32, 32, 32) +region = Rect2(0, 24, 24, 24) -[node name="SierraTopMenu" type="PanelContainer" groups=["popochiu_gui_component"]] -anchors_preset = 10 +[node name="SierraMenu" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 anchor_right = 1.0 -offset_bottom = 32.0 +anchor_bottom = 1.0 grow_horizontal = 2 -theme = ExtResource("1_tkpbh") -theme_override_styles/panel = SubResource("StyleBoxFlat_6wfxk") +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_ocp4m") script = ExtResource("1_8uwkl") -[node name="HBoxContainer" type="HBoxContainer" parent="."] +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 24.0 +grow_horizontal = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"] layout_mode = 2 theme_override_constants/separation = 0 -[node name="SierraCommandsContainer" type="HBoxContainer" parent="HBoxContainer"] +[node name="SierraCommandsContainer" type="HBoxContainer" parent="PanelContainer/HBoxContainer"] layout_mode = 2 -size_flags_horizontal = 3 theme_override_constants/separation = 0 script = ExtResource("2_3ic0i") -[node name="Walk" type="TextureButton" parent="HBoxContainer/SierraCommandsContainer"] +[node name="Walk" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"] texture_filter = 1 layout_mode = 2 toggle_mode = true @@ -133,7 +135,7 @@ texture_pressed = SubResource("AtlasTexture_ylk7h") texture_hover = SubResource("AtlasTexture_ao1oe") script = ExtResource("3_lg2l4") -[node name="Look" type="TextureButton" parent="HBoxContainer/SierraCommandsContainer"] +[node name="Look" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"] texture_filter = 1 layout_mode = 2 toggle_mode = true @@ -143,7 +145,7 @@ texture_hover = SubResource("AtlasTexture_msotb") script = ExtResource("3_lg2l4") command = 1 -[node name="Interact" type="TextureButton" parent="HBoxContainer/SierraCommandsContainer"] +[node name="Interact" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"] texture_filter = 1 layout_mode = 2 toggle_mode = true @@ -153,7 +155,7 @@ texture_hover = SubResource("AtlasTexture_ddbjm") script = ExtResource("3_lg2l4") command = 2 -[node name="Talk" type="TextureButton" parent="HBoxContainer/SierraCommandsContainer"] +[node name="Talk" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"] texture_filter = 1 layout_mode = 2 toggle_mode = true @@ -163,13 +165,13 @@ texture_hover = SubResource("AtlasTexture_m2m36") script = ExtResource("3_lg2l4") command = 3 -[node name="PanelContainer" type="PanelContainer" parent="HBoxContainer"] +[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/HBoxContainer"] texture_filter = 1 layout_mode = 2 size_flags_horizontal = 3 -theme_override_styles/panel = SubResource("StyleBoxTexture_ykyyc") +theme_override_styles/panel = SubResource("StyleBoxEmpty_a3v2b") -[node name="Inventory" type="TextureButton" parent="HBoxContainer"] +[node name="Inventory" type="TextureButton" parent="PanelContainer/HBoxContainer"] unique_name_in_owner = true texture_filter = 1 layout_mode = 2 @@ -177,7 +179,7 @@ texture_normal = SubResource("AtlasTexture_uvguw") texture_pressed = SubResource("AtlasTexture_mdjye") texture_hover = SubResource("AtlasTexture_odwa6") -[node name="Settings" type="TextureButton" parent="HBoxContainer"] +[node name="Settings" type="TextureButton" parent="PanelContainer/HBoxContainer"] unique_name_in_owner = true texture_filter = 1 layout_mode = 2 @@ -185,14 +187,14 @@ texture_normal = SubResource("AtlasTexture_wy7fm") texture_pressed = SubResource("AtlasTexture_eccvv") texture_hover = SubResource("AtlasTexture_0ahol") -[node name="Help" type="TextureButton" parent="HBoxContainer"] +[node name="Help" type="TextureButton" parent="PanelContainer/HBoxContainer"] unique_name_in_owner = true visible = false texture_filter = 1 layout_mode = 2 texture_normal = ExtResource("10_bvuyo") -[node name="Quit" type="TextureButton" parent="HBoxContainer"] +[node name="Quit" type="TextureButton" parent="PanelContainer/HBoxContainer"] unique_name_in_owner = true visible = false texture_filter = 1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd similarity index 96% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd index a2d5b3dc7..204be6462 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd @@ -1,3 +1,4 @@ +@tool extends PopochiuPopup signal option_selected(option_name) @@ -13,6 +14,8 @@ signal option_selected(option_name) func _ready() -> void: super() + if Engine.is_editor_hint(): return + # Connect to childrens' signals save.pressed.connect(_on_option_pressed.bind("save")) load.pressed.connect(_on_option_pressed.bind("load")) diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn new file mode 100644 index 000000000..8526d013f --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn @@ -0,0 +1,111 @@ +[gd_scene load_steps=7 format=3 uid="uid://c24vj4s0u08jr"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_mo7nx"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.gd" id="2_3iqg8"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_65lvt"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_qdhes"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_38rye"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_fkove"] + +[node name="SierraSettingsPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_mo7nx") +script = ExtResource("2_3iqg8") +script_name = &"SierraSettingsPopup" +title = "Options" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_fkove") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +custom_minimum_size = Vector2(120, 0) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_qdhes") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Options" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +visible = false +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_65lvt") +texture_pressed = ExtResource("4_38rye") +texture_hover = ExtResource("4_38rye") + +[node name="BodyContainer" type="VBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +custom_minimum_size = Vector2(112, 0) +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer"] +layout_mode = 2 + +[node name="Save" type="Button" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Save" + +[node name="Load" type="Button" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Load" + +[node name="Sound" type="Button" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Sound options" + +[node name="Text" type="Button" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Text options" + +[node name="Quit" type="Button" parent="Overlay/PanelContainer/VBoxContainer/BodyContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Quit" + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "OK" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Back" diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/components/sound_popup/sierra_sound_popup.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/components/sound_popup/sierra_sound_popup.tscn new file mode 100644 index 000000000..0ca5ffa32 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/sierra/components/sound_popup/sierra_sound_popup.tscn @@ -0,0 +1,81 @@ +[gd_scene load_steps=8 format=3 uid="uid://mh7ymcslp4xv"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_wcf4y"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup.gd" id="2_mv3ym"] +[ext_resource type="Texture2D" uid="uid://cmxrewai8t2lm" path="res://addons/popochiu/engine/objects/gui/resources/images/close.png" id="3_3cpvg"] +[ext_resource type="StyleBox" uid="uid://dbajakvkltfaj" path="res://addons/popochiu/engine/objects/gui/components/popups/popochiu_popup_panel_container.tres" id="3_bth8c"] +[ext_resource type="Texture2D" uid="uid://p32i25numi5e" path="res://addons/popochiu/engine/objects/gui/resources/images/close_highlight.png" id="4_5cjf6"] +[ext_resource type="PackedScene" uid="uid://drx0r8w00ivck" path="res://addons/popochiu/engine/objects/gui/components/sound_volumes/sound_volumes.tscn" id="5_tjqww"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ygj01"] + +[node name="SierraSoundPopup" type="Control" groups=["popochiu_gui_popup"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_wcf4y") +script = ExtResource("2_mv3ym") +script_name = &"SierraSoundPopup" +title = "Sound options" + +[node name="Overlay" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_ygj01") + +[node name="PanelContainer" type="PanelContainer" parent="Overlay"] +custom_minimum_size = Vector2(0, 140) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_styles/panel = ExtResource("3_bth8c") + +[node name="VBoxContainer" type="VBoxContainer" parent="Overlay/PanelContainer"] +layout_mode = 2 + +[node name="HeaderContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "Sound options" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Close" type="TextureButton" parent="Overlay/PanelContainer/VBoxContainer/HeaderContainer"] +unique_name_in_owner = true +visible = false +texture_filter = 1 +layout_mode = 2 +size_flags_vertical = 4 +texture_normal = ExtResource("3_3cpvg") +texture_pressed = ExtResource("4_5cjf6") +texture_hover = ExtResource("4_5cjf6") + +[node name="SoundVolumes" parent="Overlay/PanelContainer/VBoxContainer" instance=ExtResource("5_tjqww")] +layout_mode = 2 + +[node name="FooterContainer" type="HBoxContainer" parent="Overlay/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 10 +alignment = 1 + +[node name="Ok" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "OK" + +[node name="Cancel" type="Button" parent="Overlay/PanelContainer/VBoxContainer/FooterContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Back" diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png new file mode 100644 index 000000000..bbe384316 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png.import similarity index 67% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png.import index 9a5028929..7e6c59925 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://djve4vu1lpi34" -path="res://.godot/imported/btn_help.png-19605f4ca2a734bec46edbbfbf3ab0a5.ctex" +path="res://.godot/imported/btn_help.png-592c502a90463f8cda0e6f4947df41be.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_help.png" -dest_files=["res://.godot/imported/btn_help.png-19605f4ca2a734bec46edbbfbf3ab0a5.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_help.png" +dest_files=["res://.godot/imported/btn_help.png-592c502a90463f8cda0e6f4947df41be.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png new file mode 100644 index 000000000..2a6575658 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png.import similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png.import index 8176ac988..6e9e14a4f 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://mbfkdny6pub7" -path="res://.godot/imported/btn_interact.png-ee83b4583b11ed5aecf782512da24da8.ctex" +path="res://.godot/imported/btn_interact.png-70e04edd4fb17ba2c34cabb13d7856ce.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_interact.png" -dest_files=["res://.godot/imported/btn_interact.png-ee83b4583b11ed5aecf782512da24da8.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_interact.png" +dest_files=["res://.godot/imported/btn_interact.png-70e04edd4fb17ba2c34cabb13d7856ce.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png new file mode 100644 index 000000000..d1880d9c9 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png.import similarity index 65% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png.import index 01af06dc7..3d692eb4d 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://binqewyag102g" -path="res://.godot/imported/btn_inventory.png-a805f7c70894c6f8bd5d55a1709b0400.ctex" +path="res://.godot/imported/btn_inventory.png-3f4bfa91c4fca8542ad5cce586f0d975.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_inventory.png" -dest_files=["res://.godot/imported/btn_inventory.png-a805f7c70894c6f8bd5d55a1709b0400.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_inventory.png" +dest_files=["res://.godot/imported/btn_inventory.png-3f4bfa91c4fca8542ad5cce586f0d975.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png new file mode 100644 index 000000000..359cee7a3 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png.import similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png.import index 8cd67b0af..1c7e7bb47 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://57nl6xfjetoe" -path="res://.godot/imported/btn_look.png-bd6d62c87dce30592b8691b61cbf28fe.ctex" +path="res://.godot/imported/btn_look.png-937d7dd609333dd445f73f227717f53c.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_look.png" -dest_files=["res://.godot/imported/btn_look.png-bd6d62c87dce30592b8691b61cbf28fe.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_look.png" +dest_files=["res://.godot/imported/btn_look.png-937d7dd609333dd445f73f227717f53c.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png new file mode 100644 index 000000000..c9763d38e Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png.import similarity index 67% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png.import index 5e720f518..e6fde9096 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c1gik8lkdekx4" -path="res://.godot/imported/btn_quit.png-49dc6e5efc801d520e922226e9840fd7.ctex" +path="res://.godot/imported/btn_quit.png-0e4de86f43d10e7267c0f33d0a402b2a.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_quit.png" -dest_files=["res://.godot/imported/btn_quit.png-49dc6e5efc801d520e922226e9840fd7.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_quit.png" +dest_files=["res://.godot/imported/btn_quit.png-0e4de86f43d10e7267c0f33d0a402b2a.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_select.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_select.png new file mode 100644 index 000000000..be2e13870 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_select.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_select.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_select.png.import similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_select.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_select.png.import index 5f0fafb12..47e9ff0d9 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_select.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_select.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://pxmndq6c60g3" -path="res://.godot/imported/btn_select.png-cc28bc6d99a8409eb52efb157cdca7ce.ctex" +path="res://.godot/imported/btn_select.png-f0e43cf2f7ed196c8bce893f479ee340.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_select.png" -dest_files=["res://.godot/imported/btn_select.png-cc28bc6d99a8409eb52efb157cdca7ce.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_select.png" +dest_files=["res://.godot/imported/btn_select.png-f0e43cf2f7ed196c8bce893f479ee340.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png new file mode 100644 index 000000000..01735c119 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png.import similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png.import index 65ea8034c..ff1524183 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d3hyq5v4c2seb" -path="res://.godot/imported/btn_settings.png-0183d6a1997bf3bce08254ccd3545d4e.ctex" +path="res://.godot/imported/btn_settings.png-eaf578a5a9f0522f89a5b20e386eec06.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_settings.png" -dest_files=["res://.godot/imported/btn_settings.png-0183d6a1997bf3bce08254ccd3545d4e.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_settings.png" +dest_files=["res://.godot/imported/btn_settings.png-eaf578a5a9f0522f89a5b20e386eec06.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png new file mode 100644 index 000000000..7fc4fdfde Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png.import similarity index 67% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png.import index c2c05944e..e3f208334 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://b5vpolfm4o5f4" -path="res://.godot/imported/btn_talk.png-23099783f16b486bd15aed0ea08f19c8.ctex" +path="res://.godot/imported/btn_talk.png-0f8d60228439bd491203613702107d3d.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/btn_talk.png" -dest_files=["res://.godot/imported/btn_talk.png-23099783f16b486bd15aed0ea08f19c8.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_talk.png" +dest_files=["res://.godot/imported/btn_talk.png-0f8d60228439bd491203613702107d3d.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png new file mode 100644 index 000000000..7beaf78ac Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png differ diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png.import new file mode 100644 index 000000000..407583b95 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpbuqxha7cos2" +path="res://.godot/imported/btn_walk.png-1c05a8b429f79cffaf55cccac17f2f51.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/btn_walk.png" +dest_files=["res://.godot/imported/btn_walk.png-1c05a8b429f79cffaf55cccac17f2f51.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/separator.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/separator.png similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/separator.png rename to addons/popochiu/engine/objects/gui/templates/sierra/images/separator.png diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/separator.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/separator.png.import similarity index 66% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/separator.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/separator.png.import index c2ed10233..af9f73afd 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/separator.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/separator.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cqfu38l1h5v8j" -path="res://.godot/imported/separator.png-cd7aa1350d9e04131d3e245ae95478a5.ctex" +path="res://.godot/imported/separator.png-f24049f2e03fa1f157c7d4a7704770a9.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/separator.png" -dest_files=["res://.godot/imported/separator.png-cd7aa1350d9e04131d3e245ae95478a5.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/separator.png" +dest_files=["res://.godot/imported/separator.png-f24049f2e03fa1f157c7d4a7704770a9.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png new file mode 100644 index 000000000..6583f20bd Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png.import similarity index 65% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png.import index 8fbd22907..56b8755c7 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dwn416xagjwtd" -path="res://.godot/imported/sierra_cursor.png-7627af723013d7e40d768d9c0ef4e3df.ctex" +path="res://.godot/imported/sierra_cursor.png-405ce398f40274eea750fdb8e1a91200.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png" -dest_files=["res://.godot/imported/sierra_cursor.png-7627af723013d7e40d768d9c0ef4e3df.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png" +dest_files=["res://.godot/imported/sierra_cursor.png-405ce398f40274eea750fdb8e1a91200.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_text_continue_icon.png b/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_text_continue_icon.png similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_text_continue_icon.png rename to addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_text_continue_icon.png diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_text_continue_icon.png.import b/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_text_continue_icon.png.import similarity index 70% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_text_continue_icon.png.import rename to addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_text_continue_icon.png.import index cb4e0e7f4..e0f501027 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_text_continue_icon.png.import +++ b/addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_text_continue_icon.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://crffsrf7dn6gk" -path="res://.godot/imported/sierra_text_continue_icon.png-a230ce4c47bfa913ecb6b20017d4ae7a.ctex" +path="res://.godot/imported/sierra_text_continue_icon.png-95511879904369acc9598a04938ea445.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_text_continue_icon.png" -dest_files=["res://.godot/imported/sierra_text_continue_icon.png-a230ce4c47bfa913ecb6b20017d4ae7a.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_text_continue_icon.png" +dest_files=["res://.godot/imported/sierra_text_continue_icon.png-95511879904369acc9598a04938ea445.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_commands.gd b/addons/popochiu/engine/objects/gui/templates/sierra/sierra_commands.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_commands.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/sierra_commands.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui.gd b/addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui.gd similarity index 90% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui.gd rename to addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui.gd index eb4b12312..441f498d7 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui.gd +++ b/addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui.gd @@ -21,6 +21,7 @@ func _ready() -> void: # Connect to child signals %SierraSettingsPopup.option_selected.connect(_on_settings_option_selected) + %SierraMenu.visibility_changed.connect(_on_menu_visibility_changed) func _input(event: InputEvent) -> void: @@ -32,15 +33,20 @@ func _input(event: InputEvent) -> void: # the player from moving to the clicked position since the Sierra # GUI allows characters to move only when the WALK command is # active. - if not $SierraMenu.visible and not E.hovered\ - and E.current_command != SierraCommands.Commands.WALK: + if ( + not $SierraMenu.visible + and not E.hovered + and E.current_command != SierraCommands.Commands.WALK + ): accept_event() MOUSE_BUTTON_RIGHT: accept_event() - E.current_command = posmod( - E.current_command + 1, SierraCommands.Commands.size() - ) + if I.active: + I.active = null + E.current_command = SierraCommands.Commands.WALK + else: + E.current_command = posmod(E.current_command + 1, SierraCommands.Commands.size()) #endregion @@ -151,4 +157,11 @@ func _on_settings_option_selected(option_name: String) -> void: %QuitPopup.open() +func _on_menu_visibility_changed(): + if %SierraMenu.visible: + %SierraBar.hide() + else: + %SierraBar.show() + + #endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui.tscn b/addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui.tscn similarity index 57% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui.tscn rename to addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui.tscn index 746373abc..dce928ac0 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui.tscn +++ b/addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui.tscn @@ -1,19 +1,19 @@ -[gd_scene load_steps=26 format=3 uid="uid://6ucg5xkcreh5"] - -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui.gd" id="1_40nsv"] -[ext_resource type="Theme" uid="uid://csr0n32rthycw" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/resources/sierra_theme.tres" id="1_kw4gp"] -[ext_resource type="PackedScene" uid="uid://cv2o5p3gp1fgx" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_bar/sierra_bar.tscn" id="4_hjdb7"] -[ext_resource type="PackedScene" uid="uid://bhx2hkpkjs7dk" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_menu/sierra_menu.tscn" id="5_ffq7i"] -[ext_resource type="PackedScene" uid="uid://cg18h3icrip1r" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.tscn" id="11_b4ttw"] -[ext_resource type="Texture2D" uid="uid://dwn416xagjwtd" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/images/sierra_cursor.png" id="13_udys2"] -[ext_resource type="PackedScene" uid="uid://dhsfl8ot4j5fj" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.tscn" id="14_3gq4k"] -[ext_resource type="PackedScene" uid="uid://dc7crw22yevoo" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn" id="15_2hyjp"] -[ext_resource type="PackedScene" uid="uid://c24vj4s0u08jr" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn" id="18_sv4ik"] -[ext_resource type="PackedScene" uid="uid://bdgs3xsbq3gdd" path="res://addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.tscn" id="18_x7swu"] -[ext_resource type="PackedScene" uid="uid://mh7ymcslp4xv" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/sound_popup/sierra_sound_popup.tscn" id="19_3kc82"] -[ext_resource type="PackedScene" uid="uid://de68lx1xqv7fb" path="res://addons/popochiu/engine/objects/graphic_interface/templates/sierra/components/text_popup/sierra_text_popup.tscn" id="20_anvsw"] -[ext_resource type="PackedScene" uid="uid://cndputybyj57n" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.tscn" id="21_1xmwq"] -[ext_resource type="PackedScene" uid="uid://bnjo044fkdcq7" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/quit_popup/quit_popup.tscn" id="24_50bps"] +[gd_scene load_steps=23 format=3 uid="uid://6ucg5xkcreh5"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_3jlpr"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui.gd" id="1_40nsv"] +[ext_resource type="PackedScene" uid="uid://cv2o5p3gp1fgx" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_bar/sierra_bar.tscn" id="4_hjdb7"] +[ext_resource type="PackedScene" uid="uid://bhx2hkpkjs7dk" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_menu/sierra_menu.tscn" id="5_ffq7i"] +[ext_resource type="PackedScene" uid="uid://33wmak2jumqm" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/dialog_portrait/dialog_portrait.tscn" id="5_nehoj"] +[ext_resource type="Texture2D" uid="uid://dwn416xagjwtd" path="res://addons/popochiu/engine/objects/gui/templates/sierra/images/sierra_cursor.png" id="13_udys2"] +[ext_resource type="PackedScene" uid="uid://dhsfl8ot4j5fj" path="res://addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.tscn" id="14_3gq4k"] +[ext_resource type="PackedScene" uid="uid://dc7crw22yevoo" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_inventory_popup/sierra_inventory_popup.tscn" id="15_2hyjp"] +[ext_resource type="PackedScene" uid="uid://c24vj4s0u08jr" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sierra_settings_popup/sierra_settings_popup.tscn" id="18_sv4ik"] +[ext_resource type="PackedScene" uid="uid://bdgs3xsbq3gdd" path="res://addons/popochiu/engine/objects/gui/components/system_text/system_text.tscn" id="18_x7swu"] +[ext_resource type="PackedScene" uid="uid://mh7ymcslp4xv" path="res://addons/popochiu/engine/objects/gui/templates/sierra/components/sound_popup/sierra_sound_popup.tscn" id="19_3kc82"] +[ext_resource type="PackedScene" uid="uid://de68lx1xqv7fb" path="res://addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.tscn" id="20_anvsw"] +[ext_resource type="PackedScene" uid="uid://cndputybyj57n" path="res://addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.tscn" id="21_1xmwq"] +[ext_resource type="PackedScene" uid="uid://bnjo044fkdcq7" path="res://addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.tscn" id="24_50bps"] [sub_resource type="AtlasTexture" id="AtlasTexture_vyqmk"] atlas = ExtResource("13_udys2") @@ -102,29 +102,7 @@ animations = [{ "speed": 5.0 }] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dfmxi"] -bg_color = Color(0.337255, 0.67451, 0.301961, 1) - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_baq17"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_foak3"] -content_margin_left = 8.0 -content_margin_top = 4.0 -content_margin_right = 8.0 -content_margin_bottom = 6.0 -bg_color = Color(0.337255, 0.67451, 0.301961, 1) -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -border_color = Color(0, 0, 0, 1) -corner_detail = 4 -shadow_color = Color(0, 0, 0, 1) -shadow_size = 4 -shadow_offset = Vector2(4, 4) -anti_aliasing = false - -[node name="SierraGI" type="Control"] +[node name="SierraGUI" type="Control"] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -132,7 +110,7 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -theme = ExtResource("1_kw4gp") +theme = ExtResource("1_3jlpr") script = ExtResource("1_40nsv") [node name="Cursor" type="AnimatedSprite2D" parent="."] @@ -142,21 +120,23 @@ animation = &"gui" offset = Vector2(16, 16) [node name="SierraBar" parent="." instance=ExtResource("4_hjdb7")] +unique_name_in_owner = true layout_mode = 1 -offset_bottom = 12.0 [node name="SierraMenu" parent="." instance=ExtResource("5_ffq7i")] +unique_name_in_owner = true layout_mode = 1 -[node name="DialogText" parent="." instance=ExtResource("11_b4ttw")] +[node name="DialogPortrait" parent="." instance=ExtResource("5_nehoj")] layout_mode = 1 -theme = ExtResource("1_kw4gp") [node name="DialogMenu" parent="." instance=ExtResource("14_3gq4k")] visible = false layout_mode = 1 -theme = ExtResource("1_kw4gp") -theme_override_styles/panel = SubResource("StyleBoxFlat_dfmxi") + +[node name="SystemText" parent="." instance=ExtResource("18_x7swu")] +z_index = 1 +layout_mode = 1 [node name="Popups" type="Control" parent="."] layout_mode = 1 @@ -191,21 +171,8 @@ layout_mode = 1 unique_name_in_owner = true visible = false layout_mode = 1 -theme = ExtResource("1_kw4gp") -theme_override_styles/panel = SubResource("StyleBoxEmpty_baq17") [node name="QuitPopup" parent="Popups" instance=ExtResource("24_50bps")] unique_name_in_owner = true visible = false layout_mode = 1 -theme = ExtResource("1_kw4gp") - -[node name="SystemText" parent="." instance=ExtResource("18_x7swu")] -layout_mode = 1 -offset_left = 44.0 -offset_top = -11.0 -offset_right = -44.0 -offset_bottom = 11.0 -theme = ExtResource("1_kw4gp") -theme_override_colors/default_color = Color(0.662745, 1, 0.623529, 1) -theme_override_styles/normal = SubResource("StyleBoxFlat_foak3") diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui_info.tres b/addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui_info.tres similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/sierra/sierra_gui_info.tres rename to addons/popochiu/engine/objects/gui/templates/sierra/sierra_gui_info.tres diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd similarity index 82% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd index 81bbd79df..c62fc524f 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd @@ -1,5 +1,4 @@ -extends "settings_bar_button.gd" - +extends PopochiuSettingsBarButton #region Virtual #################################################################################### func _on_pressed() -> void: diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_load.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_load.gd similarity index 91% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_load.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_load.gd index ca7fa2c52..2f72191a3 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_load.gd +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_load.gd @@ -1,4 +1,4 @@ -extends "settings_bar_button.gd" +extends PopochiuSettingsBarButton #region Godot ###################################################################################### diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_quit.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_quit.gd similarity index 82% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_quit.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_quit.gd index 7b850e87b..6f074b0b1 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_quit.gd +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_quit.gd @@ -1,4 +1,4 @@ -extends "settings_bar_button.gd" +extends PopochiuSettingsBarButton #region Godot ###################################################################################### func _ready() -> void: @@ -12,7 +12,7 @@ func _ready() -> void: #region Virtual #################################################################################### func _on_pressed() -> void: - get_tree().quit() + G.popup_requested.emit("QuitPopup") #endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_save.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_save.gd similarity index 82% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_save.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_save.gd index 7536d65f3..696edcc43 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_save.gd +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_save.gd @@ -1,4 +1,4 @@ -extends "settings_bar_button.gd" +extends PopochiuSettingsBarButton #region Virtual #################################################################################### diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd similarity index 83% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd index 578072bc4..5dd7459e6 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd @@ -1,4 +1,4 @@ -extends "settings_bar_button.gd" +extends PopochiuSettingsBarButton #region Virtual #################################################################################### diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_text_settings.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_text_settings.gd new file mode 100644 index 000000000..46e6957e3 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_text_settings.gd @@ -0,0 +1,9 @@ +extends PopochiuSettingsBarButton + + +#region Virtual #################################################################################### +func _on_pressed() -> void: + G.show_text_settings() + + +#endregion diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/settings_bar_button.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/settings_bar_button.gd similarity index 96% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/settings_bar_button.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/settings_bar_button.gd index 9dd2897c8..4f5f3d702 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/buttons/settings_bar_button.gd +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/settings_bar_button.gd @@ -1,3 +1,4 @@ +class_name PopochiuSettingsBarButton extends TextureButton @export var description := "" : get = get_description diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png new file mode 100644 index 000000000..b38d76a43 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png.import b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png.import rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png.import index a5e871812..5621f6694 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png.import +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cyvd8h2ouw8rg" -path="res://.godot/imported/btn_audio.png-4c4e3cb8b2452bad7a644ead3226fef0.ctex" +path="res://.godot/imported/btn_audio.png-e06282bc1839828ec7b2ef37d0b657ef.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_audio.png" -dest_files=["res://.godot/imported/btn_audio.png-4c4e3cb8b2452bad7a644ead3226fef0.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png" +dest_files=["res://.godot/imported/btn_audio.png-e06282bc1839828ec7b2ef37d0b657ef.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png new file mode 100644 index 000000000..0d4bfd6df Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png.import b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png.import similarity index 62% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png.import rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png.import index 8655b3e51..335cb6d0f 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png.import +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bg1txcy1ofatq" -path="res://.godot/imported/btn_dialog_history.png-9aead40c805b43fddf748d233e2bc892.ctex" +path="res://.godot/imported/btn_dialog_history.png-a64af85fc34450a76c4c7b4c5184db4f.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_dialog_history.png" -dest_files=["res://.godot/imported/btn_dialog_history.png-9aead40c805b43fddf748d233e2bc892.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png" +dest_files=["res://.godot/imported/btn_dialog_history.png-a64af85fc34450a76c4c7b4c5184db4f.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png new file mode 100644 index 000000000..74df64f61 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png.import b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png.import rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png.import index 6d8f0547e..e0768290a 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png.import +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bns33w6nl2qkb" -path="res://.godot/imported/btn_load.png-9fbe49b44daefe756112203a159d83a7.ctex" +path="res://.godot/imported/btn_load.png-220c006d572e8cf298bde9addcd288c3.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_load.png" -dest_files=["res://.godot/imported/btn_load.png-9fbe49b44daefe756112203a159d83a7.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png" +dest_files=["res://.godot/imported/btn_load.png-220c006d572e8cf298bde9addcd288c3.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png new file mode 100644 index 000000000..7a7e69475 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png differ diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png.import b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png.import new file mode 100644 index 000000000..f824e871d --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cxpcw7xvcjcfy" +path="res://.godot/imported/btn_quit.png-b2611596d2bad3c35ffde3dc840c9cc2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png" +dest_files=["res://.godot/imported/btn_quit.png-b2611596d2bad3c35ffde3dc840c9cc2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png new file mode 100644 index 000000000..7450dcc89 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png differ diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png.import b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png.import rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png.import index e59c2e04c..7847535eb 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png.import +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bexxkrmqdiemq" -path="res://.godot/imported/btn_save.png-96ee5eb3d57c4002a93c91b685afe40d.ctex" +path="res://.godot/imported/btn_save.png-cf4863cca937ccafa3aa4cd35b783639.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/sprites/btn_save.png" -dest_files=["res://.godot/imported/btn_save.png-96ee5eb3d57c4002a93c91b685afe40d.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png" +dest_files=["res://.godot/imported/btn_save.png-cf4863cca937ccafa3aa4cd35b783639.ctex"] [params] diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png new file mode 100644 index 000000000..542074e27 Binary files /dev/null and b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png differ diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png.import b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png.import new file mode 100644 index 000000000..043c3614b --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hjol4hvanbt5" +path="res://.godot/imported/btn_text.png-04d4d0de1986570b2d0185fb14bd7f41.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png" +dest_files=["res://.godot/imported/btn_text.png-04d4d0de1986570b2d0185fb14bd7f41.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/resources/text_speed_option.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/resources/text_speed_option.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/resources/text_speed_option.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/resources/text_speed_option.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.gd similarity index 54% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.gd index 00cdb9385..4c3465aeb 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.gd +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.gd @@ -1,57 +1,59 @@ -extends PanelContainer - -const ToolbarButton := preload( - PopochiuResources.GUI_TEMPLATES_FOLDER + - "simple_click/components/settings_bar/buttons/settings_bar_button.gd" -) +class_name PopochiuSettingsBar +extends Control @export var used_in_game := true @export var always_visible := false @export var hide_when_gui_is_blocked := false +## Defines the height in pixels of the zone where moving the mouse in the top of the screen will +## make the bar to show. Note: This value will be affected by the Experimental Scale GUI checkbox +## in Project Settings > Popochiu > GUI. +@export var input_zone_height := 4 var is_disabled := false +var tween: Tween = null var _can_hide := true var _is_hidden := true var _is_mouse_hover := false -@onready var _tween: Tween = null -@onready var _box: BoxContainer = find_child("Box") -@onready var _btn_dialog_speed: ToolbarButton = find_child("BtnDialogSpeed") -@onready var _btn_power: ToolbarButton = find_child("BtnQuit") -@onready var _hide_y := position.y - (size.y - 4) +@onready var panel_container: PanelContainer = $PanelContainer +@onready var box: BoxContainer = %Box +@onready var hidden_y := panel_container.position.y - panel_container.size.y #region Godot ###################################################################################### func _ready() -> void: if not always_visible: - position.y = _hide_y + panel_container.position.y = hidden_y # Connect to child signals - for b in _box.get_children(): + for b in box.get_children(): (b as TextureButton).mouse_entered.connect(_disable_hide) (b as TextureButton).mouse_exited.connect(_enable_hide) # Connect to singletons signals if hide_when_gui_is_blocked: - G.blocked.connect(_on_graphic_interface_blocked) - G.unblocked.connect(_on_graphic_interface_unblocked) + G.blocked.connect(_on_gui_blocked) + G.unblocked.connect(_on_gui_unblocked) if not used_in_game: hide() set_process_input(not always_visible) - size.x = $Box.size.x + panel_container.size.x = box.size.x func _input(event: InputEvent) -> void: if not event is InputEventMouseMotion: return - var rect := get_rect() - + var rect := panel_container.get_rect() + rect.size += Vector2(0.0, input_zone_height) if E.settings.scale_gui: - rect = Rect2(get_rect().position * E.scale, get_rect().size * E.scale) + rect = Rect2( + panel_container.get_rect().position * E.scale, + panel_container.get_rect().size * E.scale + ) if rect.has_point(get_global_mouse_position()): _is_mouse_hover = true @@ -84,16 +86,15 @@ func is_open() -> bool: #region Private #################################################################################### func _open() -> void: if always_visible: return - if not is_disabled and position.y != _hide_y: return + if not is_disabled and panel_container.position.y != hidden_y: return - if is_instance_valid(_tween) and _tween.is_running(): - _tween.kill() - - _tween = create_tween() - _tween.tween_property(self, "position:y", 0.0, 0.5)\ - .from(_hide_y if not is_disabled else position.y)\ - .set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_OUT) + if is_instance_valid(tween) and tween.is_running(): + tween.kill() + tween = create_tween().set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_OUT) + tween.tween_property(panel_container, "position:y", 0.0, 0.5).from( + hidden_y if not is_disabled else panel_container.position.y + ) _is_hidden = false @@ -104,13 +105,13 @@ func _close() -> void: if not _can_hide: return - if is_instance_valid(_tween) and _tween.is_running(): - _tween.kill() - - _tween = create_tween() - _tween.tween_property(self, "position:y", _hide_y if not is_disabled else _hide_y - 3.5, 0.2)\ - .from(0.0).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN) + if is_instance_valid(tween) and tween.is_running(): + tween.kill() + tween = create_tween().set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN) + tween.tween_property( + panel_container, "position:y", hidden_y if not is_disabled else hidden_y - 3.5, 0.2 + ).from(0.0) _is_hidden = true @@ -122,12 +123,12 @@ func _enable_hide() -> void: _can_hide = true -func _on_graphic_interface_blocked() -> void: +func _on_gui_blocked() -> void: set_process_input(false) hide() -func _on_graphic_interface_unblocked() -> void: +func _on_gui_unblocked() -> void: set_process_input(true) show() diff --git a/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.tscn b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.tscn new file mode 100644 index 000000000..7708eed16 --- /dev/null +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.tscn @@ -0,0 +1,169 @@ +[gd_scene load_steps=33 format=3 uid="uid://0cqerawlxb3o"] + +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_457q0"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.gd" id="2_hk0vm"] +[ext_resource type="Texture2D" uid="uid://bexxkrmqdiemq" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_save.png" id="3_b0ddg"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_save.gd" id="4_q3d3e"] +[ext_resource type="Texture2D" uid="uid://bns33w6nl2qkb" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png" id="5_8xdf1"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_load.gd" id="6_dfxoh"] +[ext_resource type="Texture2D" uid="uid://cyvd8h2ouw8rg" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png" id="11_id5s2"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_text_settings.gd" id="12_16l58"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_sound_settings.gd" id="12_jqlr0"] +[ext_resource type="Texture2D" uid="uid://hjol4hvanbt5" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_text.png" id="12_y7pwl"] +[ext_resource type="Texture2D" uid="uid://bg1txcy1ofatq" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png" id="16_7j34k"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_dialog_history.gd" id="17_i76cd"] +[ext_resource type="Texture2D" uid="uid://cxpcw7xvcjcfy" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_quit.png" id="18_64yvb"] +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/buttons/btn_quit.gd" id="19_5u3hw"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_mnuax"] +atlas = ExtResource("3_b0ddg") +region = Rect2(0, 0, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gcwc6"] +atlas = ExtResource("3_b0ddg") +region = Rect2(0, 16, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yci17"] +atlas = ExtResource("3_b0ddg") +region = Rect2(0, 32, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8ii6v"] +atlas = ExtResource("5_8xdf1") +region = Rect2(0, 0, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_c5e8t"] +atlas = ExtResource("5_8xdf1") +region = Rect2(0, 16, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dtnbp"] +atlas = ExtResource("5_8xdf1") +region = Rect2(0, 32, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2vddc"] +atlas = ExtResource("12_y7pwl") +region = Rect2(0, 0, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_38kcs"] +atlas = ExtResource("12_y7pwl") +region = Rect2(0, 16, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ckg43"] +atlas = ExtResource("12_y7pwl") +region = Rect2(0, 32, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_unaqu"] +atlas = ExtResource("11_id5s2") +region = Rect2(0, 0, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i8n60"] +atlas = ExtResource("11_id5s2") +region = Rect2(0, 16, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kl1ek"] +atlas = ExtResource("11_id5s2") +region = Rect2(0, 32, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vqe4x"] +atlas = ExtResource("16_7j34k") +region = Rect2(0, 0, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_h0y2i"] +atlas = ExtResource("16_7j34k") +region = Rect2(0, 16, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_myrqy"] +atlas = ExtResource("16_7j34k") +region = Rect2(0, 32, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1sqfr"] +atlas = ExtResource("18_64yvb") +region = Rect2(0, 0, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_blkpg"] +atlas = ExtResource("18_64yvb") +region = Rect2(0, 16, 0, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_834us"] +atlas = ExtResource("18_64yvb") +region = Rect2(0, 32, 0, 16) + +[node name="SettingsBar" type="Control" groups=["popochiu_gui_component"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_457q0") +script = ExtResource("2_hk0vm") + +[node name="PanelContainer" type="PanelContainer" parent="."] +texture_filter = 1 +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -96.0 +offset_bottom = 24.0 +grow_horizontal = 0 + +[node name="Box" type="HBoxContainer" parent="PanelContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 4 +mouse_filter = 2 +alignment = 2 + +[node name="BtnSave" type="TextureButton" parent="PanelContainer/Box"] +layout_mode = 2 +texture_normal = SubResource("AtlasTexture_mnuax") +texture_pressed = SubResource("AtlasTexture_gcwc6") +texture_hover = SubResource("AtlasTexture_yci17") +script = ExtResource("4_q3d3e") +description = "Save game" +script_name = "SaveGame" + +[node name="BtnLoad" type="TextureButton" parent="PanelContainer/Box"] +visible = false +layout_mode = 2 +texture_normal = SubResource("AtlasTexture_8ii6v") +texture_pressed = SubResource("AtlasTexture_c5e8t") +texture_hover = SubResource("AtlasTexture_dtnbp") +script = ExtResource("6_dfxoh") +description = "Load game" +script_name = "LoadGame" + +[node name="BtnTextSettings" type="TextureButton" parent="PanelContainer/Box"] +layout_mode = 2 +texture_normal = SubResource("AtlasTexture_2vddc") +texture_pressed = SubResource("AtlasTexture_38kcs") +texture_hover = SubResource("AtlasTexture_ckg43") +script = ExtResource("12_16l58") + +[node name="BtnSoundSettings" type="TextureButton" parent="PanelContainer/Box"] +layout_mode = 2 +texture_normal = SubResource("AtlasTexture_unaqu") +texture_pressed = SubResource("AtlasTexture_i8n60") +texture_hover = SubResource("AtlasTexture_kl1ek") +script = ExtResource("12_jqlr0") +description = "Sound settings" +script_name = "SoundSettings" + +[node name="BtnDialogHistory" type="TextureButton" parent="PanelContainer/Box"] +layout_mode = 2 +texture_normal = SubResource("AtlasTexture_vqe4x") +texture_pressed = SubResource("AtlasTexture_h0y2i") +texture_hover = SubResource("AtlasTexture_myrqy") +script = ExtResource("17_i76cd") +description = "History" +script_name = "History" + +[node name="BtnQuit" type="TextureButton" parent="PanelContainer/Box"] +layout_mode = 2 +texture_normal = SubResource("AtlasTexture_1sqfr") +texture_pressed = SubResource("AtlasTexture_blkpg") +texture_hover = SubResource("AtlasTexture_834us") +script = ExtResource("19_5u3hw") +description = "Quit" +script_name = "Quit" diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png b/addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png rename to addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png.import b/addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png.import similarity index 64% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png.import rename to addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png.import index 6f41f919b..b4e3a8b83 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png.import +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bocign602kxhh" -path="res://.godot/imported/simple_click_cursor.png-4cd43b49a8e9b431fd8e173b0293f167.ctex" +path="res://.godot/imported/simple_click_cursor.png-8572f1aad61238225b3f0102a5d54ba7.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png" -dest_files=["res://.godot/imported/simple_click_cursor.png-4cd43b49a8e9b431fd8e173b0293f167.ctex"] +source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png" +dest_files=["res://.godot/imported/simple_click_cursor.png-8572f1aad61238225b3f0102a5d54ba7.ctex"] [params] diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_commands.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_commands.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_commands.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_commands.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui.gd b/addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui.gd similarity index 100% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui.gd rename to addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui.gd diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui.tscn b/addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui.tscn similarity index 72% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui.tscn rename to addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui.tscn index b2acb82ae..418c78a48 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui.tscn +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui.tscn @@ -1,16 +1,19 @@ -[gd_scene load_steps=32 format=3 uid="uid://cwvuu8g0ih3i8"] - -[ext_resource type="Script" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui.gd" id="1_268ni"] -[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/graphic_interface/components/hover_text/hover_text.tscn" id="2_6qu0l"] -[ext_resource type="PackedScene" uid="uid://cg18h3icrip1r" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_text/dialog_text.tscn" id="2_v42aw"] -[ext_resource type="Texture2D" uid="uid://bocign602kxhh" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/images/simple_click_cursor.png" id="3_718yk"] -[ext_resource type="PackedScene" uid="uid://bdgs3xsbq3gdd" path="res://addons/popochiu/engine/objects/graphic_interface/components/system_text/system_text.tscn" id="4_o82xq"] -[ext_resource type="PackedScene" uid="uid://dhsfl8ot4j5fj" path="res://addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.tscn" id="5_ayg0j"] -[ext_resource type="PackedScene" uid="uid://ciar5j7qm85bc" path="res://addons/popochiu/engine/objects/graphic_interface/components/inventory_bar/inventory_bar.tscn" id="6_ovwnh"] -[ext_resource type="PackedScene" uid="uid://0cqerawlxb3o" path="res://addons/popochiu/engine/objects/graphic_interface/templates/simple_click/components/settings_bar/settings_bar.tscn" id="7_mtpwc"] -[ext_resource type="PackedScene" uid="uid://dfrsiyyqncspo" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/history_popup/history_popup.tscn" id="8_207hf"] -[ext_resource type="PackedScene" uid="uid://cndputybyj57n" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/save_and_load_popup/save_and_load_popup.tscn" id="9_ueme0"] -[ext_resource type="PackedScene" uid="uid://dwxm2p1iyhpx6" path="res://addons/popochiu/engine/objects/graphic_interface/components/popups/sound_settings_popup/sound_settings_popup.tscn" id="10_csjib"] +[gd_scene load_steps=35 format=3 uid="uid://cwvuu8g0ih3i8"] + +[ext_resource type="Script" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui.gd" id="1_268ni"] +[ext_resource type="Theme" uid="uid://dpequqav4rjaf" path="res://addons/popochiu/engine/objects/gui/resources/base_gui_theme.tres" id="1_uf1ey"] +[ext_resource type="PackedScene" uid="uid://esorelppu4hw" path="res://addons/popochiu/engine/objects/gui/components/hover_text/hover_text.tscn" id="2_6qu0l"] +[ext_resource type="Texture2D" uid="uid://bocign602kxhh" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/images/simple_click_cursor.png" id="3_718yk"] +[ext_resource type="PackedScene" uid="uid://bdgs3xsbq3gdd" path="res://addons/popochiu/engine/objects/gui/components/system_text/system_text.tscn" id="4_o82xq"] +[ext_resource type="PackedScene" uid="uid://dhsfl8ot4j5fj" path="res://addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.tscn" id="5_ayg0j"] +[ext_resource type="PackedScene" uid="uid://bpl3qjbxonfpb" path="res://addons/popochiu/engine/objects/gui/components/dialog_text/dialog_caption/dialog_caption.tscn" id="5_t54kn"] +[ext_resource type="PackedScene" uid="uid://ciar5j7qm85bc" path="res://addons/popochiu/engine/objects/gui/components/inventory_bar/inventory_bar.tscn" id="6_ovwnh"] +[ext_resource type="PackedScene" uid="uid://0cqerawlxb3o" path="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/settings_bar.tscn" id="7_mtpwc"] +[ext_resource type="PackedScene" uid="uid://dfrsiyyqncspo" path="res://addons/popochiu/engine/objects/gui/components/popups/history_popup/history_popup.tscn" id="8_207hf"] +[ext_resource type="PackedScene" uid="uid://cndputybyj57n" path="res://addons/popochiu/engine/objects/gui/components/popups/save_and_load_popup/save_and_load_popup.tscn" id="9_ueme0"] +[ext_resource type="PackedScene" uid="uid://dwxm2p1iyhpx6" path="res://addons/popochiu/engine/objects/gui/components/popups/sound_settings_popup/sound_settings_popup.tscn" id="10_csjib"] +[ext_resource type="PackedScene" uid="uid://de68lx1xqv7fb" path="res://addons/popochiu/engine/objects/gui/components/popups/text_settings_popup/text_settings_popup.tscn" id="13_dn3wu"] +[ext_resource type="PackedScene" uid="uid://bnjo044fkdcq7" path="res://addons/popochiu/engine/objects/gui/components/popups/quit_popup/quit_popup.tscn" id="14_m3nqq"] [sub_resource type="AtlasTexture" id="10"] atlas = ExtResource("3_718yk") @@ -219,7 +222,7 @@ animations = [{ "speed": 5.0 }] -[node name="SimpleClickGI" type="Control"] +[node name="SimpleClickGUI" type="Control"] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -227,52 +230,38 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 +theme = ExtResource("1_uf1ey") script = ExtResource("1_268ni") [node name="Cursor" type="AnimatedSprite2D" parent="."] texture_filter = 1 sprite_frames = SubResource("SpriteFrames_1bbe3") -animation = &"gui" - -[node name="DialogText" parent="." instance=ExtResource("2_v42aw")] -layout_mode = 1 +animation = &"active" [node name="HoverText" parent="." instance=ExtResource("2_6qu0l")] layout_mode = 1 anchors_preset = 12 anchor_top = 1.0 -anchor_bottom = 1.0 offset_top = -19.0 offset_bottom = -4.0 grow_vertical = 0 +hide_during_dialogs = true -[node name="SystemText" parent="." instance=ExtResource("4_o82xq")] +[node name="DialogCaption" parent="." instance=ExtResource("5_t54kn")] layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -120.0 -offset_top = -12.0 -offset_right = 120.0 -offset_bottom = 12.0 [node name="DialogMenu" parent="." instance=ExtResource("5_ayg0j")] visible = false layout_mode = 1 [node name="InventoryBar" parent="." instance=ExtResource("6_ovwnh")] -layout_mode = 0 -offset_left = 4.0 -offset_right = 40.0 +layout_mode = 1 [node name="SettingsBar" parent="." instance=ExtResource("7_mtpwc")] layout_mode = 1 -anchors_preset = 1 -anchor_left = 1.0 -anchor_right = 1.0 -offset_left = -126.0 -offset_right = -4.0 -grow_horizontal = 0 + +[node name="SystemText" parent="." instance=ExtResource("4_o82xq")] +layout_mode = 1 [node name="Popups" type="Control" parent="."] layout_mode = 1 @@ -294,3 +283,11 @@ layout_mode = 1 [node name="SoundSettingsPopup" parent="Popups" instance=ExtResource("10_csjib")] visible = false layout_mode = 1 + +[node name="TextSettingsPopup" parent="Popups" instance=ExtResource("13_dn3wu")] +visible = false +layout_mode = 1 + +[node name="QuitPopup" parent="Popups" instance=ExtResource("14_m3nqq")] +visible = false +layout_mode = 1 diff --git a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui_info.tres b/addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui_info.tres similarity index 95% rename from addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui_info.tres rename to addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui_info.tres index 8c5bb95f2..7a744683c 100644 --- a/addons/popochiu/engine/objects/graphic_interface/templates/simple_click/simple_click_gui_info.tres +++ b/addons/popochiu/engine/objects/gui/templates/simple_click/simple_click_gui_info.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("1_bvg81") -title = "2-Click Context-sensitive" +title = "Simple Click" description = "- [b]Left click[/b] to interact. - [b]Right click[/b] to examine. - [b]Inventory bar[/b] on top-left corner (by default). diff --git a/addons/popochiu/engine/objects/inventory_item/popochiu_inventory_item.gd b/addons/popochiu/engine/objects/inventory_item/popochiu_inventory_item.gd index ec9d32520..f64f1f938 100644 --- a/addons/popochiu/engine/objects/inventory_item/popochiu_inventory_item.gd +++ b/addons/popochiu/engine/objects/inventory_item/popochiu_inventory_item.gd @@ -300,6 +300,12 @@ func handle_command(button_idx: int) -> void: await call(prefix % suffix) +## Deselects this item if it is the current [member PopochiuIInventory.active] item. +func deselect() -> void: + if I.active and I.active == self: + I.active = null + + #endregion #region SetGet ##################################################################################### diff --git a/addons/popochiu/engine/objects/popochiu_settings.gd b/addons/popochiu/engine/objects/popochiu_settings.gd index c431f8732..d3b158968 100644 --- a/addons/popochiu/engine/objects/popochiu_settings.gd +++ b/addons/popochiu/engine/objects/popochiu_settings.gd @@ -40,7 +40,7 @@ var inventory_always_visible := false var toolbar_always_visible := false ## The color the screen changes to it plays a transition (e.g. move between rooms, skip a cutscene). var fade_color: Color -## Whether the GUI should scale to match the native game resolution. The default GUI has a 320x180 +## Whether the GUI should scale to match the native game resolution. The default GUI has a 356x200 ## resolution. var scale_gui := false ## @deprecated @@ -64,7 +64,7 @@ var is_pixel_perfect := false var dialog_style := 0 ## Setting intended for development of the plugin. It makes the game to use the original files of ## the selected template to make testing changes on it easier. This is a workaround while we find -## how to make the scenes moved to [code]res://game/graphic_interface[/code] inherit from the +## how to make the scenes moved to [code]res://game/gui[/code] inherit from the ## source ones. var dev_use_addon_template := false diff --git a/addons/popochiu/engine/objects/room/popochiu_room.gd b/addons/popochiu/engine/objects/room/popochiu_room.gd index 9b9532761..5672e9da9 100644 --- a/addons/popochiu/engine/objects/room/popochiu_room.gd +++ b/addons/popochiu/engine/objects/room/popochiu_room.gd @@ -103,8 +103,8 @@ func _ready(): set_physics_process(false) # Connect to singletons signals - G.blocked.connect(_on_graphic_interface_blocked) - G.unblocked.connect(_on_graphic_interface_unblocked) + G.blocked.connect(_on_gui_blocked) + G.unblocked.connect(_on_gui_unblocked) R.room_readied(self) @@ -448,11 +448,11 @@ func set_is_current(value: bool) -> void: #endregion #region Private #################################################################################### -func _on_graphic_interface_blocked() -> void: +func _on_gui_blocked() -> void: set_process_unhandled_input(false) -func _on_graphic_interface_unblocked() -> void: +func _on_gui_unblocked() -> void: set_process_unhandled_input(true) diff --git a/addons/popochiu/engine/others/popochiu_utils.gd b/addons/popochiu/engine/others/popochiu_utils.gd index 734d31c0f..7041ec145 100644 --- a/addons/popochiu/engine/others/popochiu_utils.gd +++ b/addons/popochiu/engine/others/popochiu_utils.gd @@ -48,13 +48,17 @@ static func print_normal(msg: String) -> void: ## Checks if [param event] is an [InputEventMouseButton] or [InputEventScreenTouch] event. static func is_click_or_touch(event: InputEvent) -> bool: - if ( - (event is InputEventMouseButton and not event.double_click) - or (event is InputEventScreenTouch and not event.double_tap) - ): - return (event is InputEventMouseButton or event is InputEventScreenTouch) + return (event is InputEventMouseButton or event is InputEventScreenTouch) - return false + +## Checks if [param event] is an [InputEventMouseButton] with [member InputEventMouseButton.double_click] +## as [code]true[/code], or an [InputEventScreenTouch] with [member InputEventScreenTouch.double_tap]. +## as [code]true[/code]. +static func is_double_click_or_double_tap(event: InputEvent) -> bool: + return ( + (event is InputEventMouseButton and event.double_click) + or (event is InputEventScreenTouch and not event.double_tap) + ) ## Checks if [param event] is an [InputEventMouseButton] or [InputEventScreenTouch] event and if diff --git a/addons/popochiu/engine/popochiu.gd b/addons/popochiu/engine/popochiu.gd index 16a5ab82d..43e4697db 100644 --- a/addons/popochiu/engine/popochiu.gd +++ b/addons/popochiu/engine/popochiu.gd @@ -95,7 +95,7 @@ var auto_continue_after := -1.0 ## The current dialog style used by the game. When this property changes, the ## [signal dialog_style_changed] signal is emitted. var current_dialog_style := settings.dialog_style : set = set_dialog_style -## The scale value of the game. Defined by the native game resolution compared with (320, 180), +## The scale value of the game. Defined by the native game resolution compared with (356, 200), ## which is the default game resolution defined by Popochiu. var scale := Vector2.ONE ## A reference to the current commands script. @@ -142,7 +142,7 @@ func _ready() -> void: gui = load(path).instantiate() else: gui = load(PopochiuResources.GUI_GAME_SCENE).instantiate() - gui.name = "GraphicInterface" + gui.name = "GUI" # Load the commands for the game commands = load(PopochiuResources.GUI_COMMANDS).new() @@ -151,8 +151,7 @@ func _ready() -> void: tl = load(PopochiuResources.TRANSITION_LAYER_ADDON).instantiate() # Calculate the scale that could be applied - # FIXME We should not assume 320x180 as the default viewport size - scale = Vector2(width, height) / Vector2(320.0, 180.0) + scale = Vector2(width, height) / PopochiuResources.RETRO_RESOLUTION # Add the AudioManager, the Graphic Interface, and the Transitions Layer to the tree $GraphicInterfaceLayer.add_child(gui) diff --git a/addons/popochiu/engine/templates/graphic_interface/9_verb_commands_template.gd b/addons/popochiu/engine/templates/gui/9_verb_commands_template.gd similarity index 100% rename from addons/popochiu/engine/templates/graphic_interface/9_verb_commands_template.gd rename to addons/popochiu/engine/templates/gui/9_verb_commands_template.gd diff --git a/addons/popochiu/engine/templates/graphic_interface/custom_commands_template.gd b/addons/popochiu/engine/templates/gui/custom_commands_template.gd similarity index 100% rename from addons/popochiu/engine/templates/graphic_interface/custom_commands_template.gd rename to addons/popochiu/engine/templates/gui/custom_commands_template.gd diff --git a/addons/popochiu/engine/templates/graphic_interface/graphic_interface_template.gd b/addons/popochiu/engine/templates/gui/gui_template.gd similarity index 100% rename from addons/popochiu/engine/templates/graphic_interface/graphic_interface_template.gd rename to addons/popochiu/engine/templates/gui/gui_template.gd diff --git a/addons/popochiu/engine/templates/graphic_interface/popup_template.gd b/addons/popochiu/engine/templates/gui/popup_template.gd similarity index 100% rename from addons/popochiu/engine/templates/graphic_interface/popup_template.gd rename to addons/popochiu/engine/templates/gui/popup_template.gd diff --git a/addons/popochiu/engine/templates/graphic_interface/sierra_commands_template.gd b/addons/popochiu/engine/templates/gui/sierra_commands_template.gd similarity index 100% rename from addons/popochiu/engine/templates/graphic_interface/sierra_commands_template.gd rename to addons/popochiu/engine/templates/gui/sierra_commands_template.gd diff --git a/addons/popochiu/engine/templates/graphic_interface/simple_click_commands_template.gd b/addons/popochiu/engine/templates/gui/simple_click_commands_template.gd similarity index 100% rename from addons/popochiu/engine/templates/graphic_interface/simple_click_commands_template.gd rename to addons/popochiu/engine/templates/gui/simple_click_commands_template.gd diff --git a/addons/popochiu/migration/migrations/popochiu_migration_1.gd b/addons/popochiu/migration/migrations/popochiu_migration_1.gd index 6e6bd0c77..449be07c2 100644 --- a/addons/popochiu/migration/migrations/popochiu_migration_1.gd +++ b/addons/popochiu/migration/migrations/popochiu_migration_1.gd @@ -188,7 +188,7 @@ func _rename_folders_to_snake_case(path: String) -> bool: ) -## Copies the 2-click Context-sensitive GUI to [code]res://game/graphic_interface/[/code] if there +## Copies the 2-click Context-sensitive GUI to [code]res://game/gui/[/code] if there ## is no GUI template selected. func _select_gui_template() -> Completion: if PopochiuResources.get_data_value("ui", "template", "").is_empty(): @@ -422,7 +422,7 @@ func _map_voices(emotion_dic: Dictionary, voices: Array) -> Dictionary: return new_emotion_dic -## Replace calls to old methods ignoring the [code]res://game/graphic_interface/[/code] folder: +## Replace calls to old methods ignoring the [code]res://game/gui/[/code] folder: ## - [code]R.get_point[/code] by [code]R.get_marker[/code]. ## - [code]G.display[/code] to [code]G.show_system_text[/code]. ## - Methods with [code]_now[/code] suffix. @@ -443,7 +443,7 @@ func _replace_deprecated_method_calls() -> Completion: # TODO: Include the following replacement. But for this one, the change should only be done # in scripts which have the default method implementation. #{from = "func _on_item_used(item", to = "func _on_item_used(_item"}, - ], ["graphic_interface"]) else Completion.IGNORED + ], ["gui"]) else Completion.IGNORED #endregion diff --git a/addons/popochiu/migration/migrations/popochiu_migration_2.gd b/addons/popochiu/migration/migrations/popochiu_migration_2.gd index 1342f37de..c898e9671 100644 --- a/addons/popochiu/migration/migrations/popochiu_migration_2.gd +++ b/addons/popochiu/migration/migrations/popochiu_migration_2.gd @@ -18,14 +18,14 @@ const STEPS = [ ] const RESET_CHILDREN_OWNER = "reset_children_owner" const GAME_INVENTORY_BAR_PATH =\ -"res://game/graphic_interface/components/inventory_bar/inventory_bar.tscn" +"res://game/gui/components/inventory_bar/inventory_bar.tscn" const GAME_SETTINGS_BAR_PATH =\ -"res://game/graphic_interface/components/settings_bar/settings_bar.tscn" -const GAME_DIALOG_MENU_PATH = "res://game/graphic_interface/components/dialog_menu/dialog_menu.tscn" +"res://game/gui/components/settings_bar/settings_bar.tscn" +const GAME_DIALOG_MENU_PATH = "res://game/gui/components/dialog_menu/dialog_menu.tscn" const GAME_DIALOG_MENU_OPTION_PATH =\ -"res://game/graphic_interface/components/dialog_menu/dialog_menu_option/" +"res://game/gui/components/dialog_menu/dialog_menu_option/" const ADDON_DIALOG_MENU_PATH =\ -"res://addons/popochiu/engine/objects/graphic_interface/components/dialog_menu/dialog_menu.tscn" +"res://addons/popochiu/engine/objects/gui/components/dialog_menu/dialog_menu.tscn" const TextSpeedOption = preload( PopochiuResources.GUI_TEMPLATES_FOLDER + "simple_click/components/settings_bar/resources/text_speed_option.gd" @@ -467,7 +467,7 @@ func _update_dialog_menu() -> Completion: # Delete the old [dialog_menu_option.tscn] file done = DirAccess.remove_absolute( - "res://game/graphic_interface/components/dialog_menu/dialog_menu_option.tscn" + "res://game/gui/components/dialog_menu/dialog_menu_option.tscn" ) if done != OK: PopochiuUtils.print_error( @@ -509,7 +509,7 @@ func _update_simple_click_settings_bar() -> Completion: PopochiuResources.GUI_TEMPLATES_FOLDER.path_join( "simple_click/components/settings_bar/sprites/" ), - "res://game/graphic_interface/components/settings_bar/sprites/" + "res://game/gui/components/settings_bar/sprites/" )) speed_options.append(option) diff --git a/addons/popochiu/popochiu_plugin.gd b/addons/popochiu/popochiu_plugin.gd index 5517c6ce0..733407555 100644 --- a/addons/popochiu/popochiu_plugin.gd +++ b/addons/popochiu/popochiu_plugin.gd @@ -13,7 +13,6 @@ const POPOCHIU_CANVAS_EDITOR_MENU = preload( var dock: Panel -#var EditorInterface := get_editor_interface() var _editor_file_system := EditorInterface.get_resource_filesystem() var _is_first_install := false var _input_actions := preload("res://addons/popochiu/engine/others/input_actions.gd") diff --git a/addons/popochiu/popochiu_resources.gd b/addons/popochiu/popochiu_resources.gd index ac92ba141..e6e9a0150 100644 --- a/addons/popochiu/popochiu_resources.gd +++ b/addons/popochiu/popochiu_resources.gd @@ -36,53 +36,54 @@ enum AudioTypes { } # PLUGIN ------------------------------------------------------------------------------------------- -const MAIN_DOCK_PATH := "res://addons/popochiu/editor/main_dock/popochiu_dock.tscn" -const MAIN_TYPES := [ +const MAIN_DOCK_PATH = "res://addons/popochiu/editor/main_dock/popochiu_dock.tscn" +const MAIN_TYPES = [ Types.ROOM, Types.CHARACTER, Types.INVENTORY_ITEM, Types.DIALOG ] -const ROOM_TYPES := [Types.PROP, Types.HOTSPOT, Types.REGION, Types.MARKER, Types.WALKABLE_AREA] -const DOCUMENTATION := "https://carenalgas.github.io/popochiu/" -const CFG := "res://addons/popochiu/plugin.cfg" -const GUI_SCRIPT_TEMPLATES_FOLDER := "res://addons/popochiu/engine/templates/graphic_interface/" -const GUI_TEMPLATES_FOLDER := "res://addons/popochiu/engine/objects/graphic_interface/templates/" +const ROOM_TYPES = [Types.PROP, Types.HOTSPOT, Types.REGION, Types.MARKER, Types.WALKABLE_AREA] +const DOCUMENTATION = "https://carenalgas.github.io/popochiu/" +const CFG = "res://addons/popochiu/plugin.cfg" +const GUI_SCRIPT_TEMPLATES_FOLDER = "res://addons/popochiu/engine/templates/gui/" +const GUI_TEMPLATES_FOLDER = "res://addons/popochiu/engine/objects/gui/templates/" +const RETRO_RESOLUTION = Vector2(356.0, 200.0) # SINGLETONS --------------------------------------------------------------------------------------- -const GLOBALS_SNGL := "res://game/popochiu_globals.gd" -const UTILS_SNGL := "res://addons/popochiu/engine/others/popochiu_utils.gd" -const CURSOR_SNGL := "res://addons/popochiu/engine/cursor/cursor.tscn" -const POPOCHIU_SNGL := "res://addons/popochiu/engine/popochiu.tscn" -const IROOM := "res://addons/popochiu/engine/interfaces/i_room.gd" -const ICHARACTER := "res://addons/popochiu/engine/interfaces/i_character.gd" -const IINVENTORY := "res://addons/popochiu/engine/interfaces/i_inventory.gd" -const IDIALOG := "res://addons/popochiu/engine/interfaces/i_dialog.gd" -const IGRAPHIC_INTERFACE_SNGL := "res://addons/popochiu/engine/interfaces/i_graphic_interface.gd" -const IAUDIO := "res://addons/popochiu/engine/interfaces/i_audio.gd" -const R_SNGL := "res://game/autoloads/r.gd" -const C_SNGL := "res://game/autoloads/c.gd" -const I_SNGL := "res://game/autoloads/i.gd" -const D_SNGL := "res://game/autoloads/d.gd" -const A_SNGL := "res://game/autoloads/a.gd" -const G_SNGL := "res://game/autoloads/g.gd" +const GLOBALS_SNGL = "res://game/popochiu_globals.gd" +const UTILS_SNGL = "res://addons/popochiu/engine/others/popochiu_utils.gd" +const CURSOR_SNGL = "res://addons/popochiu/engine/cursor/cursor.tscn" +const POPOCHIU_SNGL = "res://addons/popochiu/engine/popochiu.tscn" +const IROOM = "res://addons/popochiu/engine/interfaces/i_room.gd" +const ICHARACTER = "res://addons/popochiu/engine/interfaces/i_character.gd" +const IINVENTORY = "res://addons/popochiu/engine/interfaces/i_inventory.gd" +const IDIALOG = "res://addons/popochiu/engine/interfaces/i_dialog.gd" +const IGRAPHIC_INTERFACE_SNGL = "res://addons/popochiu/engine/interfaces/i_graphic_interface.gd" +const IAUDIO = "res://addons/popochiu/engine/interfaces/i_audio.gd" +const R_SNGL = "res://game/autoloads/r.gd" +const C_SNGL = "res://game/autoloads/c.gd" +const I_SNGL = "res://game/autoloads/i.gd" +const D_SNGL = "res://game/autoloads/d.gd" +const A_SNGL = "res://game/autoloads/a.gd" +const G_SNGL = "res://game/autoloads/g.gd" # FIRST INSTALL ------------------------------------------------------------------------------------ -const GI := 0 -const TL := 1 -const GUI_ADDON_FOLDER := "res://addons/popochiu/engine/objects/graphic_interface/" -const TRANSITION_LAYER_ADDON :=\ +const GI = 0 +const TL = 1 +const GUI_ADDON_FOLDER = "res://addons/popochiu/engine/objects/gui/" +const TRANSITION_LAYER_ADDON =\ "res://addons/popochiu/engine/objects/transition_layer/transition_layer.tscn" # ENGINE ------------------------------------------------------------------------------------------- -const POPOCHIU_SCENE := "res://addons/popochiu/engine/popochiu.tscn" -const AUDIO_MANAGER :=\ +const POPOCHIU_SCENE = "res://addons/popochiu/engine/popochiu.tscn" +const AUDIO_MANAGER =\ "res://addons/popochiu/engine/audio_manager/audio_manager.tscn" -const CURSOR_TYPE :=\ +const CURSOR_TYPE =\ preload("res://addons/popochiu/engine/cursor/cursor.gd").Type -const DATA := "res://game//popochiu_data.cfg" -const ROOM_CHILDREN := ["props", "hotspots", "walkable_areas", "regions"] -const VALID_TYPES := [ +const DATA = "res://game//popochiu_data.cfg" +const ROOM_CHILDREN = ["props", "hotspots", "walkable_areas", "regions"] +const VALID_TYPES = [ TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING, TYPE_ARRAY, TYPE_PACKED_STRING_ARRAY, TYPE_PACKED_INT32_ARRAY, TYPE_PACKED_INT64_ARRAY, TYPE_PACKED_FLOAT32_ARRAY, TYPE_PACKED_FLOAT64_ARRAY ] -const PROPS_IGNORE := [ +const PROPS_IGNORE = [ "description", "baseline", "clickable", @@ -96,7 +97,7 @@ const PROPS_IGNORE := [ "_double_click_delay", "_has_double_click", ] -const HOTSPOTS_IGNORE := [ +const HOTSPOTS_IGNORE = [ "description", "baseline", "clickable", @@ -107,18 +108,18 @@ const HOTSPOTS_IGNORE := [ "_double_click_delay", "_has_double_click", ] -const WALKABLE_AREAS_IGNORE := [ +const WALKABLE_AREAS_IGNORE = [ "description", "tint" ] -const REGIONS_IGNORE := [ +const REGIONS_IGNORE = [ "description", "tint", "scaling", "scale_top", "scale_bottom" ] -const SNGL_TEMPLATE := "@tool\n" +\ +const SNGL_TEMPLATE = "@tool\n" +\ "extends \"%s\"\n\n" +\ "# classes ----\n" +\ "# ---- classes\n" +\ @@ -129,7 +130,7 @@ const SNGL_TEMPLATE := "@tool\n" +\ "# functions ----\n" +\ "# ---- functions\n" +\ "\n" -const SNGL_SETUP := { +const SNGL_SETUP = { R_SNGL : { interface = IROOM, section = "rooms", @@ -167,39 +168,39 @@ const SNGL_SETUP := { prefix = "D", } } -const A_TEMPLATE := "@tool\n" +\ +const A_TEMPLATE = "@tool\n" +\ "extends \"%s\"\n\n" +\ "# cues ----\n" +\ "# ---- cues\n" +\ "\n" -const AUDIO_CUE_SOUND :=\ +const AUDIO_CUE_SOUND =\ "res://addons/popochiu/engine/audio_manager/audio_cue_sound.gd" -const AUDIO_CUE_MUSIC :=\ +const AUDIO_CUE_MUSIC =\ "res://addons/popochiu/engine/audio_manager/audio_cue_music.gd" -const VAR_AUDIO_CUE_SOUND := "var %s: AudioCueSound = load(\"%s\")\n" -const VAR_AUDIO_CUE_MUSIC := "var %s: AudioCueMusic = load(\"%s\")\n" +const VAR_AUDIO_CUE_SOUND = "var %s: AudioCueSound = load(\"%s\")\n" +const VAR_AUDIO_CUE_MUSIC = "var %s: AudioCueMusic = load(\"%s\")\n" # GODOT PROJECT SETTINGS --------------------------------------------------------------------------- -const DISPLAY_WIDTH := "display/window/size/viewport_width" -const DISPLAY_HEIGHT := "display/window/size/viewport_height" -const MAIN_SCENE := "application/run/main_scene" -const TEST_WIDTH := "display/window/size/window_width_override" -const TEST_HEIGHT := "display/window/size/window_height_override" -const STRETCH_MODE := "display/window/stretch/mode" -const STRETCH_ASPECT := "display/window/stretch/aspect" +const DISPLAY_WIDTH = "display/window/size/viewport_width" +const DISPLAY_HEIGHT = "display/window/size/viewport_height" +const MAIN_SCENE = "application/run/main_scene" +const TEST_WIDTH = "display/window/size/window_width_override" +const TEST_HEIGHT = "display/window/size/window_height_override" +const STRETCH_MODE = "display/window/stretch/mode" +const STRETCH_ASPECT = "display/window/stretch/aspect" # GUI TEMPLATES ------------------------------------------------------------------------------------ -const GUI_CUSTOM := "custom" -const GUI_CUSTOM_SCENE := GUI_ADDON_FOLDER + "popochiu_graphic_interface.tscn" -const GUI_CUSTOM_TEMPLATE := GUI_SCRIPT_TEMPLATES_FOLDER + "custom_commands_template.gd" +const GUI_CUSTOM = "custom" +const GUI_CUSTOM_SCENE = GUI_ADDON_FOLDER + "popochiu_gui.tscn" +const GUI_CUSTOM_TEMPLATE = GUI_SCRIPT_TEMPLATES_FOLDER + "custom_commands_template.gd" # GAME --------------------------------------------------------------------------------------------- -const GAME_PATH := "res://game/" +const GAME_PATH = "res://game/" const ROOMS_PATH = GAME_PATH + "rooms/" const CHARACTERS_PATH = GAME_PATH + "characters/" const INVENTORY_ITEMS_PATH = GAME_PATH + "inventory_items/" const DIALOGS_PATH = GAME_PATH + "dialogs/" -const GUI_GAME_FOLDER := GAME_PATH + "graphic_interface/" -const GUI_GAME_SCENE := GUI_GAME_FOLDER + "graphic_interface.tscn" -const GUI_COMMANDS := GUI_GAME_FOLDER + "commands.gd" -const TRANSITION_LAYER := GAME_PATH + "transition_layer/transition_layer.tscn" +const GUI_GAME_FOLDER = GAME_PATH + "gui/" +const GUI_GAME_SCENE = GUI_GAME_FOLDER + "gui.tscn" +const GUI_COMMANDS = GUI_GAME_FOLDER + "gui_commands.gd" +const TRANSITION_LAYER = GAME_PATH + "transition_layer/transition_layer.tscn" #region Public ##################################################################################### diff --git a/project.godot b/project.godot index caa04d82f..292ae1631 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,6 @@ config_version=5 config/name="popochiu 2.0" config/description="Make 2D point n' click games with a smooth workflow (like in Adventure Game Studio or PowerQuest)." -config/tags=PackedStringArray("4.2.x", "4.3") config/features=PackedStringArray("4.3") config/icon="res://icon_v2.png" config/windows_native_icon="res://popochiu_v2.ico" @@ -76,6 +75,7 @@ common/enable_pause_aware_picking=true [popochiu] pixel/pixel_art_textures=true +inventory/items_on_start=["Key"] [rendering]