some more changes whatever

This commit is contained in:
2023-02-04 18:02:34 +01:00
parent d204d15f4a
commit 9fa1d5987f
5 changed files with 19 additions and 11 deletions

View File

@@ -16,9 +16,9 @@ public partial class dialog_bubble : CanvasLayer
dlgLines.Add("Hello! I'm a [color=purple]debug character[/color] and...");
dlgLines.Add("[center][b][wave amp=50 freq=15][rainbow]This is cool test text[/rainbow][/wave][/b][/center]"); //bbcode gets counted to so typewrite effect takes decades //make a seperate variable without bbcode and count that instead
}
public void GetDialog(string file, string title, Variant actor)
public void GetDialog(string file, string title, Variant actor, string playerName)
{
parsedDlg = Json.ParseString(FileAccess.Open(file, FileAccess.ModeFlags.Read).GetAsText());
parsedDlg = Json.ParseString(FileAccess.Open(file, FileAccess.ModeFlags.Read).GetAsText().Replace("{player}", playerName));
GetNode<Label>("box/name_label").Text = title;
GD.Print("Now talking to: " + actor);
if (GetParent().Name == "player") GetParent<player>().allowMovement = false;

View File

@@ -28,7 +28,7 @@ public partial class player : CharacterBody2D
public override void _Process(double delta)
{
if (Input.IsActionJustPressed("ui_accept") && dialogRayCast.IsColliding() && allowMovement)
GetNode<dialog_bubble>("dialog_bubble").GetDialog(dialogRayCast.GetCollider().Get("file").AsString(), dialogRayCast.GetCollider().Get("title").AsString(), dialogRayCast.GetCollider().Get("actor"));
GetNode<dialog_bubble>("dialog_bubble").GetDialog(dialogRayCast.GetCollider().Get("file").AsString(), dialogRayCast.GetCollider().Get("title").AsString(), dialogRayCast.GetCollider().Get("actor"), playerName);
//animation system (with controller support wich cant get normalized vector)
if (allowMovement == false)