From b1c5113c396fb02e8b0e17af42ebe4be32ff6298 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 24 Dec 2021 10:53:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=BA=97=E6=8A=A5=E9=94=99=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/FightLevel/ArenaTrialPanel.lua | 1 - .../~Lua/Modules/Shop/ShopManager.lua | 82 ++++++++++--------- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/ArenaTrialPanel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/ArenaTrialPanel.lua index 595487b91b..bf362566f7 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/ArenaTrialPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/ArenaTrialPanel.lua @@ -37,7 +37,6 @@ end --绑定事件(用于子类重写) function ArenaTrialPanel:BindEvent() Util.AddClick(self.btnBack, function() - LogError("self.btnBack....") self:ClosePanel() end) diff --git a/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua b/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua index 10c1049001..e16ddae934 100644 --- a/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua @@ -390,46 +390,50 @@ function this.SortItemList(shopType) -- 排序 local shopData = nil for _, v in ipairs(this.allShopData) do - local storeInfo = ConfigManager.GetConfigData(ConfigName.StoreTypeConfig, v.id) - -- shopType不存在时全部刷新,否则按shoptype刷新 - if not shopType or storeInfo.StoreType == shopType then - -- 试炼副本商店不按sort字段排序 - if storeInfo.StoreType ~= SHOP_TYPE.TRIAL_SHOP then - table.sort(v.storeItem, function(a, b) - local aId = a.id % _StoreItemIdFilter - local bId = b.id % _StoreItemIdFilter - local aInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, aId) - local bInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, bId) + local storeInfo = ConfigManager.TryGetConfigData(ConfigName.StoreTypeConfig, v.id) + if not storeInfo then + LogError("StoreTypeConfig not find Id:"..v.id) + else + -- shopType不存在时全部刷新,否则按shoptype刷新 + if not shopType or storeInfo.StoreType == shopType then + -- 试炼副本商店不按sort字段排序 + if storeInfo.StoreType ~= SHOP_TYPE.TRIAL_SHOP then + table.sort(v.storeItem, function(a, b) + local aId = a.id % _StoreItemIdFilter + local bId = b.id % _StoreItemIdFilter + local aInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, aId) + local bInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, bId) - -- 公会商店排序未解锁的往后排 - if v.id == SHOP_TYPE.GUILD_SHOP and PlayerManager.familyId ~= 0 and MyGuildManager.GetMyGuildInfo() then - local aIsUnLock = MyGuildManager.GetGuildShopSortIsUnLock(aInfo.Sort) - local bIsUnLock = MyGuildManager.GetGuildShopSortIsUnLock(bInfo.Sort) - if aIsUnLock and not bIsUnLock then return true end - if not aIsUnLock and bIsUnLock then return false end - end - -- 免费的往前排 - local _, a_price = this.calculateBuyCost(storeInfo.StoreType, aId, 1) - local _, b_price = this.calculateBuyCost(storeInfo.StoreType, bId, 1) - if a_price == 0 and b_price ~= 0 then return true end - if a_price ~= 0 and b_price == 0 then return false end - -- 按sort排序 - return aInfo.Sort < bInfo.Sort - end) - else--是试炼商店 - table.sort(v.storeItem, function(a, b) - local aId = a.id % _StoreItemIdFilter - local bId = b.id % _StoreItemIdFilter - local aInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, aId) - local bInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, bId) - if a.buyNum == 0 and b.buyNum > 0 then - return true - end - if a.buyNum > 0 and b.buyNum == 0 then - return false - end - return aInfo.Sort < bInfo.Sort - end) + -- 公会商店排序未解锁的往后排 + if v.id == SHOP_TYPE.GUILD_SHOP and PlayerManager.familyId ~= 0 and MyGuildManager.GetMyGuildInfo() then + local aIsUnLock = MyGuildManager.GetGuildShopSortIsUnLock(aInfo.Sort) + local bIsUnLock = MyGuildManager.GetGuildShopSortIsUnLock(bInfo.Sort) + if aIsUnLock and not bIsUnLock then return true end + if not aIsUnLock and bIsUnLock then return false end + end + -- 免费的往前排 + local _, a_price = this.calculateBuyCost(storeInfo.StoreType, aId, 1) + local _, b_price = this.calculateBuyCost(storeInfo.StoreType, bId, 1) + if a_price == 0 and b_price ~= 0 then return true end + if a_price ~= 0 and b_price == 0 then return false end + -- 按sort排序 + return aInfo.Sort < bInfo.Sort + end) + else--是试炼商店 + table.sort(v.storeItem, function(a, b) + local aId = a.id % _StoreItemIdFilter + local bId = b.id % _StoreItemIdFilter + local aInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, aId) + local bInfo = ConfigManager.GetConfigData(ConfigName.StoreConfig, bId) + if a.buyNum == 0 and b.buyNum > 0 then + return true + end + if a.buyNum > 0 and b.buyNum == 0 then + return false + end + return aInfo.Sort < bInfo.Sort + end) + end end end end