changhong/lua_probject/base_project/Game/View/Common/NetResetConnectWindow.lua

49 lines
1.3 KiB
Lua
Raw Normal View History

2025-05-24 14:29:14 +08:00
--通用消息弹出框View
--author--
NetResetConnectWindow = {}
local modal_wait_win_url = "ui://Common/GlobalModalWaiting"
local modal_panel = nil
function NetResetConnectWindow.new()
local self = setmetatable({}, {__index = NetResetConnectWindow})
self.class = "NetResetConnectWindow"
self._view = UIPackage.CreateObjectFromURL(modal_wait_win_url)
self._view:GetChild("title").text = "网络信号太差,正在检查网络中..."
if not modal_panel then
modal_panel = UIPackage.CreateObjectFromURL("ui://Common/UIPanel")
modal_panel.name = "NetResetConnectWindow_Win"
modal_panel:MakeFullScreen()
modal_panel:AddRelation(GRoot.inst, RelationType.Size)
end
-- self._circleLoader = CircleLoader.new(self._view:GetChild("gcm_qiu"))
-- self._circleLoader:start()
modal_panel:AddChild(self._view)
self._view:Center()
GRoot.inst:AddChild(modal_panel)
return self
end
function NetResetConnectWindow:Show()
modal_panel.visible = true
end
function NetResetConnectWindow:Close()
modal_panel.visible = false
end
local _inst = nil
function NetResetConnectWindow.ShowNetReset()
if (_inst == nil) then
_inst = NetResetConnectWindow.new()
end
_inst:Show()
end
function NetResetConnectWindow.CloseNetReset()
if(_inst) then
_inst:Close()
end
end