diff --git a/lua/app/config/item.lua b/lua/app/config/item.lua index 36a1f1b6..861fed57 100644 --- a/lua/app/config/item.lua +++ b/lua/app/config/item.lua @@ -141,37 +141,37 @@ local item = { ["icon"]="21", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=111, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=211, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=311, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=411, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=511, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=611, ["num"]=1, ["weight"]=100 @@ -184,37 +184,37 @@ local item = { ["icon"]="22", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=112, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=212, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=312, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=412, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=512, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=612, ["num"]=1, ["weight"]=100 @@ -227,37 +227,37 @@ local item = { ["icon"]="23", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=121, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=221, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=321, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=421, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=521, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=621, ["num"]=1, ["weight"]=100 @@ -270,37 +270,37 @@ local item = { ["icon"]="24", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=122, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=222, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=322, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=422, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=522, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=622, ["num"]=1, ["weight"]=100 @@ -313,37 +313,37 @@ local item = { ["icon"]="25", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=123, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=223, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=323, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=423, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=523, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=623, ["num"]=1, ["weight"]=100 @@ -356,37 +356,37 @@ local item = { ["icon"]="26", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=131, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=231, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=331, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=431, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=531, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=631, ["num"]=1, ["weight"]=100 @@ -399,37 +399,37 @@ local item = { ["icon"]="27", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=132, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=232, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=332, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=432, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=532, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=632, ["num"]=1, ["weight"]=100 @@ -442,37 +442,37 @@ local item = { ["icon"]="28", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=133, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=233, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=333, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=433, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=533, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=633, ["num"]=1, ["weight"]=100 @@ -485,37 +485,37 @@ local item = { ["icon"]="29", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=134, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=234, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=334, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=434, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=534, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=634, ["num"]=1, ["weight"]=100 @@ -528,37 +528,37 @@ local item = { ["icon"]="30", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=141, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=241, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=341, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=441, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=541, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=641, ["num"]=1, ["weight"]=100 @@ -571,37 +571,37 @@ local item = { ["icon"]="31", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=142, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=242, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=342, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=442, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=542, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=642, ["num"]=1, ["weight"]=100 @@ -614,37 +614,37 @@ local item = { ["icon"]="32", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=143, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=243, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=343, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=443, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=543, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=643, ["num"]=1, ["weight"]=100 @@ -657,37 +657,37 @@ local item = { ["icon"]="33", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=144, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=244, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=344, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=444, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=544, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=644, ["num"]=1, ["weight"]=100 @@ -700,37 +700,37 @@ local item = { ["icon"]="34", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=145, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=245, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=345, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=445, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=545, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=645, ["num"]=1, ["weight"]=100 @@ -743,37 +743,37 @@ local item = { ["icon"]="35", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=151, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=251, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=351, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=451, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=551, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=651, ["num"]=1, ["weight"]=100 @@ -786,37 +786,37 @@ local item = { ["icon"]="36", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=152, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=252, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=352, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=452, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=552, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=652, ["num"]=1, ["weight"]=100 @@ -829,37 +829,37 @@ local item = { ["icon"]="37", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=153, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=253, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=353, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=453, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=553, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=653, ["num"]=1, ["weight"]=100 @@ -872,37 +872,37 @@ local item = { ["icon"]="38", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=154, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=254, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=354, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=454, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=554, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=654, ["num"]=1, ["weight"]=100 @@ -915,37 +915,37 @@ local item = { ["icon"]="39", ["box_drop"]={ { - ["type"]=2, + ["type"]=3, ["id"]=155, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=255, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=355, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=455, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=555, ["num"]=1, ["weight"]=100 }, { - ["type"]=2, + ["type"]=3, ["id"]=655, ["num"]=1, ["weight"]=100 diff --git a/lua/app/global/global_const.lua b/lua/app/global/global_const.lua index f57147a3..d69e916a 100644 --- a/lua/app/global/global_const.lua +++ b/lua/app/global/global_const.lua @@ -714,17 +714,14 @@ GConst.GAMEOBJECT_LAYER = { GConst.REWARD_TYPE = { REWARD_NONE = 0, ITEM = 1, - EQUIP = 2, - HERO = 3, - LEGACY = 4, - RUNES = 5, + HERO = 2, + EQUIP = 3, } GConst.REWARD_TYPE_NUM = { ITEM = 1, - EQUIP = 2, - SOUL = 3, - COLLECTION = 4, + HERO = 2, + EQUIP = 3, } GConst.INT_TO_STRING = { diff --git a/lua/app/module/tips/tips_manager.lua b/lua/app/module/tips/tips_manager.lua index 68af9a83..e21e1c4b 100644 --- a/lua/app/module/tips/tips_manager.lua +++ b/lua/app/module/tips/tips_manager.lua @@ -64,6 +64,10 @@ function TipsManager:showRewardTips(rewardId, rewardType, tarPrefabObj, alignTyp return end end + elseif rewardType == GConst.REWARD_TYPE.EQUIP then + -- 展示装备tips + ModuleManager.EquipManager:showEquipInfoUI({id = rewardId, showType = GConst.EquipConst.INFO_SHOW_TYPE.PREVIEW}) + return end local desc = self:getRewardDesc(rewardId, rewardType) self:showDescTips(desc, tarPrefabObj, alignType) diff --git a/lua/app/ui/activity/act_seven_day/cell/task_cell.lua b/lua/app/ui/activity/act_seven_day/cell/task_cell.lua index 5e7e2b81..4b312ee3 100755 --- a/lua/app/ui/activity/act_seven_day/cell/task_cell.lua +++ b/lua/app/ui/activity/act_seven_day/cell/task_cell.lua @@ -23,10 +23,10 @@ function TaskCell:refresh(id, period) if not self.rewardCell then self.rewardCell = CellManager:addCellComp(uiMap["task_cell.reward_cell"], GConst.TYPEOF_LUA_CLASS.REWARD_CELL) end - self.rewardCell:refreshByConfig(cfg.reward[1]) + self.rewardCell:refreshByConfig(cfg.reward[1], false, taskInfo.collect) uiMap["task_cell.num"]:setText(cfg.reward[2].num) uiMap["task_cell.mask"]:setVisible(taskInfo.collect) - uiMap["task_cell.check_img"]:setVisible(taskInfo.collect) + -- uiMap["task_cell.check_img"]:setVisible(taskInfo.collect) self:getBaseObject():addClickListener(function() self:onClick(id, period) end) diff --git a/lua/app/ui/activity/act_seven_day/component/task_comp.lua b/lua/app/ui/activity/act_seven_day/component/task_comp.lua index 3dbb9fc5..dd41895f 100755 --- a/lua/app/ui/activity/act_seven_day/component/task_comp.lua +++ b/lua/app/ui/activity/act_seven_day/component/task_comp.lua @@ -44,7 +44,7 @@ function TaskComp:refresh(parentUI, day, period) end) else self.rewardCells[id]:hideFrameAnimation() - self.rewardCells[id]:clearClickListener() + self.rewardCells[id]:setClickShowTips() end end diff --git a/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua b/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua index 7a7f6c2d..d7281445 100644 --- a/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua +++ b/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua @@ -50,7 +50,7 @@ function ActBountyCellV1:refresh(day, maxDay, info) GFunc.setGrey(self.dayIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE), false) else self.freeRewardCell:hideFrameAnimation() - self.freeRewardCell:clearClickListener() + self.freeRewardCell:setClickShowTips() self.dayTx:setVisible(freeGot) self.dayTxGrey:setVisible(not freeGot) GFunc.setGrey(self.bg:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE), not freeGot) @@ -78,8 +78,8 @@ function ActBountyCellV1:refresh(day, maxDay, info) else self.proRewardCells[1]:hideFrameAnimation() self.proRewardCells[2]:hideFrameAnimation() - self.proRewardCells[1]:clearClickListener() - self.proRewardCells[2]:clearClickListener() + self.proRewardCells[1]:setClickShowTips() + self.proRewardCells[2]:setClickShowTips() end end diff --git a/lua/app/ui/arena/bounty_main_ui.lua b/lua/app/ui/arena/bounty_main_ui.lua index 494b8da3..b48c5738 100644 --- a/lua/app/ui/arena/bounty_main_ui.lua +++ b/lua/app/ui/arena/bounty_main_ui.lua @@ -266,7 +266,7 @@ function BountyMainUI:refreshPreviewReward(idx) return end self.previewRewardCellComp:refreshByConfig(info.reward_pro) - self.previewRewardCellComp:setNumTx(GConst.EMPTY_STRING) + self.previewRewardCellComp:showRewardNum(GConst.EMPTY_STRING) self.previewRewardNumTx:setText("X" .. GFunc.getRewardNum(info.reward_pro)) self.previewRewardLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, idx)) end diff --git a/lua/app/ui/battle/battle_armor_result_ui.lua b/lua/app/ui/battle/battle_armor_result_ui.lua index a9425f63..82b75c0b 100644 --- a/lua/app/ui/battle/battle_armor_result_ui.lua +++ b/lua/app/ui/battle/battle_armor_result_ui.lua @@ -167,7 +167,7 @@ function BattleArmorResultUI:refreshRewards() if index <= MAX_SCROLL_SHOW_COUNT and self.animRewards[index] == nil then self.animRewards[index] = self:showRewardAppearAnim(index, cell) end - cell:showFirstPass(index <= self.firstPassIdx) + cell:setShowFirstTag(index <= self.firstPassIdx) end) self.rewardScrollRectComp:setFadeArgs(0.05, 0.3) diff --git a/lua/app/ui/battle/battle_box_open_ui.lua b/lua/app/ui/battle/battle_box_open_ui.lua index e532f3b7..997dfe8e 100644 --- a/lua/app/ui/battle/battle_box_open_ui.lua +++ b/lua/app/ui/battle/battle_box_open_ui.lua @@ -101,7 +101,7 @@ function BattleBoxOpenUI:getDouble() if battleController then battleController.doubleMystery = true end - self.rewardCell:setNumTx(self.rewards.num * 2) + self.rewardCell:showRewardNum(self.rewards.num * 2) self.okBtn:setActive(true) self.adBtn:setActive(false) end diff --git a/lua/app/ui/battle/battle_result_ui.lua b/lua/app/ui/battle/battle_result_ui.lua index b55093ce..e50b4de4 100644 --- a/lua/app/ui/battle/battle_result_ui.lua +++ b/lua/app/ui/battle/battle_result_ui.lua @@ -379,7 +379,7 @@ function BattleResultUI:refreshRewards() self.animRewards[index] = self:showRewardAppearAnim(index, cell) end cell:showRightUpIcon(index <= self.mysteryBoxIdx, GConst.ATLAS_PATH.COMMON, "common_chest_1") - cell:showFirstPass(index <= self.firstPassIdx) + cell:setShowFirstTag(index <= self.firstPassIdx) if self.isDouble then cell:setNumTxDouble() end diff --git a/lua/app/ui/bounty/bounty_main_ui.lua b/lua/app/ui/bounty/bounty_main_ui.lua index 0877144e..a98edf5d 100644 --- a/lua/app/ui/bounty/bounty_main_ui.lua +++ b/lua/app/ui/bounty/bounty_main_ui.lua @@ -267,7 +267,7 @@ function BountyMainUI:refreshPreviewReward(idx) return end self.previewRewardCellComp:refreshByConfig(info.reward_pro) - self.previewRewardCellComp:setNumTx(GConst.EMPTY_STRING) + self.previewRewardCellComp:showRewardNum(GConst.EMPTY_STRING) self.previewRewardNumTx:setText("X" .. GFunc.getRewardNum(info.reward_pro)) self.previewRewardLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, idx)) end diff --git a/lua/app/ui/common/cell/equip_cell.lua b/lua/app/ui/common/cell/equip_cell.lua index d8ba9d87..1e10e83a 100644 --- a/lua/app/ui/common/cell/equip_cell.lua +++ b/lua/app/ui/common/cell/equip_cell.lua @@ -134,35 +134,35 @@ function EquipCell:showLight(show) end function EquipCell:setTouchEnable(enable) - self:getBaseObject():setTouchEnable(enable == true) + self.baseObject:setTouchEnable(enable == true) end function EquipCell:addClickListener(func) - self:getBaseObject():addClickListener(func) + self.baseObject:addClickListener(func) end function EquipCell:removeClickListener() - self:getBaseObject():removeClickListener() + self.baseObject:removeClickListener() end function EquipCell:getAnchoredPositionX() - return self:getBaseObject():getAnchoredPositionX() + return self.baseObject:getAnchoredPositionX() end function EquipCell:setVisible(visible, scale) - self:getBaseObject():setVisible(visible, scale) + self.baseObject:setVisible(visible, scale) end function EquipCell:setActive(active) - self:getBaseObject():setActive(active) + self.baseObject:setActive(active) end function EquipCell:addRedPoint(offsetX, offsetY, scale) - self:getBaseObject():addRedPoint(offsetX, offsetY, scale) + self.baseObject:addRedPoint(offsetX, offsetY, scale) end function EquipCell:removeRedPoint() - self:getBaseObject():removeRedPoint() + self.baseObject:removeRedPoint() end -- function EquipCell:showEffectUp() -- if self.effectUp == nil and self.parentUI then diff --git a/lua/app/ui/common/cell/item_cell.lua b/lua/app/ui/common/cell/item_cell.lua index 53151083..a7e48ef0 100644 --- a/lua/app/ui/common/cell/item_cell.lua +++ b/lua/app/ui/common/cell/item_cell.lua @@ -20,8 +20,15 @@ end function ItemCell:_refresh(itemId, count) local cfg = ConfigManager:getConfig("item")[itemId] + if not cfg then + return + end self.bg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[cfg.qlt]) - self.num:setText(GFunc.num2Str(count)) + if not count then + self.num:setText("") + else + self.num:setText(GFunc.num2Str(count)) + end if cfg.type == GConst.ItemConst.ITEM_TYPE.HERO_FRAGMENT then local heroInfo = ConfigManager:getConfig("hero")[cfg.parameter] if heroInfo then @@ -29,7 +36,8 @@ function ItemCell:_refresh(itemId, count) else self.icon:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha") end - self.fragment:setVisible(true) + -- self.fragment:setVisible(true) + self.fragment:setVisible(false) else self.icon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, cfg.icon) self.fragment:setVisible(false) @@ -67,4 +75,8 @@ function ItemCell:setNum(numStr) num:setText(numStr) end +function ItemCell:setActive(active) + self.baseObject:setActive(active) +end + return ItemCell diff --git a/lua/app/ui/common/cell/reward_cell.lua b/lua/app/ui/common/cell/reward_cell.lua index b80c45cc..0ab7aacf 100644 --- a/lua/app/ui/common/cell/reward_cell.lua +++ b/lua/app/ui/common/cell/reward_cell.lua @@ -1,238 +1,119 @@ local RewardCell = class("RewardCell", BaseCell) -local EFFECT_LIGHT = "assets/prefabs/effects/ui/vfx_ui_arena_gift_b02.prefab" - function RewardCell:init() local uiMap = self:getUIMap() - self.content = uiMap["reward_cell.content"] - self.icon = uiMap["reward_cell.item_bg.icon"] - self.frameBg = uiMap["reward_cell.item_bg"] - self.mask = uiMap["reward_cell.item_bg.mask"] - self.check = uiMap["reward_cell.check"] - 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.matchImg = uiMap["reward_cell.item_bg.match_img"] self.frameAni = uiMap["reward_cell.frame_ani"] - self.lock = uiMap["reward_cell.lock"] - -- 首通 - self.firstPass = uiMap["reward_cell.first"] - self.firstPassTx = uiMap["reward_cell.first.tx_first"] - -- 皮肤 - self.skin = uiMap["reward_cell.skin"] - self.skinQlt = uiMap["reward_cell.skin.img_qlt"] - -- 特效 - self.rootEffect = uiMap["reward_cell.root_effect"] - -- 选中框 - self.select = uiMap["reward_cell.content.item_bg.select"] - -- 自选 - self.choose = uiMap["reward_cell.choose"] + self.itemCell = uiMap["reward_cell.item_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ITEM_CELL) + self.equipCell = uiMap["reward_cell.equip_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.EQUIP_CELL) + self.imgSelect = uiMap["reward_cell.img_select"] -- 概率标记 - self.probNode = uiMap["reward_cell.content.prob"] - self.txProb = uiMap["reward_cell.content.prob.tx_prob"] + self.probNode = uiMap["reward_cell.prob"] + self.txProb = uiMap["reward_cell.prob.tx_prob"] + self.firstNode = uiMap["reward_cell.first_bg"] + self.txfirst = uiMap["reward_cell.first_bg.first_tx"] + self:setShowSelect(false) self:hideFrameAnimation() - self.baseObject:addClickListener(function() - if self.clickCallback then - self.clickCallback() - elseif self.rewardId ~= nil then - ModuleManager.TipsManager:showRewardTips(self.rewardId, self.rewardType, self.baseObject) - end - end) - self:setShowProbTag(false) + self:setShowFirstTag(false) end -function RewardCell:refresh(reward) - self:showMask(false, false) +function RewardCell:refresh(reward, mask, check) if reward.type == GConst.REWARD_TYPE.ITEM then - local info = ConfigManager:getConfig("item")[reward.item.id] - if info == nil then - return - end - self.rewardId = reward.item.id - self.rewardType = reward.type - self:_refreshItem(info, reward.item.count) - else - self.rewardId = nil - end - self:showFirstPass(false) -end + self.id = reward.item.id + self.num = reward.item.num + self.type = reward.type + self.itemCell:setActive(true) + self.equipCell:setActive(false) --- 展示自选 -function RewardCell:refreshByChoose() - self.choose:setVisible(true) - self.content:setVisible(false) + self.itemCell:refreshByCfg(reward.item.id, reward.item.num or reward.item.count) + elseif reward.type == GConst.REWARD_TYPE.EQUIP then + self.id = reward.equip.cfg_id + self.type = reward.type + self.itemCell:setActive(false) + self.equipCell:setActive(true) + + self.equipCell:refreshByServer(reward.equip) + end + + self:showMask(mask, check) + self:showCheck(check) + self:setShowProbTag(false) + self:setShowFirstTag(false) + self:setClickShowTips() end function RewardCell:refreshById(id, num) - local reward = {id = id, type = GConst.REWARD_TYPE.ITEM, num = num} - self:refreshByConfig(reward) + self.id = id + self.num = num + self.type = GConst.REWARD_TYPE.ITEM + self.itemCell:setActive(true) + self.equipCell:setActive(false) + + + self.itemCell:refreshByCfg(self.id, self.num) + + self:showMask(false, false) + self:showCheck(false) + self:setShowProbTag(false) + self:setShowFirstTag(false) + self:setClickShowTips() end function RewardCell:refreshByConfig(reward, mask, check) + self.id = reward.id + self.type = reward.type + self.num = reward.num + if reward.type == GConst.REWARD_TYPE_NUM.ITEM then + self.itemCell:setActive(true) + self.equipCell:setActive(false) + + local num = reward.num or reward.count + self.itemCell:refreshByCfg(reward.id, num) + elseif reward.type == GConst.REWARD_TYPE_NUM.EQUIP then + self.itemCell:setActive(false) + self.equipCell:setActive(true) + + self.equipCell:refreshByCfg(reward.id, reward.lv) + end + self:showMask(mask, check) - if reward.type == GConst.REWARD_TYPE.ITEM then - local info = ConfigManager:getConfig("item")[reward.id] - if info == nil then - return - end - self.rewardId = reward.id - self.rewardType = reward.type - self:_refreshItem(info, reward.num) - else - self.rewardId = nil - end - self:showFirstPass(false) -end - -function RewardCell:refreshItemById(itemId, count, mask, check) - self:showMask(mask, check) - local info = ConfigManager:getConfig("item")[itemId] - if info == nil then - return - end - self.rewardId = itemId - self.rewardType = GConst.REWARD_TYPE.ITEM - self:_refreshItem(info, count) - self:showFirstPass(false) -end - -function RewardCell:_refreshItem(info, count) - self.choose:setVisible(false) - self.select:setActive(false) - self.lock:setVisible(false) - self.content:setVisible(true) - self.numTx:setVisible(true) - self.frameBg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[info.qlt]) - if count and count > 0 then - if count > 100 then - self.numTx:setText(GFunc.num2Str(count)) - else - self.numTx:setText(GFunc.intToString(count)) - end - self.count = count - else - self.numTx:setText(GConst.EMPTY_STRING) - end - if info.type == GConst.ItemConst.ITEM_TYPE.HERO_FRAGMENT then - -- 英雄碎片道具 - self.skin:setVisible(false) - self.fragment:setVisible(true) - local heroInfo = ConfigManager:getConfig("hero")[info.parameter] - if heroInfo then - self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, heroInfo.icon) - 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.matchImg:setVisible(false) - end - elseif info.type == GConst.ItemConst.ITEM_TYPE.SKIN then - -- 皮肤道具 - self.skin:setVisible(true) - self.matchImg:setVisible(false) - self.fragment:setVisible(false) - local skinInfo = ConfigManager:getConfig("skin")[info.parameter] - if skinInfo then - self.skin:setVisible(true) - 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") - end - else - -- 其他 - self.icon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon) - self.fragment:setVisible(false) - self.matchImg:setVisible(false) - self.skin:setVisible(false) - end - - self:showLight(false) + self:showCheck(check) + self:setShowProbTag(false) + self:setShowFirstTag(false) + self:setClickShowTips() end function RewardCell:refreshByEntity(entity) local type = entity:getType() - local id = entity:getId() if type == GConst.REWARD_TYPE.ITEM then - local info = ConfigManager:getConfig("item")[id] - if info == nil then - return - end - self.rewardId = id - self.rewardType = type - self:_refreshItem(info, entity:getNum()) - else - self.rewardId = nil - end - self:showMask(false, false) - self:showFirstPass(false) -end - -function RewardCell:setIconSprite(atlas, res) - self.icon:setSprite(atlas, res) -end - -function RewardCell:setNumTxDouble() - if self.count then - local count = self.count * 2 - if count > 100 then - self.numTx:setText(GFunc.num2Str(count)) - else - self.numTx:setText(GFunc.intToString(count)) - end + local id = entity:getId() + self:refreshByConfig({type = type, id = id, num = entity:getNum()}) end end -function RewardCell:setNumTx(str) - self.numTx:setText(str) +function RewardCell:setShowSelect(show, scale) + self.imgSelect:setActive(show) end -function RewardCell:showMask(show, syncCheck) - self.mask:setVisible(show == true) - self:showCheck(syncCheck) +function RewardCell:setShowProbTag(show, prob) + if self.probNode == nil or self.txProb == nil then + return + end + self.probNode:setVisible(show) + self.txProb:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).fontSize = 24 -- 临时处理,大版本的时候再修改prefab + self.txProb:setText((prob or 0) .. "%") +end +function RewardCell:setShowFirstTag(show) + if self.firstNode == nil or self.txfirst == nil then + return + end + self.firstNode:setVisible(show) + self.txfirst:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_PASS)) end -function RewardCell:hideCountTx() - self:setNumTx(GConst.EMPTY_STRING) -end - -function RewardCell:showCheck(show) - self.check:setVisible(show == true) -end - -function RewardCell:setVisible(visible) - self.baseObject:setActive(visible) -end - -function RewardCell:setActive(visible) - self.baseObject:setActive(visible) -end - -function RewardCell:setAnchoredPositionX(x) - self.baseObject:setAnchoredPositionX(x) -end - -function RewardCell:setTouchEnable(enable) - self.baseObject:setTouchEnable(enable) -end - -function RewardCell:addClickListener(callback) - self.clickCallback = callback -end - -function RewardCell:clearClickListener() - self.clickCallback = nil -end - -function RewardCell:setLocalScale(x, y, z) - self.baseObject:setLocalScale(x, y, z) -end - -function RewardCell:showFrameAnimation(rewardType) +-- 展示spine动画高亮框 +function RewardCell:showFrameAnimation(scale) self.frameAni:setActive(true) self.frameAni:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR).enabled = true if self.frameAniType ~= GConst.REWARD_TYPE.ITEM then @@ -247,51 +128,96 @@ function RewardCell:hideFrameAnimation() self.frameAni:setActive(false) end -function RewardCell:showRightUpIcon(show, atlas, iconName) - self.rightUpIcon:setVisible(show) - if not show then - return - end - self.rightUpIcon:setSprite(atlas, iconName) +function RewardCell:showMask(show, syncCheck) + self.itemCell:showMask(show) + self.equipCell:showMask(show) + self:showCheck(syncCheck) end --- 展示首通标记 -function RewardCell:showFirstPass(show) - self.firstPass:setVisible(show == true) - if show then - self.firstPassTx:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_PASS)) - end +function RewardCell:showCheck(show) + self.itemCell:showCheck(show) + self.equipCell:showCheck(show) end --- 展示锁定标记 function RewardCell:showLock(show) - self.lock:setVisible(show == true) + self.itemCell:showLock(show) + self.equipCell:showLock(show) end --- 展示光效 -function RewardCell:showLight(show, ui) - self.rootEffect:removeAllChildren() - if show and ui ~= nil and not self.isLoadingEffectLight then - self.isLoadingEffectLight = true - EffectManager:loadUIEffectAsync(EFFECT_LIGHT, ui, self.rootEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) - self.isLoadingEffectLight = false - obj:setAnchoredPosition(0, 0) - obj:play() - end) - end +function RewardCell:hideRewardNum() + self.itemCell:setNum(GConst.EMPTY_STRING) end --- 展示选中框 -function RewardCell:showSelect(show) - self.select:setActive(show == true) -end - -function RewardCell:setShowProbTag(show, prob) - if self.probNode == nil or self.txProb == nil then +function RewardCell:showRewardNum(numStr) + if not numStr then return end - self.probNode:setActive(show) - self.txProb:setText((prob or 0) .. "%") + self.itemCell:setNum(numStr) end -return RewardCell \ No newline at end of file +function RewardCell:setNumTxDouble() + if self.count then + local count = self.count * 2 + if count > 100 then + self:showRewardNum(GFunc.num2Str(count)) + else + self:showRewardNum(GFunc.intToString(count)) + end + end +end + +function RewardCell:setClickShowTips(showItemTip) + self.itemCell:addClickListener(function() + ModuleManager.TipsManager:showRewardTips(self.id, self.type, self.baseObject, nil, { num = self.num }, + showItemTip) + end) + self.equipCell:addClickListener(function() + ModuleManager.TipsManager:showRewardTips(self.id, self.type, self.baseObject) + end) +end + +function RewardCell:addClickListener(func) + self.itemCell:addClickListener(func) + self.equipCell:addClickListener(func) +end + +function RewardCell:setParentUI(parent) + self.parentUI = parent +end + +function RewardCell:removeClickListener() + self.itemCell:removeClickListener() + self.equipCell:removeClickListener() +end + +function RewardCell:setVisible(visible) + self.baseObject:setActive(visible) +end + +function RewardCell:setActive(active) + self.baseObject:setActive(active) +end + +function RewardCell:setAnchoredPositionX(x) + self.baseObject:setAnchoredPositionX(x) +end + +function RewardCell:getAnchoredPositionX() + return self.baseObject:getAnchoredPositionX() +end + +function RewardCell:getAnchoredPositionY() + return self.baseObject:getAnchoredPositionY() +end + +function RewardCell:setTouchEnable(enable) + self.baseObject:setTouchEnable(enable) + self.itemCell:setTouchEnable(enable) + self.equipCell:setTouchEnable(enable) +end + +function RewardCell:setLocalScale(x, y, z) + self.baseObject:setLocalScale(x, y, z) +end + +return RewardCell diff --git a/lua/app/ui/common/common_box_ui.lua b/lua/app/ui/common/common_box_ui.lua index 69ee0719..fe4f2455 100755 --- a/lua/app/ui/common/common_box_ui.lua +++ b/lua/app/ui/common/common_box_ui.lua @@ -125,14 +125,14 @@ function CommonBoxUI:onRefresh() end) self.scrollRect:addRefreshCallback(function(index, cell) cell:refreshByConfig(self.rewards[index]) - cell:showSelect(index == self.curIndex) + cell:setShowSelect(index == self.curIndex) cell:setShowProbTag(self.itemType == GConst.ItemConst.ITEM_TYPE.BOX_RANDOM, self:getRewardProb(index)) if index ~= self.curIndex and self.itemType == GConst.ItemConst.ITEM_TYPE.BOX_SELECT then cell:addClickListener(function() self:onClickReward(index) end) else - cell:clearClickListener() + cell:setClickShowTips() end end) end diff --git a/lua/app/ui/common/mop_up_ui.lua b/lua/app/ui/common/mop_up_ui.lua index a3fcf0f3..033834d9 100644 --- a/lua/app/ui/common/mop_up_ui.lua +++ b/lua/app/ui/common/mop_up_ui.lua @@ -110,8 +110,8 @@ function MopUpUI:refreshTarget() self.rewardCell = CellManager:addCellComp(uiMap["mop_up_ui.bg.item_node.reward_cell"], GConst.TYPEOF_LUA_CLASS.REWARD_CELL) end - self.rewardCell:refreshItemById(self.target.id) - self.rewardCell:hideCountTx() + self.rewardCell:refreshById(self.target.id) + self.rewardCell:hideRewardNum() local curProgress = DataManager.BagData.ItemData:getItemNumById(self.target.id) or 0 local itemNameTx = GFunc.getRewardName(GConst.REWARD_TYPE.ITEM, self.target.id) diff --git a/lua/app/ui/dungeon/cell/dungeon_cell.lua b/lua/app/ui/dungeon/cell/dungeon_cell.lua index 64660652..2de7f6b4 100644 --- a/lua/app/ui/dungeon/cell/dungeon_cell.lua +++ b/lua/app/ui/dungeon/cell/dungeon_cell.lua @@ -43,7 +43,7 @@ function DungeonCell:refresh(moduleKey) if rewards and rewards[i] then cell:setActive(true) cell:refreshByConfig(rewards[i]) - cell:hideCountTx() + cell:hideRewardNum() else cell:setActive(false) end diff --git a/lua/app/ui/dungeon/cell/dungeon_gold_cell.lua b/lua/app/ui/dungeon/cell/dungeon_gold_cell.lua index 1bb215f6..4ceb9407 100644 --- a/lua/app/ui/dungeon/cell/dungeon_gold_cell.lua +++ b/lua/app/ui/dungeon/cell/dungeon_gold_cell.lua @@ -123,7 +123,7 @@ function DungeonGoldCell:refresh(index) end) self.scrollRectComp:addRefreshCallback(function(cellIndex, cell) cell:refreshByConfig(self.rewardList[cellIndex], false, false) - cell:showFirstPass(cellIndex <= self.firstCount) + cell:setShowFirstTag(cellIndex <= self.firstCount) end) end diff --git a/lua/app/ui/dungeon/cell/dungeon_material_cell.lua b/lua/app/ui/dungeon/cell/dungeon_material_cell.lua index 725a4ef2..dd7aa740 100644 --- a/lua/app/ui/dungeon/cell/dungeon_material_cell.lua +++ b/lua/app/ui/dungeon/cell/dungeon_material_cell.lua @@ -124,7 +124,7 @@ function DungeonMaterialCell:refresh(index) end) self.scrollRectComp:addRefreshCallback(function(cellIndex, cell) cell:refreshByConfig(self.rewardList[cellIndex], false, false) - cell:showFirstPass(cellIndex <= self.firstCount) + cell:setShowFirstTag(cellIndex <= self.firstCount) end) end diff --git a/lua/app/ui/dungeon_armor/dungeon_armor_farm_ui.lua b/lua/app/ui/dungeon_armor/dungeon_armor_farm_ui.lua index cea8d26d..92416a1b 100644 --- a/lua/app/ui/dungeon_armor/dungeon_armor_farm_ui.lua +++ b/lua/app/ui/dungeon_armor/dungeon_armor_farm_ui.lua @@ -67,7 +67,7 @@ function DungeonArmorFarmUI:refreshMiddle() cell:getBaseObject():setActive(reward ~= nil) if reward ~= nil then cell:refreshByConfig(reward) - cell:hideCountTx() + cell:hideRewardNum() end end diff --git a/lua/app/ui/dungeon_armor/dungeon_armor_fight_ui.lua b/lua/app/ui/dungeon_armor/dungeon_armor_fight_ui.lua index 0c6dc813..575b7eb0 100644 --- a/lua/app/ui/dungeon_armor/dungeon_armor_fight_ui.lua +++ b/lua/app/ui/dungeon_armor/dungeon_armor_fight_ui.lua @@ -74,7 +74,7 @@ function DungeonArmorFightUI:refreshMiddle() cell:getBaseObject():setActive(reward ~= nil) if reward ~= nil then cell:refreshByConfig(reward) - cell:hideCountTx() + cell:hideRewardNum() end end diff --git a/lua/app/ui/dungeon_weapon/cell/chapter_layer_cell.lua b/lua/app/ui/dungeon_weapon/cell/chapter_layer_cell.lua index 494a9510..f71c2f95 100644 --- a/lua/app/ui/dungeon_weapon/cell/chapter_layer_cell.lua +++ b/lua/app/ui/dungeon_weapon/cell/chapter_layer_cell.lua @@ -53,7 +53,7 @@ function ChapterLayerCell:refresh(id) for i = 1, 3 do if config.item_show[i] then self.rewardCells[i]:refreshByConfig(config.item_show[i]) - self.rewardCells[i]:hideCountTx() + self.rewardCells[i]:hideRewardNum() self.rewardCells[i]:getBaseObject():setActive(true) else self.rewardCells[i]:getBaseObject():setActive(false) @@ -81,7 +81,7 @@ function ChapterLayerCell:refresh(id) for i = 1, 3 do if config.item_show[i] then self.rewardCells[i]:refreshByConfig(config.item_show[i]) - self.rewardCells[i]:hideCountTx() + self.rewardCells[i]:hideRewardNum() self.rewardCells[i]:getBaseObject():setActive(true) else self.rewardCells[i]:getBaseObject():setActive(false) @@ -104,14 +104,14 @@ function ChapterLayerCell:refresh(id) for i = 1, 3 do if config.item_show[i] then self.rewardCells[i]:refreshByConfig(config.item_show[i]) - self.rewardCells[i]:hideCountTx() + self.rewardCells[i]:hideRewardNum() self.rewardCells[i]:getBaseObject():setActive(true) else self.rewardCells[i]:getBaseObject():setActive(false) end end self.rewardCells[4]:refreshByConfig(config.first_reward) - self.rewardCells[4]:showFirstPass(true) + self.rewardCells[4]:setShowFirstTag(true) fightBtn:addClickListener(function() ModuleManager.DungeonWeaponManager:reqFight(id) end) diff --git a/lua/app/ui/equip/equip_info_ui.lua b/lua/app/ui/equip/equip_info_ui.lua index e0a1d2f9..70622b36 100644 --- a/lua/app/ui/equip/equip_info_ui.lua +++ b/lua/app/ui/equip/equip_info_ui.lua @@ -34,6 +34,7 @@ function EquipInfoUI:onLoadRootComplete() end) self.equipCell = uiMap["equip_info_ui.bg.equip_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.EQUIP_CELL) + self.bg1 = uiMap["equip_info_ui.bg.bg1"] self.nameTx = uiMap["equip_info_ui.bg.name_tx"] self.partTx = uiMap["equip_info_ui.bg.part_desc_tx.part_tx"] self.powerTx = uiMap["equip_info_ui.bg.power_desc_tx.power_tx"] @@ -117,10 +118,11 @@ function EquipInfoUI:refreshPreview() cell.attrNameTx:setText(GFunc.getAttrDesc(extraAttr.type, extraAttr.minnum)) cell.attrValueTx:setText(GConst.EMPTY_STRING) cell.attrValueAddTx:setActive(true) - cell.attrValueAddTx:setText("".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.minnum, 2) .. "-".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.maxnum, 2) .."") + cell.attrValueAddTx:setText("".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.minnum, 2) .. "-".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.maxnum, 2) .."") end self.replaceBtn:setActive(false) self.upBtn:setActive(false) + self.bg1:setSizeDeltaY(346) end function EquipInfoUI:refreshBaseAttr() @@ -143,6 +145,7 @@ function EquipInfoUI:refreshBaseAttr() self.attrValueAddTx:setText(GConst.EMPTY_STRING) self.replaceBtn:setActive(false) self.upBtn:setActive(false) + self.bg1:setSizeDeltaY(326) end function EquipInfoUI:refreshAllAttr() @@ -195,6 +198,7 @@ function EquipInfoUI:refreshAllAttr() end self.replaceBtn:setActive(true) self.upBtn:setActive(true) + self.bg1:setSizeDeltaY(326) end return EquipInfoUI \ No newline at end of file diff --git a/lua/app/ui/fund/cell/fund_chapter_cell.lua b/lua/app/ui/fund/cell/fund_chapter_cell.lua index cd3b730e..76a12eab 100755 --- a/lua/app/ui/fund/cell/fund_chapter_cell.lua +++ b/lua/app/ui/fund/cell/fund_chapter_cell.lua @@ -65,7 +65,7 @@ function FundChapterCell:refresh(id, isLast) cell:showFrameAnimation() else cell:hideFrameAnimation() - cell:clearClickListener() + cell:setClickShowTips() end else cell:setActive(false) @@ -88,7 +88,7 @@ function FundChapterCell:refresh(id, isLast) cell:showFrameAnimation() else cell:hideFrameAnimation() - cell:clearClickListener() + cell:setClickShowTips() end else cell:setActive(false) diff --git a/lua/app/ui/hero/hero_info_comp.lua b/lua/app/ui/hero/hero_info_comp.lua index 33614580..1029b376 100644 --- a/lua/app/ui/hero/hero_info_comp.lua +++ b/lua/app/ui/hero/hero_info_comp.lua @@ -111,9 +111,9 @@ function HeroInfoComp:refreshUpInfo() self.costCell:setActive(true) self.costCell:refreshByConfig(cost) if hadNum >= cost.num then - self.costCell:setNumTx(hadNum .. "/" .. cost.num) + self.costCell:showRewardNum(hadNum .. "/" .. cost.num) else - self.costCell:setNumTx("" .. hadNum .. "" .. "/" .. cost.num) + self.costCell:showRewardNum("" .. hadNum .. "" .. "/" .. cost.num) end if canLvUp then diff --git a/lua/app/ui/hero/hero_unlock_ui.lua b/lua/app/ui/hero/hero_unlock_ui.lua index 031a82bd..173e354d 100644 --- a/lua/app/ui/hero/hero_unlock_ui.lua +++ b/lua/app/ui/hero/hero_unlock_ui.lua @@ -39,7 +39,7 @@ function HeroUnlockUI:initHeroes() local heroEntity = DataManager.HeroData:getHeroById(self.heroIdList[i]) self.uiMap["hero_unlock_ui.bg_" .. i]:setVisible(true) local rewardCell = self.uiMap["hero_unlock_ui.bg_" .. i .. ".reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) - rewardCell:refreshItemById(heroEntity:getFragmentId(), 0) + rewardCell:refreshById(heroEntity:getFragmentId(), 0) self.uiMap["hero_unlock_ui.bg_" .. i .. ".name_tx"]:setText(heroEntity:getName()) self.uiMap["hero_unlock_ui.bg_" .. i .. ".desc_tx"]:setText(heroEntity:getDesc()) end diff --git a/lua/app/ui/hero/star_info_comp.lua b/lua/app/ui/hero/star_info_comp.lua index 17a47752..995deda9 100644 --- a/lua/app/ui/hero/star_info_comp.lua +++ b/lua/app/ui/hero/star_info_comp.lua @@ -85,9 +85,9 @@ function StarInfoComp:refreshStarBtn() self.costCell:setActive(true) self.costCell:refreshByConfig(cost) if hadNum >= cost.num then - self.costCell:setNumTx(hadNum .. "/" .. cost.num) + self.costCell:showRewardNum(hadNum .. "/" .. cost.num) else - self.costCell:setNumTx("" .. hadNum .. "" .. "/" .. cost.num) + self.costCell:setNushowRewardNummTx("" .. hadNum .. "" .. "/" .. cost.num) end end end diff --git a/lua/app/ui/privilege/comp/free_daily_rewards_comp.lua b/lua/app/ui/privilege/comp/free_daily_rewards_comp.lua index 9d8e20f1..314e4d60 100644 --- a/lua/app/ui/privilege/comp/free_daily_rewards_comp.lua +++ b/lua/app/ui/privilege/comp/free_daily_rewards_comp.lua @@ -26,7 +26,7 @@ function FreeDailyRewardsComp:refresh() self.rewadCell:refreshByConfig(reward, isClaimed, isClaimed) if isClaimed then self.rewadCell:hideFrameAnimation() - self.rewadCell:clearClickListener() + self.rewadCell:setClickShowTips() else self.rewadCell:showFrameAnimation() self.rewadCell:addClickListener(function() diff --git a/lua/app/ui/privilege/comp/monthly_card_comp.lua b/lua/app/ui/privilege/comp/monthly_card_comp.lua index c7da295a..8408db34 100644 --- a/lua/app/ui/privilege/comp/monthly_card_comp.lua +++ b/lua/app/ui/privilege/comp/monthly_card_comp.lua @@ -77,9 +77,9 @@ function MonthlyCardComp:refresh() self.payBtnGreyTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_DONE)) self.payBtn:setActive(false) self.rewadCell1:hideFrameAnimation() - self.rewadCell1:clearClickListener() + self.rewadCell1:setClickShowTips() self.rewadCell12:hideFrameAnimation() - self.rewadCell12:clearClickListener() + self.rewadCell12:setClickShowTips() self.descTx6:setText(GConst.EMPTY_STRING) self.payBtn:removeRedPoint() else @@ -94,11 +94,11 @@ function MonthlyCardComp:refresh() end if rewards and rewards[1] then local num = count*rewards[1].num - self.rewadCell1:setNumTx(GFunc.num2Str(num)) + self.rewadCell1:showRewardNum(GFunc.num2Str(num)) end if rewards and rewards[2] then local num = count*rewards[2].num - self.rewadCell12:setNumTx(GFunc.num2Str(num)) + self.rewadCell12:showRewardNum(GFunc.num2Str(num)) end self.rewadCell1:showFrameAnimation() self.rewadCell1:addClickListener(function() @@ -126,12 +126,12 @@ function MonthlyCardComp:refresh() if rewards and rewards[1] then local num = count*rewards[1].num self.rewadCell1:refreshByConfig(rewards[1], false, false) - self.rewadCell1:setNumTx(GFunc.num2Str(num)) + self.rewadCell1:showRewardNum(GFunc.num2Str(num)) end if rewards and rewards[2] then local num = count*rewards[2].num self.rewadCell12:refreshByConfig(rewards[2], false, false) - self.rewadCell12:setNumTx(GFunc.num2Str(num)) + self.rewadCell12:showRewardNum(GFunc.num2Str(num)) end self.rewadCell1:showFrameAnimation() self.rewadCell1:addClickListener(function() @@ -150,12 +150,12 @@ function MonthlyCardComp:refresh() self.rewadCell1:refreshByConfig(rewards[1], false, false) end self.rewadCell1:hideFrameAnimation() - self.rewadCell1:clearClickListener() + self.rewadCell1:setClickShowTips() if rewards and rewards[2] then self.rewadCell12:refreshByConfig(rewards[2], false, false) end self.rewadCell12:hideFrameAnimation() - self.rewadCell12:clearClickListener() + self.rewadCell12:setClickShowTips() self.payBtn:removeRedPoint() end end diff --git a/lua/app/ui/sign/cell/sign_month_cell.lua b/lua/app/ui/sign/cell/sign_month_cell.lua index 3d8a4f77..3f5cef1c 100755 --- a/lua/app/ui/sign/cell/sign_month_cell.lua +++ b/lua/app/ui/sign/cell/sign_month_cell.lua @@ -70,13 +70,13 @@ function SignMonthCell:refresh(day) --不可领取 self.btn_ad:setActive(false) self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_MONTH_SIGNIN, "act_month_signin_bg_3") - -- self.rewardCell:setClickShowTips(true) + self.rewardCell:setClickShowTips(true) elseif signState == GConst.SignConst.SIGN_STATE.SIGNEDIN then --已签到 showCheck = true self.btn_ad:setActive(false) self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_MONTH_SIGNIN, "act_month_signin_bg_5") - -- self.rewardCell:setClickShowTips(true) + self.rewardCell:setClickShowTips(true) end if showFrame then self.rewardCell:showFrameAnimation() diff --git a/lua/app/ui/sign/cell/sign_week_cell.lua b/lua/app/ui/sign/cell/sign_week_cell.lua index c710dcce..f9d7f123 100755 --- a/lua/app/ui/sign/cell/sign_week_cell.lua +++ b/lua/app/ui/sign/cell/sign_week_cell.lua @@ -107,8 +107,8 @@ function SignWeekCell:refresh(day) else self.proRewardCells[1]:hideFrameAnimation() self.proRewardCells[2]:hideFrameAnimation() - -- self.proRewardCells[1]:setClickShowTips() - -- self.proRewardCells[2]:setClickShowTips() + self.proRewardCells[1]:setClickShowTips() + self.proRewardCells[2]:setClickShowTips() end self.funcBtn:addClickListener(function() diff --git a/lua/app/ui/tips/box_item_tips.lua b/lua/app/ui/tips/box_item_tips.lua index cb8fbbfe..829cd8cb 100644 --- a/lua/app/ui/tips/box_item_tips.lua +++ b/lua/app/ui/tips/box_item_tips.lua @@ -76,7 +76,7 @@ function BoxItemTips:initScrollRect() scrollRectComp:addRefreshCallback(function(index, cell) cell:refreshByConfig(self.itemList[index].reward) if not self.isFixed then - cell:hideCountTx() + cell:hideRewardNum() end end) scrollRectComp:clearCells() diff --git a/lua/app/ui/tips/box_tips.lua b/lua/app/ui/tips/box_tips.lua index 9665d904..69ed6d2e 100644 --- a/lua/app/ui/tips/box_tips.lua +++ b/lua/app/ui/tips/box_tips.lua @@ -50,7 +50,7 @@ function BoxTips:onLoadRootComplete() local rewardComp = uiMap["box_tips.bg.item_" .. i .. ".reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) rewardComp:refreshByConfig(rewardList[i]) rewardComp:setTouchEnable(false) - rewardComp:setNumTx(GConst.EMPTY_STRING) + rewardComp:showRewardNum(GConst.EMPTY_STRING) else rewardNode:setVisible(false) end diff --git a/lua/app/ui/tips/choose_reward_tips.lua b/lua/app/ui/tips/choose_reward_tips.lua index 0229091a..624502d8 100644 --- a/lua/app/ui/tips/choose_reward_tips.lua +++ b/lua/app/ui/tips/choose_reward_tips.lua @@ -51,7 +51,7 @@ function ChooseRewardTips:initScrollRect() end) self.scrollRectComp:addRefreshCallback(function(index, cell) cell:refreshByConfig(self.chooseRewards[index]) - cell:showSelect(index == self.selectIndex) + cell:setShowSelect(index == self.selectIndex) cell:addClickListener(function() self:onSelectReward(index) end) diff --git a/lua/app/ui/tips/hero_fragment_tips.lua b/lua/app/ui/tips/hero_fragment_tips.lua index 49e5d054..25ea845c 100644 --- a/lua/app/ui/tips/hero_fragment_tips.lua +++ b/lua/app/ui/tips/hero_fragment_tips.lua @@ -87,7 +87,7 @@ function HeroFragmentTips:initScrollRect() return GConst.TYPEOF_LUA_CLASS.REWARD_CELL end) scrollRectComp:addRefreshCallback(function(index, cell) - cell:refreshItemById(self.heroList[index], 0) + cell:refreshById(self.heroList[index], 0) end) scrollRectComp:clearCells() scrollRectComp:refillCells(#self.heroList) diff --git a/lua/app/ui/tips/weight_box_tips.lua b/lua/app/ui/tips/weight_box_tips.lua index cfbccb94..b7ed4c5f 100644 --- a/lua/app/ui/tips/weight_box_tips.lua +++ b/lua/app/ui/tips/weight_box_tips.lua @@ -26,7 +26,7 @@ function WeightBoxTips:onLoadRootComplete() self.dropIds = cfg.hero_drop elseif cfg.box_drop then for _, item in ipairs(cfg.box_drop) do - table.insert(self.dropIds, item.id) + table.insert(self.dropIds, item) end end local uiMap = self.root:genAllChildren() @@ -62,7 +62,7 @@ function WeightBoxTips:initScrollRect() return GConst.TYPEOF_LUA_CLASS.REWARD_CELL end) scrollRectComp:addRefreshCallback(function(index, cell) - cell:refreshItemById(self.dropIds[index], 0) + cell:refreshByConfig(self.dropIds[index]) end) scrollRectComp:clearCells() scrollRectComp:refillCells(#self.dropIds) diff --git a/lua/app/userdata/daily_challenge/daily_challenge_data.lua b/lua/app/userdata/daily_challenge/daily_challenge_data.lua index 31dc7c27..f7dd2842 100644 --- a/lua/app/userdata/daily_challenge/daily_challenge_data.lua +++ b/lua/app/userdata/daily_challenge/daily_challenge_data.lua @@ -355,6 +355,11 @@ function DailyChallengeData:getReviveCount() return self.todayRevive end +function DailyChallengeData:getReReviveCount() + local cfgAdCount = GFunc.getConstIntValue("daily_challenge_ads_revive_limit") + return cfgAdCount - self.todayRevive +end + function DailyChallengeData:canAdRevive() local cfgAdCount = GFunc.getConstIntValue("daily_challenge_ads_revive_limit") return self.todayRevive < cfgAdCount