First commit 🎉
This commit is contained in:
commit
43ea213f9b
728 changed files with 37080 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
|||
extends Control
|
||||
|
||||
@export var score := 0
|
||||
@export var max_score := 100
|
||||
|
||||
@onready var lbl_game_name: Label = %LblGameName
|
||||
@onready var lbl_score: Label = %LblScore
|
||||
|
||||
|
||||
#region Public #####################################################################################
|
||||
func set_game_name(game_name: String) -> void:
|
||||
lbl_game_name.text = game_name
|
||||
|
||||
|
||||
func reset_score() -> void:
|
||||
score = 0
|
||||
_update_text()
|
||||
|
||||
|
||||
func add_score(value: int) -> void:
|
||||
score += value
|
||||
_update_text()
|
||||
|
||||
|
||||
func subtract_score(value: int) -> void:
|
||||
score -= value
|
||||
_update_text()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private ####################################################################################
|
||||
func _update_text() -> void:
|
||||
lbl_score.text = "%d/%d" % [score, max_score]
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://bojwm5vvfycj5
|
|
@ -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"
|
|
@ -0,0 +1,19 @@
|
|||
extends TextureButton
|
||||
|
||||
@export var command: SierraCommands.Commands = 0
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready() -> void:
|
||||
toggled.connect(on_toggled)
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
func on_toggled(is_pressed: bool) -> void:
|
||||
if is_pressed:
|
||||
PopochiuUtils.e.current_command = command
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://b2uaof6tlimie
|
Binary file not shown.
After Width: | Height: | Size: 321 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cqbvve00a0t28"
|
||||
path="res://.godot/imported/btn_down.png-12b18f18ccfb54bf98274b28b5007301.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
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]
|
||||
|
||||
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
|
Binary file not shown.
After Width: | Height: | Size: 306 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bhhrpk5utqhm7"
|
||||
path="res://.godot/imported/btn_up.png-696879c6c7b5785fe7036ec4187fb9d5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
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]
|
||||
|
||||
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
|
|
@ -0,0 +1,4 @@
|
|||
[gd_resource type="ButtonGroup" format=3 uid="uid://dyskyd66yevlj"]
|
||||
|
||||
[resource]
|
||||
resource_name = "SierraInventoryButtonGroup"
|
|
@ -0,0 +1,98 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://26dqxcqhmj44"]
|
||||
|
||||
[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, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0587n"]
|
||||
atlas = ExtResource("3_f4xq7")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_331sn"]
|
||||
atlas = ExtResource("3_f4xq7")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d48vi"]
|
||||
atlas = ExtResource("3_f4xq7")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_phqhs"]
|
||||
atlas = ExtResource("4_ptth4")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i0t7f"]
|
||||
atlas = ExtResource("4_ptth4")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pyaw7"]
|
||||
atlas = ExtResource("4_ptth4")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wnjlk"]
|
||||
atlas = ExtResource("4_ptth4")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[node name="SierraInventoryGrid" type="HBoxContainer"]
|
||||
offset_right = 158.0
|
||||
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
|
||||
visible_rows = 3
|
||||
number_of_slots = 20
|
||||
h_separation = 2
|
||||
v_separation = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
custom_minimum_size = Vector2(128, 76)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
scroll_vertical_custom_step = 27.0
|
||||
horizontal_scroll_mode = 3
|
||||
vertical_scroll_mode = 3
|
||||
|
||||
[node name="Box" type="GridContainer" parent="ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/h_separation = 2
|
||||
theme_override_constants/v_separation = 2
|
||||
columns = 5
|
||||
|
||||
[node name="ScrollButtons" type="VBoxContainer" parent="."]
|
||||
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 = 3
|
||||
texture_normal = SubResource("AtlasTexture_f4cmp")
|
||||
texture_pressed = SubResource("AtlasTexture_0587n")
|
||||
texture_hover = SubResource("AtlasTexture_331sn")
|
||||
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 = 3
|
||||
texture_normal = SubResource("AtlasTexture_phqhs")
|
||||
texture_pressed = SubResource("AtlasTexture_i0t7f")
|
||||
texture_hover = SubResource("AtlasTexture_pyaw7")
|
||||
texture_disabled = SubResource("AtlasTexture_wnjlk")
|
||||
stretch_mode = 3
|
|
@ -0,0 +1,67 @@
|
|||
@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:
|
||||
_command_when_opened = PopochiuUtils.e.current_command
|
||||
PopochiuUtils.e.current_command = -1
|
||||
|
||||
for button: TextureButton in %CommandsContainer.get_children():
|
||||
button.set_pressed_no_signal(false)
|
||||
|
||||
|
||||
func _close() -> void:
|
||||
if PopochiuUtils.i.active:
|
||||
PopochiuUtils.cursor.set_secondary_cursor_texture(PopochiuUtils.i.active.texture)
|
||||
PopochiuUtils.cursor.hide_main_cursor()
|
||||
else:
|
||||
if PopochiuUtils.e.current_command == -1:
|
||||
PopochiuUtils.e.current_command = _command_when_opened
|
||||
|
||||
PopochiuUtils.cursor.show_cursor(PopochiuUtils.e.get_current_command_name().to_snake_case())
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private ####################################################################################
|
||||
func _on_interact_pressed() -> void:
|
||||
_select_command(SierraCommands.Commands.INTERACT)
|
||||
|
||||
|
||||
func _on_look_pressed() -> void:
|
||||
_select_command(SierraCommands.Commands.LOOK)
|
||||
|
||||
|
||||
func _on_talk_pressed() -> void:
|
||||
_select_command(SierraCommands.Commands.TALK)
|
||||
|
||||
|
||||
func _select_command(command: int) -> void:
|
||||
if is_instance_valid(PopochiuUtils.i.active):
|
||||
PopochiuUtils.i.active = null
|
||||
|
||||
PopochiuUtils.e.current_command = command
|
||||
|
||||
# Force changing the cursor passing `true` as second parameter
|
||||
PopochiuUtils.cursor.show_cursor(PopochiuUtils.e.get_current_command_name().to_snake_case(), true)
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://byrkusljcxqsg
|
|
@ -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"
|
|
@ -0,0 +1,76 @@
|
|||
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()
|
||||
@onready var _dflt_border_color := _style_box_flat.border_color
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready() -> void:
|
||||
add_theme_stylebox_override("panel", _style_box_flat)
|
||||
|
||||
# Connect to own signals
|
||||
mouse_entered.connect(_on_mouse_entered)
|
||||
mouse_exited.connect(_on_mouse_exited)
|
||||
child_entered_tree.connect(_on_item_assigned)
|
||||
child_exiting_tree.connect(_on_item_removed)
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
func get_content_height() -> float:
|
||||
# Subtract the value of the sum of the top and bottom borders of the StyleBoxFlat of this slot
|
||||
return size.y - 2
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private ####################################################################################
|
||||
func _on_mouse_entered() -> void:
|
||||
_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 selected_color
|
||||
|
||||
|
||||
func _on_item_assigned(node: Node) -> void:
|
||||
if not node is PopochiuInventoryItem:
|
||||
return
|
||||
|
||||
var inventory_item: PopochiuInventoryItem = node
|
||||
|
||||
inventory_item.mouse_entered.connect(_on_mouse_entered)
|
||||
inventory_item.mouse_exited.connect(_on_mouse_exited)
|
||||
inventory_item.selected.connect(_on_item_selected)
|
||||
inventory_item.unselected.connect(_on_item_unselected)
|
||||
|
||||
|
||||
func _on_item_removed(node: Node) -> void:
|
||||
if not node is PopochiuInventoryItem:
|
||||
return
|
||||
|
||||
var inventory_item: PopochiuInventoryItem = node
|
||||
|
||||
inventory_item.mouse_entered.disconnect(_on_mouse_entered)
|
||||
inventory_item.mouse_exited.disconnect(_on_mouse_exited)
|
||||
inventory_item.selected.disconnect(_on_item_selected)
|
||||
inventory_item.unselected.disconnect(_on_item_unselected)
|
||||
|
||||
|
||||
func _on_item_selected(item: PopochiuInventoryItem) -> void:
|
||||
_style_box_flat.border_color = selected_color
|
||||
_is_selected = true
|
||||
|
||||
|
||||
func _on_item_unselected() -> void:
|
||||
_is_selected = false
|
||||
_style_box_flat.border_color = _dflt_border_color
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://6ori6koegrn6
|
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://yw6qpn52gnp5"]
|
||||
|
||||
[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
|
||||
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)
|
||||
|
||||
[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")
|
|
@ -0,0 +1,20 @@
|
|||
extends HBoxContainer
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready() -> void:
|
||||
PopochiuUtils.e.command_selected.connect(_on_command_selected)
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
func _on_command_selected() -> void:
|
||||
for b in get_children():
|
||||
(b as TextureButton).set_pressed_no_signal(false)
|
||||
|
||||
(get_child(PopochiuUtils.e.current_command) as TextureButton).set_pressed_no_signal(true)
|
||||
PopochiuUtils.cursor.show_cursor(PopochiuUtils.e.get_current_command_name().to_snake_case())
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://cqoxmvinvsqj0
|
|
@ -0,0 +1,78 @@
|
|||
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
|
||||
@onready var quit = %Quit
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready():
|
||||
inventory.pressed.connect(_on_inventory_pressed)
|
||||
settings.pressed.connect(_on_settings_pressed)
|
||||
help.pressed.connect(_on_help_pressed)
|
||||
quit.pressed.connect(_on_quit_pressed)
|
||||
|
||||
hide()
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if PopochiuUtils.g.is_blocked: return
|
||||
|
||||
if event is InputEventMouseMotion:
|
||||
var rect := panel_container.get_rect()
|
||||
|
||||
if not visible:
|
||||
rect.size.y = input_zone_height
|
||||
|
||||
if PopochiuUtils.e.settings.scale_gui:
|
||||
rect = Rect2(
|
||||
panel_container.get_rect().position * PopochiuUtils.e.scale,
|
||||
(Vector2(
|
||||
panel_container.get_rect().size.x,
|
||||
panel_container.get_rect().size.y if visible
|
||||
else panel_container.get_rect().size.y / 2.0
|
||||
)) * PopochiuUtils.e.scale
|
||||
)
|
||||
|
||||
if not visible and rect.has_point(get_global_mouse_position()):
|
||||
# Show the top menu
|
||||
if not PopochiuUtils.i.active:
|
||||
PopochiuUtils.cursor.show_cursor("gui")
|
||||
show()
|
||||
elif visible and not rect.has_point(get_global_mouse_position()):
|
||||
# Hide the top menu
|
||||
if not PopochiuUtils.i.active:
|
||||
PopochiuUtils.cursor.show_cursor(PopochiuUtils.e.get_current_command_name().to_snake_case())
|
||||
hide()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private ####################################################################################
|
||||
func _on_inventory_pressed() -> void:
|
||||
hide()
|
||||
PopochiuUtils.g.popup_requested.emit("SierraInventoryPopup")
|
||||
|
||||
|
||||
func _on_settings_pressed() -> void:
|
||||
hide()
|
||||
PopochiuUtils.g.popup_requested.emit("SierraSettingsPopup")
|
||||
|
||||
|
||||
func _on_help_pressed() -> void:
|
||||
# TODO: Open the help popup
|
||||
pass
|
||||
|
||||
|
||||
func _on_quit_pressed() -> void:
|
||||
PopochiuUtils.g.popup_requested.emit("QuitPopup")
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://bj2m0cts3sjo5
|
|
@ -0,0 +1,204 @@
|
|||
[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, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ylk7h"]
|
||||
atlas = ExtResource("2_eg6ow")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ao1oe"]
|
||||
atlas = ExtResource("2_eg6ow")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_irg4s"]
|
||||
atlas = ExtResource("4_sthn3")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sijr3"]
|
||||
atlas = ExtResource("4_sthn3")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_msotb"]
|
||||
atlas = ExtResource("4_sthn3")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u5ilp"]
|
||||
atlas = ExtResource("5_3vslp")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nkumn"]
|
||||
atlas = ExtResource("5_3vslp")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ddbjm"]
|
||||
atlas = ExtResource("5_3vslp")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r0y6q"]
|
||||
atlas = ExtResource("6_0y8dr")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yyrpv"]
|
||||
atlas = ExtResource("6_0y8dr")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m2m36"]
|
||||
atlas = ExtResource("6_0y8dr")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_a3v2b"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uvguw"]
|
||||
atlas = ExtResource("8_uijy7")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mdjye"]
|
||||
atlas = ExtResource("8_uijy7")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_odwa6"]
|
||||
atlas = ExtResource("8_uijy7")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wy7fm"]
|
||||
atlas = ExtResource("9_g1qod")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_eccvv"]
|
||||
atlas = ExtResource("9_g1qod")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0ahol"]
|
||||
atlas = ExtResource("9_g1qod")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f8jt5"]
|
||||
atlas = ExtResource("11_marqj")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c0o1t"]
|
||||
atlas = ExtResource("11_marqj")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hs767"]
|
||||
atlas = ExtResource("11_marqj")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[node name="SierraMenu" 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_ocp4m")
|
||||
script = ExtResource("1_8uwkl")
|
||||
|
||||
[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="PanelContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
script = ExtResource("2_3ic0i")
|
||||
|
||||
[node name="Walk" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"]
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
texture_normal = SubResource("AtlasTexture_csu2p")
|
||||
texture_pressed = SubResource("AtlasTexture_ylk7h")
|
||||
texture_hover = SubResource("AtlasTexture_ao1oe")
|
||||
script = ExtResource("3_lg2l4")
|
||||
|
||||
[node name="Look" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"]
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
texture_normal = SubResource("AtlasTexture_irg4s")
|
||||
texture_pressed = SubResource("AtlasTexture_sijr3")
|
||||
texture_hover = SubResource("AtlasTexture_msotb")
|
||||
script = ExtResource("3_lg2l4")
|
||||
command = 1
|
||||
|
||||
[node name="Interact" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"]
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
texture_normal = SubResource("AtlasTexture_u5ilp")
|
||||
texture_pressed = SubResource("AtlasTexture_nkumn")
|
||||
texture_hover = SubResource("AtlasTexture_ddbjm")
|
||||
script = ExtResource("3_lg2l4")
|
||||
command = 2
|
||||
|
||||
[node name="Talk" type="TextureButton" parent="PanelContainer/HBoxContainer/SierraCommandsContainer"]
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
texture_normal = SubResource("AtlasTexture_r0y6q")
|
||||
texture_pressed = SubResource("AtlasTexture_yyrpv")
|
||||
texture_hover = SubResource("AtlasTexture_m2m36")
|
||||
script = ExtResource("3_lg2l4")
|
||||
command = 3
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/HBoxContainer"]
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_a3v2b")
|
||||
|
||||
[node name="Inventory" type="TextureButton" parent="PanelContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
texture_normal = SubResource("AtlasTexture_uvguw")
|
||||
texture_pressed = SubResource("AtlasTexture_mdjye")
|
||||
texture_hover = SubResource("AtlasTexture_odwa6")
|
||||
|
||||
[node name="Settings" type="TextureButton" parent="PanelContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
texture_normal = SubResource("AtlasTexture_wy7fm")
|
||||
texture_pressed = SubResource("AtlasTexture_eccvv")
|
||||
texture_hover = SubResource("AtlasTexture_0ahol")
|
||||
|
||||
[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="PanelContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
texture_normal = SubResource("AtlasTexture_f8jt5")
|
||||
texture_pressed = SubResource("AtlasTexture_c0o1t")
|
||||
texture_hover = SubResource("AtlasTexture_hs767")
|
|
@ -0,0 +1,42 @@
|
|||
@tool
|
||||
extends PopochiuPopup
|
||||
|
||||
signal option_selected(option_name)
|
||||
|
||||
@onready var save: Button = %Save
|
||||
@onready var load: Button = %Load
|
||||
@onready var sound: Button = %Sound
|
||||
@onready var text: Button = %Text
|
||||
@onready var quit: Button = %Quit
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
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"))
|
||||
sound.pressed.connect(_on_option_pressed.bind("sound"))
|
||||
text.pressed.connect(_on_option_pressed.bind("text"))
|
||||
quit.pressed.connect(_on_option_pressed.bind("quit"))
|
||||
|
||||
# Connect to autoloads signals
|
||||
# Fix #219: Close the popup whenever a slot is selected for saving or loading
|
||||
PopochiuUtils.e.game_saved.connect(close)
|
||||
PopochiuUtils.e.game_load_started.connect(close)
|
||||
|
||||
if OS.has_feature("web"):
|
||||
quit.hide()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private ####################################################################################
|
||||
func _on_option_pressed(option_name: String) -> void:
|
||||
option_selected.emit(option_name)
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://cob07o556udc
|
|
@ -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"
|
|
@ -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"
|
Loading…
Add table
Add a link
Reference in a new issue