60 lines
1.8 KiB
Lua
60 lines
1.8 KiB
Lua
local ui = {}
|
|
local _V = function(...) return SL:GetMetaValue(...) end
|
|
local FUNCQUEUE = {}
|
|
local TAGOBJ = {}
|
|
|
|
function ui.init(parent, __data__, __update__)
|
|
if __update__ then return ui.update(__data__) end
|
|
-- Create Layer
|
|
local Layer = GUI:Node_Create(parent, "Layer", 0, 0)
|
|
GUI:setTag(Layer, -1)
|
|
|
|
-- Create Panel_1
|
|
local Panel_1 = GUI:Layout_Create(Layer, "Panel_1", 0, 0, 200, 185, false)
|
|
GUI:setAnchorPoint(Panel_1, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Panel_1, false)
|
|
GUI:setTag(Panel_1, 0)
|
|
|
|
-- Create Image_1
|
|
local Image_1 = GUI:Image_Create(Panel_1, "Image_1", 0, 0, "res/custom/27/24.png")
|
|
GUI:setAnchorPoint(Image_1, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Image_1, false)
|
|
GUI:setTag(Image_1, 0)
|
|
|
|
-- Create rank_list
|
|
local rank_list = GUI:ListView_Create(Image_1, "rank_list", 0, 33, 200, 122, 1)
|
|
GUI:setAnchorPoint(rank_list, 0.00, 0.00)
|
|
GUI:setTouchEnabled(rank_list, true)
|
|
GUI:setTag(rank_list, 0)
|
|
|
|
-- Create Panel_2
|
|
local Panel_2 = GUI:Layout_Create(rank_list, "Panel_2", 0, 92, 200, 30, false)
|
|
GUI:setAnchorPoint(Panel_2, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Panel_2, false)
|
|
GUI:setTag(Panel_2, 0)
|
|
|
|
-- Create self_rank
|
|
local self_rank = GUI:Text_Create(Image_1, "self_rank", 89, 7, 16, "#00ff00", [[]])
|
|
GUI:Text_enableOutline(self_rank, "#000000", 2)
|
|
GUI:setAnchorPoint(self_rank, 0.00, 0.00)
|
|
GUI:setTouchEnabled(self_rank, false)
|
|
GUI:setTag(self_rank, 0)
|
|
|
|
-- Create self_num
|
|
local self_num = GUI:Text_Create(Image_1, "self_num", 160, 7, 16, "#00ff00", [[]])
|
|
GUI:Text_enableOutline(self_num, "#000000", 2)
|
|
GUI:setAnchorPoint(self_num, 0.00, 0.00)
|
|
GUI:setTouchEnabled(self_num, false)
|
|
GUI:setTag(self_num, 0)
|
|
|
|
ui.update(__data__)
|
|
return Layer
|
|
end
|
|
|
|
function ui.update(data)
|
|
for _, func in pairs(FUNCQUEUE) do
|
|
if func then func(data) end
|
|
end
|
|
end
|
|
|
|
return ui
|