예제 #1
0
 public RTShopGridData(EShopType shopType, ShopItemData data, RTShopGridData.ShopItemCallback buyCallback, RTShopGridData.ShopItemCallback showCallback)
 {
     this.ShopType = shopType;
     this.shopData = data;
     this.AVData = Globals.Instance.Player.ActivitySystem.GetValueMod(7);
     if (this.shopData.InfoType == 1)
     {
         this.itemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.shopData.InfoID);
         if (this.itemInfo.Type == 3 && this.itemInfo.SubType == 0)
         {
             this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
         }
         else if (this.itemInfo.Type == 3 && this.itemInfo.SubType == 3)
         {
             this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2);
         }
     }
     else if (this.shopData.InfoType == 2)
     {
         this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.shopData.InfoID);
     }
     else if (this.shopData.InfoType == 3)
     {
         this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.shopData.InfoID);
     }
     this.BuyShopItemEvent = buyCallback;
     this.ShowShopItemEvent = showCallback;
 }
예제 #2
0
 public void Show(ShopGridData data)
 {
     this.rtShopData = null;
     this.shopData = data;
     if (this.shopData == null || this.shopData.shopInfo == null)
     {
         base.gameObject.SetActive(false);
         return;
     }
     this.ItemIcon.Refresh(this.shopData);
     this.PriceIcon.spriteName = Tools.GetCurrencyIcon((ECurrencyType)this.shopData.shopInfo.CurrencyType);
     this.PriceCount.text = this.shopData.shopInfo.Price.ToString();
     this.Hot.gameObject.SetActive(false);
     if (this.shopData.shopInfo.Price2 > 0)
     {
         this.PriceIcon1.spriteName = Tools.GetCurrencyIcon((ECurrencyType)this.shopData.shopInfo.CurrencyType2);
         this.PriceCount1.text = this.shopData.shopInfo.Price2.ToString();
         this.PriceIcon1.gameObject.SetActive(true);
     }
     else
     {
         this.PriceIcon1.gameObject.SetActive(false);
     }
     base.gameObject.SetActive(true);
 }
예제 #3
0
 public void Show(RTShopGridData data)
 {
     this.rtShopData = data;
     this.shopData = null;
     if (this.rtShopData == null)
     {
         base.gameObject.SetActive(false);
         return;
     }
     this.ItemIcon.Refresh(this.rtShopData);
     this.PriceIcon.spriteName = Tools.GetCurrencyIcon((ECurrencyType)this.rtShopData.shopData.Type);
     this.PriceCount.text = this.rtShopData.GetPrice().ToString();
     this.PriceIcon1.gameObject.SetActive(false);
     this.Hot.gameObject.SetActive(this.rtShopData.AVData != null);
     base.gameObject.SetActive(true);
 }
예제 #4
0
 public override void Refresh(object data)
 {
     this.gridData = (RTShopGridData)data;
     this.RefreshShopInfo();
 }
예제 #5
0
 public static void RequestShopBuyRTItem(RTShopGridData data, EShopType shopType)
 {
     if (data == null || data.shopData == null)
     {
         return;
     }
     if (data.shopData.BuyCount != 0u)
     {
         GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopT3"), 0f, 0f);
         return;
     }
     int num = data.GetPrice();
     if (Tools.GetCurrencyMoney((ECurrencyType)data.shopData.Type, 0) < num)
     {
         Tools.MoneyNotEnough((ECurrencyType)data.shopData.Type, num, 0);
         return;
     }
     MC2S_ShopBuyItem mC2S_ShopBuyItem = new MC2S_ShopBuyItem();
     mC2S_ShopBuyItem.ID = data.shopData.ID;
     mC2S_ShopBuyItem.Price = (uint)num;
     mC2S_ShopBuyItem.ShopType = (int)shopType;
     mC2S_ShopBuyItem.Count = 1;
     Globals.Instance.CliSession.Send(514, mC2S_ShopBuyItem);
 }
예제 #6
0
 private void OnBuyClicked(GameObject go)
 {
     Globals.Instance.EffectSoundMgr.Play("ui/ui_026");
     if (this.rtShopData != null)
     {
         GUIShortcutBuyItem.RequestShopBuyRTItem(this.rtShopData, this.rtShopData.ShopType);
     }
     else if (this.shopData != null)
     {
         GUIShortcutBuyItem.RequestShopBuyItem(this.shopData.shopInfo, this.shopData.ShopType, 1);
     }
     this.rtShopData = null;
     this.shopData = null;
     base.gameObject.SetActive(false);
 }
예제 #7
0
 private void OnCancelClicked(GameObject go)
 {
     Globals.Instance.EffectSoundMgr.Play("ui/ui_002");
     this.rtShopData = null;
     this.shopData = null;
     base.gameObject.SetActive(false);
 }
예제 #8
0
 public void Refresh(RTShopGridData gridData)
 {
     LocalPlayer player = Globals.Instance.Player;
     this.fashionIcon.gameObject.SetActive(false);
     if (gridData.shopData.InfoType == 1)
     {
         if (gridData.itemInfo == null)
         {
             base.gameObject.SetActive(false);
             return;
         }
         this.itemQuality.spriteName = Tools.GetItemQualityIcon(gridData.itemInfo.Quality);
         if (gridData.itemInfo.Type == 3 && gridData.itemInfo.SubType == 0)
         {
             this.petIcon.spriteName = gridData.petInfo.Icon;
             this.itemIcon.gameObject.SetActive(false);
             this.petIcon.gameObject.SetActive(true);
             this.lopetIcon.gameObject.SetActive(false);
             this.itemFrag.spriteName = "frag";
         }
         else if (gridData.itemInfo.Type == 3 && gridData.itemInfo.SubType == 3)
         {
             this.lopetIcon.spriteName = gridData.lopetInfo.Icon;
             this.itemIcon.gameObject.SetActive(false);
             this.petIcon.gameObject.SetActive(false);
             this.lopetIcon.gameObject.SetActive(true);
             this.itemFrag.spriteName = "frag";
         }
         else
         {
             this.itemIcon.spriteName = gridData.itemInfo.Icon;
             this.itemIcon.gameObject.SetActive(true);
             this.petIcon.gameObject.SetActive(false);
             this.lopetIcon.gameObject.SetActive(false);
             this.itemFrag.spriteName = "frag2";
         }
         this.itemName.text = gridData.itemInfo.Name;
         this.itemName.color = Tools.GetItemQualityColor(gridData.itemInfo.Quality);
         this.itemFrag.gameObject.SetActive(gridData.itemInfo.Type == 3);
         if (gridData.itemInfo.Type == 3)
         {
             if (this.itemCount != null)
             {
                 this.itemCount.text = string.Format("({0}/{1})", player.ItemSystem.GetItemCount(gridData.itemInfo.ID), gridData.itemInfo.Value1);
                 this.itemCount.gameObject.SetActive(true);
             }
         }
         else if (this.itemCount != null)
         {
             this.itemCount.gameObject.SetActive(false);
         }
     }
     else if (gridData.shopData.InfoType == 2)
     {
         if (gridData.petInfo == null)
         {
             base.gameObject.SetActive(false);
             return;
         }
         this.itemQuality.spriteName = Tools.GetItemQualityIcon(gridData.petInfo.Quality);
         this.petIcon.spriteName = gridData.petInfo.Icon;
         this.itemIcon.gameObject.SetActive(false);
         this.petIcon.gameObject.SetActive(true);
         this.lopetIcon.gameObject.SetActive(false);
         this.itemName.text = Tools.GetPetName(gridData.petInfo);
         this.itemName.color = Tools.GetItemQualityColor(gridData.petInfo.Quality);
         this.itemFrag.gameObject.SetActive(false);
         if (this.itemCount != null)
         {
             this.itemCount.gameObject.SetActive(false);
         }
     }
     else
     {
         if (gridData.shopData.InfoType != 3)
         {
             base.gameObject.SetActive(false);
             return;
         }
         if (gridData.petInfo == null)
         {
             base.gameObject.SetActive(false);
             return;
         }
         this.itemQuality.spriteName = Tools.GetItemQualityIcon(gridData.lopetInfo.Quality);
         this.lopetIcon.spriteName = gridData.lopetInfo.Icon;
         this.itemIcon.gameObject.SetActive(false);
         this.petIcon.gameObject.SetActive(false);
         this.lopetIcon.gameObject.SetActive(true);
         this.itemName.text = gridData.lopetInfo.Name;
         this.itemName.color = Tools.GetItemQualityColor(gridData.lopetInfo.Quality);
         this.itemFrag.gameObject.SetActive(false);
         if (this.itemCount != null)
         {
             this.itemCount.gameObject.SetActive(false);
         }
     }
     if (gridData.shopData.Count == 0u)
     {
         this.itemNum.gameObject.SetActive(false);
     }
     else
     {
         this.itemNum.text = gridData.shopData.Count.ToString();
         this.itemNum.gameObject.SetActive(true);
     }
 }
예제 #9
0
 private void OnOpenShowRTShopItemDialog(RTShopGridData data)
 {
     if (data == null)
     {
         return;
     }
     if (data.shopData.InfoType == 1 && data.itemInfo != null)
     {
         GameUIManager.mInstance.ShowItemInfo(data.itemInfo);
     }
     else if (data.shopData.InfoType == 2 && data.petInfo != null)
     {
         GameUIManager.mInstance.ShowPetInfo(data.petInfo);
     }
 }
예제 #10
0
 private void OnOpenRTShopBuyCheckDialog(RTShopGridData data)
 {
     if (data.shopData.Type == 1)
     {
         Globals.Instance.EffectSoundMgr.Play("ui/ui_001");
         if (this.BuyCheckWnd != null)
         {
             this.BuyCheckWnd.Show(data);
         }
     }
     else
     {
         Globals.Instance.EffectSoundMgr.Play("ui/ui_026");
         GUIShortcutBuyItem.RequestShopBuyRTItem(data, data.ShopType);
     }
 }