public void OnResetButtonClick() { FF9Sfx.FF9SFX_Play(103); NameInputField.value = FF9TextTool.CharacterDefaultName(_currentCharId); }
public override Boolean OnKeyConfirm(GameObject go) { if (!base.OnKeyConfirm(go) || _hidingHud) { return(true); } if (ButtonGroupState.ActiveGroup == CommandGroupButton) { FF9Sfx.FF9SFX_Play(103); _currentCommandIndex = (CommandMenu)go.transform.GetSiblingIndex(); _currentCommandId = (UInt32)GetCommandFromCommandIndex(_currentCommandIndex, CurrentPlayerIndex); _commandCursorMemorize[CurrentPlayerIndex] = _currentCommandIndex; _subMenuType = SubMenuType.Normal; if (IsDoubleCast && _doubleCastCount < 2) { ++_doubleCastCount; } switch (_currentCommandIndex) { case CommandMenu.Attack: SetCommandVisibility(false, false); SetTargetVisibility(true); break; case CommandMenu.Defend: _targetCursor = 0; SendCommand(ProcessCommand(CurrentPlayerIndex, CursorGroup.Individual)); SetIdle(); break; case CommandMenu.Ability1: case CommandMenu.Ability2: //int num = currentCommandIndex != CommandMenu.Ability2 ? 0 : 1; CharacterCommand ff9Command = CharacterCommands.Commands[_currentCommandId]; if (ff9Command.Type == CharacterCommandType.Normal) { _subMenuType = SubMenuType.Normal; SetCommandVisibility(false, false); SetTargetVisibility(true); break; } if (ff9Command.Type == CharacterCommandType.Ability) { _subMenuType = SubMenuType.Ability; DisplayAbility(); SetCommandVisibility(false, false); SetAbilityPanelVisibility(true, false); break; } if (ff9Command.Type == CharacterCommandType.Throw) { _subMenuType = SubMenuType.Throw; DisplayItem(true); SetCommandVisibility(false, false); SetItemPanelVisibility(true, false); } break; case CommandMenu.Item: DisplayItem(false); SetCommandVisibility(false, false); SetItemPanelVisibility(true, false); break; case CommandMenu.Change: _targetCursor = 0; CommandDetail command = ProcessCommand(CurrentPlayerIndex, CursorGroup.Individual); if (_isManualTrance) { command.SubId = 96; // Trance } SendCommand(command); SetIdle(); break; } } else if (ButtonGroupState.ActiveGroup == TargetGroupButton) { FF9Sfx.FF9SFX_Play(103); if (_cursorType == CursorGroup.Individual) { for (Int32 i = 0; i < _matchBattleIdEnemyList.Count; i++) { if (i < _targetPanel.Enemies.Count && _targetPanel.Enemies[i].GameObject == go) { CheckDoubleCast(_matchBattleIdEnemyList[i], _cursorType); return(true); } } for (Int32 i = 0; i < _matchBattleIdPlayerList.Count; i++) { if (i < _targetPanel.Players.Count && _targetPanel.Players[i].GameObject == go) { CheckDoubleCast(_matchBattleIdPlayerList[i], _cursorType); return(true); } } } else if (_cursorType == CursorGroup.AllPlayer || _cursorType == CursorGroup.AllEnemy || _cursorType == CursorGroup.All) { CheckDoubleCast(-1, _cursorType); } } else if (ButtonGroupState.ActiveGroup == AbilityGroupButton) { if (CheckAbilityStatus(go.GetComponent <RecycleListItem>().ItemDataIndex) == AbilityStatus.Enable) { FF9Sfx.FF9SFX_Play(103); _currentSubMenuIndex = go.GetComponent <RecycleListItem>().ItemDataIndex; if (_currentCommandIndex == CommandMenu.Ability1) { _ability1CursorMemorize[CurrentPlayerIndex] = _currentSubMenuIndex; } else { _ability2CursorMemorize[CurrentPlayerIndex] = _currentSubMenuIndex; } SetAbilityPanelVisibility(false, false); SetTargetVisibility(true); } else { FF9Sfx.FF9SFX_Play(102); } } else if (ButtonGroupState.ActiveGroup == ItemGroupButton) { if (_itemIdList[_currentSubMenuIndex] != Byte.MaxValue) { FF9Sfx.FF9SFX_Play(103); _currentSubMenuIndex = go.GetComponent <RecycleListItem>().ItemDataIndex; _itemCursorMemorize[CurrentPlayerIndex] = _currentSubMenuIndex; SetItemPanelVisibility(false, false); SetTargetVisibility(true); } else { FF9Sfx.FF9SFX_Play(102); } } return(true); }
public override Boolean OnKeyConfirm(GameObject go) { if (base.OnKeyConfirm(go)) { if (ButtonGroupState.ActiveGroup == CloudUI.SubMenuGroupButton) { FF9Sfx.FF9SFX_Play(103); if (go == this.UploadButton) { this.syncState = CloudUI.Sync.Upload; ButtonGroupState.ActiveGroup = CloudUI.CloudFileGroupButton; ButtonGroupState.SetSecondaryOnGroup(CloudUI.SubMenuGroupButton); ButtonGroupState.HoldActiveStateOnGroup(CloudUI.SubMenuGroupButton); } else if (go == this.DownloadButton) { this.syncState = CloudUI.Sync.Download; ButtonGroupState.ActiveGroup = CloudUI.LocalFileGroupButton; ButtonGroupState.SetSecondaryOnGroup(CloudUI.SubMenuGroupButton); ButtonGroupState.HoldActiveStateOnGroup(CloudUI.SubMenuGroupButton); } } else if (ButtonGroupState.ActiveGroup == CloudUI.CloudFileGroupButton) { if (ButtonGroupState.ContainButtonInGroup(go, CloudUI.CloudFileGroupButton)) { FF9Sfx.FF9SFX_Play(103); if (this.isCloudFileExist) { this.overWriteDialogDespLabel.text = Localization.Get("UploadOverwrite"); this.DisplayOverWriteDialog(); ButtonGroupState.ActiveGroup = CloudUI.ConfirmDialogGroupButton; ButtonGroupState.HoldActiveStateOnGroup(CloudUI.CloudFileGroupButton); } else { this.SyncFileToCloud(); } } else { this.OnSecondaryGroupClick(go); } } else if (ButtonGroupState.ActiveGroup == CloudUI.LocalFileGroupButton) { if (ButtonGroupState.ContainButtonInGroup(go, CloudUI.LocalFileGroupButton)) { FF9Sfx.FF9SFX_Play(103); if (this.isLocalFileExist) { this.overWriteDialogDespLabel.text = Localization.Get("DownloadOverwrite"); this.DisplayOverWriteDialog(); ButtonGroupState.ActiveGroup = CloudUI.ConfirmDialogGroupButton; ButtonGroupState.HoldActiveStateOnGroup(CloudUI.LocalFileGroupButton); } else { this.SyncFileToCloud(); } } else { this.OnSecondaryGroupClick(go); } } else if (ButtonGroupState.ActiveGroup == CloudUI.ConfirmDialogGroupButton && ButtonGroupState.ContainButtonInGroup(go, CloudUI.ConfirmDialogGroupButton)) { this.OverWriteDialog.SetActive(false); if (go.transform.GetSiblingIndex() == 1) { FF9Sfx.FF9SFX_Play(103); this.SyncFileToCloud(); } else { FF9Sfx.FF9SFX_Play(101); if (this.syncState == CloudUI.Sync.Upload) { ButtonGroupState.ActiveGroup = CloudUI.CloudFileGroupButton; } else { ButtonGroupState.ActiveGroup = CloudUI.LocalFileGroupButton; } } } } return(true); }
private static void TryShowLoadScene(UIScene scene) { FF9Sfx.FF9SFX_Play(103); scene?.Hide(OnLoadGameButtonClick); }
public override Boolean OnKeyCancel(GameObject go) { if (UIManager.Input.GetKey(Control.Special)) { return(true); } if (base.OnKeyCancel(go) && !_hidingHud && ButtonGroupState.ActiveGroup != CommandGroupButton) { if (ButtonGroupState.ActiveGroup == TargetGroupButton) { FF9Sfx.FF9SFX_Play(101); SetTargetVisibility(false); ClearModelPointer(); switch (_currentCommandIndex) { case CommandMenu.Attack: SetCommandVisibility(true, true); break; case CommandMenu.Ability1: case CommandMenu.Ability2: if (_subMenuType == SubMenuType.Ability) { SetAbilityPanelVisibility(true, true); break; } if (_subMenuType == SubMenuType.Throw) { SetItemPanelVisibility(true, true); break; } SetCommandVisibility(true, true); break; case CommandMenu.Item: SetItemPanelVisibility(true, true); break; } } else if (ButtonGroupState.ActiveGroup == AbilityGroupButton) { FF9Sfx.FF9SFX_Play(101); if (IsDoubleCast && _doubleCastCount > 0) { --_doubleCastCount; } if (_doubleCastCount == 0) { SetAbilityPanelVisibility(false, false); SetCommandVisibility(true, true); } else { SetAbilityPanelVisibility(true, false); } } else if (ButtonGroupState.ActiveGroup == ItemGroupButton) { FF9Sfx.FF9SFX_Play(101); SetItemPanelVisibility(false, false); SetCommandVisibility(true, true); } else if (ButtonGroupState.ActiveGroup == String.Empty && UIManager.Input.ContainsAndroidQuitKey()) { OnKeyQuit(); } } return(true); }
public override Boolean OnKeyConfirm(GameObject go) { if (base.OnKeyConfirm(go)) { if (ButtonGroupState.ActiveGroup == SaveLoadUI.SlotGroupButton) { FF9Sfx.FF9SFX_Play(103); this.currentSlot = go.transform.GetSiblingIndex(); ButtonGroupState.DisableAllGroup(true); this.LoadingPreviewDialog.SetActive(true); FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpCheck"); base.Loading = true; this.timeCounter = Time.time; FF9StateSystem.Serializer.LoadSlotPreview(this.currentSlot, new ISharedDataSerializer.OnLoadSlotFinish(this.OnFinishedLoadPreview)); } else if (ButtonGroupState.ActiveGroup == SaveLoadUI.FileGroupButton) { this.currentFile = go.GetComponent <ScrollItemKeyNavigation>().ID; if (this.type == SaveLoadUI.SerializeType.Save) { FF9Sfx.FF9SFX_Play(103); if (this.isFileExistList[this.currentFile]) { this.DisplayOverWriteDialog(); ButtonGroupState.ActiveGroup = SaveLoadUI.ConfirmDialogGroupButton; } else { ButtonGroupState.DisableAllGroup(true); FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSave"); FF9UIDataTool.DisplayTextLocalize(this.loadingAccessText, "WarningSaveData"); this.LoadingAccessPanel.SetActive(true); base.StartCoroutine("RunProgressBar"); this.timeCounter = Time.time; base.Loading = true; FF9StateSystem.Settings.UpdateTickTime(); FF9StateSystem.Serializer.Save(this.currentSlot, this.currentFile, (ISharedDataSerializer.OnSaveLoadStart)null, new ISharedDataSerializer.OnSaveFinish(this.OnFinishedSaveFile)); } } else if (this.isFileExistList[this.currentFile]) { FF9Sfx.FF9SFX_Play(103); ButtonGroupState.DisableAllGroup(true); FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpLoad"); FF9UIDataTool.DisplayTextLocalize(this.loadingAccessText, "WarningAccessData"); this.LoadingAccessPanel.SetActive(true); base.StartCoroutine("RunProgressBar"); this.timeCounter = Time.time; base.Loading = true; FF9StateSystem.Serializer.Load(this.currentSlot, this.currentFile, (ISharedDataSerializer.OnSaveLoadStart)null, new ISharedDataSerializer.OnLoadFinish(this.OnFinishedLoadFile)); } else { FF9Sfx.FF9SFX_Play(102); } } else if (ButtonGroupState.ActiveGroup == SaveLoadUI.ConfirmDialogGroupButton) { this.OverWriteDialog.SetActive(false); if (go.transform.GetSiblingIndex() == 1) { FF9Sfx.FF9SFX_Play(103); ButtonGroupState.DisableAllGroup(true); FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpSave"); FF9UIDataTool.DisplayTextLocalize(this.loadingAccessText, "WarningSaveData"); this.LoadingAccessPanel.SetActive(true); base.StartCoroutine("RunProgressBar"); this.timeCounter = Time.time; base.Loading = true; FF9StateSystem.Settings.UpdateTickTime(); FF9StateSystem.Serializer.Save(this.currentSlot, this.currentFile, (ISharedDataSerializer.OnSaveLoadStart)null, new ISharedDataSerializer.OnSaveFinish(this.OnFinishedSaveFile)); } else { FF9Sfx.FF9SFX_Play(101); ButtonGroupState.ActiveGroup = SaveLoadUI.FileGroupButton; } } } return(true); }
public void HandleBoosterButton(BoosterType triggerType = BoosterType.None) { if (!Configuration.Cheats.Enabled) { return; } if (PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.Title || PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.PreEnding || (PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.Ending || !MBG.IsNull && !MBG.Instance.IsFinished())) { return; } if (UnityXInput.Input.GetKeyDown(KeyCode.F1) || triggerType == BoosterType.HighSpeedMode) { if (!Configuration.Cheats.SpeedMode) { Log.Message("[Cheats] SpeedMode was disabled."); FF9Sfx.FF9SFX_Play(102); return; } bool flag = !FF9StateSystem.Settings.IsBoosterButtonActive[1]; FF9StateSystem.Settings.CallBoosterButtonFuntion(BoosterType.HighSpeedMode, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterHudIcon(BoosterType.HighSpeedMode, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterButton(BoosterType.HighSpeedMode, flag); } if (UnityXInput.Input.GetKeyDown(KeyCode.F2) || triggerType == BoosterType.BattleAssistance) { if (!Configuration.Cheats.BattleAssistance) { Log.Message("[Cheats] BattleAssistance was disabled."); FF9Sfx.FF9SFX_Play(102); return; } if ((FF9StateSystem.Battle.isNoBoosterMap() || FF9StateSystem.Battle.FF9Battle.btl_escape_fade != 32) && SceneDirector.IsBattleScene()) { return; } bool flag = !FF9StateSystem.Settings.IsBoosterButtonActive[0]; FF9StateSystem.Settings.CallBoosterButtonFuntion(BoosterType.BattleAssistance, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterHudIcon(BoosterType.BattleAssistance, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterButton(BoosterType.BattleAssistance, flag); } if (UnityXInput.Input.GetKeyDown(KeyCode.F3) || triggerType == BoosterType.Attack9999) { if (!Configuration.Cheats.Attack9999) { Log.Message("[Cheats] Attack9999 was disabled."); FF9Sfx.FF9SFX_Play(102); return; } bool flag = !FF9StateSystem.Settings.IsBoosterButtonActive[3]; FF9StateSystem.Settings.CallBoosterButtonFuntion(BoosterType.Attack9999, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterHudIcon(BoosterType.Attack9999, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterButton(BoosterType.Attack9999, flag); } if (UnityXInput.Input.GetKeyDown(KeyCode.F4) || triggerType == BoosterType.NoRandomEncounter) { if (!Configuration.Cheats.NoRandomEncounter) { Log.Message("[Cheats] NoRandomEncounter was disabled."); FF9Sfx.FF9SFX_Play(102); return; } if (PersistenSingleton <UIManager> .Instance.State != UIManager.UIState.FieldHUD && PersistenSingleton <UIManager> .Instance.State != UIManager.UIState.WorldHUD && PersistenSingleton <UIManager> .Instance.State != UIManager.UIState.Pause) { return; } bool flag = !FF9StateSystem.Settings.IsBoosterButtonActive[4]; FF9StateSystem.Settings.CallBoosterButtonFuntion(BoosterType.NoRandomEncounter, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterHudIcon(BoosterType.NoRandomEncounter, flag); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterButton(BoosterType.NoRandomEncounter, flag); } if (UnityXInput.Input.GetKeyDown(KeyCode.F5) && (PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.FieldHUD || PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.WorldHUD || PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.Pause)) { if (!Configuration.Cheats.MasterSkill) { Log.Message("[Cheats] MasterSkill was disabled."); FF9Sfx.FF9SFX_Play(102); return; } if (!FF9StateSystem.Settings.IsMasterSkill) { PersistenSingleton <UIManager> .Instance.Booster.ShowWaringDialog(BoosterType.MasterSkill); } else { FF9StateSystem.Settings.CallBoosterButtonFuntion(BoosterType.MasterSkill, false); PersistenSingleton <UIManager> .Instance.Booster.SetBoosterHudIcon(BoosterType.MasterSkill, false); } } if (UnityXInput.Input.GetKeyDown(KeyCode.F6) && (PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.FieldHUD || PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.WorldHUD || PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.Pause)) { if (!Configuration.Cheats.LvMax) { Log.Message("[Cheats] LvMax was disabled."); FF9Sfx.FF9SFX_Play(102); return; } PersistenSingleton <UIManager> .Instance.Booster.ShowWaringDialog(BoosterType.LvMax); } if (UnityXInput.Input.GetKeyDown(KeyCode.F7) && (PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.FieldHUD || PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.WorldHUD || PersistenSingleton <UIManager> .Instance.State == UIManager.UIState.Pause)) { if (!Configuration.Cheats.GilMax) { Log.Message("[Cheats] GilMax was disabled."); FF9Sfx.FF9SFX_Play(102); return; } PersistenSingleton <UIManager> .Instance.Booster.ShowWaringDialog(BoosterType.GilMax); } }
public override Boolean OnKeyConfirm(GameObject go) { if (base.OnKeyConfirm(go)) { if (ButtonGroupState.ActiveGroup == ChocographUI.SubMenuGroupButton) { this.currentMenu = this.GetSubMenuFromGameObject(go); if (this.currentMenu == ChocographUI.SubMenu.Select) { FF9Sfx.FF9SFX_Play(103); ButtonGroupState.RemoveCursorMemorize(ChocographUI.ItemGroupButton); ButtonGroupState.ActiveGroup = ChocographUI.ItemGroupButton; ButtonGroupState.SetSecondaryOnGroup(ChocographUI.SubMenuGroupButton); ButtonGroupState.HoldActiveStateOnGroup(ChocographUI.SubMenuGroupButton); } else if (this.currentMenu == ChocographUI.SubMenu.Cancel) { if (this.hasSelectedItem) { FF9Sfx.FF9SFX_Play(107); this.SetCancelButton(false); FF9StateSystem.Common.FF9.hintmap_id = 0; ChocographUI.CurrentSelectedChocograph = -1; this.hasSelectedItem = false; this.SelectedContentPanel.SetActive(false); } else { FF9Sfx.FF9SFX_Play(102); } } } else if (ButtonGroupState.ActiveGroup == ChocographUI.ItemGroupButton) { if (ButtonGroupState.ContainButtonInGroup(go, ChocographUI.ItemGroupButton)) { Int32 id = go.GetComponent <ScrollItemKeyNavigation>().ID; if (!this.hasMap[id]) { FF9Sfx.FF9SFX_Play(102); return(true); } if (this.ability <= this.GetIconType(id)) { FF9Sfx.FF9SFX_Play(102); return(true); } FF9Sfx.FF9SFX_Play(107); ChocographUI.CurrentSelectedChocograph = id; FF9StateSystem.Common.FF9.hintmap_id = 1 + ChocographUI.CurrentSelectedChocograph; this.DisplaySelected(id); this.SetCancelButton(true); } else { this.OnSecondaryGroupClick(go); } } } return(true); }
public override Boolean OnKeyConfirm(GameObject go) { if (base.OnKeyConfirm(go)) { if (ButtonGroupState.ActiveGroup == MainMenuUI.SubMenuGroupButton) { FF9Sfx.FF9SFX_Play(103); this.currentMenu = this.GetSubMenuFromGameObject(go); switch (this.currentMenu) { case MainMenuUI.SubMenu.Item: this.NeedTweenAndHideSubMenu = false; this.submenuTransition.ShiftContentClip = new Vector2(0f, 9f); this.ItemSubMenu.GetComponent <UIButton>().SetState(UIButtonColor.State.Normal, false); this.Hide(delegate { PersistenSingleton <UIManager> .Instance.ChangeUIState(UIManager.UIState.Item); base.Loading = true; }); break; case MainMenuUI.SubMenu.Ability: case MainMenuUI.SubMenu.Equip: case MainMenuUI.SubMenu.Status: this.SetAvalableCharacter(false); this.DisplayHelp(this.currentMenu); if (this.characterMemorize != (UnityEngine.Object)null && !this.characterMemorize.GetComponent <ButtonGroupState>().enabled) { this.characterMemorize = this.CharacterHUDList[this.GetFirstPlayer()].Self; } ButtonGroupState.SetCursorMemorize(this.characterMemorize, MainMenuUI.CharacterGroupButton); ButtonGroupState.ActiveGroup = MainMenuUI.CharacterGroupButton; ButtonGroupState.SetSecondaryOnGroup(MainMenuUI.SubMenuGroupButton); ButtonGroupState.HoldActiveStateOnGroup(MainMenuUI.SubMenuGroupButton); break; case MainMenuUI.SubMenu.Order: this.SetAvalableCharacter(true); this.DisplayHelp(this.currentMenu); ButtonGroupState.SetCursorMemorize(this.characterOrderMemorize, MainMenuUI.CharacterGroupButton); ButtonGroupState.ActiveGroup = MainMenuUI.CharacterGroupButton; ButtonGroupState.SetSecondaryOnGroup(MainMenuUI.SubMenuGroupButton); ButtonGroupState.HoldActiveStateOnGroup(MainMenuUI.SubMenuGroupButton); break; case MainMenuUI.SubMenu.Card: this.NeedTweenAndHideSubMenu = false; this.submenuTransition.ShiftContentClip = new Vector2(0f, 499f); this.CardSubMenu.GetComponent <UIButton>().SetState(UIButtonColor.State.Normal, false); this.Hide(delegate { PersistenSingleton <UIManager> .Instance.ChangeUIState(UIManager.UIState.Card); base.Loading = true; }); break; case MainMenuUI.SubMenu.Config: this.NeedTweenAndHideSubMenu = false; this.submenuTransition.ShiftContentClip = new Vector2(0f, 597f); this.ConfigSubMenu.GetComponent <UIButton>().SetState(UIButtonColor.State.Normal, false); this.Hide(delegate { PersistenSingleton <UIManager> .Instance.ChangeUIState(UIManager.UIState.Config); base.Loading = true; }); break; } } else if (ButtonGroupState.ActiveGroup == MainMenuUI.CharacterGroupButton) { if (ButtonGroupState.ContainButtonInGroup(go, MainMenuUI.CharacterGroupButton)) { FF9Sfx.FF9SFX_Play(103); this.currentCharacterIndex = go.transform.GetSiblingIndex(); PLAYER player = FF9StateSystem.Common.FF9.party.member[this.currentCharacterIndex]; if (player != null) { switch (this.currentMenu) { case MainMenuUI.SubMenu.Ability: this.characterMemorize = go; this.NeedTweenAndHideSubMenu = false; this.submenuTransition.ShiftContentClip = new Vector2(0f, 107f); this.AbilitySubMenu.GetComponent <UIButton>().SetState(UIButtonColor.State.Normal, false); this.Hide(delegate { PersistenSingleton <UIManager> .Instance.AbilityScene.CurrentPartyIndex = this.currentCharacterIndex; PersistenSingleton <UIManager> .Instance.ChangeUIState(UIManager.UIState.Ability); }); break; case MainMenuUI.SubMenu.Equip: this.characterMemorize = go; this.NeedTweenAndHideSubMenu = false; this.submenuTransition.ShiftContentClip = new Vector2(0f, 205f); this.EquipSubMenu.GetComponent <UIButton>().SetState(UIButtonColor.State.Normal, false); this.Hide(delegate { PersistenSingleton <UIManager> .Instance.EquipScene.CurrentPartyIndex = this.currentCharacterIndex; PersistenSingleton <UIManager> .Instance.ChangeUIState(UIManager.UIState.Equip); }); break; case MainMenuUI.SubMenu.Status: this.characterMemorize = go; this.NeedTweenAndHideSubMenu = false; this.submenuTransition.ShiftContentClip = new Vector2(0f, 303f); this.StatusSubMenu.GetComponent <UIButton>().SetState(UIButtonColor.State.Normal, false); this.Hide(delegate { PersistenSingleton <UIManager> .Instance.StatusScene.CurrentPartyIndex = this.currentCharacterIndex; PersistenSingleton <UIManager> .Instance.ChangeUIState(UIManager.UIState.Status); }); break; case MainMenuUI.SubMenu.Order: this.characterOrderMemorize = go; ButtonGroupState.SetCursorMemorize(this.CharacterOrderGameObjectList[this.currentCharacterIndex], MainMenuUI.OrderGroupButton); ButtonGroupState.ActiveGroup = MainMenuUI.OrderGroupButton; ButtonGroupState.HoldActiveStateOnGroup(MainMenuUI.CharacterGroupButton); break; } } else if (this.currentMenu == MainMenuUI.SubMenu.Order) { this.characterOrderMemorize = go; ButtonGroupState.SetCursorMemorize(this.CharacterOrderGameObjectList[this.currentCharacterIndex], MainMenuUI.OrderGroupButton); ButtonGroupState.ActiveGroup = MainMenuUI.OrderGroupButton; ButtonGroupState.HoldActiveStateOnGroup(MainMenuUI.CharacterGroupButton); } } else { this.OnSecondaryGroupClick(go); } } else if (ButtonGroupState.ActiveGroup == MainMenuUI.OrderGroupButton) { if (ButtonGroupState.ContainButtonInGroup(go, MainMenuUI.OrderGroupButton)) { FF9Sfx.FF9SFX_Play(103); this.currentOrder = go.transform.parent.GetSiblingIndex(); this.ToggleOrder(); this.DisplayCharacter(); ButtonGroupState.SetCursorMemorize(this.CharacterHUDList[this.currentOrder].Self, MainMenuUI.CharacterGroupButton); ButtonGroupState.ActiveGroup = MainMenuUI.CharacterGroupButton; } else { this.OnSecondaryGroupClick(go); } } } return(true); }
private void ApLearned(Int32 id, Int32 abilId) { FF9Sfx.FF9SFX_Play(1043); this.abilityLearned[id].Add(abilId); BattleAchievement.UpdateAbilitiesAchievement(abilId, true); }
private Boolean ManageTargetCommand() { BattleUnit btl = FF9StateSystem.Battle.FF9Battle.GetUnit(CurrentPlayerIndex); if ((Int32)_currentCommandId == 31 && (!_magicSwordCond.IsViviExist || _magicSwordCond.IsViviDead || _magicSwordCond.IsSteinerMini)) { FF9Sfx.FF9SFX_Play(101); ResetToReady(); return(false); } if (!_isTranceMenu && btl.IsUnderAnyStatus(BattleStatus.Trance)) { FF9Sfx.FF9SFX_Play(101); ResetToReady(); return(false); } if (_subMenuType == SubMenuType.Ability) { CharacterCommand command = CharacterCommands.Commands[_currentCommandId]; if (_currentSubMenuIndex >= command.Abilities.Length) { return(true); } AA_DATA aaData = FF9StateSystem.Battle.FF9Battle.aa_data[PatchAbility(command.Abilities[_currentSubMenuIndex])]; Int32 mpCost = ff9abil.FF9Abil_GetEnableSA(btl.PlayerIndex, AbilSaMpHalf) ? aaData.MP >> 1 : aaData.MP; if (btl.CurrentMp < mpCost) { FF9Sfx.FF9SFX_Play(101); DisplayAbility(); SetTargetVisibility(false); ClearModelPointer(); SetAbilityPanelVisibility(true, true); return(false); } if ((aaData.Category & 2) != 0 && btl.IsUnderAnyStatus(BattleStatus.Silence)) { FF9Sfx.FF9SFX_Play(101); DisplayAbility(); SetTargetVisibility(false); ClearModelPointer(); SetAbilityPanelVisibility(true, true); return(false); } } if ((_subMenuType == SubMenuType.Item || _subMenuType == SubMenuType.Throw) && ff9item.FF9Item_GetCount(_itemIdList[_currentSubMenuIndex]) == 0) { FF9Sfx.FF9SFX_Play(101); DisplayItem(_subMenuType == SubMenuType.Throw); SetTargetVisibility(false); ClearModelPointer(); SetItemPanelVisibility(true, true); return(false); } return(true); }
private void UpdatePlayer() { _blinkAlphaCounter += RealTime.deltaTime * 3f; _blinkAlphaCounter = _blinkAlphaCounter <= 2.0 ? _blinkAlphaCounter : 0.0f; Single alpha = _blinkAlphaCounter > 1.0 ? 2f - _blinkAlphaCounter : _blinkAlphaCounter; if (!_commandEnable) { return; } foreach (UI.PanelParty.Character character in _partyDetail.Characters.Entries) { if (character.PlayerId == -1) { continue; } BattleUnit player = FF9StateSystem.Battle.FF9Battle.GetUnit(character.PlayerId); if ((player.IsUnderStatus(BattleStatus.Confuse) || player.IsUnderStatus(BattleStatus.Berserk)) && character.ATBBlink) { character.ATBBlink = false; } if (IsEnableInput(player) && !_isAutoAttack) { if (character.ATBBlink) { character.ATBBar.Foreground.Widget.alpha = alpha; } if (character.TranceBlink && player.HasTrance) { character.TranceBar.Foreground.Widget.alpha = alpha; } } else { if (character.ATBBlink) { character.ATBBar.Foreground.Widget.alpha = 1f; character.ATBBar.Foreground.Highlight.Sprite.alpha = 0.0f; } if (character.TranceBlink && player.HasTrance) { character.TranceBar.Foreground.Widget.alpha = 1f; character.TranceBar.Foreground.Highlight.Sprite.alpha = 0.0f; } } } YMenu_ManagerHpMp(); CheckPlayerState(); DisplayPartyRealtime(); if (TargetPanel.activeSelf) { DisplayTarget(); _statusPanel.DisplayStatusRealtime(_matchBattleIdPlayerList); } ManagerTarget(); ManagerInfo(); if (CurrentPlayerIndex > -1) { BattleUnit unit = FF9StateSystem.Battle.FF9Battle.GetUnit(CurrentPlayerIndex); if (ButtonGroupState.ActiveGroup == CommandGroupButton && _isTranceMenu) { _tranceColorCounter = (_tranceColorCounter + 1) % TranceTextColor.Length; _commandPanel.SetCaptionColor(TranceTextColor[_tranceColorCounter]); } if (!IsEnableInput(unit)) { SetIdle(); return; } if (TargetPanel.activeSelf) { if (!ManageTargetCommand()) { return; } } else if (AbilityPanel.activeSelf || ItemPanel.activeSelf) { if (AbilityPanel.activeSelf) { DisplayAbilityRealTime(); } if (ItemPanel.activeSelf) { DisplayItemRealTime(); } if ((Int32)_currentCommandId == 31 && (!_magicSwordCond.IsViviExist || _magicSwordCond.IsViviDead || _magicSwordCond.IsSteinerMini)) { FF9Sfx.FF9SFX_Play(101); ResetToReady(); return; } if (!_isTranceMenu && unit.IsUnderAnyStatus(BattleStatus.Trance)) { FF9Sfx.FF9SFX_Play(101); ResetToReady(); return; } } } if (ReadyQueue.Count <= 0 || CurrentPlayerIndex != -1) { return; } for (Int32 index = ReadyQueue.Count - 1; index >= 0; --index) { if (!_unconsciousStateList.Contains(ReadyQueue[index])) { continue; } BattleUnit unit = FF9StateSystem.Battle.FF9Battle.GetUnit(ReadyQueue[index]); Boolean needToClearCommand = unit.IsUnderStatus(BattleStatus.CmdCancel); RemovePlayerFromAction(unit.Id, needToClearCommand); } using (List <Int32> .Enumerator enumerator = ReadyQueue.GetEnumerator()) { while (enumerator.MoveNext()) { Int32 current = enumerator.Current; if (InputFinishList.Contains(current) || _unconsciousStateList.Contains(current)) { continue; } if (_isAutoAttack) { SendAutoAttackCommand(current); break; } SwitchPlayer(current); break; } } }