Browse Source

商店购买扩展

guodong 1 năm trước cách đây
mục cha
commit
76d8ae7525

+ 1 - 1
GameClient/Assets/Editor/Excel/ExcelChecker.cs

@@ -105,7 +105,7 @@ namespace GFGEditor
             foreach (ShopCfg cfg in dataArray)
             {
                 CheckItemIdExist(cfg.itemId, "商城ClothingShopCfg.itemID");
-                CheckItemIdExist(cfg.costId, "商城ClothingShopCfg.costID");
+                CheckItemIdExist(cfg.CostIdReal, "商城ClothingShopCfg.costID");
             }
         }
 

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs

@@ -50,7 +50,7 @@ namespace GFGGame
         {
             ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(buyId);
 
-            costId = shopCfg.costId;
+            costId = shopCfg.CostIdReal;
             costNum = shopCfg.Price * count;
             buyNum = count;
         }
@@ -139,10 +139,10 @@ namespace GFGGame
             List<int> costIds = new List<int>();
             for (int i = 0; i < shopCfgs.Count; i++)
             {
-                if (shopCfgs[i].costId == 0) continue;
-                if (costIds.IndexOf(shopCfgs[i].costId) < 0)
+                if (shopCfgs[i].CostIdReal == 0) continue;
+                if (costIds.IndexOf(shopCfgs[i].CostIdReal) < 0)
                 {
-                    costIds.Add(shopCfgs[i].costId);
+                    costIds.Add(shopCfgs[i].CostIdReal);
                 }
             }
             return costIds;

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Data/ShopViewManager.cs

@@ -100,13 +100,13 @@ namespace GFGGame
             if (item.m_c1.selectedIndex == 0)//可购买
             {
                 item.m_btnBuy.m_txtOriginalPrice.text = NumberUtil.ChangeNumberUnit(shopCfg.originalPrice);
-                if (shopCfg.Price > 0 && shopCfg.costType != CostType.FREE)//不免费
+                if (shopCfg.Price > 0 && shopCfg.CostTypeReal != CostType.FREE)//不免费
                 {
                     item.m_btnBuy.m_grpOriginalPrice.visible = shopCfg.originalPrice > 0 && shopCfg.originalPrice != shopCfg.Price;
                     item.m_btnBuy.m_loaIcon.visible = true;
                     item.m_btnBuy.m_txtPrice.text = NumberUtil.ChangeNumberUnit(shopCfg.Price);// cfg.price.ToString();
 
-                    if (shopCfg.costType == CostType.RMB)//人民币
+                    if (shopCfg.CostTypeReal == CostType.RMB)//人民币
                     {
                         item.m_btnBuy.m_loaIcon.visible = false;
                         item.m_btnBuy.m_txtIcon.visible = true;
@@ -114,7 +114,7 @@ namespace GFGGame
                     }
                     else//道具
                     {
-                        ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
+                        ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.CostIdReal);
                         item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(costItemCfg.res);
                         item.m_btnBuy.m_loaIcon.visible = true;
                         item.m_btnBuy.m_txtIcon.visible = false;
@@ -155,7 +155,7 @@ namespace GFGGame
             //     return;
             // }
 
-            if (cfg.costType == CostType.FREE)
+            if (cfg.CostTypeReal == CostType.FREE)
             {
                 ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/ShopSProxy.cs

@@ -65,7 +65,7 @@ namespace GFGGame
                 {
                     ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(response.BuyId);
                     ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
-                    if (shopCfg.costType == CostType.RMB)
+                    if (shopCfg.CostTypeReal == CostType.RMB)
                     {
                         QDManager.Pay(response.BuyId, response.Times, response.OrderId, response.Price);
                         return false;

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs

@@ -315,10 +315,10 @@ namespace GFGGame
             string itemName = itemCfg.name;
             listItem.m_txtName.text = itemName;
             RarityIconController.UpdateRarityIcon(listItem.m_rarity, cfg.itemId, false);
-            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(cfg.costId);
+            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(cfg.CostIdReal);
             listItem.m_iconPrice.url = "ui://CommonGame/" + costItemCfg.res;
             listItem.m_imgOwned.visible = ItemDataManager.GetItemNum(cfg.itemId) > 0;
-            listItem.m_txtPrice.text = ItemDataManager.GetItemNum(cfg.costId) >= cfg.Price ? StringUtil.GetColorText(cfg.Price.ToString(), "#DD994A") : StringUtil.GetColorText(cfg.Price.ToString(), "#F2989B");
+            listItem.m_txtPrice.text = ItemDataManager.GetItemNum(cfg.CostIdReal) >= cfg.Price ? StringUtil.GetColorText(cfg.Price.ToString(), "#DD994A") : StringUtil.GetColorText(cfg.Price.ToString(), "#F2989B");
             listItem.m_loaMainScore.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (itemCfg.mainScore));
 
             UI_ListClothingShopItem.ProxyEnd();
@@ -349,7 +349,7 @@ namespace GFGGame
             _ui.m_compItemInfo.m_txtName.text = itemName;
             _ui.m_compItemInfo.m_txtDesc.text = itemCfg.desc;
             RarityIconController.UpdateRarityIcon(_ui.m_compItemInfo.m_rarity, _cfgSelected.itemId, false);
-            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(_cfgSelected.costId);
+            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(_cfgSelected.CostIdReal);
             _ui.m_compItemInfo.m_iconPrice.url = "ui://CommonGame/" + costItemCfg.res;
             _ui.m_compItemInfo.m_txtPrice.text = "" + _cfgSelected.Price;
             _ui.m_compItemInfo.m_txtGong.text = "" + itemCfg.score1;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/GalleryShopView.cs

@@ -227,7 +227,7 @@ namespace GFGGame
             string itemName = itemCfg.name;
             listItem.m_txtName.text = itemName;
             // RarityIconController.UpdateRarityIcon(listItem.m_rarity, cfg.itemID, false);
-            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(cfg.costId);
+            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(cfg.CostIdReal);
             listItem.m_iconPrice.url = "ui://CommonGame/" + costItemCfg.res;
             listItem.m_imgOwned.visible = ItemDataManager.GetItemNum(cfg.itemId) > 0;
             // listItem.m_txtPrice.text = ItemDataManager.GetItemNum(cfg.costID) >= cfg.costNum ? StringUtil.GetColorText(cfg.costNum.ToString(), "#DD994A") : StringUtil.GetColorText(cfg.costNum.ToString(), "#F2989B");

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyCountView.cs

@@ -123,7 +123,7 @@ namespace GFGGame
             if (buyType == ConstBuyType.TYPE_SHOP)
             {
                 ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(buyId);
-                int maxBuyCount = (int)Math.Floor((decimal)(ItemDataManager.GetItemNum(shopCfg.costId) / shopCfg.Price));
+                int maxBuyCount = (int)Math.Floor((decimal)(ItemDataManager.GetItemNum(shopCfg.CostIdReal) / shopCfg.Price));
                 _maxCanBuy = Math.Min(maxCount, maxBuyCount);
                 _itemId = shopCfg.itemId;
 

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/EnduringGiftBoxView.cs

@@ -188,14 +188,14 @@ namespace GFGGame
             item.m_btnBuy.m_txtOldPrice.text = $"{shopCfg.originalPrice}";
             item.m_btnBuy.m_loaIcon.visible = false;
             string mTxtOldPrice = string.Empty;
-            if (shopCfg.costType == CostType.ITEM)
+            if (shopCfg.CostTypeReal == CostType.ITEM)
             {
                 //货币  
-                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
+                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.CostIdReal);
                 item.m_btnBuy.m_loaIcon.visible = true;
                 item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
             }
-            else if (shopCfg.costType == CostType.RMB)
+            else if (shopCfg.CostTypeReal == CostType.RMB)
             {
                 //人民币
                 mTxtOldPrice = "元";
@@ -382,7 +382,7 @@ namespace GFGGame
                 return;
             }
 
-            if (cfg.costType == CostType.FREE)
+            if (cfg.CostTypeReal == CostType.FREE)
             {
                 ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/RushSaleGiftBoxView.cs

@@ -219,16 +219,16 @@ namespace GFGGame
             _ui.m_txtLrc.text = string.Empty;
             _ui.m_btnBuyPink.m_loaIcon.visible = false;
             _ui.m_btnBuyPink.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
-            if (shopCfg.costType == CostType.ITEM)
+            if (shopCfg.CostTypeReal == CostType.ITEM)
             {
                 //货币
-                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
+                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.CostIdReal);
                 mTxtNewPrice = shopCfg.Price.ToString();
                 _ui.m_btnBuyPink.m_loaIcon.visible = true;
                 _ui.m_btnBuyPink.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
                 //_ui.m_btnBuyPink.m_txtNewPrice.x = 166;
             }
-            else if (shopCfg.costType == CostType.RMB)
+            else if (shopCfg.CostTypeReal == CostType.RMB)
             {
                 //人民币
                 mTxtNewPrice = $"{shopCfg.Price}元";
@@ -350,7 +350,7 @@ namespace GFGGame
                 return;
             }
 
-            if (cfg.costType == CostType.FREE)
+            if (cfg.CostTypeReal == CostType.FREE)
             {
                 ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/SpecialOfferGiftBoxView.cs

@@ -127,17 +127,17 @@ namespace GFGGame
                 mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
 
             uiItem.m_btnBuy.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
-            if (shopCfg.costType == CostType.ITEM)
+            if (shopCfg.CostTypeReal == CostType.ITEM)
             {
                 //货币
-                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
+                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.CostIdReal);
                 mTxtNewPrice = shopCfg.Price.ToString();
                 uiItem.m_btnBuy.m_loaIcon.visible = true;
                 uiItem.m_btnBuy.m_txtNewPrice.x = 134;
                 uiItem.m_btnBuy.m_txtOldPrice.x = 21;
                 uiItem.m_btnBuy.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
             }
-            else if (shopCfg.costType == CostType.RMB)
+            else if (shopCfg.CostTypeReal == CostType.RMB)
             {
                 //人民币 
                 mTxtNewPrice = $"{shopCfg.Price}元";
@@ -252,7 +252,7 @@ namespace GFGGame
                 return;
             }
 
-            if (cfg.costType == CostType.FREE)
+            if (cfg.CostTypeReal == CostType.FREE)
             {
                 ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);

+ 10 - 10
GameClient/Assets/Game/HotUpdate/Views/Store/ItemExchangeView.cs

@@ -56,13 +56,13 @@ namespace GFGGame
             _shopCfg = ShopCfgArray.Instance.GetCfg(_goodIds);
 
             _buyCount = 1;
-            if (_shopCfg.costType == CostType.RMB)
+            if (_shopCfg.CostTypeReal == CostType.RMB)
             {
                 _maxCanBuy = 1;
             }
             else
             {
-                long itemCount = ItemDataManager.GetItemNum(_shopCfg.costId);
+                long itemCount = ItemDataManager.GetItemNum(_shopCfg.CostIdReal);
                 long curMoneyCanBuy = itemCount / _shopCfg.Price;
                 if (_shopCfg.menu1 == ConstStoreTabId.STORE_ARENA)
                 {
@@ -151,14 +151,14 @@ namespace GFGGame
             _ui.m_btnMinus.m_c1.selectedIndex = _buyCount == 1 ? 1 : 0;
             _ui.m_btnMinus.target.touchable = _buyCount == 1 ? false : true;
             // int hasCount = ItemDataManager.GetItemNum(cfg.itemId);
-            _ui.m_btnAdd.m_c1.selectedIndex = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? 1 : 0;
-            _ui.m_btnAdd.target.touchable = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? false : true;
-            _ui.m_btnMax.m_c1.selectedIndex = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? 1 : 0;
-            _ui.m_btnMax.target.touchable = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? false : true;
+            _ui.m_btnAdd.m_c1.selectedIndex = _shopCfg.CostTypeReal == CostType.RMB || _buyCount == _maxCanBuy ? 1 : 0;
+            _ui.m_btnAdd.target.touchable = _shopCfg.CostTypeReal == CostType.RMB || _buyCount == _maxCanBuy ? false : true;
+            _ui.m_btnMax.m_c1.selectedIndex = _shopCfg.CostTypeReal == CostType.RMB || _buyCount == _maxCanBuy ? 1 : 0;
+            _ui.m_btnMax.target.touchable = _shopCfg.CostTypeReal == CostType.RMB || _buyCount == _maxCanBuy ? false : true;
 
             _ui.m_txtShow.text = "选择购买数量";
             _ui.m_txtTips.text = string.Format("确定购买{0}个【{1}】?", _buyCount, _shopCfg.itemName);
-            if (_shopCfg.costType == CostType.RMB)
+            if (_shopCfg.CostTypeReal == CostType.RMB)
             {
                 _ui.m_comCost.target.visible = false;
                 _ui.m_txtRmbCost.visible = true;
@@ -169,7 +169,7 @@ namespace GFGGame
             {
                 _ui.m_comCost.target.visible = true;
                 _ui.m_txtRmbCost.visible = false;
-                ItemUtil.UpdateItemNeedNum(_ui.m_comCost.target, _shopCfg.costId, (int)_buyCount * _shopCfg.Price);
+                ItemUtil.UpdateItemNeedNum(_ui.m_comCost.target, _shopCfg.CostIdReal, (int)_buyCount * _shopCfg.Price);
             }
         }
 
@@ -203,9 +203,9 @@ namespace GFGGame
         {
             ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodIds);
 
-            if (cfg.costType != CostType.RMB)
+            if (cfg.CostTypeReal != CostType.RMB)
             {
-                int costId = cfg.costId;
+                int costId = cfg.CostIdReal;
                 if (cfg.menu1 == ConstStoreTabId.STORE_ARENA && cfg.menu2 != ArenaDataManager.Instance.SeasonId && cfg.menu2 != ConstStoreSubId.STORE_ARENA_ITEM)
                 {
                     costId = cfg.oldSeasonCostId;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Store/StoreArenaView.cs

@@ -80,7 +80,7 @@ namespace GFGGame
 
             UI_ListShopItem item = UI_ListShopItem.Proxy(obj);
 
-            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.menu2 == 0 || shopCfg.menu2 == ArenaDataManager.Instance.SeasonId ? shopCfg.costId : shopCfg.oldSeasonCostId);
+            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.menu2 == 0 || shopCfg.menu2 == ArenaDataManager.Instance.SeasonId ? shopCfg.CostIdReal : shopCfg.oldSeasonCostId);
             item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(costItemCfg.res);
 
             UI_ListShopItem.ProxyEnd();

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/Store/StoreGiftBagAddRebateView.cs

@@ -128,14 +128,14 @@ namespace GFGGame
             item.m_btnBuy.m_txtOldPrice.text = $"{shopCfg.originalPrice}";
             item.m_btnBuy.m_loaIcon.visible = false;
             string mTxtOldPrice = string.Empty;
-            if (shopCfg.costType == CostType.ITEM)
+            if (shopCfg.CostTypeReal == CostType.ITEM)
             {
                 //货币  
-                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
+                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.CostIdReal);
                 item.m_btnBuy.m_loaIcon.visible = true;
                 item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
             }
-            else if (shopCfg.costType == CostType.RMB)
+            else if (shopCfg.CostTypeReal == CostType.RMB)
             {
                 //人民币
                 mTxtOldPrice = "元";
@@ -375,7 +375,7 @@ namespace GFGGame
                 return;
             }
 
-            if (cfg.costType == CostType.FREE)
+            if (cfg.CostTypeReal == CostType.FREE)
             {
                 ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);