diff --git a/lua/app/ui/common/cell/player_head_cell.lua b/lua/app/ui/common/cell/player_head_cell.lua index d18ba084..b272e289 100644 --- a/lua/app/ui/common/cell/player_head_cell.lua +++ b/lua/app/ui/common/cell/player_head_cell.lua @@ -5,21 +5,16 @@ function PlayerHeadCell:init() self.imgFrame = uiMap["player_head_cell.img_frame"] self.imgAvatar = uiMap["player_head_cell.img_avatar"] - - self:bind(DataManager.PlayerData, "dirty", function() - if self.isSelf then - self:refresh() - end - end, true) end -- (avatarId:头像id,frameId:头像框id) -function PlayerHeadCell:refresh(avatarId, frameId) +function PlayerHeadCell:refresh(avatarId, frameId, showRp) if avatarId == nil or frameId == nil then -- 是玩家自己 self.isSelf = true avatarId = DataManager.PlayerData:getUsingAvatarId() frameId = DataManager.PlayerData:getUsingFrameId() + showRp = DataManager.PlayerData:hasNewAvatar() or DataManager.PlayerData:hasNewFrame() end -- 头像 @@ -39,7 +34,7 @@ function PlayerHeadCell:refresh(avatarId, frameId) end -- 红点 - if DataManager.PlayerData:hasNewAvatar() or DataManager.PlayerData:hasNewFrame() then + if showRp then self.baseObject:addRedPoint(50, 50, 0.7) else self.baseObject:removeRedPoint() diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 639b8ffc..79c51e0b 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -608,6 +608,9 @@ function MainCityUI:refreshPlayerInfo() self.playerLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, lv)) self.playerSlider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = DataManager.PlayerData:getExpPercent() self.playerNameTx:setText(DataManager.PlayerData:getNickname()) + if self.headCell then + self.headCell:refresh() + end end function MainCityUI:initTopNode()