did some useless garbage
This commit is contained in:
42
src/scene-scripts/gui/dialog_bubble.cs
Normal file
42
src/scene-scripts/gui/dialog_bubble.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
public partial class dialog_bubble : CanvasLayer
|
||||
{
|
||||
[Export(PropertyHint.File, "*.json,")]
|
||||
public string textfile;
|
||||
|
||||
private Dictionary text;
|
||||
private string[] selectedText;
|
||||
private bool inProgress = false;
|
||||
|
||||
//ITS FUCKING GARBAGE I HATE THIS DOCUMENTATION
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
var background = GetNode<ColorRect>("Background");
|
||||
var textLabel = GetNode<ColorRect>("TextLabel");
|
||||
|
||||
background.Visible = false;
|
||||
//text.Add(LoadSceneText(textVariant));
|
||||
//signal_bus.Connect("DisplayDialog", this, "onDisplayDialog");
|
||||
|
||||
}
|
||||
public string LoadSceneText(string textVariant)
|
||||
{
|
||||
if (File.Exists(textfile))
|
||||
{
|
||||
File.Open(textfile, FileMode.Open);
|
||||
textVariant = JSON.ParseString(File.ReadAllText(textfile)).ToString();
|
||||
}
|
||||
return textVariant;
|
||||
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,6 +1,5 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public partial class dialog_object_area : Area2D
|
||||
{
|
||||
@@ -12,14 +11,14 @@ public partial class dialog_object_area : Area2D
|
||||
{
|
||||
if(areaActive && @event.IsActionPressed("ui_accept"))
|
||||
{
|
||||
EmitSignal("DialogDisplayEventHandler", dialogKey);
|
||||
signal_bus.EmitSignal("DialogDisplay", dialogKey);
|
||||
}
|
||||
}
|
||||
public void onAreaEntered()
|
||||
public void onDialogAreaEntered()
|
||||
{
|
||||
areaActive = true;
|
||||
}
|
||||
public void onAreaExited()
|
||||
public void onDialogAreaExited()
|
||||
{
|
||||
areaActive = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user