hengyang_client/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua

57 lines
1.2 KiB
Lua
Raw Normal View History

2025-06-17 17:51:24 +08:00
--region LOCAL
local BanDesk = {}
local root = {}
local rootLastIndex = 0
local function HideMainView()
rootLastIndex = root.familyType.selectedIndex
root.familyType.selectedIndex = 0
end
local function ShowMainView()
root.familyType.selectedIndex = rootLastIndex or 1
end
--endregion
-- 禁止同桌数据
BanDesk.BanData = {}
function BanDesk:TryShow(r)
if not self._view then
self:Init()
end
root = r
HideMainView()
self:Show()
end
function BanDesk:Close()
BaseView.Close(self)
ShowMainView()
end
function BanDesk:Init()
setmetatable(BanDesk, {__index = BaseView})
self:InitView("ui://Family/com_banDesk")
self.btn_close = self._view:GetChild("btn_close")
self.list_banItem = self._view:GetChild("list_banItem")
self.btn_close.onClick:Set(function()
self:Close()
end)
self.list_banItem.itemRenderer = function(index, obj)
local data = self.BanData[index]
local tex_name = obj:GetChild("tex_name")
local list_BanedPlayers = obj:GetChild("list_BanedPlayers")
local btn_del = obj:GetChild("btn_del")
local btn_addBanItem = obj:GetChild("btn_addBanItem")
end
end
return BanDesk