Esempio n. 1
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);
 }
Esempio n. 2
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);
    }
Esempio n. 3
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);
    }