182 lines
7.1 KiB
Lua
182 lines
7.1 KiB
Lua
local ui = {}
|
|
function ui.init(parent)
|
|
-- Create Layer
|
|
local Layer = GUI:Node_Create(parent, "Layer", 0.00, 0.00)
|
|
GUI:setAnchorPoint(Layer, 0.50, 0.50)
|
|
GUI:setTag(Layer, -1)
|
|
|
|
-- Create bg_close
|
|
local bg_close = GUI:Layout_Create(Layer, "bg_close", 0.00, 0.00, 1136.00, 640.00, false)
|
|
GUI:Layout_setBackGroundColorType(bg_close, 1)
|
|
GUI:Layout_setBackGroundColor(bg_close, "#000000")
|
|
GUI:Layout_setBackGroundColorOpacity(bg_close, 0)
|
|
GUI:setTouchEnabled(bg_close, true)
|
|
GUI:setTag(bg_close, -1)
|
|
|
|
-- Create nd_root
|
|
local nd_root = GUI:Node_Create(Layer, "nd_root", 568.00, 320.00)
|
|
GUI:setAnchorPoint(nd_root, 0.50, 0.50)
|
|
GUI:setTag(nd_root, -1)
|
|
|
|
-- Create img_bg
|
|
local img_bg = GUI:Layout_Create(nd_root, "img_bg", -210.00, -150.00, 420.00, 300.00, false)
|
|
GUI:Layout_setBackGroundColorType(img_bg, 1)
|
|
GUI:Layout_setBackGroundColor(img_bg, "#1f1a14")
|
|
GUI:Layout_setBackGroundColorOpacity(img_bg, 230)
|
|
GUI:setTouchEnabled(img_bg, true)
|
|
GUI:setTag(img_bg, -1)
|
|
|
|
-- Create title
|
|
local title = GUI:Text_Create(img_bg, "title", 168.00, 270.00, 20, "#fff000", "自动巡航")
|
|
GUI:setTouchEnabled(title, false)
|
|
GUI:setTag(title, -1)
|
|
|
|
-- Create btn_close
|
|
local btn_close = GUI:Layout_Create(img_bg, "btn_close", 378.00, 266.00, 28.00, 24.00, false)
|
|
GUI:Layout_setBackGroundColorType(btn_close, 1)
|
|
GUI:Layout_setBackGroundColor(btn_close, "#6b1f1f")
|
|
GUI:Layout_setBackGroundColorOpacity(btn_close, 210)
|
|
GUI:setTouchEnabled(btn_close, true)
|
|
GUI:setTag(btn_close, -1)
|
|
|
|
-- Create btn_close_Text
|
|
local btn_close_Text = GUI:Text_Create(btn_close, "btn_close_Text", 14.00, 12.00, 13, "#ffffff", "X")
|
|
GUI:setAnchorPoint(btn_close_Text, 0.50, 0.50)
|
|
GUI:setTouchEnabled(btn_close_Text, false)
|
|
GUI:setTag(btn_close_Text, -1)
|
|
|
|
-- Create statusText
|
|
local statusText = GUI:Text_Create(img_bg, "statusText", 24.00, 242.00, 14, "#c0c0c0", "状态: 未开启")
|
|
GUI:setTouchEnabled(statusText, false)
|
|
GUI:setTag(statusText, -1)
|
|
|
|
-- Create mapTitle
|
|
local mapTitle = GUI:Text_Create(img_bg, "mapTitle", 24.00, 216.00, 14, "#ffffff", "巡航地图")
|
|
GUI:setTouchEnabled(mapTitle, false)
|
|
GUI:setTag(mapTitle, -1)
|
|
|
|
-- Create recordBtn
|
|
local recordBtn = GUI:Layout_Create(img_bg, "recordBtn", 300.00, 205.00, 86.00, 26.00, false)
|
|
GUI:Layout_setBackGroundColorType(recordBtn, 1)
|
|
GUI:Layout_setBackGroundColor(recordBtn, "#5a3a16")
|
|
GUI:Layout_setBackGroundColorOpacity(recordBtn, 210)
|
|
GUI:setTouchEnabled(recordBtn, true)
|
|
GUI:setTag(recordBtn, -1)
|
|
|
|
-- Create recordBtn_Text
|
|
local recordBtn_Text = GUI:Text_Create(recordBtn, "recordBtn_Text", 43.00, 13.00, 13, "#ffffff", "记录当前")
|
|
GUI:setAnchorPoint(recordBtn_Text, 0.50, 0.50)
|
|
GUI:setTouchEnabled(recordBtn_Text, false)
|
|
GUI:setTag(recordBtn_Text, -1)
|
|
|
|
for i = 1, 3 do
|
|
local y = 174.00 - (i - 1) * 34.00
|
|
|
|
local mapSlot = GUI:Layout_Create(img_bg, "mapSlot" .. i, 24.00, y, 260.00, 26.00, false)
|
|
GUI:Layout_setBackGroundColorType(mapSlot, 1)
|
|
GUI:Layout_setBackGroundColor(mapSlot, "#101010")
|
|
GUI:Layout_setBackGroundColorOpacity(mapSlot, 150)
|
|
GUI:setTouchEnabled(mapSlot, false)
|
|
GUI:setTag(mapSlot, -1)
|
|
|
|
local mapText = GUI:Text_Create(mapSlot, "mapText" .. i, 8.00, 13.00, 13, "#d8d8d8", i .. ". 空")
|
|
GUI:setAnchorPoint(mapText, 0.00, 0.50)
|
|
GUI:setTouchEnabled(mapText, false)
|
|
GUI:setTag(mapText, -1)
|
|
|
|
local delBtn = GUI:Layout_Create(img_bg, "delBtn" .. i, 300.00, y, 58.00, 26.00, false)
|
|
GUI:Layout_setBackGroundColorType(delBtn, 1)
|
|
GUI:Layout_setBackGroundColor(delBtn, "#6b1f1f")
|
|
GUI:Layout_setBackGroundColorOpacity(delBtn, 210)
|
|
GUI:setTouchEnabled(delBtn, true)
|
|
GUI:setTag(delBtn, -1)
|
|
|
|
local delBtn_Text = GUI:Text_Create(delBtn, "delBtn" .. i .. "_Text", 29.00, 13.00, 13, "#ffffff", "删除")
|
|
GUI:setAnchorPoint(delBtn_Text, 0.50, 0.50)
|
|
GUI:setTouchEnabled(delBtn_Text, false)
|
|
GUI:setTag(delBtn_Text, -1)
|
|
end
|
|
|
|
-- Create autoKuangBao
|
|
local autoKuangBao = GUI:CheckBox_Create(img_bg, "autoKuangBao", 24.00, 72.00, "res/private/gui_edit/CheckBox_Normal.png", "res/private/gui_edit/CheckBox_Press.png")
|
|
GUI:setTouchEnabled(autoKuangBao, true)
|
|
GUI:setTag(autoKuangBao, -1)
|
|
|
|
-- Create autoKuangBaoText
|
|
local autoKuangBaoText = GUI:Text_Create(img_bg, "autoKuangBaoText", 48.00, 78.00, 14, "#ffffff", "自动开启狂暴")
|
|
GUI:setTouchEnabled(autoKuangBaoText, false)
|
|
GUI:setTag(autoKuangBaoText, -1)
|
|
|
|
-- Create orderMode
|
|
local orderMode = GUI:CheckBox_Create(img_bg, "orderMode", 188.00, 72.00, "res/private/gui_edit/CheckBox_Normal.png", "res/private/gui_edit/CheckBox_Press.png")
|
|
GUI:setTouchEnabled(orderMode, true)
|
|
GUI:setTag(orderMode, -1)
|
|
|
|
-- Create orderModeText
|
|
local orderModeText = GUI:Text_Create(img_bg, "orderModeText", 212.00, 78.00, 14, "#ffffff", "顺序下图")
|
|
GUI:setTouchEnabled(orderModeText, false)
|
|
GUI:setTag(orderModeText, -1)
|
|
|
|
-- Create dieText
|
|
local dieText = GUI:Text_Create(img_bg, "dieText", 24.00, 46.00, 14, "#ffffff", "死亡停止")
|
|
GUI:setTouchEnabled(dieText, false)
|
|
GUI:setTag(dieText, -1)
|
|
|
|
-- Create dieInput
|
|
local dieInput = GUI:TextInput_Create(img_bg, "dieInput", 92.00, 35.00, 44.00, 24.00, 14)
|
|
GUI:TextInput_setFontColor(dieInput, "#fff000")
|
|
GUI:TextInput_setString(dieInput, "0")
|
|
GUI:setTouchEnabled(dieInput, true)
|
|
GUI:setTag(dieInput, -1)
|
|
|
|
-- Create dieText2
|
|
local dieText2 = GUI:Text_Create(img_bg, "dieText2", 142.00, 46.00, 14, "#ffffff", "次")
|
|
GUI:setTouchEnabled(dieText2, false)
|
|
GUI:setTag(dieText2, -1)
|
|
|
|
-- Create noAtkText
|
|
local noAtkText = GUI:Text_Create(img_bg, "noAtkText", 188.00, 46.00, 14, "#ffffff", "未攻击切图")
|
|
GUI:setTouchEnabled(noAtkText, false)
|
|
GUI:setTag(noAtkText, -1)
|
|
|
|
-- Create noAtkInput
|
|
local noAtkInput = GUI:TextInput_Create(img_bg, "noAtkInput", 274.00, 35.00, 50.00, 24.00, 14)
|
|
GUI:TextInput_setFontColor(noAtkInput, "#fff000")
|
|
GUI:TextInput_setString(noAtkInput, "0")
|
|
GUI:setTouchEnabled(noAtkInput, true)
|
|
GUI:setTag(noAtkInput, -1)
|
|
|
|
-- Create noAtkText2
|
|
local noAtkText2 = GUI:Text_Create(img_bg, "noAtkText2", 330.00, 46.00, 14, "#ffffff", "秒")
|
|
GUI:setTouchEnabled(noAtkText2, false)
|
|
GUI:setTag(noAtkText2, -1)
|
|
|
|
-- Create toggleBtn
|
|
local toggleBtn = GUI:Layout_Create(img_bg, "toggleBtn", 76.00, 8.00, 112.00, 30.00, false)
|
|
GUI:Layout_setBackGroundColorType(toggleBtn, 1)
|
|
GUI:Layout_setBackGroundColor(toggleBtn, "#23531f")
|
|
GUI:Layout_setBackGroundColorOpacity(toggleBtn, 210)
|
|
GUI:setTouchEnabled(toggleBtn, true)
|
|
GUI:setTag(toggleBtn, -1)
|
|
|
|
-- Create toggleBtnText
|
|
local toggleBtnText = GUI:Text_Create(toggleBtn, "toggleBtnText", 56.00, 15.00, 13, "#ffffff", "开启巡航")
|
|
GUI:setAnchorPoint(toggleBtnText, 0.50, 0.50)
|
|
GUI:setTouchEnabled(toggleBtnText, false)
|
|
GUI:setTag(toggleBtnText, -1)
|
|
|
|
-- Create saveBtn
|
|
local saveBtn = GUI:Layout_Create(img_bg, "saveBtn", 232.00, 8.00, 112.00, 30.00, false)
|
|
GUI:Layout_setBackGroundColorType(saveBtn, 1)
|
|
GUI:Layout_setBackGroundColor(saveBtn, "#5a3a16")
|
|
GUI:Layout_setBackGroundColorOpacity(saveBtn, 210)
|
|
GUI:setTouchEnabled(saveBtn, true)
|
|
GUI:setTag(saveBtn, -1)
|
|
|
|
-- Create saveBtn_Text
|
|
local saveBtn_Text = GUI:Text_Create(saveBtn, "saveBtn_Text", 56.00, 15.00, 13, "#ffffff", "保存设置")
|
|
GUI:setAnchorPoint(saveBtn_Text, 0.50, 0.50)
|
|
GUI:setTouchEnabled(saveBtn_Text, false)
|
|
GUI:setTag(saveBtn_Text, -1)
|
|
end
|
|
return ui
|