First commit 🎉

This commit is contained in:
Tony Bark 2025-07-17 01:49:18 -04:00
commit 43ea213f9b
728 changed files with 37080 additions and 0 deletions

View file

@ -0,0 +1,166 @@
class_name NineVerbCommands
extends PopochiuCommands
## Defines the commands and fallback methods for the 9 Verbs GUI.
##
## In this GUI, players can use one of four commands to interact with objects: Walk, Open, Pick up,
## Push, Close, Look at, Pull, Give, Talk to, and Use. This behavior is based on games like The
## Secret of Monkey Island, Day of the Tentacle and Thimbleweed Park.
enum Commands { ## Defines the commands of the GUI.
WALK_TO, ## Used when players want to make the PC to walk.
OPEN, ## Used when players want to make the PC to open an object.
PICK_UP, ## Used when players want to make the PC to pick up an object.
PUSH, ## Used when players want to make the PC to push an object.
CLOSE, ## Used when players want to make the PC to close an object.
LOOK_AT, ## Used when players want to make the PC to look an object.
PULL, ## Used when players want to make the PC to pull an object.
GIVE, ## Used when players want to make the PC to give an object.
TALK_TO, ## Used when players want to make the PC to talk to an object.
USE ## Used when players want to make the PC to use an object.
}
#region Godot ######################################################################################
func _init() -> void:
super()
PopochiuUtils.e.register_command(Commands.WALK_TO, "Walk to", walk_to)
PopochiuUtils.e.register_command(Commands.OPEN, "Open", open)
PopochiuUtils.e.register_command(Commands.PICK_UP, "Pick up", pick_up)
PopochiuUtils.e.register_command(Commands.PUSH, "Push", push)
PopochiuUtils.e.register_command(Commands.CLOSE, "Close", close)
PopochiuUtils.e.register_command(Commands.LOOK_AT, "Look at", look_at)
PopochiuUtils.e.register_command(Commands.PULL, "Pull", pull)
PopochiuUtils.e.register_command(Commands.GIVE, "Give", give)
PopochiuUtils.e.register_command(Commands.TALK_TO, "Talk to", talk_to)
PopochiuUtils.e.register_command(Commands.USE, "Use", use)
#endregion
#region Public #####################################################################################
static func get_script_name() -> String:
return "NineVerbCommands"
## Called by [Popochiu] when a command doesn't have an associated [Callable]. By default this calls
## [method walk_to].
func fallback() -> void:
walk_to()
## Called when [code]E.current_command == Commands.WALK_TO[/code] and
## [code]E.command_fallback()[/code] is triggered.[br][br]
## By default makes the character walk to the clicked [code]PopochiuClickable[/code].
func walk_to() -> void:
if PopochiuUtils.i.active:
PopochiuUtils.i.active = null
return
PopochiuUtils.c.player.walk_to_clicked()
await PopochiuUtils.c.player.move_ended
if (
PopochiuUtils.e.clicked and PopochiuUtils.e.clicked.get("suggested_command")
and PopochiuUtils.e.clicked.last_click_button == MOUSE_BUTTON_RIGHT
):
PopochiuUtils.e.current_command = PopochiuUtils.e.clicked.suggested_command
PopochiuUtils.e.clicked.handle_command(MOUSE_BUTTON_LEFT)
## Called when [code]E.current_command == Commands.OPEN[/code] and [code]E.command_fallback()[/code]
## is triggered.
func open() -> void:
await PopochiuUtils.c.player.say("Can't open that")
## Called when [code]E.current_command == Commands.PICK_UP[/code] and
## [code]E.command_fallback()[/code] is triggered.
func pick_up() -> void:
await PopochiuUtils.c.player.say("Not picking that up")
## Called when [code]E.current_command == Commands.PUSH[/code] and [code]E.command_fallback()[/code]
## is triggered.
func push() -> void:
await PopochiuUtils.c.player.say("I don't want to push that")
## Called when [code]E.current_command == Commands.CLOSE[/code] and
## [code]E.command_fallback()[/code] is triggered.
func close() -> void:
await PopochiuUtils.c.player.say("Can't close that")
## Called when [code]E.current_command == Commands.LOOK_AT[/code] and
## [code]E.command_fallback()[/code] is triggered.
func look_at() -> void:
if PopochiuUtils.e.clicked:
await PopochiuUtils.c.player.face_clicked()
await PopochiuUtils.c.player.say("I have nothing to say about that")
## Called when [code]E.current_command == Commands.PULL[/code] and [code]E.command_fallback()[/code]
## is triggered.
func pull() -> void:
await PopochiuUtils.c.player.say("I don't want to pull that")
## Called when [code]E.current_command == Commands.GIVE[/code] and [code]E.command_fallback()[/code]
## is triggered.
func give() -> void:
await _give_or_use(give_item_to)
## Called when [code]E.current_command == Commands.USE[/code] and [code]E.command_fallback()[/code]
## is triggered.
func use() -> void:
await _give_or_use(use_item_on)
func _give_or_use(callback: Callable) -> void:
if PopochiuUtils.i.active and PopochiuUtils.e.clicked:
callback.call(PopochiuUtils.i.active, PopochiuUtils.e.clicked)
elif (
PopochiuUtils.i.active
and PopochiuUtils.i.clicked
and PopochiuUtils.i.active != PopochiuUtils.i.clicked
):
callback.call(PopochiuUtils.i.active, PopochiuUtils.i.clicked)
elif PopochiuUtils.i.clicked:
match PopochiuUtils.i.clicked.last_click_button:
MOUSE_BUTTON_LEFT:
PopochiuUtils.i.clicked.set_active(true)
MOUSE_BUTTON_RIGHT:
# TODO: I'm not sure this is the right way to do this. Maybe GUIs should capture
# click inputs on clickables and inventory items. ----------------------------
PopochiuUtils.e.current_command = (
PopochiuUtils.i.clicked.suggested_command
if PopochiuUtils.i.clicked.get("suggested_command")
else Commands.LOOK_AT
)
PopochiuUtils.i.clicked.handle_command(MOUSE_BUTTON_LEFT)
# ----------------------------------------------------------------------------------
else:
await PopochiuUtils.c.player.say("What?")
## Called when [code]E.current_command == Commands.TALK_TO[/code] and
## [code]E.command_fallback()[/code] is triggered.
func talk_to() -> void:
await PopochiuUtils.c.player.say("Emmmm...")
func use_item_on(_item: PopochiuInventoryItem, _target: Node) -> void:
PopochiuUtils.i.active = null
await PopochiuUtils.c.player.say("I don't want to do that")
func give_item_to(_item: PopochiuInventoryItem, _target: Node) -> void:
PopochiuUtils.i.active = null
await PopochiuUtils.c.player.say("I don't want to do that")
#endregion

View file

@ -0,0 +1 @@
uid://dbik5fn44wljc

View file

@ -0,0 +1,258 @@
class_name NineVerbGUI
extends PopochiuGraphicInterface
## Defines the behavior of the 9 Verbs GUI.
##
## In this GUI players interact with objects based on the active command, which can be changed by
## clicking one of the nine buttons in the bottom panel. The inventory is always visible in the
## bottom right corner of the screen, and the settings popup can be opened using the button in the
## top right corner of the screen.
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]9VerbPanel[/b] component (the one at the bottom containing the verbs,
## the inventory, and the button to open the [b]9VerbSettingsPopup[/b].
@onready var _9_verb_panel: Control = %"9VerbPanel"
@onready var hover_text_cursor: Control = %HoverTextCursor
## Used to access the [b]9VerbSettingsPopup[/b] node.
@onready var settings_popup: Control = %"9VerbSettingsPopup"
@onready var save_and_load_popup: Control = %SaveAndLoadPopup
@onready var history_popup: Control = %HistoryPopup
## Used to access the [b]9VerbQuitPopup[/b] node.
@onready var quit_popup: Control = %"9VerbQuitPopup"
#region Godot ######################################################################################
func _ready() -> void:
super()
PopochiuUtils.cursor.replace_frames($Cursor)
PopochiuUtils.cursor.show_cursor()
$Cursor.hide()
# Connect to own signals
settings_requested.connect(_on_settings_requested)
# Connect to children's signals
settings_popup.classic_sentence_toggled.connect(_on_classic_sentence_toggled)
settings_popup.option_selected.connect(_on_settings_option_selected)
# Connect to singletons signals
PopochiuUtils.e.ready.connect(_on_popochiu_ready)
func _unhandled_input(event: InputEvent) -> void:
# Make the PC move to the clicked point on RIGHT CLICK
if PopochiuUtils.get_click_or_touch_index(event) == MOUSE_BUTTON_RIGHT:
PopochiuUtils.c.player.walk(PopochiuUtils.r.current.get_local_mouse_position())
#endregion
#region Virtual ####################################################################################
## Called when the GUI is blocked. Makes the [member E.current_command] to be none of the available
## commands, hides the bottom panel and makes the GUI to stop processing unhandled input.
func _on_blocked(props := { blocking = true }) -> void:
PopochiuUtils.e.current_command = -1
PopochiuUtils.g.show_hover_text()
_9_verb_panel.hide()
set_process_unhandled_input(false)
## Called when the GUI is unblocked. Makes the [member E.current_command] to be
## [constant NineVerbCommands.WALK_TO], shows the bottom panel and makes the GUI to start processing
## unhandled input.
func _on_unblocked() -> void:
if PopochiuUtils.d.current_dialog:
await get_tree().process_frame
PopochiuUtils.g.block()
return
PopochiuUtils.e.current_command = NineVerbCommands.Commands.WALK_TO
PopochiuUtils.g.show_hover_text()
_9_verb_panel.show()
# Make all commands to look as no pressed
_9_verb_panel.unpress_commands()
set_process_unhandled_input(true)
## Called when [method G.show_system_text] is executed. Shows the [code]"wait"[/code] cursor.
func _on_system_text_shown(_msg: String) -> void:
PopochiuUtils.cursor.show_cursor("wait")
## Called when [method G.show_system_text] is executed. Shows the [code]"normal"[/code] cursor.
func _on_system_text_hidden() -> void:
PopochiuUtils.cursor.show_cursor()
## Called when the mouse enters (hovers) [param clickable]. It displays a text with the
## [member PopochiuClickable.description] in the [HoverText] component and shows the
## [code]"active"[/code] cursor.
func _on_mouse_entered_clickable(clickable: PopochiuClickable) -> void:
if PopochiuUtils.g.is_blocked: return
if clickable.get("suggested_command"):
_9_verb_panel.highlight_command(clickable.suggested_command)
if PopochiuUtils.i.active:
_show_command_on(PopochiuUtils.i.active.description, clickable.description)
else:
PopochiuUtils.g.show_hover_text(clickable.description)
## Called when the mouse exits [param clickable]. Clears the text in the [HoverText] component and
## shows the [code]"normal"[/code] cursor.
func _on_mouse_exited_clickable(clickable: PopochiuClickable) -> void:
if PopochiuUtils.g.is_blocked: return
if clickable.get("suggested_command"):
_9_verb_panel.highlight_command(clickable.suggested_command, false)
PopochiuUtils.cursor.show_cursor()
if PopochiuUtils.i.active:
_show_command_on(PopochiuUtils.i.active.description)
return
PopochiuUtils.g.show_hover_text()
## Called when the mouse enters (hovers) [param inventory_item]. It displays a text with the
## [member PopochiuInventoryItem.description] in the [HoverText] component and shows the
## [code]"active"[/code] cursor.
func _on_mouse_entered_inventory_item(inventory_item: PopochiuInventoryItem) -> void:
if PopochiuUtils.e.current_command == NineVerbCommands.Commands.WALK_TO:
_return_to_walk_to = true
PopochiuUtils.e.current_command = NineVerbCommands.Commands.USE
_9_verb_panel.highlight_command(NineVerbCommands.Commands.LOOK_AT)
PopochiuUtils.cursor.show_cursor()
if PopochiuUtils.i.active:
_show_command_on(PopochiuUtils.i.active.description, inventory_item.description)
else:
PopochiuUtils.g.show_hover_text(inventory_item.description)
## Called when the mouse exits [param inventory_item]. Clears the text in the [HoverText] component
## and shows the [code]"normal"[/code] cursor.
func _on_mouse_exited_inventory_item(inventory_item: PopochiuInventoryItem) -> void:
if not PopochiuUtils.i.active and _return_to_walk_to:
PopochiuUtils.e.current_command = NineVerbCommands.Commands.WALK_TO
_return_to_walk_to = false
_9_verb_panel.highlight_command(NineVerbCommands.Commands.LOOK_AT, false)
PopochiuUtils.cursor.show_cursor()
if PopochiuUtils.i.active:
_show_command_on(PopochiuUtils.i.active.description)
return
PopochiuUtils.g.show_hover_text()
## Called when a dialogue line starts. It shows the [code]"wait"[/code] cursor.
func _on_dialog_line_started() -> void:
PopochiuUtils.cursor.show_cursor("wait")
## Called when a dialogue line finishes. It shows the [code]"gui"[/code] cursor if there is an
## active [PopochiuDialog], otherwise it shows the [code]"normal"[/code] cursor.
func _on_dialog_line_finished() -> void:
PopochiuUtils.cursor.show_cursor("gui" if PopochiuUtils.d.current_dialog else "normal")
## Called when a [PopochiuDialog] starts. It shows the [code]"gui"[/code] cursor.
func _on_dialog_started(_dialog: PopochiuDialog) -> void:
PopochiuUtils.cursor.show_cursor("gui")
## Called when the running [PopochiuDialog] shows its options on screen. It shows the
## [code]"gui"[/code] cursor.
func _on_dialog_options_shown() -> void:
PopochiuUtils.cursor.unblock()
PopochiuUtils.cursor.show_cursor("gui")
## Called when a [PopochiuDialog] finishes. It shows the [code]"normal"[/code] cursor.
func _on_dialog_finished(_dialog: PopochiuDialog) -> void:
PopochiuUtils.cursor.show_cursor()
## Called when [param item] is selected in the inventory (i.e. by clicking it). For this GUI, this
## will only occur when the current command is [constant NineVerbCommands.USE].
func _on_inventory_item_selected(item: PopochiuInventoryItem) -> void:
if not item:
PopochiuUtils.e.current_command = NineVerbCommands.Commands.WALK_TO
PopochiuUtils.g.show_hover_text()
else:
_show_command_on(item.description)
## Called when the game is saved. By default, it shows [code]Game saved[/code] in the SystemText
## component.
func _on_game_saved() -> void:
PopochiuUtils.g.show_system_text("Game saved")
## Called when a game is loaded. [param loaded_game] has the loaded data. By default, it shows
## [code]Game loaded[/code] in the SystemText component.
func _on_game_loaded(loaded_game: Dictionary) -> void:
await PopochiuUtils.g.show_system_text("Game loaded")
super(loaded_game)
#endregion
#region Private ####################################################################################
func _on_popochiu_ready() -> void:
if is_instance_valid(PopochiuUtils.c.player):
PopochiuUtils.c.player.started_walk_to.connect(_on_player_started_walk)
func _on_settings_requested() -> void:
settings_popup.open()
func _on_player_started_walk(
_character: PopochiuCharacter, _start_position: Vector2, _end_position: Vector2
) -> void:
_on_unblocked()
func _on_classic_sentence_toggled(button_pressed: bool) -> void:
hover_text_cursor.visible = not button_pressed
_9_verb_panel.hover_text_centered.visible = button_pressed
func _on_settings_option_selected(option_name: String) -> void:
match option_name:
"save":
save_and_load_popup.open_save()
"load":
save_and_load_popup.open_load()
"history":
history_popup.open()
"quit":
quit_popup.open()
func _show_command_on(item_1_name: String, item_2_name := "") -> void:
var preposition = "on"
if PopochiuUtils.e.current_command == NineVerbCommands.Commands.GIVE:
preposition = "to"
PopochiuUtils.g.show_hover_text("%s %s %s %s" % [
PopochiuUtils.e.get_current_command_name(), item_1_name, preposition, item_2_name
])
#endregion

View file

@ -0,0 +1 @@
uid://dxdpjtcbpbkyp

View file

@ -0,0 +1,159 @@
[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")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jysoy"]
atlas = ExtResource("3_fpt6m")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_m2brv"]
atlas = ExtResource("3_fpt6m")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_flm5d"]
atlas = ExtResource("3_fpt6m")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_wwabf"]
atlas = ExtResource("3_fpt6m")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_vpmp7"]
atlas = ExtResource("3_fpt6m")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_0twu0"]
atlas = ExtResource("3_fpt6m")
region = Rect2(0, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_xtf0b"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_0ckh2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jysoy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m2brv")
}],
"loop": true,
"name": &"active",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_flm5d")
}],
"loop": true,
"name": &"gui",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_wwabf")
}],
"loop": true,
"name": &"normal",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_vpmp7")
}],
"loop": true,
"name": &"wait",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_0twu0")
}],
"loop": true,
"name": &"walk_to",
"speed": 5.0
}]
[node name="9VerbGUI" type="Control"]
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_5somw")
script = ExtResource("2_6nea2")
[node name="Cursor" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_xtf0b")
animation = &"active"
[node name="9VerbPanel" parent="." instance=ExtResource("6_tiq5g")]
unique_name_in_owner = true
layout_mode = 1
[node name="DialogOverhead" parent="." instance=ExtResource("5_gejku")]
layout_mode = 1
[node name="DialogMenu" parent="." instance=ExtResource("7_ypv20")]
visible = false
layout_mode = 1
[node name="HoverTextCursor" parent="." instance=ExtResource("9_pfhkt")]
unique_name_in_owner = true
layout_mode = 1
size_flags_vertical = 3
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
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
metadata/_edit_lock_ = true
[node name="9VerbSettingsPopup" parent="Popups" instance=ExtResource("11_etexu")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="SaveAndLoadPopup" parent="Popups" instance=ExtResource("12_q44n2")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="HistoryPopup" parent="Popups" instance=ExtResource("13_780pa")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="9VerbQuitPopup" parent="Popups" instance=ExtResource("14_0vlip")]
unique_name_in_owner = true
visible = false
layout_mode = 1

View file

@ -0,0 +1,15 @@
[gd_resource type="Resource" script_class="PopochiuGUIInfo" load_steps=3 format=3 uid="uid://ecktw1j2mpea"]
[ext_resource type="Texture2D" uid="uid://brnmaiifdxwm" path="res://addons/popochiu/icons/ico_9verb.png" id="1_4efef"]
[ext_resource type="Script" path="res://addons/popochiu/engine/others/popochiu_gui_info.gd" id="1_pkhv6"]
[resource]
script = ExtResource("1_pkhv6")
title = "9 Verb (LucasArts)"
description = "- Uses the 9 Verbs (commands) of LucasArts games: [b]Open[/b], [b]Pick Up[/b], [b]Push[/b], [b]Close[/b], [b]Look At[/b], [b]Pull[/b], [b]Give[/b], [b]Talk To[/b], [b]Use[/b].
- [b]Right click[/b] to trigger the suggested command or walk.
- [b]Inventory grid[/b] on the bottom.
- [b]Settings popup[/b] that opens with a button in the top-right corner.
Like in games such as Day of the Tentacle, Thimbleweed Park, The Secret of Monkey Island."
icon = ExtResource("1_4efef")

View file

@ -0,0 +1,86 @@
extends PopochiuHoverText
@export var follows_cursor := false
var _gui_width := 0.0
var _gui_height := 0.0
# Used to fix a warning shown by Godot related to the anchors of the node and changing its size
# during a _ready() execution
var _can_change_size := false
#region Godot ######################################################################################
func _ready() -> void:
super()
_gui_width = PopochiuUtils.e.width
_gui_height = PopochiuUtils.e.height
if PopochiuUtils.e.settings.scale_gui:
_gui_width /= PopochiuUtils.e.scale.x
_gui_height /= PopochiuUtils.e.scale.y
PopochiuUtils.e.current_command = NineVerbCommands.Commands.WALK_TO
set_process(follows_cursor)
label.autowrap_mode = (
TextServer.AUTOWRAP_OFF if follows_cursor else TextServer.AUTOWRAP_WORD_SMART
)
_show_text()
PopochiuUtils.e.ready.connect(set.bind("_can_change_size", true))
func _process(_delta: float) -> void:
label.position = get_viewport().get_mouse_position()
if PopochiuUtils.e.settings.scale_gui:
label.position /= PopochiuUtils.e.scale
label.position -= label.size / 2.0
label.position.y -= PopochiuUtils.cursor.get_cursor_height() / 2
# Check viewport limits
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 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:
label.text = ""
if follows_cursor and _can_change_size:
label.size = Vector2.ZERO
if txt.is_empty():
if (
PopochiuUtils.e.current_command == NineVerbCommands.Commands.WALK_TO
and is_instance_valid(PopochiuUtils.e.get_hovered())
):
super("%s %s" % [
PopochiuUtils.e.get_current_command_name(),
PopochiuUtils.e.get_hovered().description
])
elif PopochiuUtils.e.current_command != NineVerbCommands.Commands.WALK_TO:
super(PopochiuUtils.e.get_current_command_name())
elif not txt.is_empty() and not PopochiuUtils.i.active:
super("%s %s" % [PopochiuUtils.e.get_current_command_name(), txt])
elif PopochiuUtils.i.active:
super(txt)
if follows_cursor and _can_change_size:
label.size += Vector2.ONE * (PopochiuUtils.cursor.get_cursor_height() / 2)
# Adding 2.0 fixes a visual bug that was showing the first character of the text cut
label.size.x += 2.0
#endregion

View file

@ -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:
PopochiuUtils.g.gui.settings_requested.emit()
#endregion

View file

@ -0,0 +1,132 @@
[gd_scene load_steps=18 format=3 uid="uid://djan6vy0xq8dq"]
[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")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_mq4sk"]
atlas = ExtResource("2_i17ns")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_2rabq"]
atlas = ExtResource("2_i17ns")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_hw2h8"]
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)
[sub_resource type="AtlasTexture" id="AtlasTexture_obc06"]
atlas = ExtResource("3_uqfpl")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_dt380"]
atlas = ExtResource("3_uqfpl")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jgd5d"]
atlas = ExtResource("3_uqfpl")
region = Rect2(48, 0, 16, 16)
[node name="9VerbInventoryGrid" type="HBoxContainer"]
custom_minimum_size = Vector2(191, 49)
offset_right = 191.0
offset_bottom = 49.0
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 0
theme = ExtResource("1_7ovtr")
theme_override_constants/separation = 1
script = ExtResource("2_vgmo0")
slot_scene = ExtResource("2_goalc")
h_separation = 1
v_separation = 1
[node name="ScrollButtons" type="VBoxContainer" parent="."]
custom_minimum_size = Vector2(24, 0)
layout_mode = 2
theme_override_constants/separation = 1
[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
texture_normal = SubResource("AtlasTexture_5xjfw")
texture_pressed = SubResource("AtlasTexture_mq4sk")
texture_hover = SubResource("AtlasTexture_2rabq")
texture_disabled = SubResource("AtlasTexture_hw2h8")
stretch_mode = 3
[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
texture_normal = SubResource("AtlasTexture_6237a")
texture_pressed = SubResource("AtlasTexture_obc06")
texture_hover = SubResource("AtlasTexture_dt380")
texture_disabled = SubResource("AtlasTexture_jgd5d")
stretch_mode = 3
[node name="ScrollContainer" type="ScrollContainer" parent="."]
custom_minimum_size = Vector2(99, 49)
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 = 1
theme_override_constants/v_separation = 1
columns = 4

View file

@ -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")

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://co5fkuv4jgfbc"
path="res://.godot/imported/9verb_inventory_down.png-c2063bc18f3852e55efd1be63481c340.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://k5k85xjvtqwc"
path="res://.godot/imported/9verb_inventory_up.png-65c99e0daf5ad91d8211f30b267d1e5e.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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

View file

@ -0,0 +1,23 @@
extends Control
@onready var hover_text_centered: Control = %HoverTextCentered
@onready var commands_container: BoxContainer = %CommandsContainer
#region Godot ######################################################################################
func _ready() -> void:
hover_text_centered.hide()
#endregion
#region Public #####################################################################################
func unpress_commands() -> void:
commands_container.unpress_commands()
func highlight_command(command_id: int, highlighted := true) -> void:
commands_container.highlight_command(command_id, highlighted)
#endregion

View file

@ -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

View file

@ -0,0 +1,19 @@
extends Button
@export var command: NineVerbCommands.Commands = NineVerbCommands.Commands.WALK_TO
#region Godot ######################################################################################
func _ready() -> void:
pressed.connect(_on_pressed)
#endregion
#region Private ####################################################################################
func _on_pressed() -> void:
PopochiuUtils.e.current_command = command
PopochiuUtils.g.show_hover_text()
#endregion

View file

@ -0,0 +1,28 @@
extends BoxContainer
#region Public #####################################################################################
func press_command(command: int) -> void:
var btn: BaseButton = find_child(PopochiuUtils.e.get_command_name(command).to_pascal_case())
if btn:
btn.button_pressed = true
func unpress_commands() -> void:
for btn in find_children("*", "BaseButton") as Array[BaseButton]:
btn.set_pressed_no_signal(false)
if btn.has_focus():
btn.release_focus()
func highlight_command(command: int, highlighted := true) -> void:
var btn: BaseButton = find_child(PopochiuUtils.e.get_command_name(command).to_pascal_case())
if btn:
@warning_ignore("standalone_ternary")
btn.grab_focus() if highlighted else btn.release_focus()
#endregion

View file

@ -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"

View file

@ -0,0 +1,43 @@
@tool
extends PopochiuPopup
signal option_selected(option_name: String)
signal classic_sentence_toggled(pressed: bool)
@onready var classic_sentence: CheckButton = %ClassicSentence
@onready var save_btn: Button = %Save
@onready var load_btn: Button = %Load
@onready var history_btn: Button = %History
@onready var quit_btn: Button = %Quit
#region Godot ######################################################################################
func _ready() -> void:
super()
if Engine.is_editor_hint(): return
# Connect to child signals
save_btn.pressed.connect(option_selected.emit.bind("save"))
load_btn.pressed.connect(option_selected.emit.bind("load"))
history_btn.pressed.connect(option_selected.emit.bind("history"))
quit_btn.pressed.connect(option_selected.emit.bind("quit"))
classic_sentence.toggled.connect(_on_classic_sentence_toggled)
# 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_btn.hide()
#endregion
#region Private ####################################################################################
func _on_classic_sentence_toggled(button_pressed: bool) -> void:
classic_sentence_toggled.emit(button_pressed)
#endregion

View file

@ -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"

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d0fwvj88bhggm"
path="res://.godot/imported/9verb_cursor.png-30129414d11ed7d1ed7ef281b7adc46c.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 253 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dcl6wrqgsdqa1"
path="res://.godot/imported/9verb_ico_settings.png-bdd21653f4156bde0b5c01c0675b7fb1.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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

View file

@ -0,0 +1,5 @@
[gd_resource type="ButtonGroup" format=3 uid="uid://y1thfsxxjowe"]
[resource]
resource_local_to_scene = false
resource_name = "9VerbButtonGroup"

View file

@ -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

View file

@ -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"

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,4 @@
[gd_resource type="ButtonGroup" format=3 uid="uid://dyskyd66yevlj"]
[resource]
resource_name = "SierraInventoryButtonGroup"

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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")

View file

@ -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

View file

@ -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

View file

@ -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")

View file

@ -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

View file

@ -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"

View file

@ -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"

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://djve4vu1lpi34"
path="res://.godot/imported/btn_help.png-592c502a90463f8cda0e6f4947df41be.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 344 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://mbfkdny6pub7"
path="res://.godot/imported/btn_interact.png-70e04edd4fb17ba2c34cabb13d7856ce.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 269 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://binqewyag102g"
path="res://.godot/imported/btn_inventory.png-3f4bfa91c4fca8542ad5cce586f0d975.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 399 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://57nl6xfjetoe"
path="res://.godot/imported/btn_look.png-937d7dd609333dd445f73f227717f53c.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 314 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c1gik8lkdekx4"
path="res://.godot/imported/btn_quit.png-0e4de86f43d10e7267c0f33d0a402b2a.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 224 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://pxmndq6c60g3"
path="res://.godot/imported/btn_select.png-f0e43cf2f7ed196c8bce893f479ee340.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 316 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d3hyq5v4c2seb"
path="res://.godot/imported/btn_settings.png-eaf578a5a9f0522f89a5b20e386eec06.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 283 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b5vpolfm4o5f4"
path="res://.godot/imported/btn_talk.png-0f8d60228439bd491203613702107d3d.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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: 288 B

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dwn416xagjwtd"
path="res://.godot/imported/sierra_cursor.png-405ce398f40274eea750fdb8e1a91200.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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

View file

@ -0,0 +1,93 @@
class_name SierraCommands
extends PopochiuCommands
## Defines the commands and fallback methods for the Sierra GUI.
##
## In this GUI, players can use one of four commands to interact with objects: Walk, Look, Interact
## and Talk. This behavior is based on the one used in King's Quest VI and Conquests of the Longbow.
enum Commands { ## Defines the commands of the GUI.
WALK, ## Used when players want to make the PC to walk.
LOOK, ## Used when players want to make the PC to look an object.
INTERACT, ## Used when players want to make the PC to interact with an object.
TALK ## Used when players want to make the PC to talk with an object.
}
#region Godot ######################################################################################
func _init() -> void:
super()
PopochiuUtils.e.register_command(Commands.WALK, "Walk", walk)
PopochiuUtils.e.register_command(Commands.LOOK, "Look", look)
PopochiuUtils.e.register_command(Commands.INTERACT, "Interact", interact)
PopochiuUtils.e.register_command(Commands.TALK, "Talk", talk)
#endregion
#region Public #####################################################################################
## Should return the name of this class, or the identifier you want to use in scripts to know the
## type of the current GUI commands.
static func get_script_name() -> String:
return "SierraCommands"
## Called by [Popochiu] when a command doesn't have an associated [Callable]. By default this calls
## [method walk].
func fallback() -> void:
walk()
## Called when [code]E.current_command == Commands.WALK[/code] and [code]E.command_fallback()[/code]
## is triggered.[br]
## By default makes the character walk to the clicked [PopochiuClickable].
func walk() -> void:
if PopochiuUtils.e.clicked:
PopochiuUtils.c.walk_to_clicked()
## Called when [code]E.current_command == Commands.LOOK[/code] and [code]E.command_fallback()[/code]
## is triggered.
func look() -> void:
PopochiuUtils.g.show_system_text(
"%s has nothing to say about that object" % PopochiuUtils.c.player.description
)
## Called when [code]E.current_command == Commands.INTERACT[/code] and
## [code]E.command_fallback()[/code] is triggered.
func interact() -> void:
if (
(PopochiuUtils.i.active and PopochiuUtils.i.clicked)
and PopochiuUtils.i.active != PopochiuUtils.i.clicked
):
# Item used on another item
PopochiuUtils.g.show_system_text("%s can't use %s with %s" % [
PopochiuUtils.c.player.description,
PopochiuUtils.i.active.description,
PopochiuUtils.i.clicked.description
])
elif PopochiuUtils.i.active and PopochiuUtils.e.clicked:
# Item used on a PopochiuClickable
PopochiuUtils.g.show_system_text("%s can't use %s with %s" % [
PopochiuUtils.c.player.description,
PopochiuUtils.i.active.description,
PopochiuUtils.e.clicked.description
])
elif PopochiuUtils.i.clicked:
# Item selected in inventory
PopochiuUtils.i.clicked.set_active()
else:
# PopochiuClickable clicked
PopochiuUtils.g.show_system_text(
"%s doesn't want to do anything with that object" % PopochiuUtils.c.player.description
)
## Called when [code]E.current_command == Commands.TALK[/code] and [code]E.command_fallback()[/code]
## is triggered.
func talk() -> void:
PopochiuUtils.g.show_system_text("%s can't talk with that" % PopochiuUtils.c.player.description)
#endregion

View file

@ -0,0 +1 @@
uid://xrw3ig57uotu

View file

@ -0,0 +1,178 @@
class_name SierraGUI
extends PopochiuGraphicInterface
## Defines the behavior of the Sierra GUI.
##
## In this GUI players interact with objects based on the active command, which can be changed with
## right click or by using the buttons in the top bar that appears when the cursor moves to the
## top of the screen. The inventory can be opened with a button in the top bar, same for the
## settings.
@onready var sierra_bar: Control = %SierraBar
@onready var sierra_menu: Control = %SierraMenu
@onready var sierra_inventory_popup: Control = %SierraInventoryPopup
@onready var sierra_settings_popup: Control = %SierraSettingsPopup
@onready var sierra_sound_popup: Control = %SierraSoundPopup
@onready var text_settings_popup: Control = %TextSettingsPopup
@onready var save_and_load_popup: Control = %SaveAndLoadPopup
@onready var quit_popup: Control = %QuitPopup
#region Godot ######################################################################################
func _ready() -> void:
super()
PopochiuUtils.cursor.replace_frames($Cursor)
PopochiuUtils.cursor.show_cursor()
$Cursor.hide()
PopochiuUtils.e.current_command = SierraCommands.Commands.WALK
# Connect to child signals
sierra_settings_popup.option_selected.connect(_on_settings_option_selected)
sierra_menu.visibility_changed.connect(_on_menu_visibility_changed)
func _input(event: InputEvent) -> void:
if PopochiuUtils.g.is_blocked: return
match PopochiuUtils.get_click_or_touch_index(event):
MOUSE_BUTTON_LEFT:
# NOTE: When clicking anywhere with the Left Mouse Button, block
# 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 sierra_menu.visible
and not PopochiuUtils.e.hovered
and PopochiuUtils.e.current_command != SierraCommands.Commands.WALK
):
accept_event()
MOUSE_BUTTON_RIGHT:
accept_event()
if PopochiuUtils.i.active:
PopochiuUtils.i.active = null
PopochiuUtils.e.current_command = SierraCommands.Commands.WALK
else:
PopochiuUtils.e.current_command = posmod(
PopochiuUtils.e.current_command + 1, SierraCommands.Commands.size()
)
#endregion
#region Virtual ####################################################################################
## Called when the GUI is blocked. Makes the GUI to stop processing input.
func _on_blocked(props := { blocking = true }) -> void:
set_process_input(false)
## Called when the GUI is unblocked. Makes the GUI to start processing input.
func _on_unblocked() -> void:
set_process_input(true)
## Called when the mouse enters (hovers) [param clickable]. It displays a text with the
## [member PopochiuClickable.description] in the [HoverText] component.
func _on_mouse_entered_clickable(clickable: PopochiuClickable) -> void:
if PopochiuUtils.g.is_blocked: return
if not PopochiuUtils.i.active:
PopochiuUtils.g.show_hover_text(clickable.description)
else:
PopochiuUtils.g.show_hover_text(
"Use %s with %s" % [PopochiuUtils.i.active.description, clickable.description]
)
## Called when the mouse exits [param clickable]. Clears the text in the [HoverText] component.
func _on_mouse_exited_clickable(clickable: PopochiuClickable) -> void:
if PopochiuUtils.g.is_blocked: return
PopochiuUtils.g.show_hover_text()
## Called when a dialogue line starts. It shows the [code]"wait"[/code] cursor.
func _on_dialog_line_started() -> void:
PopochiuUtils.cursor.hide()
## Called when a dialogue line finishes. It shows the [code]"normal"[/code] cursor.
func _on_dialog_line_finished() -> void:
PopochiuUtils.cursor.show()
## Called when a [PopochiuDialog] starts. It shows the [code]"gui"[/code] cursor.
func _on_dialog_started(_dialog: PopochiuDialog) -> void:
PopochiuUtils.cursor.show_cursor("gui")
## Called when the running [PopochiuDialog] shows its options on screen. It shows the
## [code]"gui"[/code] cursor.
func _on_dialog_options_shown() -> void:
PopochiuUtils.cursor.unblock()
PopochiuUtils.cursor.show_cursor("gui")
## Called when a [PopochiuDialog] finishes. It shows the cursor of the last active command.
func _on_dialog_finished(_dialog: PopochiuDialog) -> void:
PopochiuUtils.cursor.show_cursor(PopochiuUtils.e.get_current_command_name().to_snake_case())
## Called when the active [PopochiuInventoryItem] changes. If there is one, it hides the main cursor
## to show the one that shows the [member PopochiuInventoryItem.texture], otherwise it shows the
## default cursor.
func _on_inventory_item_selected(item: PopochiuInventoryItem) -> void:
if is_instance_valid(item):
PopochiuUtils.cursor.set_secondary_cursor_texture(item.texture, true)
PopochiuUtils.cursor.hide_main_cursor()
else:
PopochiuUtils.cursor.remove_secondary_cursor_texture()
PopochiuUtils.cursor.show_cursor()
## Called when the game is saved. By default, it shows [code]Game saved[/code] in the SystemText
## component.
func _on_game_saved() -> void:
PopochiuUtils.g.show_system_text("Game saved")
## Called when a game is loaded. [param loaded_game] has the loaded data. By default, it shows
## [code]Game loaded[/code] in the SystemText component.
func _on_game_loaded(loaded_game: Dictionary) -> void:
await PopochiuUtils.g.show_system_text("Game loaded")
super(loaded_game)
## Called by [b]cursor.gd[/b] to get the name of the cursor texture to show.
func _get_cursor_name() -> String:
return PopochiuUtils.e.get_current_command_name().to_snake_case()
#endregion
#region Private ####################################################################################
func _on_settings_option_selected(option_name: String) -> void:
match option_name:
"sound":
sierra_sound_popup.open()
"text":
text_settings_popup.open()
"save":
save_and_load_popup.open_save()
"load":
save_and_load_popup.open_load()
"quit":
quit_popup.open()
func _on_menu_visibility_changed():
if sierra_menu.visible:
sierra_bar.hide()
else:
sierra_bar.show()
#endregion

View file

@ -0,0 +1 @@
uid://bpuyqleq1uwh2

View file

@ -0,0 +1,178 @@
[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")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_xo8dr"]
atlas = ExtResource("13_udys2")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_yxgj0"]
atlas = ExtResource("13_udys2")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_p3f06"]
atlas = ExtResource("13_udys2")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_cvutg"]
atlas = ExtResource("13_udys2")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_hlutb"]
atlas = ExtResource("13_udys2")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_e0opo"]
atlas = ExtResource("13_udys2")
region = Rect2(0, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_eo6w8"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_vyqmk")
}],
"loop": true,
"name": &"gui",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_xo8dr")
}],
"loop": true,
"name": &"interact",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_yxgj0")
}],
"loop": true,
"name": &"look",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_p3f06")
}],
"loop": true,
"name": &"normal",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_cvutg")
}],
"loop": true,
"name": &"talk",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_hlutb")
}],
"loop": true,
"name": &"wait",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_e0opo")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[node name="SierraGUI" type="Control"]
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_3jlpr")
script = ExtResource("1_40nsv")
[node name="Cursor" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_eo6w8")
animation = &"gui"
offset = Vector2(16, 16)
[node name="SierraBar" parent="." instance=ExtResource("4_hjdb7")]
unique_name_in_owner = true
layout_mode = 1
[node name="SierraMenu" parent="." instance=ExtResource("5_ffq7i")]
unique_name_in_owner = true
layout_mode = 1
[node name="DialogPortrait" parent="." instance=ExtResource("5_nehoj")]
layout_mode = 1
[node name="DialogMenu" parent="." instance=ExtResource("14_3gq4k")]
visible = false
layout_mode = 1
[node name="SystemText" parent="." instance=ExtResource("18_x7swu")]
z_index = 1
layout_mode = 1
[node name="Popups" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="SierraInventoryPopup" parent="Popups" instance=ExtResource("15_2hyjp")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="SierraSettingsPopup" parent="Popups" instance=ExtResource("18_sv4ik")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="SierraSoundPopup" parent="Popups" instance=ExtResource("19_3kc82")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="TextSettingsPopup" parent="Popups" instance=ExtResource("20_anvsw")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="SaveAndLoadPopup" parent="Popups" instance=ExtResource("21_1xmwq")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="QuitPopup" parent="Popups" instance=ExtResource("24_50bps")]
unique_name_in_owner = true
visible = false
layout_mode = 1

View file

@ -0,0 +1,15 @@
[gd_resource type="Resource" script_class="PopochiuGUIInfo" load_steps=3 format=3 uid="uid://g70ov7n7io6l"]
[ext_resource type="Script" path="res://addons/popochiu/engine/others/popochiu_gui_info.gd" id="1_0p2sc"]
[ext_resource type="Texture2D" uid="uid://c7ncrxebt8ry" path="res://addons/popochiu/icons/ico_sierra.png" id="1_4w2ga"]
[resource]
script = ExtResource("1_0p2sc")
description = "- Use the Sierra Online commands: [b]Walk[/b], [b]Look[/b], [b]Interact[/b] and [b]Talk[/b]. Which can be selected in the top menu.
- [b]Left click[/b] to execute selected command.
- [b]Right click[/b] to change command.
- [b]Inventory popup[/b] which opens with a button in the top menu.
- [b]Settings popup[/b] which opens with a button in the top menu.
Like in games such as Gabriel Knight, Crusader King."
icon = ExtResource("1_4w2ga")

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bocign602kxhh"
path="res://.godot/imported/simple_click_cursor.png-8572f1aad61238225b3f0102a5d54ba7.ctex"
metadata={
"vram_texture": false
}
[deps]
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]
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

View file

@ -0,0 +1,60 @@
class_name SimpleClickCommands
extends PopochiuCommands
## Defines the commands and fallback methods for the 2-click Context-sensitive GUI.
##
## In this GUI, players interact with objects in the game based on the clicked mouse button.
## Usually, the left click is used to INTERACT with objects, while the RIGHT click is used to
## EXAMINE objects. This behavior is based on the one used in Beneath A Steel Sky and Broken Sword.
#region Public #####################################################################################
## Called by [Popochiu] when a command doesn't have an associated method.
func fallback() -> void:
if is_instance_valid(PopochiuUtils.e.clicked):
if PopochiuUtils.e.clicked.last_click_button == MOUSE_BUTTON_LEFT:
await click_clickable()
elif PopochiuUtils.e.clicked.last_click_button == MOUSE_BUTTON_RIGHT:
await right_click_clickable()
else:
await RenderingServer.frame_post_draw
if is_instance_valid(PopochiuUtils.i.clicked):
if PopochiuUtils.i.clicked.last_click_button == MOUSE_BUTTON_LEFT:
await click_inventory_item()
elif PopochiuUtils.i.clicked.last_click_button == MOUSE_BUTTON_RIGHT:
await right_click_inventory_item()
else:
await RenderingServer.frame_post_draw
## Called when players click (LMB) a [PopochiuClickable].
func click_clickable() -> void:
if PopochiuUtils.i.active:
await PopochiuUtils.g.show_system_text("Can't USE %s with %s" % [
PopochiuUtils.i.active.description, PopochiuUtils.e.clicked.description
])
else:
await PopochiuUtils.g.show_system_text("Can't INTERACT with it")
## Called when players right click (RMB) a [PopochiuClickable].
func right_click_clickable() -> void:
await PopochiuUtils.g.show_system_text("Can't EXAMINE it")
## Called when players click (LMB) a [PopochiuInvenoryItem].
func click_inventory_item() -> void:
if PopochiuUtils.i.active and PopochiuUtils.i.active != PopochiuUtils.i.clicked:
await PopochiuUtils.g.show_system_text("Can't USE %s with %s" % [
PopochiuUtils.i.active.description, PopochiuUtils.i.clicked.description
])
else:
PopochiuUtils.i.clicked.set_active()
## Called when players right click (RMB) a [PopochiuInvenoryItem].
func right_click_inventory_item() -> void:
await PopochiuUtils.g.show_system_text('Nothing to see in this item')
#endregion

View file

@ -0,0 +1 @@
uid://dqghvoqnyj6ct

View file

@ -0,0 +1,212 @@
class_name SimpleClickGUI
extends PopochiuGraphicInterface
## Defines the behavior of the 2-click Context-sensitive GUI.
##
## In this GUI, players interact with objects in the game based on the clicked mouse button. The
## inventory bar is in the top left corner of the screen, and the settings bar is in the top right
## corner of the screen.
@onready var settings_bar: Control = %SettingsBar
@onready var save_and_load_popup: Control = %SaveAndLoadPopup
@onready var text_settings_popup: Control = %TextSettingsPopup
@onready var sound_settings_popup: Control = %SoundSettingsPopup
@onready var history_popup: Control = %HistoryPopup
@onready var quit_popup: Control = %QuitPopup
#region Godot ######################################################################################
func _ready() -> void:
super()
# Connect to children's signals
settings_bar.option_selected.connect(_on_settings_option_selected)
# Connect to autoloads' signals
PopochiuUtils.cursor.replace_frames($Cursor)
PopochiuUtils.cursor.show_cursor()
$Cursor.hide()
#endregion
#region Virtual ####################################################################################
## Called when the GUI is blocked and not intended to handle input events.
func _on_blocked(props := { blocking = true }) -> void:
PopochiuUtils.cursor.show_cursor("wait")
PopochiuUtils.cursor.is_blocked = true
## Called when the GUI is unblocked and can handle input events again.
func _on_unblocked() -> void:
PopochiuUtils.cursor.is_blocked = false
if PopochiuUtils.i.active:
PopochiuUtils.cursor.hide_main_cursor()
PopochiuUtils.cursor.show_secondary_cursor()
elif PopochiuUtils.e.hovered:
# Fixes #315 by showing the right cursor when it is over a PopochiuClickable after closing
# the SystemText component
PopochiuUtils.cursor.show_cursor(
PopochiuUtils.cursor.get_type_name(PopochiuUtils.e.hovered.cursor)
)
else:
PopochiuUtils.cursor.show_cursor(get_cursor_name())
## Called when a text is shown in the [SystemText] component. This erases the text in the
## [HoverText] component and shows the [code]"wait"[/code] cursor.
func _on_system_text_shown(msg: String) -> void:
PopochiuUtils.g.show_hover_text()
PopochiuUtils.cursor.show_cursor("wait", true)
## Called when the [SystemText] component hides. If an [PopochiuInventoryItem] is active, the cursor
## takes its texture, otherwise it takes its default one.
func _on_system_text_hidden() -> void:
if PopochiuUtils.i.active:
PopochiuUtils.cursor.hide_main_cursor()
PopochiuUtils.cursor.show_secondary_cursor()
else:
PopochiuUtils.cursor.show_cursor()
## Called when the mouse enters (hovers) [param clickable]. It changes the texture of the cursor
## and displays a message with the [member PopochiuClickable.description] on the [HoverText]
## component.
func _on_mouse_entered_clickable(clickable: PopochiuClickable) -> void:
if PopochiuUtils.g.is_blocked: return
if not (PopochiuUtils.i.active or is_showing_dialog_line):
PopochiuUtils.cursor.show_cursor(PopochiuUtils.cursor.get_type_name(clickable.cursor))
if not PopochiuUtils.i.active:
PopochiuUtils.g.show_hover_text(clickable.description)
else:
PopochiuUtils.g.show_hover_text(
'Use %s with %s' % [PopochiuUtils.i.active.description, clickable.description]
)
## Called when the mouse exits [param clickable]. Clears the text in the [HoverText] component and
## shows the default cursor texture if there is no [PopochiuInventoryItem] active.
func _on_mouse_exited_clickable(clickable: PopochiuClickable) -> void:
PopochiuUtils.g.show_hover_text()
if PopochiuUtils.i.active or is_showing_dialog_line: return
PopochiuUtils.cursor.show_cursor("gui" if PopochiuUtils.d.current_dialog else "normal")
## Called when the mouse enters (hovers) [param inventory_item]. It changes the texture of the
## cursor and displays a message with the [member PopochiuInventoryItem.description] on the
## [HoverText] component.
func _on_mouse_entered_inventory_item(inventory_item: PopochiuInventoryItem) -> void:
if PopochiuUtils.g.is_blocked: return
if not PopochiuUtils.i.active:
PopochiuUtils.cursor.show_cursor(PopochiuUtils.cursor.get_type_name(inventory_item.cursor))
PopochiuUtils.g.show_hover_text(inventory_item.description)
elif PopochiuUtils.i.active != inventory_item:
PopochiuUtils.g.show_hover_text(
'Use %s with %s' % [PopochiuUtils.i.active.description, inventory_item.description]
)
else:
PopochiuUtils.g.show_hover_text(inventory_item.description)
## Called when the mouse exits [param inventory_item]. Clears the text in the [HoverText] component
## and shows the default cursor texture if there is no [PopochiuInventoryItem] active.
func _on_mouse_exited_inventory_item(inventory_item: PopochiuInventoryItem) -> void:
if PopochiuUtils.g.is_blocked: return
PopochiuUtils.g.show_hover_text()
if PopochiuUtils.i.active or $SettingsBar.is_open(): return
PopochiuUtils.cursor.show_cursor()
## Called when a dialog line starts. It shows the [code]"wait"[/code] cursor.
func _on_dialog_line_started() -> void:
is_showing_dialog_line = true
PopochiuUtils.cursor.show_cursor("wait")
## Called when a dialog line finishes. It shows the [code]"normal"[/code] cursor if there is no
## [PopochiuDialog] active, otherwise shows the [code]"use"[/code] cursor.
func _on_dialog_line_finished() -> void:
is_showing_dialog_line = false
if PopochiuUtils.d.current_dialog:
PopochiuUtils.cursor.show_cursor("gui")
elif PopochiuUtils.e.hovered:
PopochiuUtils.cursor.show_cursor(
PopochiuUtils.cursor.get_type_name(PopochiuUtils.e.hovered.cursor)
)
else:
PopochiuUtils.cursor.show_cursor("normal")
## Called when a [PopochiuDialog] starts. It shows the [code]"use"[/code] cursor and clears the
## [HoverText] component.
func _on_dialog_started(dialog: PopochiuDialog) -> void:
PopochiuUtils.cursor.show_cursor("gui")
PopochiuUtils.g.show_hover_text()
## Called when the running [PopochiuDialog] shows its options on screen. It shows the
## [code]"gui"[/code] cursor.
func _on_dialog_options_shown() -> void:
PopochiuUtils.cursor.unblock()
PopochiuUtils.cursor.show_cursor("gui")
## Called when a [PopochiuDialog] finishes. It shows the default cursor.
func _on_dialog_finished(dialog: PopochiuDialog) -> void:
PopochiuUtils.cursor.show_cursor()
## Called when the active [PopochiuInventoryItem] changes. If there is one, it hides the main cursor
## to show the one that shows the [member PopochiuInventoryItem.texture], otherwise it shows the
## default cursor.
func _on_inventory_item_selected(item: PopochiuInventoryItem) -> void:
if is_instance_valid(item):
PopochiuUtils.cursor.set_secondary_cursor_texture(item.texture)
PopochiuUtils.cursor.hide_main_cursor()
else:
PopochiuUtils.cursor.remove_secondary_cursor_texture()
PopochiuUtils.cursor.show_cursor()
## Called when the game is saved. By default, it shows [code]Game saved[/code] in the SystemText
## component.
func _on_game_saved() -> void:
PopochiuUtils.g.show_system_text("Game saved")
## Called when a game is loaded. [param loaded_game] has the loaded data. By default, it shows
## [code]Game loaded[/code] in the SystemText component.
func _on_game_loaded(loaded_game: Dictionary) -> void:
await PopochiuUtils.g.show_system_text("Game loaded")
super(loaded_game)
func _on_settings_option_selected(option_script_name: String) -> void:
match option_script_name:
"save":
save_and_load_popup.open_save()
"load":
save_and_load_popup.open_load()
"text_settings":
text_settings_popup.open()
"sound_settings":
sound_settings_popup.open()
"history":
history_popup.open()
"quit":
quit_popup.open()
#endregion

View file

@ -0,0 +1 @@
uid://b2bq0iyql0miu

View file

@ -0,0 +1,299 @@
[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/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")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="11"]
atlas = ExtResource("3_718yk")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="12"]
atlas = ExtResource("3_718yk")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="15"]
atlas = ExtResource("3_718yk")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="16"]
atlas = ExtResource("3_718yk")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_t3qtx"]
atlas = ExtResource("3_718yk")
region = Rect2(576, 0, 32, 32)
[sub_resource type="AtlasTexture" id="4"]
atlas = ExtResource("3_718yk")
region = Rect2(192, 0, 32, 32)
[sub_resource type="AtlasTexture" id="5"]
atlas = ExtResource("3_718yk")
region = Rect2(224, 0, 32, 32)
[sub_resource type="AtlasTexture" id="18"]
atlas = ExtResource("3_718yk")
region = Rect2(256, 0, 32, 32)
[sub_resource type="AtlasTexture" id="17"]
atlas = ExtResource("3_718yk")
region = Rect2(288, 0, 32, 32)
[sub_resource type="AtlasTexture" id="9"]
atlas = ExtResource("3_718yk")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="2"]
atlas = ExtResource("3_718yk")
region = Rect2(320, 0, 32, 32)
[sub_resource type="AtlasTexture" id="3"]
atlas = ExtResource("3_718yk")
region = Rect2(352, 0, 32, 32)
[sub_resource type="AtlasTexture" id="14"]
atlas = ExtResource("3_718yk")
region = Rect2(384, 0, 32, 32)
[sub_resource type="AtlasTexture" id="19"]
atlas = ExtResource("3_718yk")
region = Rect2(416, 0, 32, 32)
[sub_resource type="AtlasTexture" id="6"]
atlas = ExtResource("3_718yk")
region = Rect2(448, 0, 32, 32)
[sub_resource type="AtlasTexture" id="7"]
atlas = ExtResource("3_718yk")
region = Rect2(480, 0, 32, 32)
[sub_resource type="AtlasTexture" id="13"]
atlas = ExtResource("3_718yk")
region = Rect2(512, 0, 32, 32)
[sub_resource type="AtlasTexture" id="8"]
atlas = ExtResource("3_718yk")
region = Rect2(544, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_1bbe3"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("10")
}, {
"duration": 1.0,
"texture": SubResource("11")
}, {
"duration": 1.0,
"texture": SubResource("12")
}, {
"duration": 1.0,
"texture": SubResource("12")
}, {
"duration": 1.0,
"texture": SubResource("11")
}],
"loop": true,
"name": &"active",
"speed": 10.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("15")
}, {
"duration": 1.0,
"texture": SubResource("16")
}],
"loop": true,
"name": &"down",
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_t3qtx")
}],
"loop": true,
"name": &"gui",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("4")
}, {
"duration": 1.0,
"texture": SubResource("5")
}],
"loop": true,
"name": &"left",
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("18")
}],
"loop": false,
"name": &"look",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("17")
}],
"loop": false,
"name": &"none",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("9")
}],
"loop": false,
"name": &"normal",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("2")
}, {
"duration": 1.0,
"texture": SubResource("3")
}],
"loop": true,
"name": &"right",
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("14")
}],
"loop": false,
"name": &"search",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("19")
}],
"loop": false,
"name": &"talk",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("6")
}, {
"duration": 1.0,
"texture": SubResource("7")
}],
"loop": true,
"name": &"up",
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("13")
}],
"loop": false,
"name": &"use",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("8")
}],
"loop": false,
"name": &"wait",
"speed": 5.0
}]
[node name="SimpleClickGUI" type="Control"]
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_uf1ey")
script = ExtResource("1_268ni")
[node name="Cursor" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_1bbe3")
animation = &"wait"
[node name="HoverText" parent="." instance=ExtResource("2_6qu0l")]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
offset_top = -19.0
offset_bottom = -4.0
grow_vertical = 0
hide_during_dialogs = true
[node name="DialogCaption" parent="." instance=ExtResource("5_t54kn")]
layout_mode = 1
[node name="DialogMenu" parent="." instance=ExtResource("5_ayg0j")]
visible = false
layout_mode = 1
[node name="InventoryBar" parent="." instance=ExtResource("6_ovwnh")]
layout_mode = 1
[node name="SettingsBar" parent="." instance=ExtResource("7_mtpwc")]
unique_name_in_owner = true
layout_mode = 1
[node name="SystemText" parent="." instance=ExtResource("4_o82xq")]
layout_mode = 1
[node name="Popups" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="SaveAndLoadPopup" parent="Popups" instance=ExtResource("9_ueme0")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="TextSettingsPopup" parent="Popups" instance=ExtResource("13_dn3wu")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="SoundSettingsPopup" parent="Popups" instance=ExtResource("10_csjib")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="HistoryPopup" parent="Popups" instance=ExtResource("8_207hf")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="QuitPopup" parent="Popups" instance=ExtResource("14_m3nqq")]
unique_name_in_owner = true
visible = false
layout_mode = 1

View file

@ -0,0 +1,15 @@
[gd_resource type="Resource" script_class="PopochiuGUIInfo" load_steps=3 format=3 uid="uid://b8ywbuj4wcljy"]
[ext_resource type="Script" path="res://addons/popochiu/engine/others/popochiu_gui_info.gd" id="1_bvg81"]
[ext_resource type="Texture2D" uid="uid://d0kfwop28dwxj" path="res://addons/popochiu/icons/ico_simple_click.png" id="1_sp7kq"]
[resource]
script = ExtResource("1_bvg81")
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).
- [b]Settings bar[/b] on top-right corner (by default).
Like in games such as Beneath A Steel Sky, Broken Sword, Samorost, Machinarium."
icon = ExtResource("1_sp7kq")