public List <Push_Info> GetPushInfosByTurnOnType(ENUM_PUSH_GIFT_BLOCK_TYPE type_, bool bought = false)
        {
            if (ENUM_PUSH_GIFT_BLOCK_TYPE.E_LOGIN == type_)
            {
                if (null != this.m_login_push_infos)
                {
                    var boughts = this.m_login_push_infos.FindAll((item) => bought == item.Buyed);

                    if (null == boughts || 0 == boughts.Count)
                    {
                        return(null);
                    }
                }

                return(this.m_login_push_infos);
            }
            else if (ENUM_PUSH_GIFT_BLOCK_TYPE.E_LVL == type_)
            {
                return(this.m_level_up_push_infos);
            }
            else
            {
                List <Push_Info> cur_infos = new List <Push_Info>();

                this.m_block_push_infos.ForEach((item) => { if ((byte)type_ == ConfPush.Get(item.PushId).bolckType)
                                                            {
                                                                cur_infos.Add(item);
                                                            }
                                                });

                return(cur_infos.Count > 0 ? cur_infos : null);
            }
        }
Example #2
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            if (param != null)
            {
                curType = (ENUM_PUSH_GIFT_BLOCK_TYPE)param;
            }
            else
            {
                OnQuit(null);
            }
            this.m_btnQuit.AddClickCallBack(OnQuit);
            for (int i = 0; i < this.m_giftItem.Length; i++)
            {
                this.m_giftItem[i].Visible = false;
            }
            List <Push_Info> gifts = PushGiftManager.Instance.GetPushInfosByTurnOnType(curType);

            if (gifts != null)
            {
                for (int i = 0; i < gifts.Count; i++)
                {
                    if (i < this.m_giftItem.Length)
                    {
                        m_giftItem[i].Refresh(gifts[i]);
                        m_giftItem[i].Visible = true;
                    }
                }
            }
        }
Example #3
0
        public bool ShowPushGiftView(ENUM_PUSH_GIFT_BLOCK_TYPE block_type)
        {
            List <Push_Info> cur_infos = PushGiftManager.Instance.GetPushInfosByTurnOnType(block_type);

            if (null != cur_infos && cur_infos.Count > 0)
            {
                m_push_gift_view.Refresh(cur_infos, OnGiftViewClosed);
                m_push_gift_view.Visible = true;
            }

            return(true);
        }
        public bool TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE type_)
        {
            if (null == this.GetPushInfosByTurnOnType(type_))
            {
                return(false);
            }

            if (type_ == ENUM_PUSH_GIFT_BLOCK_TYPE.E_COIN || type_ == ENUM_PUSH_GIFT_BLOCK_TYPE.E_VIT)
            {
                GiftBagUILogic.OpenGiftBag(type_);
                return(true);
            }

            if (!GameEvents.UIEvents.UI_PushGift_Event.OnGo.SafeInvoke(type_))
            {
                Cache(type_);
            }

            return(true);
        }
Example #5
0
        private void OnCloseClicked(GameObject obj)
        {
            ENUM_PUSH_GIFT_BLOCK_TYPE push_type = PushGiftManager.Instance.GetTurnOnType();

            if (ENUM_PUSH_GIFT_BLOCK_TYPE.E_NONE == push_type)
            {
                this.Visible = false;
                return;
            }

            List <Push_Info> infos = PushGiftManager.Instance.GetPushInfosByTurnOnType(push_type);

            if (null == infos)
            {
                this.Visible = false;
                return;
            }

            this.Refresh(infos, OnClosed);
        }
Example #6
0
        private void ShowGifts(ENUM_PUSH_GIFT_BLOCK_TYPE gift_type_)
        {
            List <Push_Info> gifts = PushGiftManager.Instance.GetPushInfosByTurnOnType(gift_type_);

            if (null != gifts)
            {
                m_gifts_grid.EnsureSize <LoseGiftItemView>(gifts.Count);

                for (int i = 0; i < gifts.Count; ++i)
                {
                    LoseGiftItemView item = m_gifts_grid.GetChild <LoseGiftItemView>(i);
                    item.Refresh(gifts[i]);
                    item.Visible = false;
                    item.Visible = true;
                }
            }
            else
            {
                m_gifts_grid.Clear();
            }
        }
Example #7
0
        private void OnShowBonusPopView(EUNM_BONUS_POP_VIEW_TYPE t_)
        {
            if (EUNM_BONUS_POP_VIEW_TYPE.E_PUSH_GIFT != t_)
            {
                return;
            }

            if (IAPTools.instance.IsInitialized())
            {
                bool taskStatus5 = SeekerGame.NewGuid.GuidNewManager.Instance.GetProgressByIndex(5);
                bool taskStatus7 = SeekerGame.NewGuid.GuidNewManager.Instance.GetProgressByIndex(7);

                ENUM_PUSH_GIFT_BLOCK_TYPE pg_type = ENUM_PUSH_GIFT_BLOCK_TYPE.E_NONE;



                pg_type = PushGiftManager.Instance.GetTurnOnType();
                if (ENUM_PUSH_GIFT_BLOCK_TYPE.E_NONE != pg_type && taskStatus5)
                {
                    if (ENUM_PUSH_GIFT_BLOCK_TYPE.E_LOGIN == pg_type && !string.IsNullOrEmpty(this.m_cur_call_ui_name))
                    {
                        this.m_cur_call_ui_name = string.Empty;

                        this.ShowPushGiftView(pg_type);
                    }
                    else
                    {
                        this.ShowPushGiftView(pg_type);
                    }
                }
                else
                {
                    m_push_gift_view.Visible = false;
                }
            }
        }
 public void Cache(ENUM_PUSH_GIFT_BLOCK_TYPE type_)
 {
     m_turn_on_types.Push(type_);
 }
Example #9
0
 public static void OpenGiftBag(ENUM_PUSH_GIFT_BLOCK_TYPE type)
 {
     FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_GIFTBAG);
     param.Param = type;
     EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param);
 }