hengyang_client/lua_probject/main_project/main/majiang/MJCheckG.lua

51 lines
1.3 KiB
Lua
Raw Permalink Normal View History

2025-06-16 15:24:27 +08:00
-- local EXMainView = import(".EXMainView")
local MJCheckG = {
}
local M = MJCheckG
function MJCheckG.new()
setmetatable(M, { __index = BaseWindow })
-- setmetatable(M, { __index = BaseWindow })
local self = setmetatable({}, { __index = M })
self.class = 'MJCheckG'
self._currenIndex = 0
self._close_destroy = true
2025-10-14 20:44:57 +08:00
self._close_zone = false
2025-06-16 15:24:27 +08:00
self:init('ui://Common/comp_checkG')
return self
end
function M:init(url)
BaseWindow.init(self, url)
self._view:GetChild('btn_ok').onClick:Set(function()
self:Destroy()
end)
self.valueTemp = 0
self.silder = self._view:GetChild('slider_check')
local showText = self._view:GetChild('n3')
self.coroutine = coroutine.start(function(...)
self.valueTemp = 0
2025-10-14 20:44:57 +08:00
local kaTime = math.random(200)
2025-06-16 15:24:27 +08:00
while self.valueTemp < 100 do
2025-10-14 20:44:57 +08:00
if self.valueTemp >= kaTime then
coroutine.wait(0.4)
kaTime = 200
2025-07-30 21:55:34 +08:00
end
2025-10-14 20:44:57 +08:00
local addVulse = math.random(4)
self.valueTemp = self.valueTemp + addVulse
2025-06-16 15:24:27 +08:00
self.silder.value = self.valueTemp
2025-10-14 20:44:57 +08:00
coroutine.wait(addVulse * 0.04)
2025-06-16 15:24:27 +08:00
end
2025-07-30 21:55:34 +08:00
showText.text = "检测完毕,环境安全"
2025-10-14 20:44:57 +08:00
coroutine.wait(0.66)
self._view:GetController('ok_touch').selectedIndex = 1
2025-08-23 22:23:17 +08:00
-- self:Destroy()
2025-06-16 15:24:27 +08:00
end)
end
return M