46 lines
1.1 KiB
Lua
46 lines
1.1 KiB
Lua
|
|
ModalWaitingWindow2 = {
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
local M = ModalWaitingWindow2
|
||
|
|
|
||
|
|
local modal_wait_win_url = "ui://Common/GlobalModalWaiting_jiangxi"
|
||
|
|
local modal_panel = nil
|
||
|
|
function ModalWaitingWindow2.new()
|
||
|
|
local self = setmetatable({}, { __index = M })
|
||
|
|
self.class = "ModalWaitingWindow2"
|
||
|
|
self._view = UIPackage.CreateObjectFromURL(modal_wait_win_url)
|
||
|
|
if not modal_panel then
|
||
|
|
modal_panel = UIPackage.CreateObjectFromURL("ui://Common/UIPanel")
|
||
|
|
modal_panel.name = "GlobalModalWaiting_Win"
|
||
|
|
modal_panel:MakeFullScreen()
|
||
|
|
modal_panel:AddRelation(GRoot.inst, RelationType.Size)
|
||
|
|
end
|
||
|
|
modal_panel:AddChild(self._view)
|
||
|
|
self._view:Center()
|
||
|
|
GRoot.inst:AddChild(modal_panel)
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:Show()
|
||
|
|
modal_panel.visible = true
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:Close()
|
||
|
|
modal_panel.visible = false
|
||
|
|
end
|
||
|
|
|
||
|
|
local _inst = nil
|
||
|
|
function ModalWaitingWindow2.ShowModal()
|
||
|
|
if (_inst == nil) then
|
||
|
|
_inst = ModalWaitingWindow2.new()
|
||
|
|
end
|
||
|
|
_inst:Show()
|
||
|
|
end
|
||
|
|
|
||
|
|
function ModalWaitingWindow2.CloseModal()
|
||
|
|
if (_inst) then
|
||
|
|
_inst:Close()
|
||
|
|
end
|
||
|
|
end
|