2025.12.29 liveroom timer整合

This commit is contained in:
kongweiqiang 2025-12-29 16:32:36 +08:00
parent 10e3e31fdd
commit 9267579156
3 changed files with 334 additions and 1557 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,23 @@
---@class LiveRoomItem__Generate_idlePad_timer
---@class LiveRoomItem__Generate_timer_text_time
---@field public gameObject UnityEngine.GameObject
---@field public text TMPro.TextMeshProUGUI
---@class LiveRoomItem__Generate_idlePad
---@field public gameObject UnityEngine.GameObject
---@field public timer LiveRoomItem__Generate_idlePad_timer
---@class LiveRoomItem__Generate_resultPad_timer
---@class LiveRoomItem__Generate_timer_text_name
---@field public gameObject UnityEngine.GameObject
---@field public text TMPro.TextMeshProUGUI
---@class LiveRoomItem__Generate_timer
---@field public gameObject UnityEngine.GameObject
---@field public text_name LiveRoomItem__Generate_timer_text_name
---@field public text_time LiveRoomItem__Generate_timer_text_time
---@class LiveRoomItem__Generate_resultPad
---@field public gameObject UnityEngine.GameObject
---@field public rectTransform UnityEngine.RectTransform
---@field public timer LiveRoomItem__Generate_resultPad_timer
---@class LiveRoomItem__Generate_showPad_timer
---@field public gameObject UnityEngine.GameObject
---@field public text TMPro.TextMeshProUGUI
---@class LiveRoomItem__Generate_showPad
---@field public gameObject UnityEngine.GameObject
---@field public rectTransform UnityEngine.RectTransform
---@field public timer LiveRoomItem__Generate_showPad_timer
---@class LiveRoomItem__Generate_readyPad_readyBtn
---@field public gameObject UnityEngine.GameObject
@ -120,14 +115,9 @@
---@field public gameObject UnityEngine.GameObject
---@field public button UnityEngine.UI.Button
---@class LiveRoomItem__Generate_readyPad_timer
---@field public gameObject UnityEngine.GameObject
---@field public text TMPro.TextMeshProUGUI
---@class LiveRoomItem__Generate_readyPad
---@field public gameObject UnityEngine.GameObject
---@field public rectTransform UnityEngine.RectTransform
---@field public timer LiveRoomItem__Generate_readyPad_timer
---@field public readyitem LiveRoomItem__Generate_readyPad_readyitem
---@field public text_title LiveRoomItem__Generate_readyPad_text_title
---@field public head1 LiveRoomItem__Generate_readyPad_head1
@ -298,7 +288,8 @@
---@field private readyPad LiveRoomItem__Generate_readyPad
---@field private showPad LiveRoomItem__Generate_showPad
---@field private resultPad LiveRoomItem__Generate_resultPad
---@field private idlePad LiveRoomItem__Generate_idlePad
---@field private idlePad UnityEngine.GameObject
---@field private timer LiveRoomItem__Generate_timer
local LiveRoomItemView = class("LiveRoomItemView")
function LiveRoomItemView:ctor()
@ -380,7 +371,6 @@ function LiveRoomItemView:InitGenerate(Root, data)
self:InitGenerate__63(Root,data)
self:InitGenerate__64(Root,data)
self:InitGenerate__65(Root,data)
self:InitGenerate__66(Root,data)
end
@ -838,20 +828,6 @@ end
---@private
function LiveRoomItemView:InitGenerate__35(Root, data)
--[[
BottomSafe/ReadyPad/time_bg/Timer
--]]
local tmp = Root:Find("BottomSafe/ReadyPad/time_bg/Timer").gameObject
if tolua.getpeer(tmp) == nil then
tolua.setpeer(tmp, {})
end
self.readyPad.timer = tmp
tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
end
---@private
function LiveRoomItemView:InitGenerate__36(Root, data)
--[[
BottomSafe/ReadyPad/readyitem
--]]
@ -866,7 +842,7 @@ function LiveRoomItemView:InitGenerate__36(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__37(Root, data)
function LiveRoomItemView:InitGenerate__36(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/text_title
--]]
@ -880,7 +856,7 @@ function LiveRoomItemView:InitGenerate__37(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__38(Root, data)
function LiveRoomItemView:InitGenerate__37(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head1
--]]
@ -892,7 +868,7 @@ function LiveRoomItemView:InitGenerate__38(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__39(Root, data)
function LiveRoomItemView:InitGenerate__38(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head1/head_img
--]]
@ -906,7 +882,7 @@ function LiveRoomItemView:InitGenerate__39(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__40(Root, data)
function LiveRoomItemView:InitGenerate__39(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head2
--]]
@ -918,7 +894,7 @@ function LiveRoomItemView:InitGenerate__40(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__41(Root, data)
function LiveRoomItemView:InitGenerate__40(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head2/head_img
--]]
@ -932,7 +908,7 @@ function LiveRoomItemView:InitGenerate__41(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__42(Root, data)
function LiveRoomItemView:InitGenerate__41(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head3
--]]
@ -944,7 +920,7 @@ function LiveRoomItemView:InitGenerate__42(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__43(Root, data)
function LiveRoomItemView:InitGenerate__42(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head3/head_img
--]]
@ -958,7 +934,7 @@ function LiveRoomItemView:InitGenerate__43(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__44(Root, data)
function LiveRoomItemView:InitGenerate__43(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head4
--]]
@ -970,7 +946,7 @@ function LiveRoomItemView:InitGenerate__44(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__45(Root, data)
function LiveRoomItemView:InitGenerate__44(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head4/head_img
--]]
@ -984,7 +960,7 @@ function LiveRoomItemView:InitGenerate__45(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__46(Root, data)
function LiveRoomItemView:InitGenerate__45(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head5
--]]
@ -996,7 +972,7 @@ function LiveRoomItemView:InitGenerate__46(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__47(Root, data)
function LiveRoomItemView:InitGenerate__46(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head5/head_img
--]]
@ -1010,7 +986,7 @@ function LiveRoomItemView:InitGenerate__47(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__48(Root, data)
function LiveRoomItemView:InitGenerate__47(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head6
--]]
@ -1022,7 +998,7 @@ function LiveRoomItemView:InitGenerate__48(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__49(Root, data)
function LiveRoomItemView:InitGenerate__48(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head6/head_img
--]]
@ -1036,7 +1012,7 @@ function LiveRoomItemView:InitGenerate__49(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__50(Root, data)
function LiveRoomItemView:InitGenerate__49(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head7
--]]
@ -1048,7 +1024,7 @@ function LiveRoomItemView:InitGenerate__50(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__51(Root, data)
function LiveRoomItemView:InitGenerate__50(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head7/head_img
--]]
@ -1062,7 +1038,7 @@ function LiveRoomItemView:InitGenerate__51(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__52(Root, data)
function LiveRoomItemView:InitGenerate__51(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head8
--]]
@ -1074,7 +1050,7 @@ function LiveRoomItemView:InitGenerate__52(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__53(Root, data)
function LiveRoomItemView:InitGenerate__52(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head8/head_img
--]]
@ -1088,7 +1064,7 @@ function LiveRoomItemView:InitGenerate__53(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__54(Root, data)
function LiveRoomItemView:InitGenerate__53(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head9
--]]
@ -1100,7 +1076,7 @@ function LiveRoomItemView:InitGenerate__54(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__55(Root, data)
function LiveRoomItemView:InitGenerate__54(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head9/head_img
--]]
@ -1114,7 +1090,7 @@ function LiveRoomItemView:InitGenerate__55(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__56(Root, data)
function LiveRoomItemView:InitGenerate__55(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head10
--]]
@ -1126,7 +1102,7 @@ function LiveRoomItemView:InitGenerate__56(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__57(Root, data)
function LiveRoomItemView:InitGenerate__56(Root, data)
--[[
BottomSafe/ReadyPad/rect/rect_head/heads/head10/head_img
--]]
@ -1140,7 +1116,7 @@ function LiveRoomItemView:InitGenerate__57(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__58(Root, data)
function LiveRoomItemView:InitGenerate__57(Root, data)
--[[
BottomSafe/ReadyPad/rect/card_bg
--]]
@ -1152,7 +1128,7 @@ function LiveRoomItemView:InitGenerate__58(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__59(Root, data)
function LiveRoomItemView:InitGenerate__58(Root, data)
--[[
BottomSafe/ReadyPad/rect/card_bg/text
--]]
@ -1166,7 +1142,7 @@ function LiveRoomItemView:InitGenerate__59(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__60(Root, data)
function LiveRoomItemView:InitGenerate__59(Root, data)
--[[
BottomSafe/ReadyPad/rect/ReadyBtn
--]]
@ -1180,7 +1156,7 @@ function LiveRoomItemView:InitGenerate__60(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__61(Root, data)
function LiveRoomItemView:InitGenerate__60(Root, data)
--[[
BottomSafe/ShowPad
--]]
@ -1194,21 +1170,7 @@ function LiveRoomItemView:InitGenerate__61(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__62(Root, data)
--[[
BottomSafe/ShowPad/time_bg/Timer
--]]
local tmp = Root:Find("BottomSafe/ShowPad/time_bg/Timer").gameObject
if tolua.getpeer(tmp) == nil then
tolua.setpeer(tmp, {})
end
self.showPad.timer = tmp
tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
end
---@private
function LiveRoomItemView:InitGenerate__63(Root, data)
function LiveRoomItemView:InitGenerate__61(Root, data)
--[[
BottomSafe/ResultPad
--]]
@ -1222,21 +1184,7 @@ function LiveRoomItemView:InitGenerate__63(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__64(Root, data)
--[[
BottomSafe/ResultPad/time_bg/Timer
--]]
local tmp = Root:Find("BottomSafe/ResultPad/time_bg/Timer").gameObject
if tolua.getpeer(tmp) == nil then
tolua.setpeer(tmp, {})
end
self.resultPad.timer = tmp
tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
end
---@private
function LiveRoomItemView:InitGenerate__65(Root, data)
function LiveRoomItemView:InitGenerate__62(Root, data)
--[[
BottomSafe/IdlePad
--]]
@ -1248,29 +1196,52 @@ function LiveRoomItemView:InitGenerate__65(Root, data)
end
---@private
function LiveRoomItemView:InitGenerate__66(Root, data)
function LiveRoomItemView:InitGenerate__63(Root, data)
--[[
BottomSafe/IdlePad/time_bg/Timer
Timer
--]]
local tmp = Root:Find("BottomSafe/IdlePad/time_bg/Timer").gameObject
local tmp = Root:Find("Timer").gameObject
if tolua.getpeer(tmp) == nil then
tolua.setpeer(tmp, {})
end
self.idlePad.timer = tmp
self.timer = tmp
end
---@private
function LiveRoomItemView:InitGenerate__64(Root, data)
--[[
Timer/text_name
--]]
local tmp = Root:Find("Timer/text_name").gameObject
if tolua.getpeer(tmp) == nil then
tolua.setpeer(tmp, {})
end
self.timer.text_name = tmp
tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
end
---@private
function LiveRoomItemView:InitGenerate__65(Root, data)
--[[
Timer/text_time
--]]
local tmp = Root:Find("Timer/text_time").gameObject
if tolua.getpeer(tmp) == nil then
tolua.setpeer(tmp, {})
end
self.timer.text_time = tmp
tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
end
---@private
function LiveRoomItemView:GenerateDestroy()
if tolua.getpeer(self.idlePad.timer) ~= nil then
tolua.setpeer(self.idlePad.timer, nil)
if tolua.getpeer(self.timer.text_time) ~= nil then
tolua.setpeer(self.timer.text_time, nil)
end
if tolua.getpeer(self.resultPad.timer) ~= nil then
tolua.setpeer(self.resultPad.timer, nil)
end
if tolua.getpeer(self.showPad.timer) ~= nil then
tolua.setpeer(self.showPad.timer, nil)
if tolua.getpeer(self.timer.text_name) ~= nil then
tolua.setpeer(self.timer.text_name, nil)
end
if tolua.getpeer(self.readyPad.readyBtn) ~= nil then
tolua.setpeer(self.readyPad.readyBtn, nil)
@ -1350,9 +1321,6 @@ function LiveRoomItemView:GenerateDestroy()
if tolua.getpeer(self.readyPad.readyitem) ~= nil then
tolua.setpeer(self.readyPad.readyitem, nil)
end
if tolua.getpeer(self.readyPad.timer) ~= nil then
tolua.setpeer(self.readyPad.timer, nil)
end
if tolua.getpeer(self.inputBar.sv_gift) ~= nil then
tolua.setpeer(self.inputBar.sv_gift, nil)
end
@ -1471,6 +1439,10 @@ function LiveRoomItemView:GenerateDestroy()
tolua.setpeer(self.idlePad, nil)
end
self.idlePad = nil
if tolua.getpeer(self.timer) ~= nil then
tolua.setpeer(self.timer, nil)
end
self.timer = nil
self.transform = nil
self.gameObject = nil
self.inited = false

View File

@ -812,19 +812,18 @@ function UILiveRoomView:RefreshStageTimer(timerVal)
local data = ManagerContainer.DataMgr.LiveRoomData:GetData()
local stage = data["stage"]
local itemLua = self:GetCurrPageLua()
local name
if stage == LIVEROOM_STAGE_IDLE then
itemLua.idlePad.timer.text.text = tostring(timerVal)
itemLua.idlePad.timer:SetActive(timerVal > 0)
name="等待中"
elseif stage == LIVEROOM_STAGE_READY then
itemLua.readyPad.timer.text.text = tostring(timerVal)
itemLua.readyPad.timer:SetActive(timerVal > 0)
name="准备中"
elseif stage == LIVEROOM_STAGE_SHOW then
itemLua.showPad.timer.text.text = tostring(timerVal)
itemLua.showPad.timer:SetActive(timerVal > 0)
name="进行中"
elseif stage == LIVEROOM_STAGE_RESULT then
itemLua.resultPad.timer.text.text = tostring(timerVal)
itemLua.resultPad.timer:SetActive(timerVal > 0)
name="结算中"
end
itemLua.timer.text_name.text.text = name
itemLua.timer.text_time.text.text = tostring(timerVal)
end
--endregion 计时器相关