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; }
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); }
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"); }