/// <summary> /// Creates a checkbox list dialog that can be modified or stored before showing. /// <para></para> /// Before calling <see cref="DialogCheckboxList.Show"/>, call <see cref="DialogCheckboxList.Initialize(string[],Action{bool[]},string,string,ImageData,Action,string)"/>. /// <para></para> /// For a simpler solution with less customizability, use <see cref="ShowCheckboxList(string[],Action{bool[]},string,string,ImageData,Action,string)"/>. /// </summary> /// <returns>The instance of the created dialog.</returns> public static DialogCheckboxList CreateCheckboxList() { DialogCheckboxList dialog = PrefabManager.InstantiateGameObject(PrefabManager.ResourcePrefabs.dialogCheckboxList, instance.transform).GetComponent <DialogCheckboxList>(); dialog.Initialize(); return(dialog); }
public override void Show() { if (options.Count == 0) { if (IsExpanded()) { Hide(); } return; } var prefabAddress = cachedPrefabAddress == null || cachedPrefabAddress.IsEmpty() || !cachedPrefabAddress.IsResources() ? PrefabManager.ResourcePrefabs.dialogCheckboxList : cachedPrefabAddress; ShowFrameActivity(_CacheDialogList, prefabAddress, (dialog, isDialog) => { _CacheDialogList = dialog; if (isDialog) { dialog.Initialize(options.ToArray(), Select, "OK", hintOption.text, hintOption.imageData, HandleOnHide, "Cancel", selectedIndexes); } //Dont show title in Dropdown Mode else { dialog.Initialize(options.ToArray(), Select, "OK", null, null, HandleOnHide, "Cancel", selectedIndexes); } }); }
/// <summary> /// Shows a checkbox list dialog with an optional title, optional icon, a required scrollable checkbox list, a required button, and an optional button. /// <para></para> /// For more customizability, use <see cref="CreateCheckboxList"/>. /// </summary> /// <param name="options">The strings to use for the list item labels.</param> /// <param name="onAffirmativeButtonClicked">Called when the affirmative button is clicked.</param> /// <param name="affirmativeButtonText">The affirmative button text.</param> /// <param name="titleText">The title text. Make null for no title.</param> /// <param name="icon">The icon next to the title. Make null for no icon.</param> /// <param name="onDismissiveButtonClicked">Called when the dismissive button is clicked.</param> /// <param name="dismissiveButtonText">The dismissive button text. Make null for no dismissive button.</param> /// <returns>The instance of the initialized, shown dialog.</returns> public static DialogCheckboxList ShowCheckboxList(string[] options, Action <bool[]> onAffirmativeButtonClicked, string affirmativeButtonText, string titleText, ImageData icon, Action onDismissiveButtonClicked, string dismissiveButtonText) { DialogCheckboxList dialog = CreateCheckboxList(); dialog.Initialize(options, onAffirmativeButtonClicked, affirmativeButtonText, titleText, icon, onDismissiveButtonClicked, dismissiveButtonText); dialog.Show(); return(dialog); }
/// <summary> /// Creates a checkbox list dialog that can be modified or stored before showing. /// <para></para> /// Before calling <see cref="DialogCheckboxList.Show"/>, call <see cref="DialogCheckboxList.Initialize(string[],Action{bool[]},string,string,ImageData,Action,string)"/>. /// <para></para> /// For a simpler solution with less customizability, use <see cref="ShowCheckboxList(string[],Action{bool[]},string,string,ImageData,Action,string)"/>. /// </summary> /// <returns>The instance of the created dialog.</returns> public DialogCheckboxList CreateCheckboxList() { DialogCheckboxList dialog = PrefabManager.InstantiateGameObject(PrefabManager.ResourcePrefabs.dialogCheckboxList, GetContentTransform()).GetComponent <DialogCheckboxList>(); DialogManager.CreateActivity(dialog, dialog.transform.parent); //dialog.Initialize(); return(dialog); }