Skip to content

Commit

Permalink
refs #264: Make ALL GUIs open their popups the same way. (#272)
Browse files Browse the repository at this point in the history
Instead of relying on IGraphicInterface methods and signals, each GUI
handles local signals to decide which popup to open. This change
affected the Simple Click and the 9 Verb GUIs.

- **upd** Remove unused images in the Sierra GUI.
- **upd** Update button style for CheckBox Buttons in
  base_gui_theme.tres.
  • Loading branch information
mapedorr authored Sep 8, 2024
1 parent b0a4fc4 commit 1cde06a
Show file tree
Hide file tree
Showing 42 changed files with 168 additions and 466 deletions.
41 changes: 0 additions & 41 deletions addons/popochiu/engine/interfaces/i_graphic_interface.gd
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,6 @@ signal popup_requested(script_name: StringName)
# NOTE: Maybe add some signals for clicking objects and items
#signal clicked_clickable(clickable: PopochiuClickable)
#signal clicked_inventory_item(inventory_item: PopochiuInventoryItem)
# TODO: deprecate this
## Emitted when [method show_history] is called in order to open the History popup.
signal history_opened
## Emitted to open the popup to save the game. You can specify the name of the saved game with
# TODO: deprecate this
## [param slot_text].
signal save_requested(slot_text: String)
# TODO: deprecate this
## Emitted to open the popup to load the game.
signal load_requested
# TODO: deprecate this
## Emitted to open the popup that allows to change the volume of the audio buses in the game.
signal sound_settings_requested
## Emitted to open the popup that allows to change the typing speed and autoadvance in dialogues.
signal text_settings_requested
## Emitted when the dialog options of the running [PopochiuDialog] are shown.
signal dialog_options_shown
## Emitted when a game is loaded and the GUI has shown (or not shown) a notification to the player.
Expand Down Expand Up @@ -168,32 +153,6 @@ func queue_show_interface() -> Callable:
return func(): show_interface()


## Emits [signal history_opened] to open the History popup.
func show_history() -> void:
history_opened.emit()


## Emits [signal save_requested] to open the Save popup. [param slot_text] will be used as the
## name of the saved game.
func show_save(slot_text := "") -> void:
save_requested.emit(slot_text)


## Emits [signal load_requested] to open the Load popup.
func show_load() -> void:
load_requested.emit()


## Emits [signal sound_settings_requested] to open the popup that allows changing the volume of the
## audio buses in the game.
func show_sound_settings() -> void:
sound_settings_requested.emit()

## Emits [signal texts_settings_requested] to open the popup that allows changing the text speed
## and toggle the dialogue auto advancement
func show_text_settings() -> void:
text_settings_requested.emit()

## Returns the name of the cursor texture to show.
func get_cursor_name() -> String:
if not is_instance_valid(gui): return ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ func _ready() -> void:

if Engine.is_editor_hint(): return

# Connect to singletons signals
G.history_opened.connect(open)

for c in lines_list.get_children():
(c as Control).queue_free()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ func _ready() -> void:

btn_ok.disabled = true

# Connect to singletons signals
G.save_requested.connect(_show_save)
G.load_requested.connect(_show_load)

var saves: Dictionary = E.get_saves_descriptions()

for btn: Button in slots.get_children():
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ extends PopochiuPopup
@onready var sound_volumes: GridContainer = %SoundVolumes


#region Godot ######################################################################################
func _ready() -> void:
super()

if Engine.is_editor_hint(): return

# Connect to singletons signals
G.sound_settings_requested.connect(open)


#endregion

#region Virtual ####################################################################################
func _open() -> void:
sound_volumes.update_sliders()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ func _ready() -> void:
dialog_style.item_selected.connect(_on_dialog_style_selected)
continue_mode.toggled.connect(_on_continue_mode_toggled)

# Connect to singletons signals
G.text_settings_requested.connect(open)


#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5015x"]

[node name="TextPopup" type="Control" groups=["popochiu_gui_popup"]]
[node name="TextSettingsPopup" type="Control" groups=["popochiu_gui_popup"]]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,3 @@ func _ready() -> void:


#endregion

#region Virtual ####################################################################################
func _on_pressed() -> void:
G.show_load()


#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,3 @@ func _ready() -> void:


#endregion

#region Virtual ####################################################################################
func _on_pressed() -> void:
G.popup_requested.emit("QuitPopup")


#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@ extends TextureButton

#region Godot ######################################################################################
func _ready() -> void:
pressed.connect(_on_pressed)
mouse_entered.connect(_on_mouse_entered)
mouse_exited.connect(_on_mouse_exited)


#endregion

#region Virtual ####################################################################################
func _on_pressed() -> void:
pass


#endregion

#region SetGet #####################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cyvd8h2ouw8rg"
path="res://.godot/imported/btn_audio.png-e06282bc1839828ec7b2ef37d0b657ef.ctex"
path="res://.godot/imported/btn_audio.png-0e4052f1dae1f1f9c4ac0c708f040b4f.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_audio.png"
dest_files=["res://.godot/imported/btn_audio.png-e06282bc1839828ec7b2ef37d0b657ef.ctex"]
source_file="res://addons/popochiu/engine/objects/gui/components/settings_bar/images/btn_audio.png"
dest_files=["res://.godot/imported/btn_audio.png-0e4052f1dae1f1f9c4ac0c708f040b4f.ctex"]

[params]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bg1txcy1ofatq"
path="res://.godot/imported/btn_dialog_history.png-a64af85fc34450a76c4c7b4c5184db4f.ctex"
path="res://.godot/imported/btn_dialog_history.png-5e6b81c2188724ad496fcf8877a9452a.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_dialog_history.png"
dest_files=["res://.godot/imported/btn_dialog_history.png-a64af85fc34450a76c4c7b4c5184db4f.ctex"]
source_file="res://addons/popochiu/engine/objects/gui/components/settings_bar/images/btn_dialog_history.png"
dest_files=["res://.godot/imported/btn_dialog_history.png-5e6b81c2188724ad496fcf8877a9452a.ctex"]

[params]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bns33w6nl2qkb"
path="res://.godot/imported/btn_load.png-220c006d572e8cf298bde9addcd288c3.ctex"
path="res://.godot/imported/btn_load.png-ecbfe8ff6b76c734e44ba7e7e6bdcc9b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://addons/popochiu/engine/objects/gui/templates/simple_click/components/settings_bar/images/btn_load.png"
dest_files=["res://.godot/imported/btn_load.png-220c006d572e8cf298bde9addcd288c3.ctex"]
source_file="res://addons/popochiu/engine/objects/gui/components/settings_bar/images/btn_load.png"
dest_files=["res://.godot/imported/btn_load.png-ecbfe8ff6b76c734e44ba7e7e6bdcc9b.ctex"]

[params]

Expand Down
Loading

0 comments on commit 1cde06a

Please sign in to comment.