diff --git a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua index 916695ab..7f47a1e7 100644 --- a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua +++ b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua @@ -43,7 +43,6 @@ function DungeonTargetCell:showWeapon() if weaponData:canFarmChapter(self.dungeonId) and remainTime > 0 then -- 扫荡 - self.isSmash = true self.timeObj:setActive(true) self.powerObj:setActive(true) self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH)) @@ -68,7 +67,7 @@ function DungeonTargetCell:showWeapon() self.btn:setTouchEnable(false) end self.btn:addClickListener(function() - if self.isSmash then + if weaponData:canFarmChapter(self.dungeonId) and remainTime > 0 then ModuleManager.DungeonWeaponManager:reqSweep(self.dungeonId, self.target) else ModuleManager.DungeonWeaponManager:showMainUI() @@ -88,7 +87,6 @@ function DungeonTargetCell:showArmor() if armorData:canFarmChapter(self.dungeonId) and remainTime > 0 then -- 扫荡 - self.isSmash = true self.timeObj:setActive(true) self.powerObj:setActive(true) self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH)) @@ -114,7 +112,7 @@ function DungeonTargetCell:showArmor() self.btn:setTouchEnable(false) end self.btn:addClickListener(function() - if self.isSmash then + if armorData:canFarmChapter(self.dungeonId) and remainTime > 0 then ModuleManager.DungeonArmorManager:reqSweep(self.dungeonId, self.target) else ModuleManager.DungeonArmorManager:showMainUI() diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index a67ebfec..2fc19b88 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -120,9 +120,9 @@ function HeroDetailUI:onLoadRootComplete() self:addEventListener(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI, function() self:closeUI() end) - self:bind(DataManager.BagData.ItemData:getItemById(GConst.ItemConst.ITEM_ID_GOLD), "isDirty", function() - self:refreshShow() - end) + self:bind(DataManager.BagData.ItemData, "dirty", function() + self:refreshShow() + end) end function HeroDetailUI:updateSide() diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua index d81628fc..1aec126d 100644 --- a/lua/app/userdata/hero/hero_entity.lua +++ b/lua/app/userdata/hero/hero_entity.lua @@ -129,6 +129,9 @@ function HeroEntity:setEquipAttrValue(name, value) end function HeroEntity:addEquipAttrValue(name, value) + if self.equipAttr[name] == nil then + self.equipAttr[name] = 0 + end self.equipAttr[name] = self.equipAttr[name] + value end