This repository has been archived by the owner on Mar 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
/
menu.lua
67 lines (52 loc) · 1.6 KB
/
menu.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--[[
Autoinstall plugin
Licensed by Creative Commons Attribution-ShareAlike 4.0
http://creativecommons.org/licenses/by-sa/4.0/
Dev: TheHeroeGAC
Designed By Gdljjrod & DevDavisNunez.
Collaborators: BaltazaR4 & Wzjk.
]]
local psvita_callback = function ()
menu_ps()
end
local psp_callback = function ()
menu_psp()
end
local extras_callback = function ()
extras()
end
local exit_callback = function ()
if change then
os.message(LANGUAGE["STRING_PSVITA_RESTART"])
os.delay(250)
buttons.homepopup(1)
power.restart()
end
os.exit()
end
local menu = {
{ text = LANGUAGE["MENU_PSVITA"], funct = psvita_callback },
{ text = LANGUAGE["MENU_PSP"], funct = psp_callback },
{ text = LANGUAGE["MENU_EXTRAS"], funct = extras_callback },
{ text = LANGUAGE["MENU_EXIT"], funct = exit_callback }
}
local scrollm = newScroll(menu,#menu)
change = false
buttons.interval(10,10)
while true do
buttons.read()
if change then buttons.homepopup(0) else buttons.homepopup(1) end
if back then back:blit(0,0) end
screen.print(480,25,LANGUAGE["MENU_TITLE"],1.3,color.green, 0x0, __ACENTER)
local y = 145
for i=scrollm.ini, scrollm.lim do
if i == scrollm.sel then draw.offsetgradrect(10,y-12,960-20,40,color.shine:a(75),color.shine:a(135),0x0,0x0,21) end
screen.print(480,y,menu[i].text,1.2,color.white, 0x0, __ACENTER)
y+=45
end
screen.flip()
--Controls
if buttons.up or buttons.analogly < -60 then scrollm:up() end
if buttons.down or buttons.analogly > 60 then scrollm:down() end
if buttons[accept] then menu[scrollm.sel].funct() end
end