Example #1
0
        private async void _on_DaysInc()
        {
            GMRoot.runner.DaysInc();

            foreach (var spevent in SpecialEventDialog.Process())
            {
                await ToSignal(ShowSpecialDialog(spevent), "tree_exited");
            }

            foreach (var eventobj in GMRoot.modder.events)
            {
                await ToSignal(ShowDialog(eventobj), "tree_exited");
            }

            foreach (var eventobj in riskContainer.Refresh())
            {
                await ToSignal(ShowDialog(eventobj), "tree_exited");
            }

            warnContainer.Refresh();

            //warnContainer.Refresh(GMRoot.modder.warns);

            ////taskContainer.Refresh(Runner.GetTask());

            //riskContainer.Refresh(GMRoot.runner.risks);

            if (GMRoot.runner.isEnd())
            {
                GMRoot.runner = null;
                GetTree().ChangeScene(EndScene.path);
            }
        }
Example #2
0
        private async void _on_DaysInc()
        {
            RunData.Root.DaysInc();

            foreach (var spevent in SpecialEventDialog.Process())
            {
                var dialog = ShowSpecialDialog(spevent);

                await ToSignal(dialog, "tree_exited");
            }

            foreach (var eventobj in Modder.Mod.EventProcess(RunData.Date.Value))
            {
                var dialog = ShowDialog(eventobj);

                await ToSignal(dialog, "tree_exited");
            }

            warnContainer.Refresh(Modder.Mod.WarnProcess());

            taskContainer.Refresh(RunData.Root.GetTask());

            if (Root.inst.isEnd)
            {
                Root.Exit();
                GetTree().ChangeScene("res://Scenes/End/EndScene.tscn");
            }
        }
Example #3
0
        internal static Node ShowSpecialDialog(SpecialEventDialog spEvent)
        {
            var dialogNode = (SpecialEventDialog)ResourceLoader.Load <PackedScene>("res://Scenes/Main/Dynamic/DialogPanel/SpecialDialogPanel/" + spEvent.name + ".tscn").Instance();

            inst.AddChild(dialogNode);
            return(dialogNode);
        }
Example #4
0
        private void _on_Button_pressed(int index)
        {
            GD.Print(index.ToString());
            gEventObj.options[index].Selected();

            var nextEventKey = gEventObj.options[index].Next;

            GD.Print(nextEventKey);

            if (nextEventKey != "")
            {
                this.Visible = false;

                GEvent nextEvent = gEventObj.GetNext(nextEventKey);
                if (nextEvent != null)
                {
                    nextEventDialog = MainScene.ShowDialog(nextEvent);
                    nextEventDialog.Connect("tree_exited", this, nameof(Exit));
                    return;
                }
                SpecialEventDialog spEvent = SpecialEventDialog.GetEvent(nextEventKey);
                if (spEvent != null)
                {
                    nextEventDialog = MainScene.ShowSpecialDialog(spEvent);
                    nextEventDialog.Connect("tree_exited", this, nameof(Exit));
                    return;
                }
            }

            Exit();
        }
Example #5
0
 internal static Node ShowSpecialDialog(SpecialEventDialog spEvent)
 {
     return(spEvent.Instance(inst));
 }