Ejemplo n.º 1
0
        private void MetaClicked(string info)
        {
            TextMemory.MetaTag metaTag = TextMemory.Parse(info);
            switch (metaTag.group)
            {
            case '?':
                ThoughtPopup.Instance.Open(metaTag.key);
                break;

            case '~':
                ThoughtPopup.Instance.Hide();
                if (metaTag.key == "village")
                {
                    RNG.ResetCycle();
                    GetTree().ChangeScene("res://Scenes/VillageScene.tscn");
                }
                else if (metaTag.key == "combat")
                {
                    GetTree().ChangeScene("res://Scenes/BattleScene.tscn");
                }
                else if (metaTag.key == "save")
                {
                    Global.SaveGame();
                    ThoughtPopup.Instance.Open("saved");
                }
                else if (metaTag.key == "title")
                {
                    Global.SaveGame();
                    GetTree().ChangeScene("res://Scenes/TitleScreen.tscn");
                    Global.ResetGame(GetTree());
                }
                else
                {
                    GD.PrintErr("Unknown scene");
                }
                break;
            }
        }
Ejemplo n.º 2
0
 private void MetaClicked(string info)
 {
     TextMemory.MetaTag metaTag = TextMemory.Parse(info);
     // Do something with the MetaTag
 }