132 lines
4.8 KiB
Lua
132 lines
4.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 bg_close
|
|
local bg_close = GUI:Layout_Create(Layer, "bg_close", 0, 0, 1136, 640, false)
|
|
GUI:Layout_setBackGroundColorType(bg_close, 1)
|
|
GUI:Layout_setBackGroundColor(bg_close, "#000000")
|
|
GUI:Layout_setBackGroundColorOpacity(bg_close, 0)
|
|
GUI:setAnchorPoint(bg_close, 0.00, 0.00)
|
|
GUI:setTouchEnabled(bg_close, true)
|
|
GUI:setTag(bg_close, -1)
|
|
|
|
-- Create nd_root
|
|
local nd_root = GUI:Node_Create(Layer, "nd_root", 568, 320)
|
|
GUI:setTag(nd_root, 670)
|
|
TAGOBJ["670"] = nd_root
|
|
|
|
-- Create img_bg
|
|
local img_bg = GUI:Image_Create(nd_root, "img_bg", 0, 0, "res/custom/12/0.png")
|
|
GUI:setChineseName(img_bg, "背景图片")
|
|
GUI:setAnchorPoint(img_bg, 0.50, 0.50)
|
|
GUI:setTouchEnabled(img_bg, true)
|
|
GUI:setTag(img_bg, -1)
|
|
|
|
-- Create btn_close
|
|
local btn_close = GUI:Button_Create(img_bg, "btn_close", 772, 449, "res/public/1900000510.png")
|
|
GUI:Button_loadTexturePressed(btn_close, "res/public/1900000511.png")
|
|
GUI:setContentSize(btn_close, 26, 42)
|
|
GUI:setIgnoreContentAdaptWithSize(btn_close, false)
|
|
GUI:Button_setTitleText(btn_close, [[]])
|
|
GUI:Button_setTitleColor(btn_close, "#ffffff")
|
|
GUI:Button_setTitleFontSize(btn_close, 14)
|
|
GUI:Button_titleDisableOutLine(btn_close)
|
|
GUI:setAnchorPoint(btn_close, 0.00, 0.00)
|
|
GUI:setTouchEnabled(btn_close, true)
|
|
GUI:setTag(btn_close, -1)
|
|
|
|
-- Create ListView_1
|
|
local ListView_1 = GUI:ListView_Create(img_bg, "ListView_1", 54, 35, 140, 410, 1)
|
|
GUI:setAnchorPoint(ListView_1, 0.00, 0.00)
|
|
GUI:setTouchEnabled(ListView_1, true)
|
|
GUI:setTag(ListView_1, -1)
|
|
|
|
-- Create Button
|
|
local Button = GUI:Button_Create(ListView_1, "Button", 0, 373, "res/public/1900000662.png")
|
|
GUI:setContentSize(Button, 140, 37)
|
|
GUI:setIgnoreContentAdaptWithSize(Button, false)
|
|
GUI:Button_setTitleText(Button, [[Button]])
|
|
GUI:Button_setTitleColor(Button, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button, 14)
|
|
GUI:Button_titleEnableOutline(Button, "#000000", 1)
|
|
GUI:setAnchorPoint(Button, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Button, true)
|
|
GUI:setTag(Button, -1)
|
|
|
|
-- Create ListView_2
|
|
local ListView_2 = GUI:ListView_Create(img_bg, "ListView_2", 205, 35, 140, 410, 1)
|
|
GUI:setAnchorPoint(ListView_2, 0.00, 0.00)
|
|
GUI:setTouchEnabled(ListView_2, true)
|
|
GUI:setTag(ListView_2, -1)
|
|
|
|
-- Create Button_1
|
|
local Button_1 = GUI:Button_Create(ListView_2, "Button_1", 0, 357, "res/public/1900000680.png")
|
|
GUI:Button_loadTexturePressed(Button_1, "res/private/gui_edit/Button_Press.png")
|
|
GUI:Button_loadTextureDisabled(Button_1, "res/private/gui_edit/Button_Disable.png")
|
|
GUI:setContentSize(Button_1, 140, 53)
|
|
GUI:setIgnoreContentAdaptWithSize(Button_1, false)
|
|
GUI:Button_setTitleText(Button_1, [[Button]])
|
|
GUI:Button_setTitleColor(Button_1, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button_1, 14)
|
|
GUI:Button_titleEnableOutline(Button_1, "#000000", 1)
|
|
GUI:setAnchorPoint(Button_1, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Button_1, true)
|
|
GUI:setTag(Button_1, -1)
|
|
|
|
-- Create hc_item
|
|
local hc_item = GUI:ItemShow_Create(img_bg, "hc_item", 555, 366, {index = 1, count = 1, look = true, bgVisible = false, color = 255})
|
|
GUI:setAnchorPoint(hc_item, 0.50, 0.50)
|
|
GUI:setTag(hc_item, -1)
|
|
|
|
-- Create att_Text
|
|
local att_Text = GUI:Text_Create(img_bg, "att_Text", 554, 263, 16, "#00ff00", [[随机提升1-4点]])
|
|
GUI:Text_enableOutline(att_Text, "#000000", 2)
|
|
GUI:setAnchorPoint(att_Text, 0.50, 0.50)
|
|
GUI:setTouchEnabled(att_Text, false)
|
|
GUI:setTag(att_Text, -1)
|
|
|
|
-- Create xh_Layout
|
|
local xh_Layout = GUI:Layout_Create(img_bg, "xh_Layout", 373, 117, 360, 60, false)
|
|
GUI:setAnchorPoint(xh_Layout, 0.00, 0.00)
|
|
GUI:setTouchEnabled(xh_Layout, false)
|
|
GUI:setTag(xh_Layout, -1)
|
|
|
|
-- Create up_btn
|
|
local up_btn = GUI:Button_Create(img_bg, "up_btn", 490, 60, "res/custom/12/1.png")
|
|
GUI:Button_loadTexturePressed(up_btn, "res/custom/12/2.png")
|
|
GUI:setContentSize(up_btn, 144, 48)
|
|
GUI:setIgnoreContentAdaptWithSize(up_btn, false)
|
|
GUI:Button_setTitleText(up_btn, [[]])
|
|
GUI:Button_setTitleColor(up_btn, "#ffffff")
|
|
GUI:Button_setTitleFontSize(up_btn, 14)
|
|
GUI:Button_titleEnableOutline(up_btn, "#000000", 1)
|
|
GUI:setAnchorPoint(up_btn, 0.00, 0.00)
|
|
GUI:setTouchEnabled(up_btn, true)
|
|
GUI:setTag(up_btn, -1)
|
|
|
|
-- Create Text_1
|
|
local Text_1 = GUI:Text_Create(img_bg, "Text_1", 555, 49, 16, "#ffff00", [[对战玩家时重铸总数高于敌人时增加:伤害加成+8%]])
|
|
GUI:Text_enableOutline(Text_1, "#000000", 2)
|
|
GUI:setAnchorPoint(Text_1, 0.50, 0.50)
|
|
GUI:setTouchEnabled(Text_1, false)
|
|
GUI:setTag(Text_1, 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
|