コード例 #1
0
        public void Set(QuestionManager.QuestionSet questionSet, bool toggled, System.Action onChanged = null)
        {
            this.questionSet = questionSet;

            this.questionSetNameText.text = this.questionSet.GetDisplayName();
            this.IsOn      = toggled;
            this.onChanged = onChanged;
        }
コード例 #2
0
        private void SetCurrent(QuestionManager.QuestionSet questionSet, int dropdownIndex)
        {
            if (currSet != null)
            {
                SaveCurrent(); // Autosave.
            }

            currSet = questionSet;
            questionSetDropdown.SetValueWithoutNotify(dropdownIndex);
            setNameButton.Text = questionSet.GetDisplayName();
            questionDisplay.SetCurrentSet(currSet);
        }
コード例 #3
0
        private void PromptRemoveCurrent()
        {
            if (QuestionManager.GetAllSetNames().Count <= 1)
            {
                ConfirmScreen.Create().Set("You can't remove this set because you must atleast have one.", null, useCancel: false);
                return;
            }

            if (!CanRemoveCurrent())
            {
                return;
            }

            ConfirmScreen.Create(UIUtil.UIType.ConfirmScreenRemove).Set("Are you sure you wish to remove the set: <b><color=red>" + currSet.GetDisplayName() + "</color></b>?",
                                                                        confirm: () =>
            {
                currSet.Delete();
                currSet = null;     // So it won't be autosaved.
                UpdateDropdown();
                SetCurrent(QuestionManager.GetSet(QuestionManager.GetAllSetNames()[0]), 0);
            }, confirmText: "Remove");
        }