void M8.IModalPush.Push(M8.GenericParams parms) { if (button) { button.interactable = allowRestart; } }
void M8.IModalPush.Push(M8.GenericParams parms) { if (parms != null) { if (parms.ContainsKey(parmPortraitSprite)) { SetupPortraitTextContent(parms.GetValue <Sprite>(parmPortraitSprite), parms.GetValue <string>(parmNameTextRef), parms.GetValue <string>(parmDialogTextRef)); } else { SetupTextContent(parms.GetValue <string>(parmNameTextRef), parms.GetValue <string>(parmDialogTextRef)); } mNextCallback = parms.GetValue <System.Action>(parmNextCallback); } if (textProcessActiveGO) { textProcessActiveGO.SetActive(false); } if (textProcessFinishGO) { textProcessFinishGO.SetActive(false); } mIsNextProcessed = false; }
void M8.IModalPush.Push(M8.GenericParams parms) { mDescTextRef = null; mIsDescSpoken = false; mCallback = null; if (parms != null) { if (parms.ContainsKey(parmTitleTextRef)) { if (titleText) { titleText.text = M8.Localize.Get(parms.GetValue <string>(parmTitleTextRef)); } } if (parms.ContainsKey(parmDescTextRef)) { mDescTextRef = parms.GetValue <string>(parmDescTextRef); if (descText) { descText.text = M8.Localize.Get(mDescTextRef); } } if (parms.ContainsKey(parmCallback)) { mCallback = parms.GetValue <System.Action <bool> >(parmCallback); } } }
void M8.IModalPush.Push(M8.GenericParams parms) { HideAll(); int startIndex = 0; int count = 0; if (parms != null) { if (parms.ContainsKey(parmCurIndex)) { startIndex = parms.GetValue <int>(parmCurIndex); } if (parms.ContainsKey(parmCount)) { count = parms.GetValue <int>(parmCount); } } StartCoroutine(DoQuestionSequence(startIndex, count)); }
void M8.IModalPush.Push(M8.GenericParams parms) { if (parms == null) { return; } int startIndex; bool shuffle; ModalChoiceItemInfo[] infos; //grab configuration parms.TryGetValue(parmTitleTextRef, out mTitleTextRef); parms.TryGetValue(parmDescTextRef, out mDescTextRef); parms.TryGetValue(parmChoices, out infos); parms.TryGetValue(parmNextCallback, out mNextCallback); parms.TryGetValue(parmShuffle, out shuffle); parms.TryGetValue(parmDisplayPostSelected, out mIsDisplayPostSelected); startIndex = parms.ContainsKey(parmStartSelect) ? parms.GetValue <int>(parmStartSelect) : -1; //setup display if (titleLabel) { titleLabel.text = !string.IsNullOrEmpty(mTitleTextRef) ? M8.Localize.Get(mTitleTextRef) : ""; } if (descLabel) { descLabel.text = !string.IsNullOrEmpty(mDescTextRef) ? M8.Localize.Get(mDescTextRef) : ""; //resize to fit all of description //TODO: kind of hacky, also make sure not to use "stretch" for label's vertical Canvas.ForceUpdateCanvases(); var size = descLabel.rectTransform.sizeDelta; size.y = descLabel.preferredHeight; descLabel.rectTransform.sizeDelta = size; } //setup choices ClearChoices(); if (infos != null) { GenerateChoices(infos, startIndex, shuffle); } //setup confirm if (confirmButton) { confirmButton.interactable = false; } if (confirmReadyGO) { confirmReadyGO.SetActive(false); } }