public void BuyWpnButtonInteraction(bool wpn2) { SovereignWpn buyable; if (wpn2) { buyable = GameDataManager.Instance.dataStore.buyable1; } else { buyable = GameDataManager.Instance.dataStore.buyable0; } if (buyable.wpnLevel > 1) { if (GameDataManager.Instance.SpendManaIfPossible(lv2cost)) { GameDataManager.Instance.GiveSovereignBuyableWpn(wpn2); shell.Close(); } else { shell.SurrenderFocus(); insufficientResourcesPopup.Open(); } } else { int[] costs; if (buyable.wpnLevel == 0) { costs = new int[] { lv0cost, lv0cost, lv0cost } } ; else { costs = new int[] { lv1cost, lv1cost, lv1cost } }; if (GameDataManager.Instance.SpendResourcesIfPossible(costs)) { GameDataManager.Instance.GiveSovereignBuyableWpn(wpn2); shell.Close(); } else { shell.SurrenderFocus(); insufficientResourcesPopup.Open(); } } }
private void OnOptions() { StateLayer val = default(StateLayer); if (StateManager.TryGetLayer("OptionUI", ref val)) { StateManager.SetActiveInputLayer(val); UIManager.instance.NotifyLayerIndexChange(); OptionState optionState = new OptionState { onStateClosed = OnOptionsClosed }; val.GetChainEnd().SetChildState(optionState, 0); } m_popupMenu.Close(); }
public void Close() { if (HasFlag(MessageFlags.LaunchAdventureOnClose)) { advScreenChanger.Activate(); } shell.Close(); }
public void SpClose() { if (lState == PeddlerLocalState.PeddlerPaid) { ChangeLocalState(PeddlerLocalState.PeddlerDone); } shell.Close(); }
public void ConfirmedRetrain() { if (cachedClass == AdventurerClass.Warrior) { associatedAdventurer.Reclass(AdventurerClass.Mystic); } else { associatedAdventurer.Reclass(AdventurerClass.Warrior); } shell.Close(); }
public void Depart() { int[] costs = { 0, 0, 0, GameDataManager.Instance.dataStore.nextRandomAdventureAnte, GameDataManager.Instance.dataStore.nextRandomAdventureAnte, GameDataManager.Instance.dataStore.nextRandomAdventureAnte }; if (GameDataManager.Instance.dataStore.adventureLevel >= AdventureSubstageLoader.randomAdventureBaseLevel) { if (GameDataManager.Instance.SpendResourcesIfPossible(costs)) { shell.Close(); screenChanger.Activate(); } else { insufficientResourcesPopup.Open(); } } else { shell.Close(); screenChanger.Activate(); } }
public void PromoteUnit() { int manaCost = Adventurer.GetPromoteCostForClass(setClass); if (GameDataManager.Instance.SpendManaIfPossible(manaCost)) { adv.PromoteToTier2(setClass); shell.Close(); } else { shell.SurrenderFocus(); insufficientResourcesPopup.Open(); } }
public void CalledShotsButtonInteraction() { if (GameDataManager.Instance.dataStore.unlock_sovSpe_CalledShots) { GameDataManager.Instance.SetSovereignSpecial(AdventurerSpecial.CalledShots); shell.Close(); } else if (GameDataManager.Instance.SpendResourcesIfPossible(5, 5, 5)) { GameDataManager.Instance.dataStore.unlock_sovSpe_CalledShots = true; GameDataManager.Instance.SetSovereignSpecial(AdventurerSpecial.CalledShots); shell.Close(); } else { shell.SurrenderFocus(); insufficientResourcesPopup.Open(); } }
public void FlankingButtonInteraction() { GameDataManager.Instance.SetSovereignTactic(BattlerAction.Flanking); shell.Close(); }
// Draw public override void Draw() { // Top layer GUI.depth = 0; // Set GUI font if (GUI.skin.font != Config.instance.font) { GUI.skin.font = Config.instance.font; } GUIArea.width = Screen.width; GUIArea.height = Screen.height; if (introEnabled) { return; } // Always draw the invisible focus control GUIHelper.UnityFocusFix(); // Clear focus ClearFocus(); // Exit button and version number DrawExitButtonAndVersion(); // Clearing popup menu bool popupClear = false; if ( popupMenu != null && ( (Event.current.isMouse && Event.current.type == EventType.MouseUp && Event.current.button == 0) || (Event.current.isKey && Event.current.keyCode == KeyCode.Escape) ) ) { popupClear = true; } // General keys UpdateGeneralKeys(); // State switch (GameManager.currentState) { case State.ConnectingToLobby: ConnectingToLobbyGUI(); break; case State.Disconnected: DisconnectedGUI(); break; case State.Update: PleaseUpdateGUI(); break; case State.LogIn: LoginGUI(); break; case State.Register: RegisterGUI(); break; case State.License: LicenseGUI(); break; case State.Lobby: LobbyGUI(); break; case State.Game: /*if(Event.current.isKey && Event.current.keyCode == KeyCode.Tab || Event.current.character == '\t' && !gameLobby.lobbyChat.chatInputFocused) { * if(GameManager.serverType != ServerType.Town || Player.main == null || !Player.main.talkingWithNPC) { * GUIHelper.Focus(GUI.GetNameOfFocusedControl()); * Event.current.Use(); * } * }*/ if (MainMenu.instance != null && (MainMenu.instance.currentState == InGameMenuState.Lobby)) { using (new GUIArea(Screen.width * 0.95f, Screen.height * 0.95f)) { LobbyGUI(); } } // On 1366 x 768 laptop screen you should use // 0.85f width for profile at least, 0.91f for artifacts // 0.75f height max if (Player.main != null && Player.main.talkingWithNPC) { using (new GUIArea(Screen.width * 0.91f, Screen.height * 0.75f)) { Player.main.talkingWithNPC.Draw(); } } break; } // Changelog DrawChangeLog(); // Popup menu if (popupMenu != null) { popupMenu.Draw(); if (popupClear && popupMenu != null) { popupMenu.Close(); } } // Tooltip DrawTooltip(); // Popup window if (popupWindow != null) { // Dim background DimBackground(); using (new GUIArea(new Rect(GUIArea.width * 0.25f, GUIArea.height * 0.25f, GUIArea.width * 0.5f, GUIArea.height * 0.5f))) { using (new GUIVerticalCenter()) { using (new GUIHorizontalCenter()) { popupWindow.DrawAll(); } } } } // Disable game input when GUI is active if (GUIUtility.hotControl != 0 || GUIUtility.keyboardControl != 0) { InputManager.ignoreInput = true; InputManager.instance.Clear(); } else { InputManager.ignoreInput = false; } // Debug if (Debugger.instance.debugGUI && Event.current.type == EventType.Layout) { Debugger.Label("FocusedControl: " + GUI.GetNameOfFocusedControl()); Debugger.Label("HotControl: " + GUIUtility.hotControl.ToString()); Debugger.Label("KeyboardControl: " + GUIUtility.keyboardControl.ToString()); } // Debugger Debugger.instance.Draw(); }
public void ReturnFromBattle() { shell.Close(); screenChanger.Activate(); }
public void Win() { cutscenePlayer.StartCutscene(overworldCutscenePlayerEndingIndex); shell.Close(); }
public void SetMace() { GameDataManager.Instance.ChangeSetSovWpn(WpnType.Mace); shell.Close(); }
public void OpenDocksPopup() { shell.Close(); docksPopup.Open(); }
public void RerollAsHuman() // yes there have to be three of these - ugly af but Unity can't invoke functions with args from UI buttons { associatedAdventurer.Reroll(associatedAdventurer.advClass, AdventurerSpecies.Human, associatedAdventurer.isElite, Adventurer.GetRandomStatPoint()); shell.Close(); }