dialogue system changes

This commit is contained in:
2023-02-07 14:13:30 +01:00
parent 72421f4a32
commit 0190b6bdb2
4 changed files with 133 additions and 132 deletions

View File

@@ -13,9 +13,9 @@
] ]
}, },
"welcome": [ "welcome": [
"Oh hello, [color=blue]{player}[/color]... You look great! What do you want from me?", "Oh hello, {player}... You look great! What do you want from me?",
"Hey, [color=blue]{player}[/color]! Hope you have fun today! So what do you want?", "Hey, {player}! Hope you have fun today! So what do you want?",
"Hi! What's up [color=blue]{player}[/color]?" "Hi! What's up {player}?"
], ],
"else": [ "else": [
"Do you need something else?", "Do you need something else?",
@@ -23,7 +23,7 @@
], ],
"goodbye": [ "goodbye": [
"Was nice talking to you goodbye!", "Was nice talking to you goodbye!",
"Have a great day, [color=blue]{player}[/color]!" "Have a great day, {player}!"
], ],
"tipp": [ "tipp": [
[ [

View File

@@ -11,7 +11,7 @@ script = ExtResource("1_xtj1q")
metadata/_edit_use_anchors_ = true metadata/_edit_use_anchors_ = true
[node name="typewriter_timer" type="Timer" parent="."] [node name="typewriter_timer" type="Timer" parent="."]
wait_time = 0.05 wait_time = 0.04
one_shot = true one_shot = true
metadata/charsAtOnce = 60 metadata/charsAtOnce = 60

View File

@@ -17,6 +17,7 @@ public partial class dialog_bubble : CanvasLayer
} }
public void GetDialog(string file, string title, Variant actor, string playerName) public void GetDialog(string file, string title, Variant actor, string playerName)
{ {
playerName = "[color=blue]" + playerName + "[/color]";
parsedDlg = Json.ParseString(FileAccess.Open(file, FileAccess.ModeFlags.Read).GetAsText().Replace("{player}", playerName)); parsedDlg = Json.ParseString(FileAccess.Open(file, FileAccess.ModeFlags.Read).GetAsText().Replace("{player}", playerName));
GetNode<Label>("box/name_label").Text = title; GetNode<Label>("box/name_label").Text = title;
GD.Print("Now talking to: " + actor); GD.Print("Now talking to: " + actor);