Change out floor prompt message

This commit is contained in:
2024-09-13 17:07:47 -07:00
parent 1d7d70e033
commit 8ea532bcfa
12 changed files with 274 additions and 163 deletions

View File

@@ -1,6 +0,0 @@
~ floor_exit
Proceed to the next floor?
- Yes
do GoToNextFloor()
- No
=> END

View File

@@ -1,15 +0,0 @@
[remap]
importer="dialogue_manager_compiler_12"
type="Resource"
uid="uid://6bhfbvi6jbms"
path="res://.godot/imported/FloorExit.dialogue-d2fbe7fb8dbc88a2f9b0dc79a5124041.tres"
[deps]
source_file="res://src/ui/dialogue/FloorExit.dialogue"
dest_files=["res://.godot/imported/FloorExit.dialogue-d2fbe7fb8dbc88a2f9b0dc79a5124041.tres"]
[params]
defaults=true

View File

@@ -1,77 +1,12 @@
[gd_scene load_steps=17 format=3 uid="uid://b1muxus5qdbeu"]
[gd_scene load_steps=7 format=3 uid="uid://b1muxus5qdbeu"]
[ext_resource type="Script" path="res://src/ui/in_game_ui/InGameUI.cs" id="1_sc13i"]
[ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"]
[ext_resource type="PackedScene" uid="uid://dlj8qdg1c5048" path="res://src/inventory_menu/InventoryMenu.tscn" id="3_4vcdl"]
[ext_resource type="PackedScene" uid="uid://dxl8il8f13c2x" path="res://src/ui/player_ui/PlayerInfoUI.tscn" id="4_46s5l"]
[ext_resource type="FontFile" uid="uid://cm8j5vcdop5x0" path="res://src/ui/fonts/Mrs-Eaves-OT-Roman_31443.ttf" id="5_pmvvi"]
[ext_resource type="Script" path="res://src/ui/in_game_ui/UseTeleportPrompt.cs" id="5_uhl2q"]
[ext_resource type="PackedScene" uid="uid://bea2waybmgd6u" path="res://src/ui/teleport_prompt/UseTeleportPrompt.tscn" id="5_h1hgq"]
[ext_resource type="Script" path="res://src/utils/FpsCounter.cs" id="7_c6o8j"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ahhj2"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1tca4"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_crnka"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_yoep7"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cmr8o"]
[sub_resource type="Animation" id="Animation_efhb5"]
resource_name = "fade_in"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_ibgld"]
resource_name = "fade_out"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="Animation_xrfau"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7x216"]
_data = {
"RESET": SubResource("Animation_xrfau"),
"fade_in": SubResource("Animation_efhb5"),
"fade_out": SubResource("Animation_ibgld")
}
[node name="InGameUI" type="Control"]
process_mode = 3
custom_minimum_size = Vector2(1920, 1080)
@@ -100,73 +35,10 @@ process_mode = 3
visible = false
layout_mode = 1
[node name="UseTeleportPrompt" type="Control" parent="."]
[node name="UseTeleportPrompt" parent="." instance=ExtResource("5_h1hgq")]
unique_name_in_owner = true
visible = false
modulate = Color(1, 1, 1, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("5_uhl2q")
[node name="CenterContainer" type="CenterContainer" parent="UseTeleportPrompt"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="UseTeleportPrompt/CenterContainer"]
layout_mode = 2
[node name="MovePrompt" type="Label" parent="UseTeleportPrompt/CenterContainer/VBoxContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.737255, 0.705882, 0.690196, 1)
theme_override_fonts/font = ExtResource("5_pmvvi")
theme_override_font_sizes/font_size = 50
theme_override_styles/normal = SubResource("StyleBoxEmpty_ahhj2")
text = "Move to the next floor?"
[node name="YesButton" type="Button" parent="UseTeleportPrompt/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
focus_neighbor_left = NodePath(".")
focus_neighbor_top = NodePath(".")
focus_neighbor_right = NodePath(".")
focus_neighbor_bottom = NodePath("../NoButton")
theme_override_colors/font_focus_color = Color(1, 0.94902, 0, 1)
theme_override_colors/font_color = Color(0.737255, 0.705882, 0.690196, 1)
theme_override_fonts/font = ExtResource("5_pmvvi")
theme_override_font_sizes/font_size = 50
theme_override_styles/focus = SubResource("StyleBoxEmpty_1tca4")
theme_override_styles/normal = SubResource("StyleBoxEmpty_crnka")
button_mask = 0
text = "Yes"
[node name="NoButton" type="Button" parent="UseTeleportPrompt/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_left = NodePath(".")
focus_neighbor_top = NodePath("../YesButton")
focus_neighbor_right = NodePath(".")
focus_neighbor_bottom = NodePath(".")
theme_override_colors/font_focus_color = Color(1, 0.94902, 0, 1)
theme_override_colors/font_color = Color(0.737255, 0.705882, 0.690196, 1)
theme_override_fonts/font = ExtResource("5_pmvvi")
theme_override_font_sizes/font_size = 50
theme_override_styles/focus = SubResource("StyleBoxEmpty_yoep7")
theme_override_styles/normal = SubResource("StyleBoxEmpty_cmr8o")
button_mask = 0
text = "No"
[node name="AnimationPlayer" type="AnimationPlayer" parent="UseTeleportPrompt"]
libraries = {
"": SubResource("AnimationLibrary_7x216")
}
[node name="Label" type="Label" parent="."]
layout_mode = 1

View File

@@ -3,11 +3,26 @@ using Chickensoft.GodotNodeInterfaces;
using Chickensoft.Introspection;
using Godot;
public interface IUseTeleportPrompt : IControl;
public interface IUseTeleportPrompt : IControl
{
event UseTeleportPrompt.TeleportToNextFloorEventHandler TeleportToNextFloor;
event UseTeleportPrompt.CloseTeleportPromptEventHandler CloseTeleportPrompt;
public void FadeIn();
public void FadeOut();
}
[Meta(typeof(IAutoNode))]
public partial class UseTeleportPrompt : Control
public partial class UseTeleportPrompt : Control, IUseTeleportPrompt
{
public override void _Notification(int what) => this.Notify(what);
[Signal]
public delegate void TeleportToNextFloorEventHandler();
[Signal]
public delegate void CloseTeleportPromptEventHandler();
[Node] public Button YesButton { get; set; } = default!;
[Node] public Button NoButton { get; set; } = default!;
@@ -17,6 +32,21 @@ public partial class UseTeleportPrompt : Control
public void OnResolved()
{
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
YesButton.Pressed += YesButton_Pressed;
NoButton.Pressed += NoButton_Pressed;
}
public void FadeIn() => AnimationPlayer.Play("fade_in");
public void FadeOut() => AnimationPlayer.Play("fade_out");
private void NoButton_Pressed()
{
EmitSignal(SignalName.CloseTeleportPrompt);
}
private void YesButton_Pressed()
{
EmitSignal(SignalName.TeleportToNextFloor);
}
private void AnimationPlayer_AnimationFinished(StringName animName)

View File

@@ -0,0 +1,179 @@
[gd_scene load_steps=14 format=3 uid="uid://bea2waybmgd6u"]
[ext_resource type="Script" path="res://src/ui/in_game_ui/UseTeleportPrompt.cs" id="1_x3wkp"]
[ext_resource type="FontFile" uid="uid://cm8j5vcdop5x0" path="res://src/ui/fonts/Mrs-Eaves-OT-Roman_31443.ttf" id="2_i6kb2"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ahhj2"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1tca4"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1pd8j"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_crnka"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_yoep7"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_svmjr"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cmr8o"]
[sub_resource type="Animation" id="Animation_xrfau"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_efhb5"]
resource_name = "fade_in"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_ibgld"]
resource_name = "fade_out"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.5),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7x216"]
_data = {
"RESET": SubResource("Animation_xrfau"),
"fade_in": SubResource("Animation_efhb5"),
"fade_out": SubResource("Animation_ibgld")
}
[node name="UseTeleportPrompt" type="Control"]
process_mode = 3
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_x3wkp")
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="MovePrompt" type="Label" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.737255, 0.705882, 0.690196, 1)
theme_override_fonts/font = ExtResource("2_i6kb2")
theme_override_font_sizes/font_size = 50
theme_override_styles/normal = SubResource("StyleBoxEmpty_ahhj2")
text = "Move to the next floor?"
[node name="YesButton" type="Button" parent="CenterContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
focus_neighbor_left = NodePath(".")
focus_neighbor_top = NodePath(".")
focus_neighbor_right = NodePath(".")
focus_neighbor_bottom = NodePath("../NoButton")
theme_override_colors/font_focus_color = Color(1, 0.94902, 0, 1)
theme_override_colors/font_color = Color(0.737255, 0.705882, 0.690196, 1)
theme_override_fonts/font = ExtResource("2_i6kb2")
theme_override_font_sizes/font_size = 50
theme_override_styles/focus = SubResource("StyleBoxEmpty_1tca4")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_1pd8j")
theme_override_styles/normal = SubResource("StyleBoxEmpty_crnka")
button_mask = 0
text = "Yes"
[node name="NoButton" type="Button" parent="CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_left = NodePath(".")
focus_neighbor_top = NodePath("../YesButton")
focus_neighbor_right = NodePath(".")
focus_neighbor_bottom = NodePath(".")
theme_override_colors/font_focus_color = Color(1, 0.94902, 0, 1)
theme_override_colors/font_color = Color(0.737255, 0.705882, 0.690196, 1)
theme_override_fonts/font = ExtResource("2_i6kb2")
theme_override_font_sizes/font_size = 50
theme_override_styles/focus = SubResource("StyleBoxEmpty_yoep7")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_svmjr")
theme_override_styles/normal = SubResource("StyleBoxEmpty_cmr8o")
button_mask = 0
text = "No"
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
"": SubResource("AnimationLibrary_7x216")
}