Exemplo n.º 1
0
 private void OnResponse(object obj)
 {
     if (obj == null)
     {
         return;
     }
     if (obj is MarketResponse)
     {
         var res = (MarketResponse)obj;
         if (res.Category == cate)
         {
             ShopPropData m_crashdata = ShopHelper.getShopData(res);
             InitData(m_crashdata);
         }
     }
 }
Exemplo n.º 2
0
 private ShopItemData getShopDataByID()
 {
     if (m_curChooseID < 0)
     {
         return(null);
     }
     if (m_curType == ShopType.BlackMarket)
     {
         return(ShopHelper.getShopDataByID(m_blackdata, m_curChooseID));
     }
     else if (m_curType == ShopType.Prop)
     {
         return(ShopHelper.getShopDataByID(m_propdata, m_curChooseID));
     }
     return(null);
 }
Exemplo n.º 3
0
 public void RefreshPageByCacheData(Category cat)
 {
     if (cat == Category.Black)
     {
         m_ChooseEffect.gameObject.transform.SetParent(m_MaskRoot, false);
         m_blackdata   = ShopHelper.getShopData(cat);
         m_NeedReflash = true;
         System.DateTime dt = CommonTools.TimeStampToDateTime(m_blackdata.m_NextReflashTime);
         m_TotalSecond          = (float)(dt - System.DateTime.Now).TotalSeconds + 2;
         m_curTime              = Time.time;
         m_tradingTime_lab.Text = CommonTools.SecondToStringDDMMSS(m_TotalSecond);
         ReflashShop(m_blackdata);
     }
     else if (cat == Category.Common)
     {
         m_ChooseEffect.gameObject.transform.SetParent(m_MaskRoot, false);
         m_propdata = ShopHelper.getShopData((cat));
         ReflashShop(m_propdata);
     }
 }
Exemplo n.º 4
0
        public virtual void setData(ShopItemData itemdata, ShopType shopType, int index_, bool is_fast_buy = false)
        {
            m_itemdata    = itemdata;
            m_curShopType = shopType;
            m_is_fast_buy = is_fast_buy;
            m_idx         = index_;
            if (itemdata == null)
            {
                return;
            }
            if (itemdata.m_prop != null)
            {
                m_icon_img.Sprite = itemdata.m_prop.icon;
            }

            m_cashType_img.Sprite         = ShopHelper.getCashType(itemdata.m_costType);
            m_limited_cashType_img.Sprite = ShopHelper.getCashType(itemdata.m_costType);

            m_count_lab.Text = string.Format("x{0}", itemdata.m_number);

            if (itemdata.m_hasDis)
            {
                m_cost = itemdata.m_disPrice;
                m_disCount_root.Visible = true;
                m_oriPrice_root.Visible = true;
                m_disCount_lab.Text     = string.Format("-{0}%", (100 - itemdata.m_disCount));
                m_oriPrice_lab.Text     = itemdata.m_oriPrice.ToString();
                m_limited_cost_lab.Text = m_cost_lab.Text = itemdata.m_disPrice.ToString();
            }
            else
            {
                m_cost = itemdata.m_oriPrice;
                m_disCount_root.Visible = false;
                m_oriPrice_root.Visible = false;
                m_limited_cost_lab.Text = m_cost_lab.Text = itemdata.m_oriPrice.ToString();
            }

            if (ShopType.Coin == m_curShopType && null == m_icon_effect)
            {
                m_icon_effect = Make <GameUIEffect>("UI_jinbi_goumai01");
            }

            if (null != m_icon_effect)
            {
                m_icon_effect.EffectPrefabName = string.Format("UI_jinbi_goumai0{0}.prefab", index_ + 1);
            }

            if (ShopType.Vit == m_curShopType && itemdata.m_limitNumber >= 0)
            {
                m_limited_buy_btn.Visible  = true;
                m_buy_btn.Visible          = false;
                m_limited_max_num          = itemdata.m_limitNumber;
                m_limited_buy_num_txt.Text = string.Format("({0}/{1})", m_limited_max_num, m_limited_max_num);
            }
            else
            {
                m_limited_buy_btn.Visible = false;
                m_buy_btn.Visible         = true;
            }

            if (ShopType.Vit == m_curShopType && 0 == itemdata.m_limitNumber)
            {
                m_limited_buy_btn.Enable = false;
                m_limited_buy_btn.SetGray(true);
            }
            else
            {
                m_limited_buy_btn.Enable = true;
                m_limited_buy_btn.SetGray(false);
            }
        }
Exemplo n.º 5
0
        void PreSyncUIData()
        {
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(new CSGetPushRequest());

            ShopHelper.RefreshAllShopData();
        }
Exemplo n.º 6
0
        public static void btnTransPanel(string panelName)
        {
            if (panelName.Equals(UIDefine.UI_MAIL))
            {
                EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_MAIL);
            }

            else if (panelName.Equals(UIDefine.UI_BAG))
            {
                //CSPlayerPropRequest msg_prop = new CSPlayerPropRequest();
                //GameEvents.NetWorkEvents.SendHalfSyncMsg.SafeInvoke(msg_prop);

                //EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_BAG);
                EngineCoreEvents.UIEvent.ShowUIByOther.SafeInvoke(UIDefine.UI_BAG, UIDefine.UI_GAMEENTRY);
            }
#if OFFICER_SYS
            else if (panelName.Equals(UIDefine.UI_POLICE))
            {
                EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_POLICE);
            }
#endif
            else if (panelName.Equals(UIDefine.UI_EVENT_INGAME_ENTRY))
            {
                CSEventDropInfoRequest req = new CSEventDropInfoRequest();

#if TEST
                req.EventId = 2;
#endif

#if !NETWORK_SYNC || UNITY_EDITOR
                GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
#else
                GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
#endif
            }
            else if (panelName.Equals(UIDefine.UI_SHOP))
            {
                if (ShopHelper.IsShopDataAvaliable(Category.Common))
                {
                    ShopHelper.OpenShop(Category.Common);
                }
                else
                {
                    MessageHandler.RegisterMessageHandler(MessageDefine.MarketResponse, GameEntryHelper.TransPanel);

                    MarketRequest req = new MarketRequest();
                    req.Category = Category.Common;

                    GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
                }
            }
            else if (panelName.Equals(UIDefine.UI_SCENETALK))
            {
                TalkUIHelper.OnStartTalk(3);
            }
            else if (panelName.Equals(UIDefine.UI_SLOTS))
            {
                EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_ACTIVITY);
            }
            else if (panelName.Equals(UIDefine.UI_ACHIEVEMENT))
            {
                EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_ACHIEVEMENT);
            }
            else if (panelName.Equals(UIDefine.UI_FRIEND))
            {
                EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_FRIEND);
            }
            else if (panelName == UIDefine.UI_CHAPTER)
            {
                EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_CHAPTER);
            }
            else if (panelName.Equals(UIDefine.UI_COMBINE))
            {
                EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_COMBINE);
            }
        }