From 371f5f2893dc024f1225d7c5916672870227a6ad Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Mon, 8 Sep 2025 20:00:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=8C=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/config/item.lua | 26 ++++++++++++++++++++++++++ lua/app/config/skill.lua | 12 ++++++------ lua/app/ui/common/cell/reward_cell.lua | 6 ------ lua/app/userdata/bag/item_data.lua | 5 ++++- lua/app/userdata/bag/item_entity.lua | 15 +++++++++++++++ 5 files changed, 51 insertions(+), 13 deletions(-) diff --git a/lua/app/config/item.lua b/lua/app/config/item.lua index 6794621d..8c1a98ed 100644 --- a/lua/app/config/item.lua +++ b/lua/app/config/item.lua @@ -1,21 +1,25 @@ local item = { [1]={ ["type"]=1, + ["inbag"]=1, ["qlt"]=5, ["icon"]="1" }, [2]={ ["type"]=1, + ["inbag"]=1, ["qlt"]=5, ["icon"]="2" }, [3]={ ["type"]=1, + ["inbag"]=1, ["qlt"]=5, ["icon"]="3" }, [4]={ ["type"]=1, + ["inbag"]=1, ["qlt"]=5, ["icon"]="4" }, @@ -1141,132 +1145,154 @@ local item = { }, [13001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=13001, ["qlt"]=3, ["icon"]="13001" }, [14001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=14001, ["qlt"]=4, ["icon"]="14001" }, [15001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=15001, ["qlt"]=5, ["icon"]="15001" }, [15002]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=15002, ["qlt"]=5, ["icon"]="15002" }, [16001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=16001, ["qlt"]=6, ["icon"]="16001" }, [23001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=23001, ["qlt"]=3, ["icon"]="23001" }, [24001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=24001, ["qlt"]=4, ["icon"]="24001" }, [25001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=25001, ["qlt"]=5, ["icon"]="25001" }, [25002]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=25002, ["qlt"]=5, ["icon"]="25002" }, [26001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=26001, ["qlt"]=6, ["icon"]="26001" }, [33001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=33001, ["qlt"]=3, ["icon"]="33001" }, [34001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=34001, ["qlt"]=4, ["icon"]="34001" }, [35001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=35001, ["qlt"]=5, ["icon"]="35001" }, [35002]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=35002, ["qlt"]=5, ["icon"]="35002" }, [43001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=43001, ["qlt"]=3, ["icon"]="43001" }, [44001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=44001, ["qlt"]=4, ["icon"]="44001" }, [45001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=45001, ["qlt"]=5, ["icon"]="45001" }, [45002]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=45002, ["qlt"]=5, ["icon"]="45002" }, [53001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=53001, ["qlt"]=3, ["icon"]="53001" }, [54001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=54001, ["qlt"]=4, ["icon"]="54001" }, [55001]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=55001, ["qlt"]=5, ["icon"]="55001" }, [55002]={ ["type"]=5, + ["inbag"]=1, ["parameter"]=55002, ["qlt"]=5, ["icon"]="55002" diff --git a/lua/app/config/skill.lua b/lua/app/config/skill.lua index c5897a09..d872bd19 100644 --- a/lua/app/config/skill.lua +++ b/lua/app/config/skill.lua @@ -8661,7 +8661,7 @@ local skill = { ["fx_self"]=200002 }, [20061]={ - ["battle_icon"]="45002", + ["battle_icon"]="m20001_1", ["effect_type"]=1, ["trigger"]=1, ["effect"]={ @@ -8774,7 +8774,7 @@ local skill = { ["fx_self"]=200006 }, [20066]={ - ["battle_icon"]="45002", + ["battle_icon"]="m20002_1", ["effect_type"]=1, ["trigger"]=1, ["effect"]={ @@ -8877,7 +8877,7 @@ local skill = { 2, 3 }, - ["battle_icon"]="45002", + ["battle_icon"]="m20003_1", ["effect_type"]=1, ["trigger"]=1, ["effect"]={ @@ -8994,7 +8994,7 @@ local skill = { ["fx_self"]=200014 }, [20074]={ - ["battle_icon"]="45002", + ["battle_icon"]="m20004_1", ["effect_type"]=1, ["trigger"]=1, ["effect"]={ @@ -9109,7 +9109,7 @@ local skill = { 5, 2 }, - ["battle_icon"]="45002", + ["battle_icon"]="m20005_1", ["effect_type"]=1, ["trigger"]=1, ["effect"]={ @@ -9228,7 +9228,7 @@ local skill = { 9, 2 }, - ["battle_icon"]="45002", + ["battle_icon"]="m20006_1", ["effect_type"]=1, ["trigger"]=1, ["effect"]={ diff --git a/lua/app/ui/common/cell/reward_cell.lua b/lua/app/ui/common/cell/reward_cell.lua index 0029058f..e02da834 100644 --- a/lua/app/ui/common/cell/reward_cell.lua +++ b/lua/app/ui/common/cell/reward_cell.lua @@ -12,7 +12,6 @@ function RewardCell:init() self.numTx = uiMap["reward_cell.item_bg.num"] self.fragment = uiMap["reward_cell.item_bg.fragment"] self.rightUpIcon = uiMap["reward_cell.item_bg.right_up_icon"] - self.sImg = uiMap["reward_cell.item_bg.s"] self.matchImg = uiMap["reward_cell.item_bg.match_img"] self.frameAni = uiMap["reward_cell.frame_ani"] self.lock = uiMap["reward_cell.lock"] @@ -112,12 +111,10 @@ function RewardCell:_refreshItem(info, count) local heroInfo = ConfigManager:getConfig("hero")[info.parameter] if heroInfo then self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, heroInfo.icon) - self.sImg:setVisible(heroInfo.qlt >= 4) self.matchImg:setVisible(true) self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position]) else self.icon:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha") - self.sImg:setVisible(false) self.matchImg:setVisible(false) end elseif info.type == GConst.ItemConst.ITEM_TYPE.SKIN then @@ -128,20 +125,17 @@ function RewardCell:_refreshItem(info, count) local skinInfo = ConfigManager:getConfig("skin")[info.parameter] if skinInfo then self.skin:setVisible(true) - self.sImg:setVisible(skinInfo.qlt >= 4) self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, skinInfo.icon) self.skin:setSprite(GConst.ATLAS_PATH.ICON_HERO, "frame_dec_" .. skinInfo.qlt) self.skinQlt:setSprite(GConst.ATLAS_PATH.HERO, "hero_skin_" .. skinInfo.qlt) self.frameBg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[skinInfo.qlt]) else self.icon:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha") - self.sImg:setVisible(false) end else -- 其他 self.icon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon) self.fragment:setVisible(false) - self.sImg:setVisible(false) self.matchImg:setVisible(false) self.skin:setVisible(false) end diff --git a/lua/app/userdata/bag/item_data.lua b/lua/app/userdata/bag/item_data.lua index 0f6296b8..9bc64c60 100644 --- a/lua/app/userdata/bag/item_data.lua +++ b/lua/app/userdata/bag/item_data.lua @@ -356,10 +356,13 @@ end function ItemData:getItemList() local items = {} for _, v in pairs(self.items) do - if v:getNum() > 0 then + if v:getNum() > 0 and v:getInBag() then table.insert(items, v) end end + table.sort(items, function (a, b) + return a:getSort() > b:getSort() + end) return items end --@endregion diff --git a/lua/app/userdata/bag/item_entity.lua b/lua/app/userdata/bag/item_entity.lua index 14eb2611..b8e1bcf6 100644 --- a/lua/app/userdata/bag/item_entity.lua +++ b/lua/app/userdata/bag/item_entity.lua @@ -5,6 +5,7 @@ function ItemEntity:ctor(id, num) self.data.num = num self.data.isDirty = false self.config = nil + self.sort = nil self:_loadConfig(id) self:checkForceLockAndAddNum(num) @@ -101,6 +102,11 @@ function ItemEntity:getParam() return self.config.parameter end +-- 是否在背包显示 +function ItemEntity:getInBag() + return not self.config.inbag or self.config.inbag ~= 1 +end + -- 道具描述 function ItemEntity:getName() return I18N:getText("item", self.data.id, "name") @@ -111,4 +117,13 @@ function ItemEntity:getDesc() return I18N:getText("item", self.data.id, "desc") end +function ItemEntity:getSort() + if self.sort then + return self.sort + end + self.sort = self.data.id + self.config.qlt * 100000000 + return self.sort +end + + return ItemEntity \ No newline at end of file