コード例 #1
0
        public void UpdateInfo(ItemlistModel model)
        {
            this.mModel = model;
            bool flag = this.Usable();

            if (flag)
            {
                base.get_transform().SetActive(true);
                this.mLabel_Name.text        = model.Name;
                this.mLabel_Description.text = UserInterfaceAlbumManager.Utils.NormalizeDescription(15, 1, model.Description);
                this.mSprite_Icon.spriteName = string.Format("item_{0}", this.mModel.MstId);
                bool flag2 = this.mModel.IsUsable();
                if (flag2)
                {
                    this.mButton_Use.get_transform().SetActive(true);
                }
                else
                {
                    this.mButton_Use.get_transform().SetActive(false);
                }
            }
            else
            {
                base.get_transform().SetActive(false);
            }
        }
コード例 #2
0
 private void OnSelect(ItemlistModel model)
 {
     if (this.mOnSelectListener != null)
     {
         this.mOnSelectListener.Invoke(model);
     }
 }
コード例 #3
0
 internal void Clean()
 {
     this.mModel                  = null;
     this.mLabel_Name.text        = string.Empty;
     this.mLabel_Description.text = string.Empty;
     this.mSprite_Icon.spriteName = string.Empty;
 }
コード例 #4
0
 public void Release()
 {
     mModel = null;
     mItemlistCheckUtils = null;
     mFocusButton        = null;
     mFocasableButtons   = null;
 }
コード例 #5
0
        private void __UpdateCount__()
        {
            Dictionary <int, Mem_slotitem> dictionary = null;

            for (int i = 0; i < _have_items.Count; i++)
            {
                ItemlistModel itemlistModel = _have_items[i];
                Mst_item_shop mst_cabinet   = _cabinet_relations[itemlistModel];
                if (mst_cabinet == null || !mst_cabinet.IsChildReference() || mst_cabinet.Item2_type == 1)
                {
                    itemlistModel.__SetOverrideCount__(0);
                }
                else if (mst_cabinet.Item2_type == 2)
                {
                    if (dictionary == null)
                    {
                        dictionary = new Api_get_Member().Slotitem().data;
                    }
                    int value = dictionary.Count((KeyValuePair <int, Mem_slotitem> item) => item.Value.Slotitem_id == mst_cabinet.Item2_id);
                    itemlistModel.__SetOverrideCount__(value);
                }
                else if (mst_cabinet.Item2_type == 3)
                {
                    enumMaterialCategory item2_id = (enumMaterialCategory)mst_cabinet.Item2_id;
                    int count = base.Material.GetCount(item2_id);
                    itemlistModel.__SetOverrideCount__(count);
                }
                else
                {
                    itemlistModel.__SetOverrideCount__(0);
                }
            }
        }
コード例 #6
0
    public void Initialize(ItemlistModel itemStoreModel, ItemlistManager checkUtils)
    {
        mModel = itemStoreModel;
        mItemlistCheckUtils = checkUtils;
        List <UIButton> list     = new List <UIButton>();
        ItemlistModel   listItem = checkUtils.GetListItem(57);

        if (listItem != null && 0 < listItem.Count)
        {
            if (4 <= listItem.Count)
            {
                mButton_Plan.isEnabled = true;
                list.Add(mButton_Plan);
            }
            else
            {
                mButton_Plan.isEnabled = false;
            }
            list.Add(mButton_Screw);
            list.Add(mButton_Materials);
            mFocasableButtons = list.ToArray();
            ChangeFocus(mFocasableButtons[0], needSe: false);
        }
        ((Component)mButton_Plan.transform.parent.FindChild("Label_Message")).GetComponent <UILabel>().text = "「資源」や「改修資材」に交換出来ます。\nまた、勲章4個を「改装設計図」1枚に交換可能です。";
    }
コード例 #7
0
ファイル: UIItemList.cs プロジェクト: syncsyncsynchalt/BD-6Kr
 private void OnFocusChange(ItemlistModel model)
 {
     if (mOnFocusChangeListener != null)
     {
         mOnFocusChangeListener(model);
     }
 }
コード例 #8
0
ファイル: UIItemList.cs プロジェクト: syncsyncsynchalt/BD-6Kr
 private void OnSelect(ItemlistModel model)
 {
     if (mOnSelectListener != null)
     {
         mOnSelectListener(model);
     }
 }
コード例 #9
0
        private IEnumerator OnGetMaterialsReward(ItemlistModel usedModel, IReward_Materials reward)
        {
            UIGetRewardDialog      dialog          = Util.Instantiate(mPrefab_UIGetRewardDialog.gameObject, mTransform_DialogArea.gameObject).GetComponent <UIGetRewardDialog>();
            List <Reward_Material> rewardMaterials = new List <Reward_Material>();

            IReward_Material[] rewards = reward.Rewards;
            foreach (IReward_Material material in rewards)
            {
                rewardMaterials.Add((Reward_Material)material);
            }
            bool showFlag = true;

            dialog.Initialize(rewardMaterials.ToArray());
            dialog.Show(mKeyController);
            dialog.SetOnDialogClosedCallBack(delegate
            {
                showFlag = false;
                UnityEngine.Object.Destroy(dialog.gameObject);
            });
            while (showFlag)
            {
                yield return(null);
            }
            yield return(null);
        }
コード例 #10
0
 private void OnFocusChange(ItemlistModel model)
 {
     if (this.mOnFocusChangeListener != null)
     {
         this.mOnFocusChangeListener.Invoke(model);
     }
 }
コード例 #11
0
ファイル: UIItemList.cs プロジェクト: syncsyncsynchalt/BD-6Kr
 private void Update()
 {
     if (mKeyController == null)
     {
         return;
     }
     if (mKeyController.keyState[14].down)
     {
         int num  = Array.IndexOf(mItemListChildren, mFocusListChild);
         int num2 = num - 1;
         if (0 <= num2)
         {
             ChangeFocus(mItemListChildren[num2], playSE: true);
         }
     }
     else if (mKeyController.keyState[10].down)
     {
         int num3 = Array.IndexOf(mItemListChildren, mFocusListChild);
         int num4 = num3 + 1;
         if (num4 < mItemListChildren.Length)
         {
             ChangeFocus(mItemListChildren[num4], playSE: true);
         }
     }
     else if (mKeyController.keyState[8].down)
     {
         int num5 = Array.IndexOf(mItemListChildren, mFocusListChild);
         int num6 = num5 - 7;
         if (0 <= num6)
         {
             ChangeFocus(mItemListChildren[num6], playSE: true);
         }
     }
     else if (mKeyController.keyState[12].down)
     {
         int num7 = Array.IndexOf(mItemListChildren, mFocusListChild);
         int num8 = num7 + 7;
         if (num8 < mItemListChildren.Length)
         {
             ChangeFocus(mItemListChildren[num8], playSE: true);
         }
     }
     else if (mKeyController.keyState[1].down)
     {
         if (mFocusListChild != null)
         {
             ItemlistModel mModel = mFocusListChild.mModel;
             if (0 < mModel.Count && mModel.IsUsable())
             {
                 SoundUtils.PlaySE(mAudioClip_SE_013);
                 OnSelect(mFocusListChild.mModel);
             }
         }
     }
     else if (mKeyController.keyState[0].down)
     {
         SingletonMonoBehaviour <PortObjectManager> .Instance.BackToActiveScene();
     }
 }
コード例 #12
0
 private void OnDestroy()
 {
     UserInterfacePortManager.ReleaseUtils.Release(ref mSprite_Icon);
     UserInterfacePortManager.ReleaseUtils.Release(ref mLabel_Count);
     UserInterfacePortManager.ReleaseUtils.Release(ref mWidgetThis);
     mModel           = null;
     mOnTouchListener = null;
 }
コード例 #13
0
 private void Update()
 {
     if (this.mKeyController != null)
     {
         if (this.mKeyController.keyState.get_Item(14).down)
         {
             int num  = Array.IndexOf <UIItemListChild>(this.mItemListChildren, this.mFocusListChild);
             int num2 = num - 1;
             if (0 <= num2)
             {
                 this.ChangeFocus(this.mItemListChildren[num2], true);
             }
         }
         else if (this.mKeyController.keyState.get_Item(10).down)
         {
             int num3 = Array.IndexOf <UIItemListChild>(this.mItemListChildren, this.mFocusListChild);
             int num4 = num3 + 1;
             if (num4 < this.mItemListChildren.Length)
             {
                 this.ChangeFocus(this.mItemListChildren[num4], true);
             }
         }
         else if (this.mKeyController.keyState.get_Item(8).down)
         {
             int num5 = Array.IndexOf <UIItemListChild>(this.mItemListChildren, this.mFocusListChild);
             int num6 = num5 - 7;
             if (0 <= num6)
             {
                 this.ChangeFocus(this.mItemListChildren[num6], true);
             }
         }
         else if (this.mKeyController.keyState.get_Item(12).down)
         {
             int num7 = Array.IndexOf <UIItemListChild>(this.mItemListChildren, this.mFocusListChild);
             int num8 = num7 + 7;
             if (num8 < this.mItemListChildren.Length)
             {
                 this.ChangeFocus(this.mItemListChildren[num8], true);
             }
         }
         else if (this.mKeyController.keyState.get_Item(1).down)
         {
             if (this.mFocusListChild != null)
             {
                 ItemlistModel mModel = this.mFocusListChild.mModel;
                 if (0 < mModel.Count && mModel.IsUsable())
                 {
                     SoundUtils.PlaySE(this.mAudioClip_SE_013);
                     this.OnSelect(this.mFocusListChild.mModel);
                 }
             }
         }
         else if (this.mKeyController.keyState.get_Item(0).down)
         {
             SingletonMonoBehaviour <PortObjectManager> .Instance.BackToActiveScene();
         }
     }
 }
コード例 #14
0
        private bool IsExchangeItemlistModel(ItemlistModel model)
        {
            int mstId = model.MstId;

            if (mstId == 57)
            {
                return(true);
            }
            return(false);
        }
コード例 #15
0
 private void OnDestroy()
 {
     UserInterfacePortManager.ReleaseUtils.Release(ref this.mLabel_Name);
     UserInterfacePortManager.ReleaseUtils.Release(ref this.mLabel_Description);
     UserInterfacePortManager.ReleaseUtils.Release(ref this.mSprite_Icon);
     UserInterfacePortManager.ReleaseUtils.Release(ref this.mButton_Use);
     this.mItemYousei       = null;
     this.mKeyController    = null;
     this.mUseCallBack      = null;
     this.mOnCalcelCallBack = null;
     this.mModel            = null;
 }
コード例 #16
0
 private IEnumerator OnGetRewards(ItemlistModel usedModel, IReward[] rewards, Action onAllReceived)
 {
     foreach (IReward reward in rewards)
     {
         if (reward is IReward_Useitem)
         {
             yield return(StartCoroutine(OnGetUseItemReward(usedModel, (IReward_Useitem)reward)));
         }
         else if (reward is IReward_Materials)
         {
             TrophyUtil.Unlock_Material();
             yield return(StartCoroutine(OnGetMaterialsReward(usedModel, (IReward_Materials)reward)));
         }
     }
     onAllReceived?.Invoke();
 }
コード例 #17
0
        private IEnumerator OnGetUseItemReward(ItemlistModel usedModel, IReward_Useitem reward)
        {
            switch (usedModel.MstId)
            {
            case 10:
            case 11:
            case 12:
            {
                UIUseItemReceiveFurnitureBox furnitureBox = Util.Instantiate(mPrefab_UIUseItemReceiveFurnitureBox.gameObject, mTransform_DialogArea.gameObject).GetComponent <UIUseItemReceiveFurnitureBox>();
                mItemListChildDetai.SetKeyController(null);
                furnitureBox.SetKeyController(mKeyController);
                bool showFlag = true;
                StartCoroutine(furnitureBox.Show(usedModel.MstId, reward.Count, delegate
                    {
                        furnitureBox.SetKeyController(null);
                        UnityEngine.Object.Destroy(furnitureBox.gameObject);
                        showFlag = false;
                    }));
                while (showFlag)
                {
                    yield return(null);
                }
                break;
            }

            case 57:
            {
                UIGetRewardDialog dialog = Util.Instantiate(mPrefab_UIGetRewardDialog.gameObject, mTransform_DialogArea.gameObject).GetComponent <UIGetRewardDialog>();
                bool showDialogFlag      = true;
                dialog.Initialize(new Reward_Useitem[1]
                    {
                        (Reward_Useitem)reward
                    });
                dialog.Show(mKeyController);
                dialog.SetOnDialogClosedCallBack(delegate
                    {
                        showDialogFlag = false;
                        UnityEngine.Object.Destroy(dialog.gameObject);
                    });
                while (showDialogFlag)
                {
                    yield return(null);
                }
                break;
            }
            }
        }
コード例 #18
0
 public void Initialize(ItemlistModel model)
 {
     mModel            = model;
     mLabel_Count.text = mModel.Count.ToString();
     if (mModel != null && 0 < mModel.Count)
     {
         mSprite_Icon.SetActive(isActive: true);
         mLabel_Count.SetActive(isActive: true);
         mSprite_Icon.spriteName = $"item_{mModel.MstId}";
         mLabel_Count.text       = mModel.Count.ToString();
     }
     else
     {
         mSprite_Icon.spriteName = string.Empty;
         mLabel_Count.text       = string.Empty;
         mSprite_Icon.SetActive(isActive: false);
         mLabel_Count.SetActive(isActive: false);
     }
 }
コード例 #19
0
        public static void log(ItemlistModel[] items)
        {
            string text = string.Empty;

            for (int i = 0; i < items.Length; i++)
            {
                ItemlistModel itemlistModel = items[i];
                if (itemlistModel != null)
                {
                    text += string.Format("{0}{1}\n", itemlistModel, (!itemlistModel.IsUsable()) ? string.Empty : "[使用可能]");
                }
                else
                {
                    text += " - \n";
                }
            }
            Logging.log(new object[]
            {
                text
            });
        }
コード例 #20
0
        public void Initialize(ItemlistModel model)
        {
            this.mModel            = model;
            this.mLabel_Count.text = this.mModel.Count.ToString();
            bool flag = this.mModel != null && 0 < this.mModel.Count;

            if (flag)
            {
                this.mSprite_Icon.SetActive(true);
                this.mLabel_Count.SetActive(true);
                this.mSprite_Icon.spriteName = string.Format("item_{0}", this.mModel.MstId);
                this.mLabel_Count.text       = this.mModel.Count.ToString();
            }
            else
            {
                this.mSprite_Icon.spriteName = string.Empty;
                this.mLabel_Count.text       = string.Empty;
                this.mSprite_Icon.SetActive(false);
                this.mLabel_Count.SetActive(false);
            }
        }
コード例 #21
0
 public void UpdateInfo(ItemlistModel model)
 {
     mModel = model;
     if (Usable())
     {
         base.transform.SetActive(isActive: true);
         mLabel_Name.text        = model.Name;
         mLabel_Description.text = UserInterfaceAlbumManager.Utils.NormalizeDescription(15, 1, model.Description);
         mSprite_Icon.spriteName = $"item_{mModel.MstId}";
         if (mModel.IsUsable())
         {
             mButton_Use.transform.SetActive(isActive: true);
         }
         else
         {
             mButton_Use.transform.SetActive(isActive: false);
         }
     }
     else
     {
         base.transform.SetActive(isActive: false);
     }
 }
コード例 #22
0
        private void OnSelectUseItemCallBack(ItemlistModel model)
        {
            bool activeState = CurrentState == State.ItemSelect || CurrentState == State.UseCheck;

            if (!activeState)
            {
                return;
            }
            if (CurrentState == State.ItemSelect)
            {
                mItemList.SetKeyController(null);
                PushState(State.UseCheck);
            }
            mItemListChildDetai.SetKeyController(null);
            if (IsExchangeItemlistModel(model))
            {
                int mstId = model.MstId;
                if (mstId == 57)
                {
                    mItemExchangeMedalConfirm.Initialize(model, mItemListManager);
                    mItemExchangeMedalConfirm.SetKeyController(mKeyController);
                    mItemExchangeMedalConfirm.SetOnExchangeItemSelectedCallBack(delegate(ItemExchangeKinds selectedItemExchangeKind)
                    {
                        mItemExchangeMedalConfirm.SetKeyController(null);
                        ItemlistManager.Result result3 = mItemListManager.UseItem(model.MstId, is_force: false, selectedItemExchangeKind);
                        if (result3.IsLimitOver())
                        {
                            mItemExchangeMedalConfirm.Close(null);
                            mItemUseLimitOverConfirm.SetOnNegativeCallBack(delegate
                            {
                                if (CurrentState == State.ExchangeSelect)
                                {
                                    PopState();
                                    mItemUseLimitOverConfirm.Close(null);
                                    mItemUseLimitOverConfirm.SetKeyController(null);
                                    ResumeState();
                                }
                            });
                            mItemUseLimitOverConfirm.SetOnPositiveCallBack(delegate
                            {
                                if (CurrentState == State.ExchangeSelect)
                                {
                                    PopState();
                                    mItemUseLimitOverConfirm.Close(null);
                                    mItemUseLimitOverConfirm.SetKeyController(null);
                                    ItemlistManager.Result result4 = mItemListManager.UseItem(model.MstId, is_force: true, selectedItemExchangeKind);
                                    StartCoroutine(OnGetRewards(model, result4.Rewards, delegate
                                    {
                                        mItemList.Refresh(mItemListManager.HaveItems.ToArray());
                                        ResumeState();
                                    }));
                                }
                            });
                            mItemUseLimitOverConfirm.Initialize();
                            mItemUseLimitOverConfirm.SetKeyController(mKeyController);
                            mItemUseLimitOverConfirm.Show(null);
                            ReplaceState(State.ExchangeSelect);
                        }
                        else
                        {
                            mItemExchangeMedalConfirm.Close(null);
                            ReplaceState(State.GetReward);
                            StartCoroutine(OnGetRewards(model, result3.Rewards, delegate
                            {
                                mItemList.Refresh(mItemListManager.HaveItems.ToArray());
                                PopState();
                                ResumeState();
                            }));
                        }
                    });
                    mItemExchangeMedalConfirm.SetOnCancelCallBack(delegate
                    {
                        mItemExchangeMedalConfirm.Close(null);
                        mItemExchangeMedalConfirm.SetKeyController(null);
                        PopState();
                        ResumeState();
                    });
                    mItemExchangeMedalConfirm.Show(null);
                    ReplaceState(State.ExchangeSelect);
                }
            }
            else
            {
                mItemUseConfirm.SetOnNegativeCallBack(delegate
                {
                    bool flag = CurrentState == State.ExchangeSelect;
                    if (activeState)
                    {
                        PopState();
                        mItemUseConfirm.SetKeyController(null);
                        mItemUseConfirm.Close(null);
                        ResumeState();
                    }
                });
                mItemUseConfirm.SetOnPositiveCallBack(delegate
                {
                    bool flag2 = CurrentState == State.ExchangeSelect;
                    if (activeState)
                    {
                        mItemUseConfirm.SetKeyController(null);
                        mItemUseConfirm.Close(null);
                        ItemlistManager.Result result = mItemListManager.UseItem(model.MstId, is_force: false, ItemExchangeKinds.NONE);
                        if (result == null)
                        {
                            if (model.MstId == 53)
                            {
                                CommonPopupDialog.Instance.StartPopup("これ以上拡張できません");
                            }
                            PopState();
                            ResumeState();
                        }
                        else if (result.IsLimitOver())
                        {
                            ReplaceState(State.ExchangeSelect);
                            mItemUseLimitOverConfirm.SetOnNegativeCallBack(delegate
                            {
                                PopState();
                                mItemUseLimitOverConfirm.SetKeyController(null);
                                mItemUseLimitOverConfirm.Close(null);
                                ResumeState();
                            });
                            mItemUseLimitOverConfirm.SetOnPositiveCallBack(delegate
                            {
                                mItemUseLimitOverConfirm.SetKeyController(null);
                                mItemUseLimitOverConfirm.Close(null);
                                ItemlistManager.Result result2 = mItemListManager.UseItem(model.MstId, is_force: true, ItemExchangeKinds.NONE);
                                StartCoroutine(OnGetRewards(model, result2.Rewards, delegate
                                {
                                    mItemList.Refresh(mItemListManager.HaveItems.ToArray());
                                    PopState();
                                    ResumeState();
                                }));
                            });
                            mItemUseLimitOverConfirm.Initialize();
                            mItemUseLimitOverConfirm.SetKeyController(mKeyController);
                            mItemUseLimitOverConfirm.Show(null);
                        }
                        else
                        {
                            ReplaceState(State.GetReward);
                            IReward[] rewards = result.Rewards;
                            StartCoroutine(OnGetRewards(model, rewards, delegate
                            {
                                mItemList.Refresh(mItemListManager.HaveItems.ToArray());
                                PopState();
                                ResumeState();
                            }));
                        }
                    }
                });
                mItemListChildDetai.SetKeyController(null);
                ReplaceState(State.ExchangeSelect);
                mItemUseConfirm.Initialize();
                mItemUseConfirm.Show(null);
                mItemUseConfirm.SetKeyController(mKeyController);
            }
        }
コード例 #23
0
 private IEnumerator OnGetUseItemReward(ItemlistModel usedModel, IReward_Useitem reward)
 {
     UIItemListManager.< OnGetUseItemReward > c__Iterator90 <OnGetUseItemReward> c__Iterator = new UIItemListManager.< OnGetUseItemReward > c__Iterator90();
コード例 #24
0
        private bool IsExchangeItemlistModel(ItemlistModel model)
        {
            int mstId = model.MstId;

            return(mstId == 57);
        }
コード例 #25
0
        private void OnSelectUseItemCallBack(ItemlistModel model)
        {
            bool activeState = this.CurrentState == UIItemListManager.State.ItemSelect || this.CurrentState == UIItemListManager.State.UseCheck;

            if (activeState)
            {
                if (this.CurrentState == UIItemListManager.State.ItemSelect)
                {
                    this.mItemList.SetKeyController(null);
                    this.PushState(UIItemListManager.State.UseCheck);
                }
                this.mItemListChildDetai.SetKeyController(null);
                bool flag = this.IsExchangeItemlistModel(model);
                if (flag)
                {
                    int mstId = model.MstId;
                    if (mstId == 57)
                    {
                        this.mItemExchangeMedalConfirm.Initialize(model, this.mItemListManager);
                        this.mItemExchangeMedalConfirm.SetKeyController(this.mKeyController);
                        this.mItemExchangeMedalConfirm.SetOnExchangeItemSelectedCallBack(delegate(ItemExchangeKinds selectedItemExchangeKind)
                        {
                            this.mItemExchangeMedalConfirm.SetKeyController(null);
                            ItemlistManager.Result result = this.mItemListManager.UseItem(model.MstId, false, selectedItemExchangeKind);
                            if (result.IsLimitOver())
                            {
                                this.mItemExchangeMedalConfirm.Close(null);
                                this.mItemUseLimitOverConfirm.SetOnNegativeCallBack(delegate
                                {
                                    bool flag2 = this.CurrentState == UIItemListManager.State.ExchangeSelect;
                                    if (flag2)
                                    {
                                        this.PopState();
                                        this.mItemUseLimitOverConfirm.Close(null);
                                        this.mItemUseLimitOverConfirm.SetKeyController(null);
                                        this.ResumeState();
                                    }
                                });
                                this.mItemUseLimitOverConfirm.SetOnPositiveCallBack(delegate
                                {
                                    bool flag2 = this.CurrentState == UIItemListManager.State.ExchangeSelect;
                                    if (flag2)
                                    {
                                        this.PopState();
                                        this.mItemUseLimitOverConfirm.Close(null);
                                        this.mItemUseLimitOverConfirm.SetKeyController(null);
                                        ItemlistManager.Result result2 = this.mItemListManager.UseItem(model.MstId, true, selectedItemExchangeKind);
                                        this.StartCoroutine(this.OnGetRewards(model, result2.Rewards, delegate
                                        {
                                            this.mItemList.Refresh(this.mItemListManager.HaveItems.ToArray());
                                            this.ResumeState();
                                        }));
                                    }
                                });
                                this.mItemUseLimitOverConfirm.Initialize();
                                this.mItemUseLimitOverConfirm.SetKeyController(this.mKeyController);
                                this.mItemUseLimitOverConfirm.Show(null);
                                this.ReplaceState(UIItemListManager.State.ExchangeSelect);
                            }
                            else
                            {
                                this.mItemExchangeMedalConfirm.Close(null);
                                this.ReplaceState(UIItemListManager.State.GetReward);
                                this.StartCoroutine(this.OnGetRewards(model, result.Rewards, delegate
                                {
                                    this.mItemList.Refresh(this.mItemListManager.HaveItems.ToArray());
                                    this.PopState();
                                    this.ResumeState();
                                }));
                            }
                        });
                        this.mItemExchangeMedalConfirm.SetOnCancelCallBack(delegate
                        {
                            this.mItemExchangeMedalConfirm.Close(null);
                            this.mItemExchangeMedalConfirm.SetKeyController(null);
                            this.PopState();
                            this.ResumeState();
                        });
                        this.mItemExchangeMedalConfirm.Show(null);
                        this.ReplaceState(UIItemListManager.State.ExchangeSelect);
                    }
                }
                else
                {
                    this.mItemUseConfirm.SetOnNegativeCallBack(delegate
                    {
                        bool flag2 = this.CurrentState == UIItemListManager.State.ExchangeSelect;
                        if (activeState)
                        {
                            this.PopState();
                            this.mItemUseConfirm.SetKeyController(null);
                            this.mItemUseConfirm.Close(null);
                            this.ResumeState();
                        }
                    });
                    this.mItemUseConfirm.SetOnPositiveCallBack(delegate
                    {
                        bool flag2 = this.CurrentState == UIItemListManager.State.ExchangeSelect;
                        if (activeState)
                        {
                            this.mItemUseConfirm.SetKeyController(null);
                            this.mItemUseConfirm.Close(null);
                            ItemlistManager.Result result = this.mItemListManager.UseItem(model.MstId, false, ItemExchangeKinds.NONE);
                            if (result == null)
                            {
                                if (model.MstId == 53)
                                {
                                    CommonPopupDialog.Instance.StartPopup("これ以上拡張できません");
                                }
                                this.PopState();
                                this.ResumeState();
                            }
                            else if (result.IsLimitOver())
                            {
                                this.ReplaceState(UIItemListManager.State.ExchangeSelect);
                                this.mItemUseLimitOverConfirm.SetOnNegativeCallBack(delegate
                                {
                                    this.PopState();
                                    this.mItemUseLimitOverConfirm.SetKeyController(null);
                                    this.mItemUseLimitOverConfirm.Close(null);
                                    this.ResumeState();
                                });
                                this.mItemUseLimitOverConfirm.SetOnPositiveCallBack(delegate
                                {
                                    this.mItemUseLimitOverConfirm.SetKeyController(null);
                                    this.mItemUseLimitOverConfirm.Close(null);
                                    ItemlistManager.Result result2 = this.mItemListManager.UseItem(model.MstId, true, ItemExchangeKinds.NONE);
                                    this.StartCoroutine(this.OnGetRewards(model, result2.Rewards, delegate
                                    {
                                        this.mItemList.Refresh(this.mItemListManager.HaveItems.ToArray());
                                        this.PopState();
                                        this.ResumeState();
                                    }));
                                });
                                this.mItemUseLimitOverConfirm.Initialize();
                                this.mItemUseLimitOverConfirm.SetKeyController(this.mKeyController);
                                this.mItemUseLimitOverConfirm.Show(null);
                            }
                            else
                            {
                                this.ReplaceState(UIItemListManager.State.GetReward);
                                IReward[] rewards = result.Rewards;
                                this.StartCoroutine(this.OnGetRewards(model, rewards, delegate
                                {
                                    this.mItemList.Refresh(this.mItemListManager.HaveItems.ToArray());
                                    this.PopState();
                                    this.ResumeState();
                                }));
                            }
                        }
                    });
                    this.mItemListChildDetai.SetKeyController(null);
                    this.ReplaceState(UIItemListManager.State.ExchangeSelect);
                    this.mItemUseConfirm.Initialize();
                    this.mItemUseConfirm.Show(null);
                    this.mItemUseConfirm.SetKeyController(this.mKeyController);
                }
            }
        }
コード例 #26
0
        protected void _Init(bool all_item)
        {
            if (_descriptions == null)
            {
                _descriptions = Mst_DataManager.Instance.GetUseitemText();
            }
            _have_items = new List <ItemlistModel>();
            if (_mst_cabinet == null)
            {
                _mst_cabinet = Mst_DataManager.Instance.GetMstCabinet();
            }
            List <Mst_item_shop> list = _mst_cabinet[3];

            _cabinet_relations = new Dictionary <ItemlistModel, Mst_item_shop>();
            Api_Result <Dictionary <int, Mem_useitem> > api_Result = new Api_get_Member().UseItem();

            if (api_Result.state == Api_Result_State.Success)
            {
                Dictionary <int, Mst_useitem> mst_useitem = Mst_DataManager.Instance.Mst_useitem;
                Dictionary <int, Mem_useitem> dictionary  = (api_Result.data != null) ? api_Result.data : new Dictionary <int, Mem_useitem>();
                if (all_item)
                {
                    foreach (Mst_useitem value7 in mst_useitem.Values)
                    {
                        if (!(value7.Name == string.Empty))
                        {
                            Mem_useitem value = null;
                            dictionary.TryGetValue(value7.Id, out value);
                            _descriptions.TryGetValue(value7.Id, out string value2);
                            ItemlistModel tmp = new ItemlistModel(value7, value, value2);
                            _have_items.Add(tmp);
                            Mst_item_shop value3 = list.Find((Mst_item_shop item) => item.Item1_id == tmp.MstId);
                            _cabinet_relations.Add(tmp, value3);
                        }
                    }
                    _have_items.Sort((ItemlistModel a, ItemlistModel b) => (a.MstId > b.MstId) ? 1 : (-1));
                }
                else
                {
                    foreach (Mst_item_shop item in list)
                    {
                        int         key    = (item.Item1_type == 1) ? item.Item1_id : 0;
                        Mst_useitem value4 = null;
                        mst_useitem.TryGetValue(key, out value4);
                        Mem_useitem value5 = null;
                        dictionary.TryGetValue(key, out value5);
                        string value6 = string.Empty;
                        if (value4 != null)
                        {
                            _descriptions.TryGetValue(value4.Id, out value6);
                        }
                        ItemlistModel itemlistModel = new ItemlistModel(value4, value5, value6);
                        _have_items.Add(itemlistModel);
                        _cabinet_relations.Add(itemlistModel, item);
                    }
                }
                __UpdateCount__();
                return;
            }
            throw new Exception("Logic Error");
        }
コード例 #27
0
        protected void _Init(bool all_item)
        {
            if (this._descriptions == null)
            {
                this._descriptions = Mst_DataManager.Instance.GetUseitemText();
            }
            this._have_items = new List <ItemlistModel>();
            if (this._mst_cabinet == null)
            {
                this._mst_cabinet = Mst_DataManager.Instance.GetMstCabinet();
            }
            List <Mst_item_shop> list = this._mst_cabinet.get_Item(3);

            this._cabinet_relations = new Dictionary <ItemlistModel, Mst_item_shop>();
            Api_Result <Dictionary <int, Mem_useitem> > api_Result = new Api_get_Member().UseItem();

            if (api_Result.state == Api_Result_State.Success)
            {
                Dictionary <int, Mst_useitem> mst_useitem = Mst_DataManager.Instance.Mst_useitem;
                Dictionary <int, Mem_useitem> dictionary  = (api_Result.data != null) ? api_Result.data : new Dictionary <int, Mem_useitem>();
                if (all_item)
                {
                    using (Dictionary <int, Mst_useitem> .ValueCollection.Enumerator enumerator = mst_useitem.get_Values().GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            Mst_useitem current = enumerator.get_Current();
                            if (!(current.Name == string.Empty))
                            {
                                Mem_useitem mem_data = null;
                                dictionary.TryGetValue(current.Id, ref mem_data);
                                string description;
                                this._descriptions.TryGetValue(current.Id, ref description);
                                ItemlistModel tmp = new ItemlistModel(current, mem_data, description);
                                this._have_items.Add(tmp);
                                Mst_item_shop mst_item_shop = list.Find((Mst_item_shop item) => item.Item1_id == tmp.MstId);
                                this._cabinet_relations.Add(tmp, mst_item_shop);
                            }
                        }
                    }
                    this._have_items.Sort((ItemlistModel a, ItemlistModel b) => (a.MstId <= b.MstId) ? -1 : 1);
                }
                else
                {
                    using (List <Mst_item_shop> .Enumerator enumerator2 = list.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            Mst_item_shop current2     = enumerator2.get_Current();
                            int           num          = (current2.Item1_type != 1) ? 0 : current2.Item1_id;
                            Mst_useitem   mst_useitem2 = null;
                            mst_useitem.TryGetValue(num, ref mst_useitem2);
                            Mem_useitem mem_data2 = null;
                            dictionary.TryGetValue(num, ref mem_data2);
                            string empty = string.Empty;
                            if (mst_useitem2 != null)
                            {
                                this._descriptions.TryGetValue(mst_useitem2.Id, ref empty);
                            }
                            ItemlistModel itemlistModel = new ItemlistModel(mst_useitem2, mem_data2, empty);
                            this._have_items.Add(itemlistModel);
                            this._cabinet_relations.Add(itemlistModel, current2);
                        }
                    }
                }
                this.__UpdateCount__();
                return;
            }
            throw new Exception("Logic Error");
        }
コード例 #28
0
 private void OnItemListFocusChangeListener(ItemlistModel model)
 {
     mItemListChildDetai.UpdateInfo(model);
 }
コード例 #29
0
 private void OnItemListInItemSelectedListener(ItemlistModel model)
 {
     mItemList.SetKeyController(null);
     PushState(State.UseCheck);
 }