Example #1
0
    private void OnSecondaryGroupClick(GameObject go)
    {
        ButtonGroupState.HoldActiveStateOnGroup(go, SubMenuGroupButton);
        if (ButtonGroupState.ActiveGroup == ItemGroupButton)
        {
            FF9Sfx.muteSfx = true;
            OnKeyCancel(_itemScrollList.GetItem(_currentItemIndex).gameObject);
            FF9Sfx.muteSfx = false;
            OnKeyConfirm(go);
        }
        else if (ButtonGroupState.ActiveGroup == KeyItemGroupButton)
        {
            FF9Sfx.muteSfx = true;
            OnKeyCancel(_keyItemScrollList.GetItem(_currentItemIndex).gameObject);
            FF9Sfx.muteSfx = false;
            OnKeyConfirm(go);
        }
        else
        {
            if (ButtonGroupState.ActiveGroup != ItemArrangeGroupButton)
            {
                return;
            }

            GameObject currentItemObject = _itemScrollList.GetItem(_currentItemIndex).gameObject;
            FF9Sfx.muteSfx = true;
            OnKeyCancel(currentItemObject.GetChild(1));
            OnKeyCancel(currentItemObject);
            FF9Sfx.muteSfx = false;
            OnKeyConfirm(go);
        }
    }
Example #2
0
    private void DisplayItemDetail(Transform item, ListDataTypeBase data, Int32 index, Boolean isInit)
    {
        FieldItemListData fieldItemListData = (FieldItemListData)data;
        ItemDetailHUD     itemDetailHud     = new ItemDetailHUD(item.gameObject);

        if (isInit)
        {
            UIEventListener uiEventListener = UIEventListener.Get(itemDetailHud.ManualButton.gameObject);
            uiEventListener.Select += itemDetailHud.Self.GetComponent <ScrollItemKeyNavigation>().OnOtherObjectSelect;
            DisplayWindowBackground(item.gameObject, null);
        }
        if (ButtonGroupState.ActiveGroup == ItemArrangeGroupButton)
        {
            if (_currentItemIndex == index && !_switchingItem)
            {
                if (isInit)
                {
                    ButtonGroupState.HoldActiveStateOnGroup(item.gameObject, ItemGroupButton);
                }
                ButtonGroupState.SetButtonAnimation(item.gameObject, false);
                ButtonGroupState.SetOutsideLimitRectBehavior(PointerManager.LimitRectBehavior.Hide, ItemGroupButton);
            }
            else
            {
                ButtonGroupState.SetButtonAnimation(item.gameObject, true);
            }
        }
        FF9UIDataTool.DisplayItem(fieldItemListData.ItemId, itemDetailHud.IconSprite, itemDetailHud.NameLabel, fieldItemListData.Enable);
        itemDetailHud.NumberLabel.text         = fieldItemListData.ItemCount.ToString();
        itemDetailHud.NumberLabel.color        = !fieldItemListData.Enable ? FF9TextTool.Gray : FF9TextTool.White;
        itemDetailHud.Button.Help.Enable       = true;
        itemDetailHud.Button.Help.Text         = FF9TextTool.ItemHelpDescription(fieldItemListData.ItemId);
        itemDetailHud.ManualButton.Help.Enable = true;
        itemDetailHud.ManualButton.Help.Text   = FF9TextTool.ItemHelpDescription(fieldItemListData.ItemId);
    }
Example #3
0
    private void PrepareListItemWithIndex(Transform item, Int32 newIndex, Int32 oldIndex)
    {
        if (newIndex < oldIndex)
        {
            item.localPosition += new Vector3(0f, (Single)(this.poolSize / this.Column) * this.cellHeight, 0f);
        }
        else
        {
            item.localPosition -= new Vector3(0f, (Single)(this.poolSize / this.Column) * this.cellHeight, 0f);
        }
        item.GetComponent <RecycleListItem>().ItemDataIndex = newIndex;
        UIKeyNavigation component = item.GetComponent <UIKeyNavigation>();

        if (component)
        {
            component.startsSelected = (this.activeNumber == newIndex);
        }
        if (oldIndex == this.activeNumber)
        {
            ButtonGroupState component2 = item.GetComponent <ButtonGroupState>();
            ButtonGroupState.RemoveActiveStateOnGroup(item.gameObject, component2.GroupName);
        }
        if (newIndex == this.activeNumber)
        {
            ButtonGroupState component3 = item.GetComponent <ButtonGroupState>();
            ButtonGroupState.HoldActiveStateOnGroup(item.gameObject, component3.GroupName);
        }
        item.name = "Item " + newIndex;
        this.PopulateListItemWithData(item, this.dataList[newIndex], newIndex, false);
        this.dataTracker.Add(newIndex, this.dataTracker[oldIndex]);
        this.dataTracker.Remove(oldIndex);
    }
Example #4
0
 private void DisplayKeyItemSkin(Boolean visibility)
 {
     if (visibility)
     {
         Int32 keyItemId = _keyItemIdList[_currentItemIndex];
         _keyItemDetailName.text            = FF9TextTool.ImportantItemName(keyItemId);
         _keyItemDetailDescription.spacingY = _defaultSkinLabelSpacingY;
         String text            = FF9TextTool.ImportantItemSkin(keyItemId);
         Single additionalWidth = 0.0f;
         _keyItemDetailDescription.text = _keyItemDetailDescription.PhrasePreOpcodeSymbol(text, ref additionalWidth);
         Loading = true;
         // ISSUE: method pointer
         _keyItemSkinTransition.TweenIn(new Byte[1], () =>
         {
             Loading = false;
             _isShowingKeyItemDesp = true;
         });
         ButtonGroupState.DisableAllGroup(false);
         ButtonGroupState.HoldActiveStateOnGroup(KeyItemGroupButton);
     }
     else
     {
         Loading = true;
         _isShowingKeyItemDesp = false;
         // ISSUE: method pointer
         _keyItemSkinTransition.TweenOut(new Byte[1], () =>
         {
             Loading = false;
             ButtonGroupState.ActiveGroup = KeyItemGroupButton;
             Singleton <PointerManager> .Instance.SetPointerBlinkAt(ButtonGroupState.ActiveButton, false);
         });
         ff9item.FF9Item_UseImportant(_keyItemIdList[_currentItemIndex]);
         DisplayKeyItem();
     }
 }
Example #5
0
 public static void HoldActiveStateOnGroup(GameObject go, String oldGroup)
 {
     if (ButtonGroupState.activeButtonList.ContainsKey(oldGroup) && oldGroup != ButtonGroupState.ActiveGroup)
     {
         ButtonGroupState.activeButtonList[oldGroup] = go;
         ButtonGroupState.HoldActiveStateOnGroup(oldGroup);
     }
 }
Example #6
0
 private void OnSecondaryGroupClick(GameObject go)
 {
     ButtonGroupState.HoldActiveStateOnGroup(go, ChocographUI.SubMenuGroupButton);
     if (ButtonGroupState.ActiveGroup == ChocographUI.ItemGroupButton)
     {
         FF9Sfx.muteSfx = true;
         this.OnKeyCancel(this.chocographItemList[this.currentSelectItemIndex].Self);
         FF9Sfx.muteSfx = false;
         this.OnKeyConfirm(go);
     }
 }
Example #7
0
    private IEnumerator Show_dalay()
    {
        yield return(new WaitForEndOfFrame());

        if (_itemIdList.Count > 0)
        {
            ButtonGroupState.ActiveGroup = ItemGroupButton;
            ButtonGroupState.SetSecondaryOnGroup(SubMenuGroupButton);
            ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
        }
    }
Example #8
0
    private IEnumerator HideSuccessfulAccessDialog()
    {
        if (this.syncState == CloudUI.Sync.Download)
        {
            yield return(new WaitForSeconds(0.5f));

            FF9StateSystem.Serializer.GetSelectedLanguage(delegate(DataSerializerErrorCode errNo, Int32 selectedLanguage)
            {
                if (errNo == DataSerializerErrorCode.Success)
                {
                    FF9StateSystem.Settings.CurrentLanguage = LanguageCode.ConvertToLanguageName(selectedLanguage);
                    Localization.language = LanguageCode.ConvertToLanguageName(selectedLanguage);
                    UIManager.Field.InitializeATEText();
                    this.StartCoroutine(PersistenSingleton <FF9TextTool> .Instance.UpdateTextLocalization(delegate
                    {
                        this.Loading = false;
                        this.SuccessfulAccessPanel.SetActive(false);
                        this.UpdateLabelLanguage();
                        this.DisplayFileInfo(this.localFileHud, this.localPreview, this.corruptFile == CloudUI.Sync.Upload, ISharedDataSerializer.LastErrno);
                        this.DisplayFileInfo(this.cloudFileHud, this.cloudPreview, this.corruptFile == CloudUI.Sync.Download, ISharedDataSerializer.LastErrno);
                        this.DisplayTimeStamp();
                        this.CheckData();
                        ButtonGroupState.ActiveGroup = CloudUI.LocalFileGroupButton;
                        ButtonGroupState.HoldActiveStateOnGroup(CloudUI.SubMenuGroupButton);
                    }));
                }
                else
                {
                    this.Loading = false;
                    this.SuccessfulAccessPanel.SetActive(false);
                    this.DisplayFileInfo(this.localFileHud, this.localPreview, this.corruptFile == CloudUI.Sync.Upload, ISharedDataSerializer.LastErrno);
                    this.DisplayFileInfo(this.cloudFileHud, this.cloudPreview, this.corruptFile == CloudUI.Sync.Download, ISharedDataSerializer.LastErrno);
                    this.DisplayTimeStamp();
                    this.CheckData();
                    ButtonGroupState.ActiveGroup = CloudUI.LocalFileGroupButton;
                    ButtonGroupState.HoldActiveStateOnGroup(CloudUI.SubMenuGroupButton);
                }
            });
        }
        else
        {
            yield return(new WaitForSeconds(1.5f));

            base.Loading = false;
            this.SuccessfulAccessPanel.SetActive(false);
            this.DisplayFileInfo(this.localFileHud, this.localPreview, this.corruptFile == CloudUI.Sync.Upload, ISharedDataSerializer.LastErrno);
            this.DisplayFileInfo(this.cloudFileHud, this.cloudPreview, this.corruptFile == CloudUI.Sync.Download, ISharedDataSerializer.LastErrno);
            this.DisplayTimeStamp();
            this.CheckData();
            ButtonGroupState.ActiveGroup = CloudUI.CloudFileGroupButton;
            ButtonGroupState.HoldActiveStateOnGroup(CloudUI.SubMenuGroupButton);
        }
        yield break;
    }
Example #9
0
    public override Boolean OnKeyConfirm(GameObject go)
    {
        if (base.OnKeyConfirm(go))
        {
            if (ButtonGroupState.ActiveGroup == CardUI.CardGroupButton)
            {
                if (go != this.DeleteSubmenuButton)
                {
                    this.currentCardId = this.cardHudList[go.transform.GetSiblingIndex()].Id;
                }
                if (this.count[this.currentCardId] > 0)
                {
                    FF9Sfx.FF9SFX_Play(103);
                    base.Loading = true;
                    this.deleteDialogTransition.TweenIn(delegate
                    {
                        base.Loading = false;
                        ButtonGroupState.RemoveCursorMemorize(CardUI.DiscardDialogButtonGroup);
                        ButtonGroupState.ActiveGroup = CardUI.DiscardDialogButtonGroup;
                        ButtonGroupState.HoldActiveStateOnGroup(CardUI.CardGroupButton);
                    });
                    this.prevOffsetButton.enabled = false;
                    this.nextOffsetButton.enabled = false;
                    this.deleteCardId             = this.currentCardId;
                }
                else
                {
                    FF9Sfx.FF9SFX_Play(102);
                }
            }
            else if (ButtonGroupState.ActiveGroup == CardUI.DiscardDialogButtonGroup)
            {
                if (go == this.DeleteSubmenuButton)
                {
                    return(true);
                }

                OnDiscardDialogKeyConfirm(go);

                base.Loading = true;
                this.deleteDialogTransition.TweenOut(delegate
                {
                    base.Loading = false;
                    ButtonGroupState.ActiveGroup = CardUI.CardGroupButton;
                });
                this.prevOffsetButton.enabled = true;
                this.nextOffsetButton.enabled = true;
                ButtonGroupState.DisableAllGroup(true);
            }
        }
        return(true);
    }
Example #10
0
 private void OnSecondaryGroupClick(GameObject go)
 {
     ButtonGroupState.HoldActiveStateOnGroup(go, CloudUI.SubMenuGroupButton);
     if (ButtonGroupState.ActiveGroup == CloudUI.CloudFileGroupButton)
     {
         FF9Sfx.muteSfx = true;
         this.OnKeyCancel(this.FileListPanel.GetChild(0));
         FF9Sfx.muteSfx = false;
         this.OnKeyConfirm(go);
     }
     else if (ButtonGroupState.ActiveGroup == CloudUI.LocalFileGroupButton)
     {
         FF9Sfx.muteSfx = true;
         this.OnKeyCancel(this.FileListPanel.GetChild(2));
         FF9Sfx.muteSfx = false;
         this.OnKeyConfirm(go);
     }
 }
Example #11
0
 private void OnSecondaryGroupClick(GameObject go)
 {
     ButtonGroupState.HoldActiveStateOnGroup(go, MainMenuUI.SubMenuGroupButton);
     if (ButtonGroupState.ActiveGroup == MainMenuUI.CharacterGroupButton)
     {
         FF9Sfx.muteSfx = true;
         this.OnKeyCancel(this.CharacterListPanel.GetChild(this.currentCharacterIndex));
         FF9Sfx.muteSfx = false;
         this.OnKeyConfirm(go);
     }
     else if (ButtonGroupState.ActiveGroup == MainMenuUI.OrderGroupButton)
     {
         FF9Sfx.muteSfx = true;
         GameObject child = this.CharacterListPanel.GetChild(this.currentOrder);
         this.OnKeyCancel(child.GetChild(1));
         this.OnKeyCancel(this.CharacterListPanel.GetChild(this.currentCharacterIndex));
         FF9Sfx.muteSfx = false;
         this.OnKeyConfirm(go);
     }
 }
Example #12
0
    private IEnumerator OnFinishedSync_delay(Boolean isSuccess)
    {
        Single remainTime = Mathf.Max(2f - (Time.time - this.timeCounter), 0f);

        yield return(new WaitForSeconds(remainTime));

        this.progressBar.value = 1f;
        yield return(new WaitForSeconds(0.1f));

        this.LoadingAccessDialog.SetActive(false);
        if (isSuccess)
        {
            FF9Sfx.FF9SFX_Play(103);
            this.currentState = CloudUI.State.None;
            this.DisplaySuccessfulAccessDialog(this.isSyncSuccess);
        }
        else
        {
            FF9Sfx.FF9SFX_Play(1046);
            this.DisplayCorruptAccessDialog(delegate
            {
                this.Loading      = false;
                this.currentState = CloudUI.State.None;
                this.DisplayFileInfo(this.localFileHud, this.localPreview, this.corruptFile == CloudUI.Sync.Upload, ISharedDataSerializer.LastErrno);
                this.DisplayFileInfo(this.cloudFileHud, this.cloudPreview, this.corruptFile == CloudUI.Sync.Download, ISharedDataSerializer.LastErrno);
                this.DisplayTimeStamp();
                this.CheckData();
                if (this.syncState == CloudUI.Sync.Upload)
                {
                    ButtonGroupState.ActiveGroup = CloudUI.CloudFileGroupButton;
                }
                else
                {
                    ButtonGroupState.ActiveGroup = CloudUI.LocalFileGroupButton;
                }
                ButtonGroupState.HoldActiveStateOnGroup(CloudUI.SubMenuGroupButton);
            });
        }
        yield break;
    }
Example #13
0
 public override Boolean OnKeyConfirm(GameObject go)
 {
     if (base.OnKeyConfirm(go))
     {
         if (ButtonGroupState.ActiveGroup == SelectCharGroupButton)
         {
             FF9Sfx.FF9SFX_Play(103);
             this.currentCharacterSelect = this.GetCurrentSelect(go);
             this.currentCharacterId     = this.GetCurrentId(go);
             ButtonGroupState.SetCursorStartSelect((this.currentCharacterSelect.Group != Mode.Menu) ? go.GetChild(0) : go.GetChild(2), MoveCharGroupButton);
             ButtonGroupState.RemoveCursorMemorize(MoveCharGroupButton);
             ButtonGroupState.ActiveGroup = MoveCharGroupButton;
             ButtonGroupState.HoldActiveStateOnGroup(SelectCharGroupButton);
             foreach (CharacterOutsidePartyHud current in this.outsidePartyHudList)
             {
                 ButtonGroupState.SetButtonEnable(current.MoveButton, this.currentCharacterId == FF9PARTY_NONE || !this.info.fix[this.currentCharacterId]);
             }
         }
         else if (ButtonGroupState.ActiveGroup == MoveCharGroupButton)
         {
             PartySelect currentSelect = this.GetCurrentSelect(go);
             Byte        currentId     = this.GetCurrentId(go);
             if (this.currentCharacterSelect.Group == Mode.Select && currentId != FF9PARTY_NONE && this.info.fix[currentId])
             {
                 FF9Sfx.FF9SFX_Play(102);
             }
             else
             {
                 FF9Sfx.FF9SFX_Play(103);
                 this.SwapCharacter(this.currentCharacterSelect, currentSelect);
                 this.DisplayCharacter();
                 this.DisplayCharacterInfo(this.currentCharacterId);
                 ButtonGroupState.SetCursorMemorize(go.transform.parent.gameObject, SelectCharGroupButton);
                 ButtonGroupState.ActiveGroup = SelectCharGroupButton;
             }
         }
     }
     return(true);
 }
Example #14
0
 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);
 }
Example #15
0
    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);
    }
Example #16
0
    public override Boolean OnKeyConfirm(GameObject go)
    {
        if (base.OnKeyConfirm(go))
        {
            if (_isShowingKeyItemDesp)
            {
                FF9Sfx.FF9SFX_Play(103);
                DisplayKeyItemSkin(false);
            }
            if (ButtonGroupState.ActiveGroup == SubMenuGroupButton)
            {
                FF9Sfx.FF9SFX_Play(103);
                _currentMenu = GetSubMenuFromGameObject(go);
                switch (_currentMenu)
                {
                case SubMenu.Use:
                    _currentArrangeMode          = 0;
                    ButtonGroupState.ActiveGroup = ItemGroupButton;
                    ButtonGroupState.SetSecondaryOnGroup(SubMenuGroupButton);
                    ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    break;

                case SubMenu.Arrange:
                    _arrangeTransition.TweenIn(() =>
                    {
                        Loading = false;
                        ButtonGroupState.ActiveGroup = ArrangeMenuGroupButton;
                        ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    });
                    Loading = true;
                    break;

                case SubMenu.Key:
                    if (_keyItemIdList.Count > 0)
                    {
                        ButtonGroupState.ActiveGroup = KeyItemGroupButton;
                        ButtonGroupState.SetSecondaryOnGroup(SubMenuGroupButton);
                        ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    }
                    break;
                }
            }
            else if (ButtonGroupState.ActiveGroup == ArrangeMenuGroupButton)
            {
                FF9Sfx.FF9SFX_Play(103);
                _currentArrangeMode = go.transform.GetSiblingIndex() + 1;
                switch (_currentArrangeMode)
                {
                case 1:
                    _arrangeTransition.TweenOut(() => Loading = false);
                    Loading = true;
                    ButtonGroupState.ActiveGroup = SubMenuGroupButton;
                    ArrangeAuto();
                    DisplayItem();
                    break;

                case 2:
                    _arrangeTransition.TweenOut(() => Loading = false);
                    Loading = true;
                    ButtonGroupState.ActiveGroup = ItemGroupButton;
                    ButtonGroupState.SetSecondaryOnGroup(SubMenuGroupButton);
                    ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    DisplayItem();
                    break;
                }
            }
            else if (ButtonGroupState.ActiveGroup == ItemGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, ItemGroupButton))
                {
                    _currentItemIndex = go.GetComponent <RecycleListItem>().ItemDataIndex;
                    if (_currentArrangeMode == 0)
                    {
                        PLAYER       player      = FF9StateSystem.Common.FF9.party.member[0];
                        Int32        itemId      = _itemIdList[_currentItemIndex];
                        FF9ITEM_DATA ff9ItemData = ff9item._FF9Item_Data[itemId];
                        if (citem.YCITEM_IS_ITEM(itemId))
                        {
                            ITEM_DATA tbl = ff9item._FF9Item_Info[itemId - 224];
                            if ((ff9ItemData.type & 1) == 1)
                            {
                                if (!_usedItemIdList.Contains(itemId))
                                {
                                    if ((FF9FITEM_ID_VEGETABLE != itemId ? tbl.info.DisplayStats : 0) == 0)
                                    {
                                        if (SFieldCalculator.FieldCalcMain(player, player, tbl, tbl.Ref.ScriptId, 0U))
                                        {
                                            FF9Sfx.FF9SFX_Play(106);
                                            ff9item.FF9Item_Remove(itemId, 1);
                                            if (ff9item.FF9Item_GetCount(itemId) == 0)
                                            {
                                                _usedItemIdList.Add(itemId);
                                            }
                                            DisplayItem();
                                        }
                                        else
                                        {
                                            FF9Sfx.FF9SFX_Play(102);
                                        }
                                    }
                                    else
                                    {
                                        FF9Sfx.FF9SFX_Play(103);
                                        if (_currentItemIndex % 2 == 0)
                                        {
                                            _targetTransition.animatedInStartPosition = new Vector3(1543f, 0.0f, 0.0f);
                                            _targetTransition.animatedOutEndPosition  = new Vector3(1543f, 0.0f, 0.0f);
                                            TargetListPanel.transform.localPosition   = new Vector3(TargetPositionXOffset, 0.0f, 0.0f);
                                        }
                                        else
                                        {
                                            _targetTransition.animatedInStartPosition = new Vector3(-1543f, 0.0f, 0.0f);
                                            _targetTransition.animatedOutEndPosition  = new Vector3(-1543f, 0.0f, 0.0f);
                                            TargetListPanel.transform.localPosition   = new Vector3((Single)(-TargetPositionXOffset - 60.0), 0.0f, 0.0f);
                                        }
                                        _targetTransition.DestinationPosition = new Vector3[1]
                                        {
                                            TargetListPanel.transform.localPosition
                                        };
                                        DisplayTarget();
                                        Loading = true;
                                        _targetTransition.TweenIn(new Byte[1], () =>
                                        {
                                            Loading = false;
                                            ButtonGroupState.RemoveCursorMemorize(TargetGroupButton);
                                            ButtonGroupState.ActiveGroup = TargetGroupButton;
                                            ButtonGroupState.HoldActiveStateOnGroup(ItemGroupButton);
                                        });
                                    }
                                }
                                else
                                {
                                    FF9Sfx.FF9SFX_Play(102);
                                }
                            }
                            else
                            {
                                FF9Sfx.FF9SFX_Play(102);
                            }
                        }
                        else
                        {
                            FF9Sfx.FF9SFX_Play(102);
                        }
                    }
                    else if (_currentArrangeMode == 2)
                    {
                        FF9Sfx.FF9SFX_Play(103);
                        ButtonGroupState.SetCursorMemorize(go.GetChild(1), ItemArrangeGroupButton);
                        ButtonGroupState.ActiveGroup = ItemArrangeGroupButton;
                        ButtonGroupState.HoldActiveStateOnGroup(ItemGroupButton);
                        ButtonGroupState.SetOutsideLimitRectBehavior(PointerManager.LimitRectBehavior.Hide, ItemGroupButton);
                    }
                }
                else
                {
                    OnSecondaryGroupClick(go);
                }
            }
            else if (ButtonGroupState.ActiveGroup == KeyItemGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, KeyItemGroupButton))
                {
                    _currentItemIndex = go.GetComponent <RecycleListItem>().ItemDataIndex;
                    if (_keyItemIdList[_currentItemIndex] != FF9FITEM_RARE_NONE)
                    {
                        FF9Sfx.FF9SFX_Play(103);
                        DisplayKeyItemSkin(true);
                    }
                    else
                    {
                        FF9Sfx.FF9SFX_Play(102);
                    }
                }
                else
                {
                    OnSecondaryGroupClick(go);
                }
            }
            else if (ButtonGroupState.ActiveGroup == TargetGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, TargetGroupButton))
                {
                    Int32     siblingIndex = go.transform.GetSiblingIndex();
                    Int32     itemId       = _itemIdList[_currentItemIndex];
                    PLAYER    player       = FF9StateSystem.Common.FF9.party.member[siblingIndex];
                    ITEM_DATA tbl          = ff9item._FF9Item_Info[itemId - 224];
                    if (SFieldCalculator.FieldCalcMain(player, player, tbl, tbl.Ref.ScriptId, 0U))
                    {
                        FF9Sfx.FF9SFX_Play(106);
                        ff9item.FF9Item_Remove(itemId, 1);
                        if (ff9item.FF9Item_GetCount(itemId) > 0)
                        {
                            DisplayItem();
                            DisplayTarget();
                        }
                        else
                        {
                            _usedItemIdList.Add(itemId);
                            DisplayItem();
                            ButtonGroupState.ActiveGroup = ItemGroupButton;
                            Loading = true;
                            // ISSUE: method pointer
                            _targetTransition.TweenOut(new Byte[1], () => Loading = false);
                        }
                    }
                    else
                    {
                        FF9Sfx.FF9SFX_Play(102);
                    }
                }
            }
            else if (ButtonGroupState.ActiveGroup == ItemArrangeGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, ItemArrangeGroupButton))
                {
                    FF9Sfx.FF9SFX_Play(103);
                    _currentArrangeItemIndex = go.transform.parent.GetComponent <RecycleListItem>().ItemDataIndex;
                    FF9ITEM ff9Item = FF9StateSystem.Common.FF9.item[_currentItemIndex];
                    FF9StateSystem.Common.FF9.item[_currentItemIndex]        = FF9StateSystem.Common.FF9.item[_currentArrangeItemIndex];
                    FF9StateSystem.Common.FF9.item[_currentArrangeItemIndex] = ff9Item;
                    _switchingItem = true;
                    DisplayItem();
                    _itemScrollList.JumpToIndex(_currentArrangeItemIndex, false);
                    ButtonGroupState.RemoveCursorMemorize(ItemGroupButton);
                    ButtonGroupState.ActiveGroup = ItemGroupButton;
                    ButtonGroupState.SetOutsideLimitRectBehavior(PointerManager.LimitRectBehavior.Limit, ItemGroupButton);
                    _switchingItem = false;
                }
                else
                {
                    OnSecondaryGroupClick(go);
                }
            }
        }
        return(true);
    }
Example #17
0
 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);
 }