2021-12-20 00:39:38 +01:00
|
|
|
local triggerSplashScreen = false
|
|
|
|
|
2021-12-20 01:34:41 +01:00
|
|
|
local rootMenu = {
|
2021-12-20 00:39:38 +01:00
|
|
|
{
|
|
|
|
label = 'IDOLS',
|
|
|
|
children = {
|
2021-12-20 01:34:41 +01:00
|
|
|
{label = 'GRACEv6'},
|
|
|
|
{label = 'NEARNOAHv6'},
|
|
|
|
{label = 'IDKv6'}
|
2021-12-20 00:39:38 +01:00
|
|
|
}
|
2021-12-20 01:34:41 +01:00
|
|
|
}, {
|
2021-12-20 00:39:38 +01:00
|
|
|
label = 'LASER COLORS',
|
|
|
|
children = {
|
|
|
|
{
|
2021-12-20 01:34:41 +01:00
|
|
|
label = 'LEFT LASER',
|
|
|
|
children = {
|
|
|
|
{label='BLUE', color={0,128,255}},
|
|
|
|
{label='PINK', color={255,0,255}},
|
|
|
|
{label='GREEN', color={0,255,0}},
|
|
|
|
{label='YELLOW', color={255,255,0}},
|
|
|
|
}
|
|
|
|
},
|
2021-12-20 00:39:38 +01:00
|
|
|
{
|
2021-12-20 01:34:41 +01:00
|
|
|
label = 'RIGHT LASER',
|
|
|
|
children = {
|
|
|
|
{label='BLUE'},
|
|
|
|
{label='PINK'},
|
|
|
|
{label='GREEN'},
|
|
|
|
{label='YELLOW'},
|
|
|
|
}
|
2021-12-20 00:39:38 +01:00
|
|
|
}
|
|
|
|
}
|
2021-12-20 01:34:41 +01:00
|
|
|
}, {
|
|
|
|
label = 'MORE OPTIONS',
|
|
|
|
children = {{label = 'TEST'}}
|
|
|
|
}, {
|
2021-12-20 00:39:38 +01:00
|
|
|
label = 'OH YOU SUSSY BAKA',
|
2021-12-20 01:34:41 +01:00
|
|
|
children = {{label = 'TEST'}}
|
2021-12-20 00:39:38 +01:00
|
|
|
},
|
2021-12-20 01:34:41 +01:00
|
|
|
{label = "BACK TO TITLE SCREEN", type="back", handler = function() triggerSplashScreen = true; end}
|
2021-12-20 00:39:38 +01:00
|
|
|
}
|
|
|
|
|
2021-12-20 01:34:41 +01:00
|
|
|
local menu = rootMenu
|
|
|
|
|
2021-12-20 00:39:38 +01:00
|
|
|
local index = 1;
|
|
|
|
|
2021-12-20 01:34:41 +01:00
|
|
|
render = function(deltaTime)
|
2021-12-20 00:39:38 +01:00
|
|
|
gfx.BeginPath();
|
2021-12-20 01:34:41 +01:00
|
|
|
gfx.FillColor(0, 0, 0, 255);
|
2021-12-20 00:39:38 +01:00
|
|
|
gfx.Rect(0, 0, 1080, 1920);
|
|
|
|
gfx.Fill();
|
|
|
|
|
|
|
|
gfx.LoadSkinFont("dfmarugoth.ttf")
|
2021-12-20 01:34:41 +01:00
|
|
|
gfx.FillColor(255, 255, 255, 255);
|
2021-12-20 00:39:38 +01:00
|
|
|
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE)
|
|
|
|
gfx.FontSize(24);
|
|
|
|
|
|
|
|
gfx.BeginPath();
|
2021-12-20 01:34:41 +01:00
|
|
|
gfx.Text('SERIVCE MENU', 1080 / 2, 128);
|
|
|
|
gfx.Text('BT-A/BT-B = GO UP/DOWN', 1080 / 2, 1920 - 256 - 28);
|
|
|
|
gfx.Text('START = SELECT', 1080 / 2, 1920 - 256);
|
|
|
|
|
2021-12-20 00:39:38 +01:00
|
|
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
2021-12-20 01:34:41 +01:00
|
|
|
|
|
|
|
local yOffset = 256;
|
2021-12-20 00:39:38 +01:00
|
|
|
for i, menuItem in ipairs(menu) do
|
2021-12-20 01:34:41 +01:00
|
|
|
if menuItem.type == 'back' then
|
|
|
|
yOffset = yOffset + 28 * 2;
|
|
|
|
else
|
|
|
|
yOffset = yOffset + 28;
|
|
|
|
end
|
|
|
|
|
2021-12-20 00:39:38 +01:00
|
|
|
if (i == index) then
|
2021-12-20 01:34:41 +01:00
|
|
|
if menuItem.color then
|
|
|
|
gfx.FillColor(
|
|
|
|
menuItem.color[1],
|
|
|
|
menuItem.color[2],
|
|
|
|
menuItem.color[3]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
gfx.FillColor(0, 255, 0, 255);
|
|
|
|
end
|
2021-12-20 00:39:38 +01:00
|
|
|
-- gfx.FillColor(0,128,255,255);
|
|
|
|
else
|
2021-12-20 01:34:41 +01:00
|
|
|
gfx.FillColor(255, 255, 255, 255);
|
2021-12-20 00:39:38 +01:00
|
|
|
end
|
|
|
|
gfx.BeginPath();
|
2021-12-20 01:34:41 +01:00
|
|
|
gfx.Text(menuItem.label, 100, yOffset);
|
2021-12-20 00:39:38 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
if (triggerSplashScreen) then
|
|
|
|
triggerSplashScreen = false;
|
2021-12-20 01:34:41 +01:00
|
|
|
return {eventType = 'switch', toScreen = 'splash'}
|
2021-12-20 00:39:38 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local onButtonPressed = function(button)
|
|
|
|
if button == game.BUTTON_STA then
|
2021-12-20 01:34:41 +01:00
|
|
|
if (menu[index].handler) then
|
|
|
|
menu[index].handler()
|
|
|
|
elseif menu[index].children ~= nil then
|
|
|
|
menu = menu[index].children
|
|
|
|
index=1;
|
|
|
|
|
|
|
|
-- If the back button does not exist, add it.
|
|
|
|
if (menu[#menu].type ~= 'back') then
|
|
|
|
menu[#menu+1] = {
|
|
|
|
type="back",
|
|
|
|
label = "BACK TO MAIN MENU",
|
|
|
|
handler = function()
|
|
|
|
index=1;
|
|
|
|
menu = rootMenu
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-12-20 00:39:38 +01:00
|
|
|
elseif button == game.BUTTON_BTA then
|
|
|
|
index = index - 1;
|
2021-12-20 01:34:41 +01:00
|
|
|
if (index == 0) then index = #menu end
|
2021-12-20 00:39:38 +01:00
|
|
|
elseif button == game.BUTTON_BTB then
|
|
|
|
index = index + 1;
|
2021-12-20 01:34:41 +01:00
|
|
|
if (index == #menu+1) then index = 1 end
|
2021-12-20 00:39:38 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-12-20 01:34:41 +01:00
|
|
|
return {render = render, onButtonPressed = onButtonPressed}
|