upgrade
This commit is contained in:
@@ -18,17 +18,17 @@ local firstCell
|
||||
function CLLPPopTime.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
table.insert(hours, joinStr(NumEx.nStrForLen(23, 2), "点"))
|
||||
for i = 0, 22 do
|
||||
table.insert(hours, joinStr(NumEx.nStrForLen(i, 2), "点"))
|
||||
end
|
||||
-- table.insert(hours, joinStr(NumEx.nStrForLen(23, 2), "点"))
|
||||
-- for i = 0, 22 do
|
||||
-- table.insert(hours, joinStr(NumEx.nStrForLen(i, 2), "点"))
|
||||
-- end
|
||||
|
||||
table.insert(minutes, joinStr(NumEx.nStrForLen(59, 2), "分"))
|
||||
table.insert(seconds, joinStr(NumEx.nStrForLen(59, 2), "秒"))
|
||||
for i = 0, 58 do
|
||||
table.insert(minutes, joinStr(NumEx.nStrForLen(i, 2), "分"))
|
||||
table.insert(seconds, joinStr(NumEx.nStrForLen(i, 2), "秒"))
|
||||
end
|
||||
-- table.insert(minutes, joinStr(NumEx.nStrForLen(59, 2), "分"))
|
||||
-- table.insert(seconds, joinStr(NumEx.nStrForLen(59, 2), "秒"))
|
||||
-- for i = 0, 58 do
|
||||
-- table.insert(minutes, joinStr(NumEx.nStrForLen(i, 2), "分"))
|
||||
-- table.insert(seconds, joinStr(NumEx.nStrForLen(i, 2), "秒"))
|
||||
-- end
|
||||
---@type UISprite
|
||||
uiobjs.SpriteBg = getCC(transform, "Bottom/offset/SpriteBg", "UISprite")
|
||||
local offset = getChild(transform, "Bottom/offset")
|
||||
@@ -52,6 +52,52 @@ function CLLPPopTime.setData(paras)
|
||||
hh = strs[1]
|
||||
mm = strs[2]
|
||||
ss = strs[3]
|
||||
CLLPPopTime.setPopList(hh, mm, ss)
|
||||
end
|
||||
|
||||
function CLLPPopTime.setPopList(hh, mm, ss)
|
||||
hours = {}
|
||||
local h = hh -1
|
||||
if h < 0 then
|
||||
h = 23
|
||||
end
|
||||
table.insert(hours, joinStr(NumEx.nStrForLen(h, 2), "点"))
|
||||
for i = 0, 22 do
|
||||
h = hh + i
|
||||
if h > 23 then
|
||||
h = h - 24
|
||||
end
|
||||
table.insert(hours, joinStr(NumEx.nStrForLen(h, 2), "点"))
|
||||
end
|
||||
|
||||
minutes = {}
|
||||
seconds = {}
|
||||
|
||||
local m = mm -1
|
||||
if m < 0 then
|
||||
m = 59
|
||||
end
|
||||
|
||||
local s = ss -1
|
||||
if s < 0 then
|
||||
s = 59
|
||||
end
|
||||
|
||||
table.insert(minutes, joinStr(NumEx.nStrForLen(m, 2), "分"))
|
||||
table.insert(seconds, joinStr(NumEx.nStrForLen(s, 2), "秒"))
|
||||
for i = 0, 58 do
|
||||
m = mm + i
|
||||
if m > 59 then
|
||||
m = m - 60
|
||||
end
|
||||
s = ss + i
|
||||
if s > 59 then
|
||||
s = s - 60
|
||||
end
|
||||
table.insert(minutes, joinStr(NumEx.nStrForLen(m, 2), "分"))
|
||||
table.insert(seconds, joinStr(NumEx.nStrForLen(s, 2), "秒"))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--当有通用背板显示时的回调
|
||||
|
||||
Reference in New Issue
Block a user