First commit 🎉
This commit is contained in:
commit
43ea213f9b
728 changed files with 37080 additions and 0 deletions
39
game/gui/components/hover_text/hover_text.gd
Normal file
39
game/gui/components/hover_text/hover_text.gd
Normal file
|
@ -0,0 +1,39 @@
|
|||
extends Control
|
||||
class_name GUIHoverText
|
||||
|
||||
@export var hide_during_dialogs := false
|
||||
|
||||
@onready var label: RichTextLabel = $RichTextLabel
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready() -> void:
|
||||
label.text = ""
|
||||
|
||||
# Connect to autoloads' signals
|
||||
PopochiuUtils.g.hover_text_shown.connect(_show_text)
|
||||
PopochiuUtils.g.dialog_line_started.connect(_on_dialog_line_started)
|
||||
PopochiuUtils.g.dialog_line_finished.connect(_on_dialog_line_finished)
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Virtual ####################################################################################
|
||||
func _show_text(txt := "") -> void:
|
||||
label.text = "[center]%s[/center]" % txt
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private ####################################################################################
|
||||
func _on_dialog_line_started() -> void:
|
||||
if hide_during_dialogs:
|
||||
hide()
|
||||
|
||||
|
||||
func _on_dialog_line_finished() -> void:
|
||||
if hide_during_dialogs:
|
||||
show()
|
||||
|
||||
|
||||
#endregion
|
1
game/gui/components/hover_text/hover_text.gd.uid
Normal file
1
game/gui/components/hover_text/hover_text.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dpntx5tuyavax
|
29
game/gui/components/hover_text/hover_text.tscn
Normal file
29
game/gui/components/hover_text/hover_text.tscn
Normal file
|
@ -0,0 +1,29 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://b71fus0srl1s6"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://djl1xk7jgyvpp" path="res://game/gui/resources/gui_theme.tres" id="1_3qkco"]
|
||||
[ext_resource type="Script" uid="uid://cctf1a46ej4r" path="res://game/gui/components/hover_text/hover_text_custom.gd" id="2_18lgb"]
|
||||
|
||||
[node name="HoverText" type="Control" groups=["popochiu_gui_component"]]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("1_3qkco")
|
||||
script = ExtResource("2_18lgb")
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 12.0
|
||||
grow_horizontal = 2
|
||||
mouse_filter = 2
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 4
|
||||
bbcode_enabled = true
|
||||
text = "[center]text for hovered objects[/center]"
|
||||
fit_content = true
|
||||
scroll_active = false
|
1
game/gui/components/hover_text/hover_text_custom.gd
Normal file
1
game/gui/components/hover_text/hover_text_custom.gd
Normal file
|
@ -0,0 +1 @@
|
|||
extends "hover_text.gd"
|
1
game/gui/components/hover_text/hover_text_custom.gd.uid
Normal file
1
game/gui/components/hover_text/hover_text_custom.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://cctf1a46ej4r
|
Loading…
Add table
Add a link
Reference in a new issue