diff --git a/lua_probject/base_project/Game/View/PlayerInfoView.lua b/lua_probject/base_project/Game/View/PlayerInfoView.lua index 3cf632e9..c1af3f40 100644 --- a/lua_probject/base_project/Game/View/PlayerInfoView.lua +++ b/lua_probject/base_project/Game/View/PlayerInfoView.lua @@ -22,13 +22,13 @@ local M = PlayerInfoView function M.new(view, main_view, isHideIpAdds) local self = {} - setmetatable(self, {__index = PlayerInfoView}) + setmetatable(self, { __index = PlayerInfoView }) self._view = view self._main_view = main_view self._isHideIpAdds = isHideIpAdds - self.isShowTGTimer=false - self.currentTime=0 - self.totalTime=0 + self.isShowTGTimer = false + self.currentTime = 0 + self.totalTime = 0 --self.isShow = fasle self:init() return self @@ -41,36 +41,36 @@ function M:init() self._tex_player_name = player_name_score:GetChild('tex_player_name') self._tex_player_id = player_name_score:GetChild('tex_player_id') self._tex_score = player_name_score:GetChild('tex_score') - self._tex_score.visible=true - - self._tex_score1 = self._view:GetChild("info"):GetChild("tex_score1") - if self._tex_score1 then - self._tex_score1.visible=true - end + self._tex_score.visible = true + + self._tex_score1 = self._view:GetChild("info"):GetChild("tex_score1") + if self._tex_score1 then + self._tex_score1.visible = true + end self._tex_score2 = self._view:GetChild("info"):GetChild("tex_score2") - if self._tex_score2 then - self._tex_score2.visible=true - end - - self._tex_n4 = self._view:GetChild("info"):GetChild("n4") - if self._tex_n4 then - self._tex_n4.visible=true - end + if self._tex_score2 then + self._tex_score2.visible = true + end + + self._tex_n4 = self._view:GetChild("info"):GetChild("n4") + if self._tex_n4 then + self._tex_n4.visible = true + end self._tex_n5 = self._view:GetChild("info"):GetChild("n5") - if self._tex_n5 then - self._tex_n5.visible=true - end - - self.n3Bg=self._view:GetChild("info"):GetChild("n3") - if self.n3Bg then - --self.n3Bg:SetSize(138,55) - end - self.zhanjitext=self._view:GetChild("text_jifen") - if self.zhanjitext then - self.zhanjitext.text=0 - end - - + if self._tex_n5 then + self._tex_n5.visible = true + end + + self.n3Bg = self._view:GetChild("info"):GetChild("n3") + if self.n3Bg then + --self.n3Bg:SetSize(138,55) + end + self.zhanjitext = self._view:GetChild("text_jifen") + if self.zhanjitext then + self.zhanjitext.text = 0 + end + + self._biaoqing = view:GetChild('face') self._chat = view:GetChild('chat') @@ -82,69 +82,90 @@ function M:init() self._ctr_room_owner = view:GetController('room_owner') self._ctr_mask_voice = view:GetController('mask_voice') self._ctr_dismiss_room = view:GetController('dismiss_room') - - self.PlayerTGTips=view:GetChild('tuoguanTips') - if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then - self.PlayerTGTips.displayObject.gameObject:SetActive(false) - end - + + self.PlayerTGTips = view:GetChild('tuoguanTips') + if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then + self.PlayerTGTips.displayObject.gameObject:SetActive(false) + end + + self.PlayerTGBg = view:GetChild('pb_tuoGuan_Bg') + if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then + self.PlayerTGBg.displayObject.gameObject:SetActive(false) + end + self.PlayerTGBorder = view:GetChild('pb_tuoGuan_Border') + if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then + self.PlayerTGBorder.displayObject.gameObject:SetActive(false) + end end - -function M:IsShowTGTips(isShow,time) +function M:IsShowTGTips(isShow, time) --printlog("isShowisShowisShow==== ",isShow," time ",time) - if time==nil then time=0 end - - self.isShowTGTimer = isShow - if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then - self.PlayerTGTips.displayObject.gameObject:SetActive(isShow) - end - self.currentTime=0 - if isShow then - if self.PlayerTGTips then - self.PlayerTGTips.text="开启托管剩余时间"..time.."s" - end - self.totalTime=time - --UpdateBeat:Remove(self.OnUpdate,self) - --UpdateBeat:Add(self.OnUpdate,self) - -- printlog("aaaaaaaaa111111111111111111111111111111") - --TimerManager.RemoveTimer(self.OnUpdate) - TimerManager.AddTimer(self.OnUpdate,self) - --printlog(self) - else - -- printlog("移除IsShowTGTips",self.isShow) - --UpdateBeat:Remove(self.OnUpdate,self) - TimerManager.RemoveTimer(self.OnUpdate,self) - end - -end + if time == nil then time = 0 end + self.isShowTGTimer = isShow + if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then + self.PlayerTGTips.displayObject.gameObject:SetActive(isShow) + end + if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then + self.PlayerTGBg.displayObject.gameObject:SetActive(isShow) + end + if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then + self.PlayerTGBorder.displayObject.gameObject:SetActive(isShow) + end + self.currentTime = 0 + if isShow then + if self.PlayerTGTips then + self.PlayerTGTips.text = "开启托管剩余时间" .. time .. "s" + end + if self.PlayerTGBg then + self.PlayerTGBg.max = time + end + if self.PlayerTGBorder then + self.PlayerTGBorder.max = time + end + self.totalTime = time + --UpdateBeat:Remove(self.OnUpdate,self) + --UpdateBeat:Add(self.OnUpdate,self) + -- printlog("aaaaaaaaa111111111111111111111111111111") + --TimerManager.RemoveTimer(self.OnUpdate) + TimerManager.AddTimer(self.OnUpdate, self) + --printlog(self) + else + -- printlog("移除IsShowTGTips",self.isShow) + --UpdateBeat:Remove(self.OnUpdate,self) + TimerManager.RemoveTimer(self.OnUpdate, self) + end +end function M:OnUpdate() - --printlog("OnUpdate=====================") - if self.isShowTGTimer then - self.currentTime=self.currentTime+Time.deltaTime - if self.currentTime>=1 then - self.currentTime=0 - self.totalTime=self.totalTime-1 - --printlog("当前计时器===>>>",self.totalTime) - if self.PlayerTGTips then - self.PlayerTGTips.text="开启托管剩余时间"..self.totalTime.."s" - end - - if self.totalTime<=0 then - self.isShowTGTimer=false - if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then - self.PlayerTGTips.displayObject.gameObject:SetActive(false) - end - end - end + --printlog("OnUpdate=====================") + if self.isShowTGTimer then + self.currentTime = self.currentTime + Time.deltaTime + if self.currentTime >= 1 then + self.currentTime = 0 + self.totalTime = self.totalTime - 1 + --printlog("当前计时器===>>>",self.totalTime) + if self.PlayerTGTips then + self.PlayerTGTips.text = "开启托管剩余时间" .. self.totalTime .. "s" + end + if self.PlayerTGBg then + self.PlayerTGBg.value = self.totalTime + end + if self.PlayerTGBorder then + self.PlayerTGBorder.value = self.totalTime + end + if self.totalTime <= 0 then + self.isShowTGTimer = false + if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then + self.PlayerTGTips.displayObject.gameObject:SetActive(false) + end + end + end - if self.muShiPlayerUpdate then - self:muShiPlayerUpdate() - end - end - + if self.muShiPlayerUpdate then + self:muShiPlayerUpdate() + end + end end function M:FillData(player) @@ -164,7 +185,7 @@ function M:FillData(player) --local headView = HeadView.new(self._main_view._root_view, player.self_user, self._isHideIpAdds) --headView:Show() end - ) + ) else local ctr = self._btn_head:GetController("hidden") if ctr then @@ -172,13 +193,13 @@ function M:FillData(player) end end - if isHidden - --and player.self_user.account_id ~= room.self_player.self_user.account_id + if isHidden + --and player.self_user.account_id ~= room.self_player.self_user.account_id then if player.orgSeat and player.orgSeat > 0 then - self._tex_player_name.text = "玩家"..player.orgSeat + self._tex_player_name.text = "玩家" .. player.orgSeat else - self._tex_player_name.text = "玩家"..player.seat + self._tex_player_name.text = "玩家" .. player.seat player.orgSeat = membe_clone(player.seat) end if self._tex_player_id then @@ -187,7 +208,7 @@ function M:FillData(player) else self._tex_player_name.text = player.self_user.nick_name if self._tex_player_id then - self._tex_player_id.text = "ID:".. player.self_user.account_id + self._tex_player_id.text = "ID:" .. player.self_user.account_id end end self._ctr_room_owner.selectedIndex = room.owner_id == player.self_user.account_id and 1 or 0 @@ -213,7 +234,7 @@ function M:UpdateScore(score) -- score = d2ad(self._player.total_hp).."/"..d2ad(self._player.cur_hp) -- else score = d2ad(self._player.cur_hp) - -- end + -- end end end end @@ -339,9 +360,11 @@ function M:MarkTuoguan() local com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan') self:AddMarkToHead(com_tuoguan, 'mark_tuoguan') end + function M:UnmarkTuoguan() self:RemoveMarkFromHead('mark_tuoguan') end + -- 动态的往头像上加载组件 function M:AddMarkToHead(com, key) if key then @@ -354,6 +377,7 @@ function M:AddMarkToHead(com, key) com.touchable = false com.xy = self:GetHeadCenter() end + -- 动态移除组件 function M:RemoveMarkFromHead(key) if self[key] then @@ -363,11 +387,10 @@ function M:RemoveMarkFromHead(key) end function M:Destroy() - self.isShowTGTimer=false - TimerManager.RemoveTimer(self.OnUpdate,self) - self.OnUpdate=nil - self.muShiPlayerUpdate=nil + self.isShowTGTimer = false + TimerManager.RemoveTimer(self.OnUpdate, self) + self.OnUpdate = nil + self.muShiPlayerUpdate = nil end - return M diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index df48d804..47c432ba 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -25,6 +25,12 @@ "ui://m7iejg46ilon7ias", "ui://m7iejg46ilon7ibc", "ui://m7iejg46imp57ihp", + "ui://9n9stu2eprgzf0", + "ui://v0j9abjygq7ms2", + "ui://v0j9abjyp0aisn", + "ui://v0j9abjyp0aism", + "ui://v0j9abjygq7mgx", + "ui://v0j9abjygq7mh1", "ui://m7iejg46z3847i6m", "ui://m7iejg46kwi0hk0", "ui://m7iejg46imp57igy", @@ -42,27 +48,17 @@ "test.device": "720p Phone", "canvasColor": 10066329, "auxline2": true, - "doc.activeDoc": "ui://m7iejg46imp57ihp", + "doc.activeDoc": "ui://v0j9abjygq7ms2", "libview.twoColumn": false, "libview.expandedNodes": [ - "27vd145b", + "s63l0suw", "/", - "27vd145b", - "/buttons/", - "0khx14ar", + "v0j9abjy", "/", - "m7iejg46", - "/", - "m7iejg46", + "v0j9abjy", "/component/", - "m7iejg46", - "/component/Lst_room/", - "m7iejg46", - "/images/", - "m7iejg46", - "/images/allNumber/", - "m7iejg46", - "/mgr/" + "v0j9abjy", + "/images/" ], "auxline1": true, "snapToGrid": true, diff --git a/wb_new_ui/assets/Main_Majiang/Main_2.xml b/wb_new_ui/assets/Main_Majiang/Main_2.xml index 74eeab14..5bf33011 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_2.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_2.xml @@ -5,23 +5,23 @@ - + - + - + - + diff --git a/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_1_s2(1).xml b/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_1_s2(1).xml index 249a63e1..2fdc02dd 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_1_s2(1).xml +++ b/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_1_s2(1).xml @@ -10,7 +10,6 @@ - @@ -53,5 +52,11 @@ + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_3_s2(1).xml b/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_3_s2(1).xml index 7c236e64..06f5f2ce 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_3_s2(1).xml +++ b/wb_new_ui/assets/Main_Majiang/Main_style_2/PlayerHead_3_s2(1).xml @@ -57,5 +57,11 @@ + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_Majiang/component/PlayerHead_1.xml b/wb_new_ui/assets/Main_Majiang/component/PlayerHead_1.xml index 85dad7ce..ff5abb29 100644 --- a/wb_new_ui/assets/Main_Majiang/component/PlayerHead_1.xml +++ b/wb_new_ui/assets/Main_Majiang/component/PlayerHead_1.xml @@ -2,18 +2,18 @@ - + - + - + @@ -22,7 +22,7 @@ - + @@ -41,5 +41,11 @@ + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_Majiang/component/PlayerHead_3.xml b/wb_new_ui/assets/Main_Majiang/component/PlayerHead_3.xml index 4906028b..7ba62a4b 100644 --- a/wb_new_ui/assets/Main_Majiang/component/PlayerHead_3.xml +++ b/wb_new_ui/assets/Main_Majiang/component/PlayerHead_3.xml @@ -2,13 +2,13 @@ - + - + @@ -19,10 +19,10 @@ - + - + @@ -41,5 +41,11 @@ + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_Majiang/component/pb_tuoGuan_Bg.xml b/wb_new_ui/assets/Main_Majiang/component/pb_tuoGuan_Bg.xml new file mode 100644 index 00000000..2240c62d --- /dev/null +++ b/wb_new_ui/assets/Main_Majiang/component/pb_tuoGuan_Bg.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_Majiang/component/pb_tuoGuan_Border.xml b/wb_new_ui/assets/Main_Majiang/component/pb_tuoGuan_Border.xml new file mode 100644 index 00000000..2040c6a7 --- /dev/null +++ b/wb_new_ui/assets/Main_Majiang/component/pb_tuoGuan_Border.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_Majiang/images/bg.png b/wb_new_ui/assets/Main_Majiang/images/bg.png new file mode 100644 index 00000000..0e11f5b3 Binary files /dev/null and b/wb_new_ui/assets/Main_Majiang/images/bg.png differ diff --git a/wb_new_ui/assets/Main_Majiang/images/tuoguan.png b/wb_new_ui/assets/Main_Majiang/images/tuoguan.png new file mode 100644 index 00000000..b4abc879 Binary files /dev/null and b/wb_new_ui/assets/Main_Majiang/images/tuoguan.png differ diff --git a/wb_new_ui/assets/Main_Majiang/package.xml b/wb_new_ui/assets/Main_Majiang/package.xml index 739aa380..81972035 100644 --- a/wb_new_ui/assets/Main_Majiang/package.xml +++ b/wb_new_ui/assets/Main_Majiang/package.xml @@ -1028,6 +1028,10 @@ + + + + \ No newline at end of file