lcy
2 天以前 4b1247636bb04a0f0491537cb9853cd0b2101367
348 功能预告-客户端 适配坊市表新增CostItemID
7个文件已修改
145 ■■■■ 已修改文件
Main/Config/Configs/StoreConfig.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/OSActivity/OSGalaGiftCell.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/OSActivity/OSRankHeroCallGiftCell.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/BuyItemWin.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/StoreCell.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/StoreModel.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/UIHelper.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/StoreConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           2026年1月8日
//    [  Date ]:           2026年3月5日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -24,6 +24,7 @@
    public int[][] ItemListEx;
    public int ResetType;
    public int LimitCnt;
    public int CostItemID;
    public int MoneyType;
    public int MoneyNum;
    public int MoneyOriginal;
@@ -58,19 +59,21 @@
            int.TryParse(tables[7],out LimitCnt); 
            int.TryParse(tables[8],out MoneyType);
            int.TryParse(tables[8],out CostItemID);
            int.TryParse(tables[9],out MoneyNum);
            int.TryParse(tables[9],out MoneyType);
            int.TryParse(tables[10],out MoneyOriginal);
            int.TryParse(tables[10],out MoneyNum);
            int.TryParse(tables[11],out UnlockType);
            int.TryParse(tables[11],out MoneyOriginal);
            int.TryParse(tables[12],out UnlockValue);
            int.TryParse(tables[12],out UnlockType);
            int.TryParse(tables[13],out IsExclusive);
            int.TryParse(tables[13],out UnlockValue);
            Name = tables[14];
            int.TryParse(tables[14],out IsExclusive);
            Name = tables[15];
        }
        catch (Exception exception)
        {
Main/System/OSActivity/OSGalaGiftCell.cs
@@ -118,7 +118,14 @@
                });
                moneyText.text = storeConfig.MoneyNum == 0 ? Language.Get("L1127") : storeConfig.MoneyNum.ToString();
                moneyIcon.SetActive(storeConfig.MoneyNum != 0);
                moneyIcon.SetIconWithMoneyType(storeConfig.MoneyType);
                if (storeConfig.MoneyType <= 0)
                {
                    moneyIcon.SetItemSprite(storeConfig.CostItemID);
                }
                else
                {
                    moneyIcon.SetIconWithMoneyType(storeConfig.MoneyType);
                }
                redImg.SetActive(storeConfig.MoneyNum == 0);
            }   
            var buyCnt = StoreModel.Instance.GetShopLimitBuyCount(id);
Main/System/OSActivity/OSRankHeroCallGiftCell.cs
@@ -119,7 +119,14 @@
                });
                moneyText.text = storeConfig.MoneyNum == 0 ? Language.Get("L1127") : storeConfig.MoneyNum.ToString();
                moneyIcon.SetActive(storeConfig.MoneyNum != 0);
                moneyIcon.SetIconWithMoneyType(storeConfig.MoneyType);
                if (storeConfig.MoneyType <= 0)
                {
                    moneyIcon.SetItemSprite(storeConfig.CostItemID);
                }
                else
                {
                    moneyIcon.SetIconWithMoneyType(storeConfig.MoneyType);
                }
                redImg.SetActive(storeConfig.MoneyNum == 0);
            }   
            var buyCnt = StoreModel.Instance.GetShopLimitBuyCount(id);
Main/System/Store/BuyItemWin.cs
@@ -50,8 +50,15 @@
        maxCnt = shopConfig.LimitCnt - buyCnt;
        if (maxCnt == 0)
        {
            //没有限购,用货币可购买数量
            maxCnt = Math.Max(1, (int)(UIHelper.GetMoneyCnt(shopConfig.MoneyType)/shopConfig.MoneyNum));
            if (shopConfig.MoneyType <= 0)
            {
                maxCnt = Math.Max(1, (int)(PackManager.Instance.GetItemCountByID(PackType.Item, shopConfig.CostItemID) / shopConfig.MoneyNum));
            }
            else
            {
                //没有限购,用货币可购买数量
                maxCnt = Math.Max(1, (int)(UIHelper.GetMoneyCnt(shopConfig.MoneyType) / shopConfig.MoneyNum));
            }
        }
        OnSliderChange(useCnt);
@@ -97,8 +104,17 @@
        }
        limitText.text = limitStr;
        moneyIcon.SetIconWithMoneyType(shopConfig.MoneyType);
        moneyText.text = UIHelper.ShowUseMoney(shopConfig.MoneyType, shopConfig.MoneyNum * useCnt, false);
        if (shopConfig.MoneyType <= 0)
        {
            moneyIcon.SetItemSprite(shopConfig.CostItemID);
            moneyText.text = UIHelper.ShowUseItem(PackType.Item, shopConfig.CostItemID, shopConfig.MoneyNum * useCnt, false);
        }
        else
        {
            moneyIcon.SetIconWithMoneyType(shopConfig.MoneyType);
            moneyText.text = UIHelper.ShowUseMoney(shopConfig.MoneyType, shopConfig.MoneyNum * useCnt, false);
        }
    }
Main/System/Store/StoreCell.cs
@@ -86,7 +86,14 @@
            freeButton.SetActive(false);
            lockTip.text = "";
            priceIcon.SetIconWithMoneyType(storeData.storeConfig.MoneyType);
            if (storeData.storeConfig.MoneyType <= 0)
            {
                priceIcon.SetItemSprite(storeData.storeConfig.CostItemID);
            }
            else
            {
                priceIcon.SetIconWithMoneyType(storeData.storeConfig.MoneyType);
            }
            priceText.text = storeData.storeConfig.MoneyNum.ToString();
            if (storeData.storeConfig.MoneyOriginal == 0)
Main/System/Store/StoreModel.cs
@@ -362,14 +362,28 @@
    public void SendBuyShopItem(StoreConfig model, int count)
    {
        if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
        if (model.MoneyType <= 0)
        {
            CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
            buyShop.ShopID = (ushort)model.ID;
            buyShop.BuyCount = (uint)count;
            GameNetSystem.Instance.SendInfo(buyShop);
            if (UIHelper.CheckItemCount(model.CostItemID, model.MoneyNum * count, 2))
            {
                SendBuyItem(model.ID, count);
            }
        }
        else
        {
            if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
            {
                SendBuyItem(model.ID, count);
            }
        }
    }
    public void SendBuyItem(int shopID, int count)
    {
        CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
        buyShop.ShopID = (ushort)shopID;
        buyShop.BuyCount = (uint)count;
        GameNetSystem.Instance.SendInfo(buyShop);
    }
    //货币购买的二次确认框的确认记录
@@ -392,16 +406,21 @@
            return;
        }
        ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
        Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
        {
            if (isOk)
        ConfirmCancel.ToggleConfirmCancel(
            Language.Get("Mail101"),
            model.MoneyType <= 0 ?
                Language.Get("BuyStoreItem1", model.MoneyNum, ItemConfig.Get(model.CostItemID).ItemName, model.Name) :
                Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
            Language.Get("ConfirmCancel102"),
            (isOk, isToggle) =>
            {
                SendBuyShopItem(model, count);
                buyItemCheckDict[eventType] = isToggle;
            }
        });
                if (isOk)
                {
                    SendBuyShopItem(model, count);
                    buyItemCheckDict[eventType] = isToggle;
                }
            });
    }
    //花仙玉购买的二次确认框(本次登录)
Main/Utility/UIHelper.cs
@@ -1275,6 +1275,34 @@
        return isEnough;
    }
    /// <param name="needTips">0 不响应 1 弹提示 2 弹获取途径tips</param>
    public static bool CheckItemCount(int itemId, long needCount, int needTips = 0)
    {
        if (needCount <= 0)
        {
            return true;
        }
        long haveCount = PackManager.Instance.GetItemCountByID(PackType.Item, itemId);
        bool isEnough = haveCount >= needCount;
        if (!isEnough)
        {
            if (needTips == 1)
            {
                ItemConfig itemConfig = ItemConfig.Get(itemId);
                if (itemConfig != null)
                {
                    SysNotifyMgr.Instance.ShowTip("LackItem", itemConfig.ItemName);
                }
            }
            else if (needTips == 2)
            {
                ItemTipUtility.Show(itemId, true);
            }
        }
        return isEnough;
    }
    #endregion