Merge pull request #615 from WallK/feat/godot-configurator-w

Rekku Help text from element description and theme fixes
This commit is contained in:
XargonWan 2023-12-21 14:14:03 +01:00 committed by GitHub
commit 610123961d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 272 additions and 134 deletions

View file

@ -0,0 +1,5 @@
extends Control
func _input(event):
if event.is_action_pressed("rekku_hide"):
self.visible = !self.visible

View file

@ -1,18 +1,13 @@
extends RichTextLabel
var selected_element
@onready var helper_text_node = self
# Called when the node enters the scene tree for the first time.
func _ready():
# Get a reference to the helper_text node
var helper_text_node = $bubble/helper_text
# Ensure that the helper_text node exists before trying to access it
if helper_text_node != null:
# Set the text of the helper_text node only if the element is selected and has the 'description' variable
if selected_element != null and selected_element.has("description"):
helper_text_node.text = selected_element.description
else:
helper_text_node.text = ""
# Connect the signal that gets fired on every focus change
get_viewport().connect("gui_focus_changed", _on_focus_changed)
func _on_focus_changed(selected_element:Control) -> void:
if selected_element != null and selected_element.has_meta("description"):
helper_text_node.text = selected_element.get_meta("description")
else:
print("Error: helper_text node not found!")
helper_text_node.text = "Hey, there's no description"

View file

@ -2,3 +2,7 @@ extends Control
func _ready():
$MarginContainer/TabContainer/System/ScrollContainer/VBoxContainer/game_control_container/GridContainer/resume.grab_focus() #Required to enable controller focusing
func _input(event):
if event.is_action_pressed("quit"):
get_tree().quit()

View file

@ -1,8 +1,10 @@
[gd_scene load_steps=14 format=3 uid="uid://61f6m4r1mpan"]
[gd_scene load_steps=17 format=3 uid="uid://61f6m4r1mpan"]
[ext_resource type="Texture2D" uid="uid://bv6vh33cnfaw4" path="res://icon.svg" id="1_axfei"]
[ext_resource type="Script" path="res://main.gd" id="1_obpq7"]
[ext_resource type="AudioStream" uid="uid://dig4pco500pyt" path="res://res/configurator.mp3" id="3_xivj6"]
[ext_resource type="Texture2D" uid="uid://dx0u5hiwxfgu5" path="res://res/pixel_ui_theme/8x8_ui_elements.png" id="4_2tuu4"]
[ext_resource type="Script" path="res://Rekku.gd" id="4_nqqx3"]
[ext_resource type="Script" path="res://helper_text.gd" id="5_cprkf"]
[ext_resource type="Texture2D" uid="uid://cor8ep0fkqm08" path="res://res/Rekku/base.png" id="9_brsrf"]
[ext_resource type="Texture2D" uid="uid://cavtn1rljc5oe" path="res://res/Rekku/eyes-open.png" id="10_y6gkh"]
@ -12,6 +14,15 @@
[ext_resource type="Texture2D" uid="uid://kx8eypf4ffvu" path="res://res/Rekku/mouth-base.png" id="14_lnkoa"]
[ext_resource type="Texture2D" uid="uid://b6gl8sltbak7v" path="res://res/Rekku/mouth-O.png" id="15_1sikj"]
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_rf0rc"]
texture = ExtResource("4_2tuu4")
texture_margin_left = 6.0
texture_margin_top = 6.0
texture_margin_right = 6.0
texture_margin_bottom = 6.0
region_rect = Rect2(0, 8, 16, 16)
modulate_color = Color(0.65098, 0.403922, 0.819608, 1)
[sub_resource type="SpriteFrames" id="SpriteFrames_trwmf"]
animations = [{
"frames": [{
@ -130,6 +141,7 @@ layout_mode = 2
theme_override_constants/h_separation = 128
button_pressed = true
text = "Quick Resume"
metadata/description = "This is a test description set to this element"
[node name="Button" type="Button" parent="MarginContainer/TabContainer/System/ScrollContainer/VBoxContainer/game_control_container/GridContainer"]
layout_mode = 2
@ -140,6 +152,7 @@ text = "Advanced"
layout_mode = 2
theme_override_constants/h_separation = 256
text = "Rewind"
metadata/description = "This is another description. Very long text anyone? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
[node name="Button2" type="Button" parent="MarginContainer/TabContainer/System/ScrollContainer/VBoxContainer/game_control_container/GridContainer"]
layout_mode = 2
@ -777,53 +790,11 @@ position = Vector2(998, 212)
scale = Vector2(0.507812, 0.507812)
texture = ExtResource("1_axfei")
[node name="bubble" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 376.0
offset_top = 612.0
offset_right = -282.0
offset_bottom = -68.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.133333, 0.0470588, 0.188235, 1)
[node name="helper_text" type="RichTextLabel" parent="bubble"]
layout_mode = 2
offset_left = 10.0
offset_top = 9.0
offset_right = 603.0
offset_bottom = 121.0
text = "Rekku:
When \"Quick Resume\" is enabled, a savestate is created upon quit and it will be loaded once the game is started.
This is mot working on the following systems: Switch, WiiU."
scroll_following = true
script = ExtResource("5_cprkf")
[node name="Rekku" type="Sprite2D" parent="."]
position = Vector2(1125, 586)
scale = Vector2(0.292969, 0.292969)
texture = ExtResource("9_brsrf")
[node name="blink" type="AnimatedSprite2D" parent="Rekku"]
sprite_frames = SubResource("SpriteFrames_trwmf")
animation = &"blink"
autoplay = "blink"
frame_progress = 0.299789
[node name="speech" type="AnimatedSprite2D" parent="Rekku"]
sprite_frames = SubResource("SpriteFrames_p8gbs")
animation = &"speech"
frame_progress = 0.664627
[node name="coltroller_guide" type="PanelContainer" parent="."]
layout_mode = 0
offset_left = 1.0
offset_top = 767.0
offset_right = 1281.0
offset_top = 762.0
offset_right = 1280.0
offset_bottom = 800.0
[node name="controller_guide_text" type="RichTextLabel" parent="coltroller_guide"]
@ -833,3 +804,63 @@ theme_override_font_sizes/normal_font_size = 32
text = "(A) Accept (B) Back (Y) Call/Dismiss Rekku (X) ??? (L/R) Tab Switch"
fit_content = true
scroll_active = false
[node name="Rekku" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("4_nqqx3")
[node name="bubble" type="Panel" parent="Rekku"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -310.0
offset_top = -206.0
offset_right = 310.0
offset_bottom = -66.0
grow_horizontal = 2
grow_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxTexture_rf0rc")
[node name="helper_text" type="RichTextLabel" parent="Rekku/bubble"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -300.0
offset_top = -60.0
offset_right = 300.0
offset_bottom = 60.0
grow_horizontal = 2
grow_vertical = 2
text = "Rekku:
When \"Quick Resume\" is enabled, a savestate is created upon quit and it will be loaded once the game is started.
This is mot working on the following systems: Switch, WiiU."
scroll_following = true
script = ExtResource("5_cprkf")
[node name="RekkuSprite" type="Sprite2D" parent="Rekku"]
position = Vector2(1125, 586)
scale = Vector2(0.292969, 0.292969)
texture = ExtResource("9_brsrf")
[node name="blink" type="AnimatedSprite2D" parent="Rekku/RekkuSprite"]
sprite_frames = SubResource("SpriteFrames_trwmf")
animation = &"blink"
autoplay = "blink"
frame_progress = 0.299789
[node name="speech" type="AnimatedSprite2D" parent="Rekku/RekkuSprite"]
sprite_frames = SubResource("SpriteFrames_p8gbs")
animation = &"speech"
frame_progress = 0.664627

View file

@ -39,6 +39,29 @@ ui_accept={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
ui_select={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"echo":false,"script":null)
]
}
ui_cancel={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194305,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
]
}
rekku_hide={
"deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":3,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":72,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
]
}
quit={
"deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":81,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
]
}
[rendering]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

File diff suppressed because one or more lines are too long