void OpenDialog() { string textRef = dialogTexts[mCurIndex].GetStringRef(); if (!string.IsNullOrEmpty(textRef)) { if (clearModals.Value) { var uiMgr = ModalManager.main; if (uiMgr.GetTop() != modal.Value) { uiMgr.CloseAll(); } } if (usePortrait.Value) { ModalDialog.OpenApplyPortrait(modal.Value, portrait.Value as Sprite, nameText.GetStringRef(), textRef, OnDialogNext); } else { ModalDialog.Open(modal.Value, nameText.GetStringRef(), textRef, OnDialogNext); } mIsNext = false; } else { mCurIndex++; mIsNext = true; } }
private void ApplyBlessing(GOD blessing) { if (blessing == GOD.ZEUS) { dialog.SetText("Zeus grants you power! +5 Max health"); Stats.temporaryMaxHealth += 5; } else if (blessing == GOD.ARES) { dialog.SetText("Ares grants you strength! +1 Power"); Stats.currentPower += 1; } else if (blessing == GOD.APHRODITE) { dialog.SetText("Aphrodite healed your wounds! +6 Health"); Stats.CurrentHealth = Mathf.Min(Stats.CurrentHealth + 6, Stats.temporaryMaxHealth); } else if (blessing == GOD.DIONYSUS) { dialog.SetText("Dionysus grants you riches! Money (+10) "); Stats.Money += 10; } dialog.Open(); }
protected override IEnumerator Start() { yield return(base.Start()); ModalDialog.Open("", "test", ModalDialog.CloseGeneric); opsWidget.operation = testOps; opsWidget.Show(); deckWidget.Fill(testDeck); }
void OnSignalExecute() { switch (GameData.instance.helpState) { case GameData.HelpState.PreInvestigateLogin: ModalDialog.Open(null, preInvestigateLogin, OnDialogNextClose); break; case GameData.HelpState.PreInvestigateBriefing: ModalDialog.Open(null, preInvestigateBriefing, OnDialogNextClose); break; case GameData.HelpState.InvestigateCameraInstruction: var cameraDragInstructGO = GameObject.FindGameObjectWithTag(tagCameraDrag); if (cameraDragInstructGO) { var camDragger = cameraDragInstructGO.GetComponent <CameraDragger>(); if (camDragger) { if (camDragger.hideOnDragGO) { camDragger.hideOnDragGO.SetActive(true); } if (camDragger.clickInstructGO) { camDragger.clickInstructGO.SetActive(false); camDragger.clickInstructGO.SetActive(true); } } } break; case GameData.HelpState.InvestigateComputerPower: ModalDialog.Open(null, computerPowerCheck, OnDialogNextClose); break; case GameData.HelpState.VolatileDataGather: ModalDialog.Open(null, volatileDataGather, OnDialogNextClose); break; case GameData.HelpState.DeviceGather: ModalDialog.Open(null, computerPowerCheck, OnDialogNextClose); break; case GameData.HelpState.CloneDrive: ModalDialog.Open(null, cloneDrive, OnDialogNextClose); break; case GameData.HelpState.DataInvestigate: mCurIndex = 0; ModalDialog.Open(null, dataInvestigate[mCurIndex], OnDialogNextDataInvestigate); break; } }
void OnDialogNextDataInvestigate() { mCurIndex++; if (mCurIndex == dataInvestigate.Length) { ModalDialog.CloseGeneric(); } else { ModalDialog.Open(null, dataInvestigate[mCurIndex], OnDialogNextDataInvestigate); } }
public void OpenDialog(string nameTextRef, string dialogTextRef) { if (!string.IsNullOrEmpty(modalDialog)) { ModalDialog.Open(modalDialog, nameTextRef, dialogTextRef, NextPage); } else { ModalDialog.Open(nameTextRef, dialogTextRef, NextPage); } mIsDialogOpen = true; }
private void PickItem() { if (selectedIndex == options.Count - 1) { ExitShop(); return; } int price = options[selectedIndex].price.price; if (Stats.Money < price) { dialog.SetText("Sorry!\nNot enough money"); dialog.Open(); return; } if (selectedIndex == 0) { Stats.permanentMaxHealth += 3; Stats.temporaryMaxHealth = Stats.permanentMaxHealth; Stats.CurrentHealth = Stats.permanentMaxHealth; Stats.Money -= price; dialog.SetText($"Max health increased to {Stats.permanentMaxHealth.ToString()}"); dialog.Open(); } else if (selectedIndex == 1) { Stats.permanentPower += 1; Stats.currentPower = Stats.permanentPower; Stats.Money -= price; dialog.SetText($"Power increased to {Stats.permanentPower.ToString()}"); dialog.Open(); } }
IEnumerator DoPlay() { for (int i = 0; i < dialogTextRefs.Length; i++) { string textRef = dialogTextRefs[i]; if (string.IsNullOrEmpty(textRef)) { continue; } mIsNext = false; if (applyPortrait) { ModalDialog.OpenApplyPortrait(modal, portrait, nameTextRef, textRef, OnDialogNext); } else { ModalDialog.Open(modal, nameTextRef, textRef, OnDialogNext); } while (!mIsNext) { yield return(null); } } if (M8.ModalManager.main.IsInStack(modal)) { M8.ModalManager.main.CloseUpTo(modal, true); } //wait for dialog to close while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(modal)) { yield return(null); } mPlayRout = null; }
void OpenDialog() { string textRef = dialogTexts[mCurIndex].GetStringRef(); if (!string.IsNullOrEmpty(textRef)) { if (usePortrait.Value) { ModalDialog.OpenApplyPortrait(modal.Value, portrait.Value as Sprite, nameText.GetStringRef(), textRef, OnDialogNext); } else { ModalDialog.Open(modal.Value, nameText.GetStringRef(), textRef, OnDialogNext); } mIsNext = false; } else { mCurIndex++; mIsNext = true; } }
public override void Start(MonoBehaviour behaviour, Sequencer.StateInstance state) { ModalDialog.Open(portrait, name, texts); }