changed a value and some formatting
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"randomWelcomeText":[
|
"randomWelcomeText":[
|
||||||
"Oh hello, §player§... You look great! What do you want from me?",
|
"Oh hello, {player}... You look great! What do you want from me?",
|
||||||
"Hey, §player§! Hope you have fun today!",
|
"Hey, {player}! Hope you have fun today!",
|
||||||
"Hi! What's up §player§?"
|
"Hi! What's up {player}?"
|
||||||
],
|
],
|
||||||
"debugAnswer": "Cool master you set me up successfully for this simulation!",
|
"debugAnswer": "This is a debug answer!",
|
||||||
"randomGoodbyeText":[
|
"randomGoodbyeText":[
|
||||||
"Was nice talking to you goodbye!",
|
"Was nice talking to you goodbye!",
|
||||||
"Have a great day, §player§!"
|
"Have a great day, {player}!"
|
||||||
]
|
]
|
||||||
}
|
}
|
@@ -6,14 +6,13 @@ public partial class dialog_trigger_area : Area2D
|
|||||||
[Export(PropertyHint.File, "*json")]
|
[Export(PropertyHint.File, "*json")]
|
||||||
string dialogFile;
|
string dialogFile;
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
using var file = FileAccess.Open(dialogFile, FileAccess.ModeFlags.Read);
|
using var file = FileAccess.Open(dialogFile, FileAccess.ModeFlags.Read);
|
||||||
string text = file.GetAsText();
|
string text = file.GetAsText();
|
||||||
|
|
||||||
var jsonFile = JSON.ParseString(text);
|
var jsonFile = JSON.ParseString(text);
|
||||||
Dictionary allDialog = (Dictionary)jsonFile;
|
Dictionary allDialog = (Dictionary)jsonFile;
|
||||||
|
GD.Print(allDialog["randomWelcomeText"]);
|
||||||
GD.Print(allDialog["debugAnswer"]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user