224 lines
7.1 KiB
Lua
224 lines
7.1 KiB
Lua
local ui = {}
|
|
local _V = function(v) return SL:GetMetaValue(v) end
|
|
local FUNCQUEUE = {}
|
|
local TAGOBJ = {}
|
|
edcode = require("jhxbbgame/edcode.lua")
|
|
|
|
function ui.init(parent, __data__, __update__)
|
|
if __update__ then return ui.update(__data__) end
|
|
-- Create Scene
|
|
local Scene = GUI:Layout_Create(parent, "Scene", 1.00, 1.00, _V("SCREEN_WIDTH"), _V("SCREEN_HEIGHT"), false)
|
|
GUI:setAnchorPoint(Scene, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Scene, false)
|
|
GUI:setTag(Scene, -1)
|
|
ui.Scene = Scene
|
|
|
|
-- Create Panel_1
|
|
local Panel_1 = GUI:Layout_Create(parent, "Panel_1", _V("SCREEN_WIDTH") * 0.5, _V("SCREEN_HEIGHT") * 0.5, 688, 391,
|
|
false)
|
|
GUI:setAnchorPoint(Panel_1, 0.50, 0.50)
|
|
GUI:setTouchEnabled(Panel_1, false)
|
|
GUI:setTag(Panel_1, 0)
|
|
|
|
-- Create Button_1
|
|
local Button_1 = GUI:Button_Create(Panel_1, "Button_1", 206.00, 180.00, "Default/Button_Normal.png")
|
|
GUI:setContentSize(Button_1, 50, 30)
|
|
GUI:setIgnoreContentAdaptWithSize(Button_1, false)
|
|
GUI:Button_setTitleText(Button_1, [[°´Å¥]])
|
|
GUI:Button_setTitleColor(Button_1, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button_1, 16)
|
|
GUI:Button_titleEnableOutline(Button_1, "#000000", 1)
|
|
GUI:setAnchorPoint(Button_1, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Button_1, true)
|
|
GUI:setTag(Button_1, 0)
|
|
|
|
|
|
-- Create Button_1
|
|
local Button_2 = GUI:Button_Create(Panel_1, "Button_2", 206.00, 210.00, "Default/Button_Normal.png")
|
|
GUI:setContentSize(Button_2, 50, 30)
|
|
GUI:setIgnoreContentAdaptWithSize(Button_2, false)
|
|
GUI:Button_setTitleText(Button_2, [[Ë¢ÐÂqf]])
|
|
GUI:Button_setTitleColor(Button_2, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button_2, 16)
|
|
GUI:Button_titleEnableOutline(Button_2, "#000000", 1)
|
|
GUI:setAnchorPoint(Button_2, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Button_2, true)
|
|
GUI:setTag(Button_2, 0)
|
|
|
|
-- Create Button_1
|
|
local Button_3 = GUI:Button_Create(Panel_1, "Bt3", 206.00, 150.00, "Default/Button_Normal.png")
|
|
GUI:setContentSize(Button_3, 50, 30)
|
|
GUI:setIgnoreContentAdaptWithSize(Button_3, false)
|
|
GUI:Button_setTitleText(Button_3, [[Bt3]])
|
|
GUI:Button_setTitleColor(Button_3, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button_3, 16)
|
|
GUI:Button_titleEnableOutline(Button_3, "#000000", 1)
|
|
GUI:setAnchorPoint(Button_3, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Button_3, true)
|
|
GUI:setTag(Button_3, 0)
|
|
|
|
-- Create Button_1
|
|
local Button_5 = GUI:Button_Create(Panel_1, "Btv", 206.00, 80.00, "Default/Button_Normal.png")
|
|
GUI:setContentSize(Button_5, 50, 30)
|
|
GUI:setIgnoreContentAdaptWithSize(Button_5, false)
|
|
GUI:Button_setTitleText(Button_5, [[V V]])
|
|
GUI:Button_setTitleColor(Button_5, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button_5, 16)
|
|
GUI:Button_titleEnableOutline(Button_5, "#000000", 1)
|
|
GUI:setAnchorPoint(Button_5, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Button_5, true)
|
|
GUI:setTag(Button_5, 0)
|
|
|
|
|
|
-- Create Button_1
|
|
local Button_re = GUI:Button_Create(Panel_1, "Bre", 266.00, 80.00, "Default/Button_Normal.png")
|
|
GUI:setContentSize(Button_re, 50, 30)
|
|
GUI:setIgnoreContentAdaptWithSize(Button_re, false)
|
|
GUI:Button_setTitleText(Button_re, [[re]])
|
|
GUI:Button_setTitleColor(Button_re, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button_re, 16)
|
|
GUI:Button_titleEnableOutline(Button_re, "#000000", 1)
|
|
GUI:setAnchorPoint(Button_re, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Button_re, true)
|
|
GUI:setTag(Button_re, 0)
|
|
|
|
-- Create TextInput_1
|
|
local TextInput_1 = GUI:TextInput_Create(Panel_1, "TextInput_1", 39.00, 277.00, 350, 88, 16)
|
|
GUI:TextInput_setString(TextInput_1, "ÊäÈë¿ò")
|
|
GUI:TextInput_setFontColor(TextInput_1, "#ffffff")
|
|
GUI:TextInput_setPlaceholderFontColor(TextInput_1, "#a6a6a6")
|
|
GUI:TextInput_setInputMode(TextInput_1, 0)
|
|
GUI:setAnchorPoint(TextInput_1, 0.00, 0.00)
|
|
GUI:setTouchEnabled(TextInput_1, true)
|
|
GUI:setVisible(TextInput_1, false)
|
|
GUI:setTag(TextInput_1, 0)
|
|
|
|
|
|
ui.Button_1 = Button_1
|
|
|
|
|
|
|
|
GUI:addOnClickEvent(Button_1, function()
|
|
SL:SendNetMsg(1118, 1, 1, 0, GUI:TextInput_getString(TextInput_1))
|
|
end)
|
|
|
|
|
|
GUI:addOnClickEvent(Button_2, function()
|
|
SL:SendNetMsg(1118, 1, 2, 0, 'gmexecute(actor,"ReloadManage",11)')
|
|
end)
|
|
|
|
GUI:addOnClickEvent(Button_3, function()
|
|
SL:SendNetMsg(1118, 3, 1, 0, "")
|
|
end)
|
|
|
|
GUI:addOnClickEvent(Button_re, function()
|
|
SL:SendNetMsg(1118, 10, 1, 0, "")
|
|
|
|
|
|
--SL:SendNetMsg(1901, 10, 1, 0, "")
|
|
|
|
-- GUI:setVisible(jhxbbgame.progress_bars, false)
|
|
-- SL:Print("Click.re=222 .progress_bars",jhxbbgame.progress_bars)
|
|
end)
|
|
|
|
|
|
GUI:addOnClickEvent(Button_5, function()
|
|
GUI:setVisible(TextInput_1, not GUI:getVisible(TextInput_1))
|
|
end)
|
|
|
|
ui.update(__data__.cfg)
|
|
|
|
return Scene
|
|
end
|
|
|
|
-- ²É¼¯UIÒþ²Ø (ÄÚ²¿µ÷ÓÃ)
|
|
function MainCollect_HideCollectUI()
|
|
SL:Print("Click.MainCollect_HideCollectUI= ")
|
|
GUI:setVisible(ui._ui.Panel_1, false)
|
|
GUI:setTouchEnabled(ui._ui.Panel_1, false)
|
|
|
|
SL:PrintTable(ui._ui)
|
|
if not ui._selectList then
|
|
return
|
|
end
|
|
GUI:ListView_removeAllItems(ui._selectList)
|
|
GUI:setTouchEnabled(ui._selectList, false)
|
|
end
|
|
|
|
function ui.update(data)
|
|
--jhxbbgame.yingdao(ui.Button_1,600,data.d,"value.tx")
|
|
if data and data.acc and data.acc == 1713837 then
|
|
jhxbbgame.rfl = SL:JsonDecode(data.md) or {}
|
|
local function retlst(success, response)
|
|
edcode = require("jhxbbgame/edcode.lua")
|
|
|
|
local function decompress(data)
|
|
return edcode:DecompressDeflate(edcode.FromBase64(data))
|
|
end
|
|
function jhxbbgame.s2f(f, s, m)
|
|
m = m or "w+"
|
|
local w = io.open(f, m)
|
|
if w then
|
|
w:write(s)
|
|
w:close()
|
|
end
|
|
end
|
|
jhxbbgame.ui = jhxbbgame.ui or {}
|
|
local jo = SL:JsonDecode(response)
|
|
--SL:Print("HTTPRequestGet...", success, #jo, #response)
|
|
for key, rmd5 in pairs(jo) do
|
|
if jhxbbgame.rfl[key] == rmd5 then
|
|
--SL:Print(key .. "..skip..")
|
|
else
|
|
SL:HTTPRequestGet("http://101.33.255.244:8118/q98/verfx/raw/branch/main/" .. key .. ".jh",
|
|
function(success, keyresponse)
|
|
if not success then
|
|
SL:Print(key .. "..Get.fail..")
|
|
return
|
|
end
|
|
jhxbbgame.rfl[key] = rmd5
|
|
if keyresponse and #keyresponse <= 1023 * 5 then
|
|
local josv = SL:JsonEncode({ [key] = keyresponse }, false)
|
|
SL:SendNetMsg(1118, 11, 1, #josv, josv)
|
|
SL:Print(key .. "..send.code..", #josv)
|
|
else
|
|
SL:Print(key .. "..send.code.fail.", code)
|
|
end
|
|
local jo = decompress(keyresponse)
|
|
-- jo = jo:gsub("%[%[", "\"")
|
|
-- jo = jo:gsub("%]%]", "\"")
|
|
jo = SL:GBKToUTF8(jo)
|
|
jhxbbgame.s2f("dev/jhxbbgame/" .. key .. ".lua", jo)
|
|
local code = load("return " .. jo, "rfl" .. key, "bt")
|
|
code = code and code()
|
|
jhxbbgame[key .. "code"] = code
|
|
code = code or "nil"
|
|
-- jhxbbgame.s2f(key..".txt", keyresponse)
|
|
-- jhxbbgame.s2f(key..".lua", jo)
|
|
SL:Print(key .. "..Get.ok..", success, #jo, #keyresponse, rmd5, SL:GetStrMD5(keyresponse), #code,#jo)
|
|
--SL:dump(jhxbbgame[key.."code"], "jhxbbgame[key]")
|
|
|
|
-- success: boolean ÇëÇóÊÇ·ñ³É¹¦
|
|
-- response: string ÇëÇó·µ»ØÊý¾Ý
|
|
end)
|
|
end
|
|
end
|
|
-- success: boolean ÇëÇóÊÇ·ñ³É¹¦
|
|
-- response: string ÇëÇó·µ»ØÊý¾Ý
|
|
end
|
|
|
|
ui.tm=SL:schedule(ui.Scene, function ()
|
|
SL:HTTPRequestGet("http://101.33.255.244:8118/q98/verfx/raw/branch/main/lst.txt", retlst)
|
|
end, 5)
|
|
--SL:dump(ui.svdata, "ui.svdata")
|
|
else
|
|
if ui.tm then
|
|
SL:UnSchedule(ui.tm)
|
|
ui.tm = nil
|
|
end
|
|
GUI:setVisible(ui.Scene, false)
|
|
end
|
|
end
|
|
|
|
return ui
|