diff --git a/lua/app/ui/hero/armor_info_comp.lua b/lua/app/ui/hero/armor_info_comp.lua index 18d46be3..70392281 100644 --- a/lua/app/ui/hero/armor_info_comp.lua +++ b/lua/app/ui/hero/armor_info_comp.lua @@ -68,9 +68,6 @@ end function ArmorInfoComp:setHeroData(heroEntity) self.heroEntity = heroEntity self.selectPart = self.selectPart or GConst.EquipConst.PART_TYPE.HAT - self:bind(DataManager.EquipData:getEquip(self.heroEntity:getCfgId(), self.selectPart), "isDirty", function() - self:refresh() - end) end function ArmorInfoComp:refresh() @@ -79,6 +76,10 @@ end function ArmorInfoComp:onSelectIdx(index) self.selectPart = ARMOR_PART_INDEX[index] + self:bind(DataManager.EquipData:getEquip(self.heroEntity:getCfgId(), self.selectPart), "isDirty", function() + self:refresh() + end) + self:refreshSelectArmor() for index, value in ipairs(self.armor) do