Compare commits
2 Commits
628da80ed3
...
hint_box
| Author | SHA1 | Date | |
|---|---|---|---|
| 77a7441400 | |||
| d8b427de8f |
+7
-2
@@ -18,6 +18,7 @@ config/icon="res://icon.svg"
|
||||
[autoload]
|
||||
|
||||
Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd"
|
||||
HelpBox="*res://scripts/HelpBox.gd"
|
||||
|
||||
[dialogic]
|
||||
|
||||
@@ -27,7 +28,9 @@ directories/dch_directory={
|
||||
directories/dtl_directory={
|
||||
"test_time_line": "res://dialog/test_time_line.dtl"
|
||||
}
|
||||
variables={}
|
||||
variables={
|
||||
"TestVariable": "none"
|
||||
}
|
||||
glossary/default_case_sensitive=true
|
||||
layout/style_list=[]
|
||||
layout/default_style="Default"
|
||||
@@ -65,6 +68,8 @@ text/autopauses={}
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=1920
|
||||
window/size/viewport_height=1080
|
||||
window/size/always_on_top=true
|
||||
|
||||
[dotnet]
|
||||
@@ -114,4 +119,4 @@ click={
|
||||
|
||||
[internationalization]
|
||||
|
||||
locale/translations=PackedStringArray("res://dialog/translations/dialogic_character_translations.en.translation", "res://dialog/translations/dialogic_test_time_line_translation.de.translation", "res://dialog/translations/dialogic_test_time_line_translation.en.translation", "res://dialog/translations/dialogic_character_translations.de.translation")
|
||||
locale/translations=PackedStringArray("res://dialog/translations/dialogic_character_translations.en.translation", "res://dialog/translations/dialogic_test_time_line_translation.de.translation", "res://dialog/translations/dialogic_test_time_line_translation.en.translation", "res://dialog/translations/dialogic_character_translations.de.translation", "res://dialog/translations/dialogic_semi_cat_translation.de.translation", "res://dialog/translations/dialogic_semi_cat_translation.en.translation")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=32 format=3 uid="uid://c1j5u0cjdswvp"]
|
||||
[gd_scene load_steps=33 format=3 uid="uid://vxj2hkqp3gpx"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cg1cxmqbo1pa" path="res://graphics/mockups/darktree1.png" id="1_u6vd6"]
|
||||
[ext_resource type="Texture2D" uid="uid://fcm6etmmj65d" path="res://graphics/mockups/darktree2.png" id="2_tcvf7"]
|
||||
@@ -26,7 +26,8 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dfynp0xqtpcke" path="res://graphics/testingground/chestnut1.png" id="24_ohuks"]
|
||||
[ext_resource type="Texture2D" uid="uid://63rgrra0tdef" path="res://graphics/testingground/chestnut2.png" id="25_j83yj"]
|
||||
[ext_resource type="Texture2D" uid="uid://cygt1j1m0vpqg" path="res://graphics/mockups/field_placeholder.png" id="26_7nyv4"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbd1niu3tp8y5" path="res://scenes/props/Player3D.tscn" id="27_mqdni"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/props/Player3D.tscn" id="27_mqdni"]
|
||||
[ext_resource type="PackedScene" uid="uid://ba238rhu5e887" path="res://scenes/props/ui_help_overlay.tscn" id="28_jn4e8"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_8dxh5"]
|
||||
|
||||
@@ -1360,3 +1361,5 @@ texture = ExtResource("26_7nyv4")
|
||||
|
||||
[node name="Player3d" parent="." instance=ExtResource("27_mqdni")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.110292, 0.0067718, 0.0825893)
|
||||
|
||||
[node name="UiHelpOverlay" parent="." instance=ExtResource("28_jn4e8")]
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ba238rhu5e887"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/HelpBoxContainer.gd" id="1_qafrk"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ots6x"]
|
||||
|
||||
[node name="UiHelpOverlay" type="Node2D"]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="CanvasLayer"]
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -77.0
|
||||
offset_top = -110.0
|
||||
offset_right = -19.0
|
||||
offset_bottom = -20.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ots6x")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="CanvasLayer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_qafrk")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer/PanelContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasLayer/PanelContainer/PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 51
|
||||
text = "H"
|
||||
@@ -0,0 +1,26 @@
|
||||
extends Node
|
||||
|
||||
var container: HelpBoxContainer
|
||||
|
||||
func showHelp(text:String)->void:
|
||||
container.showHelp(text)
|
||||
|
||||
func hideHelp()->void:
|
||||
container.hideHelp()
|
||||
|
||||
func registerContainer(container: HelpBoxContainer)->void:
|
||||
self.container = container
|
||||
|
||||
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
|
||||
if event.is_action_pressed("ui_left"):
|
||||
HelpBox.showHelp("This is a test help text.")
|
||||
|
||||
if event.is_action_pressed("ui_right"):
|
||||
HelpBox.hideHelp()
|
||||
|
||||
if event.is_action_pressed("ui_up"):
|
||||
Dialogic.start_timeline("test_time_line")
|
||||
@@ -0,0 +1,55 @@
|
||||
extends PanelContainer
|
||||
class_name HelpBoxContainer
|
||||
|
||||
@onready var textLabel: Label = $MarginContainer/Label
|
||||
var animationTween:Tween
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
HelpBox.registerContainer(self)
|
||||
await get_tree().process_frame
|
||||
hideHelpInstant()
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func showHelp(text: String) -> void:
|
||||
textLabel.text = text
|
||||
if animationTween:
|
||||
animationTween.kill()
|
||||
|
||||
visible = false
|
||||
visible = true
|
||||
|
||||
var offset = get_rect().size.x + 40
|
||||
|
||||
animationTween = get_tree().create_tween()
|
||||
animationTween.set_ease(Tween.EASE_OUT)
|
||||
animationTween.set_trans(Tween.TRANS_QUAD)
|
||||
animationTween.tween_property(self, "position:x", 0, .5).from(offset)
|
||||
|
||||
|
||||
func hideHelp() -> void:
|
||||
|
||||
if animationTween:
|
||||
animationTween.kill()
|
||||
|
||||
var offset = get_rect().size.x + 40
|
||||
|
||||
animationTween = get_tree().create_tween()
|
||||
animationTween.set_ease(Tween.EASE_IN)
|
||||
animationTween.set_trans(Tween.TRANS_QUAD)
|
||||
animationTween.tween_property(self, "position:x", offset, .5)
|
||||
|
||||
func hideHelpInstant() -> void:
|
||||
if animationTween:
|
||||
animationTween.kill()
|
||||
|
||||
var offset = get_rect().size.x + 40
|
||||
|
||||
animationTween = get_tree().create_tween()
|
||||
animationTween.set_ease(Tween.EASE_IN)
|
||||
animationTween.set_trans(Tween.TRANS_QUAD)
|
||||
animationTween.tween_property(self, "position:x", offset, 0)
|
||||
|
||||
Reference in New Issue
Block a user