Example #1
0
        private void SetShowAddButtons(bool val)
        {
            CreateNodeButton.showCreateButtons = val;

            addButtonCourner.TargetValue = CreateNodeButton.showCreateButtons ? 1 : 0;

            LogicMGMT.AddLogicVersion();
        }
Example #2
0
        private void BackToInteractionSelection()
        {
            LogicMGMT.AddLogicVersion();
            ClearTexts();

            CollectInteractions(interactionBranch);

            if (PossibleInteractions.Count != 0)
            {
                _questVersion = LogicMGMT.CurrentLogicVersion;

                _interactionStage = 0;

                if (!continuationReference.IsNullOrEmpty())
                {
                    foreach (var ie in PossibleInteractions)
                    {
                        if (ie.ReferenceName.SameAs(continuationReference))
                        {
                            _interaction = ie;
                            _interactionStage++;
                            SelectOption(0);
                            break;
                        }
                    }
                }

                if (View && _interactionStage == 0)
                {
                    var lst = new List <string>();

                    foreach (var interaction in PossibleInteractions)
                    {
                        lst.Add(interaction.texts.NameForPEGI);
                    }

                    View.Options = lst;
                }
            }
            else
            {
                Exit();
            }
        }
Example #3
0
        public static void SelectOption(int no)
        {
            LogicMGMT.AddLogicVersion();
            switch (_interactionStage)
            {
            case 0:
                _interactionStage++; _interaction = PossibleInteractions.TryGet(no);
                goto case 1;

            case 1:
                continuationReference = null;

                if (_interaction == null)
                {
                    SingleText = "No Possible Interactions.";
                }
                else
                {
                    if (_interaction.texts.GotNextText)
                    {
                        SingleText = _interaction.texts.GetNext();
                        break;
                    }

                    _interactionStage++;


                    goto case 2;
                }

                break;

            case 2:
                _interactionStage++;
                if (!CheckOptions(_interaction))
                {
                    goto case 4;
                }
                break;

            case 3:
                _option = PossibleOptions[no];
                _option.results.Apply();
                _interaction.finalResults.Apply();
                continuationReference = _option.nextOne;
                goto case 5;

            case 4:
                _interaction.finalResults.Apply(); enteredInstance.BackToInteractionSelection(); break;

            case 5:
                if (_option.text2.GotNextText)
                {
                    SingleText        = _option.text2.GetNext();
                    _interactionStage = 5;
                }
                else
                {
                    goto case 6;
                }

                break;

            case 6:
                enteredInstance.BackToInteractionSelection();
                break;
            }
        }