├── README.md
├── SCREENSHOT
├── intro.png
├── intro2.png
├── intro3.png
└── intro4.png
└── SHORTCUTS
├── eboot.bin
├── git
├── shared.lua
├── thread_net.lua
├── updater.lua
└── updater
│ ├── param.sfo
│ ├── script.lua
│ └── update.png
├── lang
└── english_us.txt
├── np
├── img
│ ├── SHORTCUT001.png
│ ├── SHORTCUT002.png
│ └── SHORTCUT003.png
└── whatsnew.xml
├── resources
├── back.png
├── bk_001.png
├── bk_002.png
├── bk_003.png
├── bk_004.png
├── bk_005.png
├── bk_006.png
├── bk_007.png
├── bk_008.png
├── bk_009.png
├── bk_010.png
├── bk_011.png
├── bk_012.png
├── font.ttf
├── icondef.png
├── splash.png
└── splashB.png
├── sce_sys
├── icon0.png
├── livearea
│ └── contents
│ │ ├── bg0.png
│ │ ├── startup.png
│ │ └── template.xml
└── param.sfo
├── script.lua
└── system
├── apps.lua
├── commons.lua
└── scroll.lua
/README.md:
--------------------------------------------------------------------------------
1 | # Shortcuts Enhancer
2 | **Simple app to enhance the shortcuts on the PS Vita index menu.**
3 |
4 | 
5 |
6 | **Based on QuickLaunch Installer by 1upus and IndexMenuMaker by Moody_Blues**
7 |
8 | 
9 |
10 | With this app, you can create custom images linked to any PS Vita app/game for the shortcuts shown in the PS Vita index menu, also, you can select between the icon or the startup image of your app/game to create the shrotcut preview.
11 |
12 | When creating the preview images, you can choose between a bunch of colorfull backgrounds (when icon0 is selected, thanks to moody b) to make your shortcuts look the way you want them.
13 |
14 | 
15 |
16 | ### Changelog 2.00 ###
17 | - Added compatibility with new official XML (blue icons).
18 | - Added option to restore official XML (press and hold L&R).
19 |
20 | ### Changelog 1.01 ###
21 | - Whatsnew.xml links fixed, ONEmenu was linked instead of Vitashell by default.
22 | - Whatsnew.xml read/write issue fixed.
23 |
24 | ## Controls are as follows: ##
25 |
26 | The front touch pad is enabled in this app for some functions :)
27 |
28 | - Up/Down (Dir Pad)Scroll trough game/app list.
29 | - Right/Left (Dir Pad)Change preview background.
30 | - R/L or Touch Pad (Or tap the preview highlight it)Switch shortcut preview.
31 | - Square Switch between Icon0/Startup/Custom image.
32 | - Accept Set the selected preview to appear in the index menu (restart required).
33 | - Triangle Set all 3 previews to appear in the index menu (restart required).
34 | - SELECT or Touch Pad (Or double tap at the bottom of the screen) To show controls menu
35 | - START Go back to Livearea (when doing changes a restart is needed for changes to take effect).
36 |
37 | 
38 |
39 | Just in case you want to create your own images with PS or any other image editor, all you have to do is resize them to 282*108, rename them to the game id in upper case letters,save them as png format and place them in the following path
40 | *ux0:data/SHORTCUTS/1MENUVITA.PNG* (as an example XD)
41 |
42 | Also, if you want to use your own font for the previews you can place your font file at
43 | *ux0:data/SHORTCUTS/font/*
44 |
45 | ### Credits: ###
46 |
47 | **u/CaSquall** for sharing their images in [Vitahacks]
48 | (https://www.reddit.com/r/vitahacks/comments/arzjbn/vita_quicklaunch_setup_custom_icons_whatsnewxml/)
49 |
50 | **IndexMenuMaker by Moody_Blues** https://hackusagi.hateblo.jp/entry/IndexMenuMaker
51 |
52 | **QuickLaunch Installer by 1upus** https://github.com/1upus/QuickLaunch_installer_for_PSVita
53 |
--------------------------------------------------------------------------------
/SCREENSHOT/intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SCREENSHOT/intro.png
--------------------------------------------------------------------------------
/SCREENSHOT/intro2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SCREENSHOT/intro2.png
--------------------------------------------------------------------------------
/SCREENSHOT/intro3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SCREENSHOT/intro3.png
--------------------------------------------------------------------------------
/SCREENSHOT/intro4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SCREENSHOT/intro4.png
--------------------------------------------------------------------------------
/SHORTCUTS/eboot.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/eboot.bin
--------------------------------------------------------------------------------
/SHORTCUTS/git/shared.lua:
--------------------------------------------------------------------------------
1 | -- Constants
2 |
3 | APP_REPO = "ONElua"
4 | APP_PROJECT = "Shortcuts-Enhancer"
5 |
6 | URL_WIKI = ""
7 |
8 | APP_VERSION_MAJOR = 0x02 -- major.minor
9 | APP_VERSION_MINOR = 0x00
10 |
11 | APP_VERSION = ((APP_VERSION_MAJOR << 0x18) | (APP_VERSION_MINOR << 0x10)) -- Union Binary
12 |
--------------------------------------------------------------------------------
/SHORTCUTS/git/thread_net.lua:
--------------------------------------------------------------------------------
1 | dofile("git/shared.lua")
2 |
3 | UPDATE_PORT = channel.new("UPDATE_PORT")
4 |
5 | local info = http.get("http://devdavisnunez.x10.mx/wikihb/api/v1/auto_update.php?id=93&v="..APP_VERSION);
6 | if info then
7 | info /= "|"
8 | local version = info[1]
9 | if version and tonumber(version) then
10 | version = tonumber(version)
11 | local major = (version >> 0x18) & 0xFF;
12 | local minor = (version >> 0x10) & 0xFF;
13 | if version > APP_VERSION then
14 | UPDATE_PORT:push({version, tostring(info[2] or "")})
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/SHORTCUTS/git/updater.lua:
--------------------------------------------------------------------------------
1 | dofile("git/shared.lua")
2 |
3 | if files.exists("ux0:/app/ONEUPDATE") then
4 | game.delete("ONEUPDATE") -- Exists delete update app
5 | end
6 |
7 | UPDATE_PORT = channel.new("UPDATE_PORT")
8 |
9 | local scr_flip = screen.flip
10 | function screen.flip()
11 | scr_flip()
12 | if UPDATE_PORT:available() > 0 then
13 |
14 | local info = UPDATE_PORT:pop()
15 | local version = info[1]
16 | local major = (version >> 0x18) & 0xFF;
17 | local minor = (version >> 0x10) & 0xFF;
18 | update = image.load("git/updater/update.png")
19 |
20 | if update then update:blit(0,0)
21 | elseif back then back:blit(0,0) end
22 | screen.flip()
23 |
24 | if os.dialog(info[2].."\nDo you want to update the application?", string.format("New Update %s %s available.", APP_PROJECT, string.format("%X.%02X",major, minor)), __DIALOG_MODE_OK_CANCEL) == true then
25 | buttons.homepopup(0)
26 |
27 | if update then update:blit(0,0)
28 | elseif back then back:blit(0,0) end
29 |
30 | local url = "http://devdavisnunez.x10.mx/wikihb/download/?id=93"
31 | local path = "ux0:data/"..APP_PROJECT..".vpk"
32 | local onAppInstallOld = onAppInstall
33 | function onAppInstall(step, size_argv, written, file, totalsize, totalwritten)
34 | return 10 -- Ok code
35 | end
36 | local onNetGetFileOld = onNetGetFile
37 | function onNetGetFile(size,written,speed)
38 |
39 | if update then update:blit(0,0)
40 | elseif back then back:blit(0,0) end
41 |
42 | screen.print(10,10,"Downloading Update...")
43 | screen.print(480,470,tostring(files.sizeformat(written or 0)).." / "..tostring(files.sizeformat(size or 0)),1,color.white, color.blue:a(135),__ACENTER)
44 |
45 | l = (written*940)/size
46 | screen.print(3+l,495,math.floor((written*100)/size).."%",0.8,0xFFFFFFFF,0x0,__ACENTER)
47 | draw.fillrect(10,524,l,6,color.new(0,255,0))
48 | draw.circle(10+l,526,6,color.new(0,255,0),30)
49 |
50 | screen.flip()
51 |
52 | buttons.read()
53 | if buttons.circle then return 0 end --Cancel or Abort
54 | return 1;
55 | end
56 | local res = http.getfile(url, path)
57 | --local res = http.getfile(URL_WIKI, path)
58 | if res then -- Success!
59 | files.mkdir("ux0:/data/1luapkg")
60 | files.copy("eboot.bin","ux0:/data/1luapkg")
61 | files.copy("git/updater/script.lua","ux0:/data/1luapkg/")
62 | files.copy("git/updater/update.png","ux0:/data/1luapkg/")
63 | files.copy("git/updater/param.sfo","ux0:/data/1luapkg/sce_sys/")
64 | game.installdir("ux0:/data/1luapkg")
65 | files.delete("ux0:/data/1luapkg")
66 | game.launch(string.format("ONEUPDATE&%s&%s",os.titleid(),path)) -- Goto installer extern!
67 | end
68 | onAppInstall = onAppInstallOld
69 | onNetGetFile = onNetGetFileOld
70 | buttons.homepopup(1)
71 | end
72 | end
73 | end
74 |
75 | THID = thread.new("git/thread_net.lua")
76 |
--------------------------------------------------------------------------------
/SHORTCUTS/git/updater/param.sfo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/git/updater/param.sfo
--------------------------------------------------------------------------------
/SHORTCUTS/git/updater/script.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | Updater Of App.
3 | Designed by DevDavisNunez to ONElua projects.. :D
4 | TODO:
5 | Maybe, extract in APP, and only installdir in this..
6 | ]]
7 |
8 | buttons.homepopup(0)
9 | color.loadpalette()
10 | update = image.load("update.png")
11 |
12 | args = os.arg()
13 | if args:len() == 0 then
14 | os.message("Error args lost!")
15 | os.exit()
16 | end
17 |
18 | args /= "&"
19 | if #args != 3 then
20 | os.message("Error args lost!")
21 | os.exit()
22 | end
23 |
24 | function onAppInstall(step, size_argv, written, file, totalsize, totalwritten)
25 |
26 | if step == 1 then -- Only msg of state
27 | if update then update:blit(0,0) end
28 | draw.fillrect(0,0,960,30, color.green:a(100))
29 | screen.print(10,10,"Search in vpk, Unsafe or Dangerous files!")
30 | screen.flip()
31 | elseif step == 2 then -- Warning Vpk confirmation!
32 | return 10 -- Ok
33 | elseif step == 3 then -- Unpack
34 | if update then update:blit(0,0) end
35 | draw.fillrect(0,0,960,30, color.green:a(100))
36 | screen.print(10,10,"Unpack vpk...")
37 | screen.print(10,35,"File: "..tostring(file))
38 |
39 | l = (totalwritten*940)/totalsize
40 | screen.print(3+l,495,math.floor((totalwritten*100)/totalsize).."%",0.8,0xFFFFFFFF,0x0,__ACENTER)
41 | draw.fillrect(10,524,l,6,color.new(0,255,0))
42 | draw.circle(10+l,526,6,color.new(0,255,0),30)
43 |
44 | screen.flip()
45 | elseif step == 4 then -- Promote or install
46 | if update then update:blit(0,0) end
47 | draw.fillrect(0,0,960,30, color.green:a(100))
48 | screen.print(10,10,"Installing...")
49 | screen.flip()
50 | end
51 | end
52 |
53 | game.install(args[3])
54 | files.delete(args[3])
55 |
56 | buttons.homepopup(1)
57 |
58 | game.launch(args[2])
--------------------------------------------------------------------------------
/SHORTCUTS/git/updater/update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/git/updater/update.png
--------------------------------------------------------------------------------
/SHORTCUTS/lang/english_us.txt:
--------------------------------------------------------------------------------
1 | --Texts (only text in " ")
2 |
3 | --script.lua
4 | STRINGS_TITLE = "SHORTCUTS ENHANCER"
5 | STRINGS_EMPTY = "Empty"
6 | STRINGS_HELP = "SELECT/DOUBLE TAP HERE for help"
7 |
8 | STRINGS_DEFAULT = "Default"
9 | STRINGS_ICON0 = "Icon0"
10 | STRINGS_STARTUP = "Startup"
11 | STRINGS_CUSTOM = "Custom"
12 | STRINGS_BKG = "Bkg"
13 |
14 | STRINGS_WAIT_PREVIEW = "Saving Preview"
15 | STRINGS_READY_PREVIEW = "OK"
16 | STRINGS_DONE = "Done!!!"
17 |
18 | STRINGS_REBOOT = "RESTART NOW ??"
19 | STRINGS_REBOOT_NEED = "Your PSvita will reboot"
20 | STRINGS_SYSTEM_DIALOG = "System Message"
21 | STRINGS_WAIT = "Please wait..."
22 |
23 | --Dialog Help
24 | STRINGS_HELP_CONTROLS = "Controls"
25 | STRINGS_HELP_SQUARE = "Icon0/Startup/Custom Image"
26 | STRINGS_HELP_LR= "L/R Switch Shortcut preview or Touch each preview"
27 | STRINGS_HELP_LEFTRIGHT= "<-/-> Change preview Bkg"
28 | STRINGS_HELP_HELD_LR= "Press and hold L & R to restore the official XML"
29 | STRINGS_HELP_CONFIRM = "Set selected preview"
30 | STRINGS_HELP_TRIANGLE = "Set all 3 previews"
31 | STRINGS_HELP_START = "START Go back to Livearea"
32 |
33 | STRINGS_RESTORE_QUESTION = "You really want to restore the original XML ??"
34 | STRINGS_RESTORE_XML_NEW = "Restoring new Official XML"
35 | STRINGS_RESTORE_XML_OLD = "Restoring Old Official XML"
36 | STRINGS_DELETE_CUSTOMXL = "Eliminating Custom XML"
37 |
--------------------------------------------------------------------------------
/SHORTCUTS/np/img/SHORTCUT001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/np/img/SHORTCUT001.png
--------------------------------------------------------------------------------
/SHORTCUTS/np/img/SHORTCUT002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/np/img/SHORTCUT002.png
--------------------------------------------------------------------------------
/SHORTCUTS/np/img/SHORTCUT003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/np/img/SHORTCUT003.png
--------------------------------------------------------------------------------
/SHORTCUTS/np/whatsnew.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | SHORTCUT001.png
4 | psgm:play?titleid=VITASHELL
5 | all
6 | all
7 |
8 |
9 |
10 | SHORTCUT002.png
11 | psgm:play?titleid=PKGJ00000
12 | all
13 | all
14 |
15 |
16 |
17 | SHORTCUT003.png
18 | psgm:play?titleid=AUTOPLUG0
19 | all
20 | all
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/SHORTCUTS/resources/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/back.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_001.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_002.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_003.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_004.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_005.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_006.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_007.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_008.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_009.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_010.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_011.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/bk_012.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/bk_012.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/font.ttf
--------------------------------------------------------------------------------
/SHORTCUTS/resources/icondef.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/icondef.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/splash.png
--------------------------------------------------------------------------------
/SHORTCUTS/resources/splashB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/resources/splashB.png
--------------------------------------------------------------------------------
/SHORTCUTS/sce_sys/icon0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/sce_sys/icon0.png
--------------------------------------------------------------------------------
/SHORTCUTS/sce_sys/livearea/contents/bg0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/sce_sys/livearea/contents/bg0.png
--------------------------------------------------------------------------------
/SHORTCUTS/sce_sys/livearea/contents/startup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/sce_sys/livearea/contents/startup.png
--------------------------------------------------------------------------------
/SHORTCUTS/sce_sys/livearea/contents/template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bg0.png
6 |
7 |
8 | startup.png
9 |
10 |
11 |
12 |
13 | Shortcuts Enhancer
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | Version 2.00
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | ®2019 Team ONElua - ONElua.x10.mx
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/SHORTCUTS/sce_sys/param.sfo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/Shortcuts-Enhancer/74401524718ca14df79544ae23dfefa0aabd34c2/SHORTCUTS/sce_sys/param.sfo
--------------------------------------------------------------------------------
/SHORTCUTS/script.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | Shortcuts Enhancer
3 | Designed By:
4 | - Gdljjrod (https://twitter.com/gdljjrod).
5 | ]]
6 |
7 | game.close()
8 |
9 | --Load palette
10 | color.loadpalette()
11 |
12 | --Show splash
13 | splash.zoom("resources/splash.png")
14 |
15 | back = image.load("resources/back.png")
16 |
17 | --Update
18 | dofile("git/shared.lua")
19 | dofile("git/updater.lua")
20 |
21 | --Checking XML
22 | local objxml = xml.parsefile("ur0:shell/whats_new/np/whatsnew.xml")
23 | if objxml then
24 | local var = objxml:find("target","type", "p")
25 | if var and var.value then
26 | files.delete("ur0:shell/whats_new/np/whatsnew_old.xml")
27 | files.rename("ur0:shell/whats_new/np/whatsnew.xml","whatsnew_old.xml")
28 | change = true
29 | end
30 | local var = objxml:find("target","type", "c")
31 | if var and var.value then
32 | files.delete("ur0:shell/whats_new/np/whatsnew_new.xml")
33 | files.rename("ur0:shell/whats_new/np/whatsnew.xml","whatsnew_new.xml")
34 | change = true
35 | end
36 | if change then
37 | files.copy("np/whatsnew.xml","ur0:shell/whats_new/np/")
38 | for i=1,3 do
39 | files.delete("ur0:shell/whats_new/np/img/SHORTCUT00"..i..".png")
40 | end
41 | end
42 | end
43 |
44 | --Resize del icon de cada app
45 | w1,h1 = 100,85
46 |
47 | dofile("system/commons.lua")
48 | dofile("system/apps.lua")
49 | dofile("system/scroll.lua")
50 |
51 | ScanAPPS()
52 |
53 | local scrolls_bkgs,sel = {},1
54 | local maxim,d_scroll = 8,15
55 | local scroll_apps = newScroll(APPS,maxim)
56 |
57 | for i=1,__TOT do
58 | --Aqui guardaremos las posiciones de c/PREVIEW
59 | PREVIEWS[i].ini = scroll_apps.ini
60 | PREVIEWS[i].sel = scroll_apps.sel
61 | PREVIEWS[i].lim = scroll_apps.lim
62 |
63 | --Necesitamos 3 scrolls para los 3 PREVIEWS
64 | table.insert(scrolls_bkgs,newScroll(BKGS,#BKGS))
65 |
66 | end
67 |
68 | function backup_cursors(selector)
69 | --backup cursors
70 | PREVIEWS[sel].ini = scroll_apps.ini
71 | PREVIEWS[sel].sel = scroll_apps.sel
72 | PREVIEWS[sel].lim = scroll_apps.lim
73 |
74 | sel = selector
75 |
76 | --restore cursors
77 | scroll_apps.ini = PREVIEWS[sel].ini
78 | scroll_apps.sel = PREVIEWS[sel].sel
79 | scroll_apps.lim = PREVIEWS[sel].lim
80 | end
81 |
82 | local coords, yp = { 35, 339, 641 }, 348
83 | buttons.interval(12,5)
84 | local crono, clicked = timer.new(), false
85 | while true do
86 | buttons.read()
87 | touch.read()
88 | if change then buttons.homepopup(0) else buttons.homepopup(1) end
89 |
90 | if back then back:blit(0,0) end
91 |
92 | ------------------------------------------------------------------------------------------
93 | screen.print(480,10,STRINGS_TITLE,1,color.white,color.black,__ACENTER)
94 | screen.print(955,10,"("..scroll_apps.maxim..")",1,color.red,color.black, __ARIGHT)
95 |
96 | if scroll_apps.maxim > 0 and APPS then
97 |
98 | local y=40
99 | for i=scroll_apps.ini, scroll_apps.lim do
100 |
101 | if i == scroll_apps.sel then
102 |
103 | draw.offsetgradrect(5,y-7,940,34,color.shine:a(75),color.shine:a(135),0x0,0x0,21)
104 |
105 | if i == 1 then
106 | if not PREVIEWS[sel].img then
107 | PREVIEWS[sel].def = true
108 | PREVIEWS[sel].img = image.load(APPS[1][sel].path_img)
109 | if PREVIEWS[sel].img then
110 | PREVIEWS[sel].img:resize(282,108)
111 | PREVIEWS[sel].img:setfilter(__IMG_FILTER_LINEAR, __IMG_FILTER_LINEAR)
112 | else
113 | PREVIEWS[sel].img = iconDef
114 | end
115 | end
116 | PREVIEWS[sel].id = APPS[1][sel].id
117 |
118 | else
119 | if not PREVIEWS[sel].img then
120 | PREVIEWS[sel].def = false
121 |
122 | if PREVIEWS[sel].icono == 1 then
123 | local _title = string.upper(APPS[scroll_apps.sel].title) or "UNK"
124 | if APPS[scroll_apps.sel].type == "EG" or APPS[scroll_apps.sel].type == "ME" then
125 | if _title == "VHBL" or _title == "TRINITY" or _title == "ARK" then
126 | PREVIEWS[sel].img = game.geticon0(APPS[scroll_apps.sel].path.."/PBOOT.PBP") or game.geticon0(APPS[scroll_apps.sel].path.."/EBOOT.PBP")
127 | else
128 | PREVIEWS[sel].img = game.geticon0(APPS[scroll_apps.sel].path.."/EBOOT.PBP")
129 | end
130 | else
131 | PREVIEWS[sel].img = image.load(APPS[scroll_apps.sel].path_img)
132 | end
133 | elseif PREVIEWS[sel].icono == 2 and APPS[scroll_apps.sel].path_startup then
134 | PREVIEWS[sel].img = image.load(APPS[scroll_apps.sel].path_startup)
135 | elseif PREVIEWS[sel].icono == 3 and APPS[scroll_apps.sel].path_custom then
136 | PREVIEWS[sel].img = image.load(APPS[scroll_apps.sel].path_custom)
137 | end
138 |
139 | if PREVIEWS[sel].img then
140 | if PREVIEWS[sel].icono == 1 then
141 | PREVIEWS[sel].img:resize(w1,h1)
142 | else
143 | PREVIEWS[sel].img:resize(282,108)
144 | end
145 | PREVIEWS[sel].img:setfilter(__IMG_FILTER_LINEAR, __IMG_FILTER_LINEAR)
146 | else
147 | if PREVIEWS[sel].icono == 1 then PREVIEWS[sel].img = iconDef end
148 | end
149 | end
150 | PREVIEWS[sel].id = APPS[scroll_apps.sel].id
151 | PREVIEWS[sel].title = APPS[scroll_apps.sel].title2
152 | end
153 |
154 | end
155 |
156 | if screen.textwidth(APPS[i].title,1) > 945 then
157 | d_scroll = screen.print(d_scroll,y,APPS[i].title,1,color.white,color.black, __SLEFT,920)
158 | else
159 | screen.print(15,y,APPS[i].title,1,color.white,color.black, __ALEFT)
160 | end
161 |
162 | --Bar scroll_apps
163 | if scroll_apps.maxim >= maxim then -- Draw Scroll Bar
164 | local ybar,h = 35,(maxim*34)
165 | draw.fillrect(950, ybar-2, 8, h, color.shine:a(50))
166 | local pos_height = math.max(h/scroll_apps.maxim, maxim)
167 | draw.fillrect(950, ybar-2 + ((h-pos_height)/(scroll_apps.maxim-1))*(scroll_apps.sel-1), 8, pos_height, color.new(0,255,0))
168 | end
169 |
170 | y+=34
171 |
172 | end --for
173 |
174 | draw.fillrect(coords[sel]-4, yp-4, 290, 116, color.green)
175 |
176 | --blit icons
177 | for j=1,__TOT do
178 |
179 | --ID
180 | screen.print(coords[j]+141,yp-28,PREVIEWS[j].id,1,color.white,color.black, __ACENTER)
181 |
182 | --BKGS
183 | if BKGS[scrolls_bkgs[j].sel] then BKGS[scrolls_bkgs[j].sel]:blit(coords[j],yp) end
184 |
185 | --Icons & Text
186 | if PREVIEWS[j].def then
187 | if PREVIEWS[j].img then PREVIEWS[j].img:blit(coords[j],yp) end
188 | else
189 | if PREVIEWS[j].icono == 1 then
190 |
191 | if PREVIEWS[j].img then PREVIEWS[j].img:blit(coords[j]+5,yp+5) end
192 | draw.fillrect(coords[j]+5,yp+108-18, screen.textwidth(fnt,PREVIEWS[j].title,0.8)+10, 20, color.shine:a(45))
193 | screen.print(fnt, coords[j]+10,yp+108-19,PREVIEWS[j].title,0.8,color.white,color.black, __ALEFT)
194 | screen.print(coords[j],yp+108+13,STRINGS_ICON0,0.9,color.white,color.black, __ALEFT)
195 | else
196 |
197 | if PREVIEWS[j].img then PREVIEWS[j].img:blit(coords[j],yp) end
198 |
199 | if PREVIEWS[j].icono == 2 then
200 | screen.print(coords[j],yp+108+13,STRINGS_STARTUP,0.9,color.white,color.black, __ALEFT)
201 | else
202 | screen.print(coords[j],yp+108+13,STRINGS_CUSTOM,0.9,color.white,color.black, __ALEFT)
203 | end
204 |
205 | end
206 | end
207 |
208 | screen.print(coords[j]+280,yp+108+13,STRINGS_BKG.." ("..scrolls_bkgs[j].sel..")",0.9,color.white,color.black, __ARIGHT)
209 | end
210 |
211 | else
212 | screen.print(480,202,STRINGS_EMPTY,1.5,color.yellow,color.black,__ACENTER)
213 | end
214 |
215 | --Info
216 | draw.fillrect(0,500,960,544, color.shine:a(10))
217 | screen.print(480,515,STRINGS_HELP,1,color.white,color.black, __ACENTER)
218 |
219 | screen.flip()
220 |
221 | ----------------------------------Controls-------------------------------
222 | if scroll_apps.maxim > 0 and APPS then
223 |
224 | if (buttons.up or buttons.analogly<-60) and (not buttons.held.l or not buttons.held.r) then
225 | if scroll_apps:up() then
226 | if not APPS[scroll_apps.sel].path_custom and PREVIEWS[sel].icono == 3 then PREVIEWS[sel].icono = 1 end
227 | d_scroll = 25
228 | PREVIEWS[sel].img = nil
229 | end
230 | end
231 |
232 | if (buttons.down or buttons.analogly>60) and (not buttons.held.l or not buttons.held.r) then
233 | if scroll_apps:down() then
234 | if not APPS[scroll_apps.sel].path_custom and PREVIEWS[sel].icono == 3 then PREVIEWS[sel].icono = 1 end
235 | d_scroll = 25
236 | PREVIEWS[sel].img = nil
237 | end
238 | end
239 |
240 | if buttons.released.l or buttons.released.r then
241 | --backup cursors
242 | PREVIEWS[sel].ini = scroll_apps.ini
243 | PREVIEWS[sel].sel = scroll_apps.sel
244 | PREVIEWS[sel].lim = scroll_apps.lim
245 |
246 | if buttons.released.l then sel -= 1 else sel += 1 end
247 |
248 | if sel < 1 then sel = __TOT end
249 | if sel > __TOT then sel = 1 end
250 |
251 | --restore cursors
252 | scroll_apps.ini = PREVIEWS[sel].ini
253 | scroll_apps.sel = PREVIEWS[sel].sel
254 | scroll_apps.lim = PREVIEWS[sel].lim
255 | end
256 | if isTouched(40,358,270,100) then
257 | backup_cursors(1)
258 | elseif isTouched(344,358,270,100) then
259 | backup_cursors(2)
260 | elseif isTouched(646,358,270,100) then
261 | backup_cursors(3)
262 | end
263 |
264 | if (buttons.left or buttons.right) and not PREVIEWS[sel].def then
265 | --if PREVIEWS[sel].icono != 3 then
266 | if buttons.left then
267 | scrolls_bkgs[sel]:up()
268 | else
269 | scrolls_bkgs[sel]:down()
270 | end
271 | --end
272 | end
273 |
274 | if buttons.square and not PREVIEWS[sel].def then
275 | local lim = 2
276 | if APPS[scroll_apps.sel].path_custom then lim = 3 end
277 |
278 | PREVIEWS[sel].icono += 1
279 |
280 | if PREVIEWS[sel].icono < 1 then PREVIEWS[sel].icono = lim end
281 | if PREVIEWS[sel].icono > lim then PREVIEWS[sel].icono = 1 end
282 |
283 | PREVIEWS[sel].img = nil
284 | end
285 |
286 | if buttons.accept then
287 | if not PREVIEWS[sel].def then
288 |
289 | local vbuff = screen.toimage()
290 |
291 | if vbuff then vbuff:blit(0,0) end
292 | message_wait(STRINGS_WAIT_PREVIEW.." "..PREVIEWS[sel].id)
293 | os.delay(500)
294 |
295 | image.clip(vbuff,coords[sel],yp,282,108,sel)
296 |
297 | if vbuff then vbuff:blit(0,0) end
298 | message_wait(PREVIEWS[sel].id.." "..STRINGS_READY_PREVIEW)
299 | os.delay(1000)
300 |
301 | write_xml(XMLPATH,sel,PREVIEWS[sel].id)
302 | files.write(XMLPATH,tb_xml)
303 | os.delay(500)
304 |
305 | os.message(STRINGS_DONE)
306 | change = true
307 | end
308 | end
309 |
310 | if buttons.triangle then
311 | local flag = false
312 | local vbuff = screen.toimage()
313 | for i=1, __TOT do
314 | if not PREVIEWS[i].def then
315 |
316 | if vbuff then vbuff:blit(0,0) end
317 | message_wait(STRINGS_WAIT_PREVIEW.." "..PREVIEWS[i].id)
318 | os.delay(500)
319 |
320 | image.clip(vbuff,coords[i],yp,282,108,i)
321 |
322 | if vbuff then vbuff:blit(0,0) end
323 | message_wait(PREVIEWS[i].id.." "..STRINGS_READY_PREVIEW)
324 | os.delay(1000)
325 |
326 | write_xml(XMLPATH,i,PREVIEWS[i].id)
327 | flag = true
328 | end
329 | end
330 | if flag then
331 | files.write(XMLPATH,tb_xml)
332 | os.delay(500)
333 |
334 | os.message(STRINGS_DONE)
335 | change = true
336 | end
337 | end
338 |
339 | if buttons.held.l and buttons.held.r then
340 | local vbuff = screen.toimage()
341 | if vbuff then vbuff:blit(0,0) end
342 |
343 | --if os.dialog(STRINGS_RESTORE_QUESTION, STRINGS_SYSTEM_DIALOG, __DIALOG_MODE_OK_CANCEL) == true then
344 | if os.message("\n\n"..STRINGS_RESTORE_QUESTION,1) == 1 then
345 |
346 | files.delete("ur0:shell/whats_new/np/whatsnew.xml")
347 | if files.exists("ur0:shell/whats_new/np/whatsnew_new.xml") then
348 | files.rename("ur0:shell/whats_new/np/whatsnew_new.xml", "whatsnew.xml")
349 | os.dialog(STRINGS_RESTORE_XML_NEW)
350 | elseif files.exists("ur0:shell/whats_new/np/whatsnew_old.xml") then
351 | files.rename("ur0:shell/whats_new/np/whatsnew_old.xml", "whatsnew.xml")
352 | os.dialog(STRINGS_RESTORE_XML_OLD)
353 | else
354 | os.dialog(STRINGS_DELETE_CUSTOMXL)
355 | end
356 |
357 | for i=1,3 do
358 | files.delete("ur0:shell/whats_new/np/img/SHORTCUT00"..i..".png")
359 | end
360 |
361 | os.delay(250)
362 | os.message(STRINGS_REBOOT_NEED)
363 |
364 | buttons.homepopup(1)
365 | power.restart()
366 | end
367 |
368 | end
369 |
370 | --Help
371 | if buttons.select then
372 | show_dialog()
373 | end
374 | if isTouched(0,495,960,544) and touch.front[1].released then--pressed then
375 | if clicked then
376 | clicked = false
377 | if crono:time() <= 300 then -- Double click and in time to Go.
378 | -- Your action here.
379 | show_dialog()
380 | end
381 | else
382 | -- Your action here.
383 | clicked = true
384 | crono:reset()
385 | crono:start()
386 | end
387 | end
388 |
389 | if crono:time() > 300 then -- First click, but long time to double click...
390 | clicked = false
391 | end
392 |
393 | if buttons.start then exit_hb() end
394 |
395 | end
396 |
397 | end
398 |
--------------------------------------------------------------------------------
/SHORTCUTS/system/apps.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | Shortcuts Enhancer
3 | Designed By:
4 | - Gdljjrod (https://twitter.com/gdljjrod).
5 | ]]
6 |
7 | APPS = {}
8 |
9 | function fill_list(obj)
10 |
11 | if obj.type == "mb" or obj.type == "mba" then
12 | obj.path_img = "ur0:appmeta/"..obj.id.."/pic0.png"
13 | obj.path_startup = "ur0:appmeta/"..obj.id.."/livearea/contents/".."LA_bg.png"
14 | else
15 |
16 | obj.path_img = "ur0:appmeta/"..obj.id.."/icon0.png"
17 |
18 | --Startup
19 | local objxml = xml.parsefile("ur0:appmeta/"..obj.id.."/livearea/contents/template.xml")
20 | if objxml then
21 | local var = objxml:find("startup-image")--startup
22 | if var and var.value then
23 | obj.path_startup = "ur0:appmeta/"..obj.id.."/livearea/contents/"..var.value
24 | end
25 | end
26 |
27 | end
28 |
29 | if files.exists("ux0:data/SHORTCUTS/"..obj.id..".png") then
30 | obj.path_custom = "ux0:data/SHORTCUTS/"..obj.id..".png"
31 | end
32 |
33 | objxml = nil
34 |
35 | table.insert(APPS, obj)
36 | end
37 |
38 | function ScanAPPS()
39 | --id, type, version, dev, path, title
40 | local list = game.list(__GAME_LIST_ALL)
41 | if list and #list>0 then
42 | table.sort(list, function (a,b) return string.lower(a.title) 272) do
51 | title = string.sub(title,1,j-1).."..."
52 | len = screen.textwidth(fnt, title,0.8)
53 | j = j-1
54 | end
55 |
56 | list[i].title2 = title
57 |
58 | end
59 |
60 | fill_list(list[i])
61 | end
62 | end
63 |
64 | local tmp = {}
65 | tmp.title = STRINGS_DEFAULT
66 | for i=1,__TOT do
67 | table.insert(tmp, { path_img = PREVIEWS[i].path_img or "", title = PREVIEWS[i].title or "unk", id = PREVIEWS[i].id or names[i] } )
68 | end
69 | table.insert(APPS,1,tmp)
70 |
71 | end
72 |
--------------------------------------------------------------------------------
/SHORTCUTS/system/commons.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | Shortcuts Enhancer
3 | Designed By:
4 | - Gdljjrod (https://twitter.com/gdljjrod).
5 | ]]
6 |
7 | --Load BKGS
8 | BKGS = {}
9 | local list = files.listfiles("resources")
10 | if list and #list > 0 then
11 | for i=1,#list do
12 | local img = image.load('resources/bk_'..string.rep('0', 3-#(tostring(i)))..i..'.png')
13 | if img then table.insert(BKGS,img) end
14 | end
15 | end
16 |
17 | iconDef = image.load("resources/icondef.png")
18 | if iconDef then iconDef:resize(w1,h1) end
19 |
20 | __SHORTCUTS = "ux0:data/SHORTCUTS/"
21 | files.mkdir(__SHORTCUTS)
22 | files.mkdir(__SHORTCUTS.."lang/")
23 | files.mkdir(__SHORTCUTS.."font/")
24 |
25 | -- Loading language file
26 | __LANG = os.language()
27 |
28 | dofile("lang/english_us.txt")
29 | if not files.exists(__SHORTCUTS.."lang/english_us.txt") then files.copy("lang/english_us.txt",__SHORTCUTS.."lang/") end
30 | if files.exists(__SHORTCUTS.."lang/"..__LANG..".txt") then dofile(__SHORTCUTS.."lang/"..__LANG..".txt") end
31 | if files.exists("lang/"..__LANG..".txt") then dofile("lang/"..__LANG..".txt") end
32 |
33 | -- Loading custom font
34 | fnt = font.load(__SHORTCUTS.."font/font.ttf") or font.load(__SHORTCUTS.."font/font.pgf") or font.load(__SHORTCUTS.."font/font.pvf")
35 | if not fnt then fnt = font.load ("resources/font.ttf") end
36 |
37 | SYMBOL_CROSS = string.char(0xe2)..string.char(0x95)..string.char(0xb3)
38 | SYMBOL_SQUARE = string.char(0xe2)..string.char(0x96)..string.char(0xa1)
39 | SYMBOL_TRIANGLE = string.char(0xe2)..string.char(0x96)..string.char(0xb3)
40 | SYMBOL_CIRCLE = string.char(0xe2)..string.char(0x97)..string.char(0x8b)
41 |
42 | SYMBOL_CONFIRM = SYMBOL_CROSS
43 | SYMBOL_CANCEL = SYMBOL_CIRCLE
44 | if buttons.assign()==0 then
45 | SYMBOL_CONFIRM = SYMBOL_CIRCLE
46 | SYMBOL_CANCEL = SYMBOL_CROSS
47 | end
48 |
49 | XMLQUICK = "np/whatsnew.xml"
50 | XMLPATH = "ur0:shell/whats_new/np/whatsnew.xml"
51 | NPPATH = "ur0:shell/whats_new/np/"
52 |
53 | __TOT = 3
54 | local names = { "VITASHELL", "PKGJ00000", "AUTOPLUG0" }
55 |
56 | --Functions XML
57 | tb_xml={}
58 | function read_xml(path)
59 | for line in io.lines(path) do
60 | if line:byte(#line) == 13 then line = line:sub(1,#line-1) end --Remove CR == 13
61 | table.insert(tb_xml, line)
62 | end
63 | end
64 | read_xml(XMLQUICK)
65 |
66 | -- Write a file.
67 | function files.write(path, tb)
68 | local file = io.open(path, "w+")
69 | for s,t in pairs(tb) do
70 | file:write(string.format('%s\n', tostring(t)))
71 | end
72 | file:close()
73 | end
74 |
75 | function write_xml(path,selector,id)
76 | local linesXML = {
77 | { png = 3, id = 4 },
78 | { png = 10, id = 11},
79 | { png = 17, id = 18}
80 | }
81 |
82 | --W001.png
83 | tb_xml[linesXML[selector].png] = tb_xml[linesXML[selector].png]:gsub('>(%w+)',">".."SHORTCUT00"..selector)
84 | --psgm:play?titleid=1MENUVITA
85 | tb_xml[linesXML[selector].id] = tb_xml[linesXML[selector].id]:gsub('=(%w+)',"="..id)
86 |
87 | end
88 |
89 | PREVIEWS = {}
90 | function parsexml(path)
91 |
92 | local linesXML = {
93 | { png = 3, id = 4 },
94 | { png = 10, id = 11},
95 | { png = 17, id = 18}
96 | }
97 |
98 | for i=1,__TOT do
99 | PREVIEWS[i] = {}
100 | PREVIEWS[i].def = false
101 | PREVIEWS[i].img = nil
102 | PREVIEWS[i].icono = 1
103 | if not files.exists(NPPATH.."img/SHORTCUT00"..i..".png") then
104 | files.copy("np/img/SHORTCUT00"..i..".png", NPPATH.."img/")
105 | end
106 | PREVIEWS[i].id = names[i]
107 | end
108 | if not files.exists(XMLPATH) then files.copy("np/whatsnew.xml", NPPATH) end
109 |
110 | local objxml = xml.parsefile(path)
111 | if objxml then
112 |
113 | local var = objxml:findall("url","type","106")--png
114 | for i=1,__TOT do
115 |
116 | if var[i] and var[i].value then
117 |
118 | PREVIEWS[i].name_img = var[i].value
119 | PREVIEWS[i].path_img = NPPATH.."img/"..var[i].value
120 | else
121 | PREVIEWS[i].name_img = "SHORTCUT00"..i..".png"
122 | PREVIEWS[i].path_img = NPPATH.."img/SHORTCUT00"..i..".png"
123 | end
124 |
125 | --os.message(PREVIEWS[i].name_img)
126 | tb_xml[linesXML[i].png] = tb_xml[linesXML[i].png]:gsub('>(%w+)',">"..PREVIEWS[i].name_img:gsub(".png",""))
127 | --os.message(tb_xml[linesXML[i].png])
128 |
129 | --Load imgs
130 | PREVIEWS[i].img = image.load(PREVIEWS[i].path_img)
131 | PREVIEWS[i].def = true
132 | if PREVIEWS[i].img then
133 | PREVIEWS[i].img:resize(282,108)
134 | PREVIEWS[i].img:setfilter(__IMG_FILTER_LINEAR, __IMG_FILTER_LINEAR)
135 | end
136 |
137 | end
138 |
139 | local var = objxml:findall("target","type","u")
140 | for i=1,__TOT do
141 |
142 | local value = names[i]
143 |
144 | if var[i] and var[i].value then
145 | value = var[i].value:gsub("\n","")
146 | value = value:match('?titleid=(.+)')
147 | end
148 |
149 | PREVIEWS[i].id = value or names[i]
150 | PREVIEWS[i].title = value or names[i]
151 | PREVIEWS[i].id = value or names[i]
152 |
153 | tb_xml[linesXML[i].id] = tb_xml[linesXML[i].id]:gsub('=(%w+)',"="..PREVIEWS[i].id)
154 | end
155 | end
156 |
157 | files.write(XMLPATH,tb_xml)
158 |
159 | end
160 | parsexml(XMLPATH)
161 |
162 | -- Simple clip of image
163 | function image.clip(img,x,y,w,h,selector)
164 | local sheet = image.new(w,h,0x0)
165 | local px,py = 0,0
166 | for py=0,h-1 do
167 | for px=0,w-1 do
168 | local c = img:pixel(px+x,py+y)
169 | sheet:pixel(px, py, c)
170 | end
171 | end
172 | --return sheet
173 | files.mkdir("ur0:shell/whats_new/np/img/")
174 | image.save(sheet, "ur0:shell/whats_new/np/img/SHORTCUT00"..selector..".png")
175 |
176 | os.delay(1500)
177 | end
178 |
179 | function draw.offsetgradrect(x,y,sx,sy,c1,c2,c3,c4,offset)
180 | local sizey = sy/2
181 | draw.gradrect(x,y,sx,sizey + offset,c1,c2,c3,c4)
182 | draw.gradrect(x,y + sizey - offset,sx,sizey + offset,c3,c4,c1,c2)
183 | end
184 |
185 | function message_wait(message)
186 | local mge = (message or STRINGS_WAIT)
187 | local titlew = string.format(mge)
188 | local w,h = screen.textwidth(titlew,1) + 30,70
189 | local x,y = 480 - (w/2), 272 - (h/2)
190 |
191 | draw.fillrect(x,y,w,h,color.black:a(150))
192 | draw.rect(x,y,w,h,color.white)
193 | screen.print(480,y+20, titlew,1,color.white,color.black,__ACENTER)
194 | screen.flip()
195 | end
196 |
197 | function isTouched(x,y,sx,sy)
198 | if math.minmax(touch.front[1].x,x,x+sx)==touch.front[1].x and math.minmax(touch.front[1].y,y,y+sy)==touch.front[1].y then
199 | return true
200 | end
201 | return false
202 | end
203 |
204 | function show_dialog()
205 |
206 | os.dialog( " "..SYMBOL_SQUARE.." "..STRINGS_HELP_SQUARE..
207 | "\n\n".." "..STRINGS_HELP_LR..
208 | "\n\n".." "..STRINGS_HELP_LEFTRIGHT..
209 | "\n\n".." "..STRINGS_HELP_HELD_LR..
210 | "\n\n".." "..SYMBOL_CONFIRM.." "..STRINGS_HELP_CONFIRM..
211 | "\n\n".." "..SYMBOL_TRIANGLE.." "..STRINGS_HELP_TRIANGLE..
212 | "\n\n".." "..STRINGS_HELP_START,
213 | STRINGS_HELP_CONTROLS )
214 | end
215 |
216 | function exit_hb()
217 | if change then
218 | if os.dialog(STRINGS_REBOOT, STRINGS_SYSTEM_DIALOG, __DIALOG_MODE_OK_CANCEL) == true then
219 | --if os.message(STRINGS_REBOOT,1) == 1 then
220 | os.delay(250)
221 | buttons.homepopup(1)
222 | power.restart()
223 | end
224 | end
225 | os.exit()
226 | end
227 |
--------------------------------------------------------------------------------
/SHORTCUTS/system/scroll.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ## Library Scroll ##
3 | Designed By DevDavis (Davis Nuñez) 2011 - 2018.
4 | Based on library of Robert Galarga.
5 | Create a obj scroll, this is very usefull for list show
6 |
7 | Modified by gdljjrod 2019
8 |
9 | ]]
10 |
11 | function newScroll(a,b,c)
12 |
13 | local obj = {ini=1,sel=1,lim=1,maxim=0,minim=0}
14 |
15 | function obj:set(tab,mxn,modemintomin) -- Set a obj scroll
16 | obj.ini,obj.sel,obj.lim,obj.maxim,obj.minim, obj.mxn = 1,1,1,1,1,mxn
17 | if(type(tab)=="number")then
18 | if tab > mxn then obj.lim=mxn else obj.lim=tab end
19 | obj.maxim = tab
20 | else
21 | if #tab > mxn then obj.lim=mxn else obj.lim=#tab end
22 | obj.maxim = #tab
23 | end
24 | if modemintomin then obj.minim = obj.lim end
25 | end
26 |
27 | function obj:max(mx)
28 | obj.maxim = #mx
29 | end
30 |
31 | function obj:up()
32 | if obj.sel>obj.ini then obj.sel=obj.sel-1 return true
33 | elseif obj.ini-1>=obj.minim then
34 | obj.ini,obj.sel,obj.lim=obj.ini-1,obj.sel-1,obj.lim-1
35 | return true
36 | end
37 | end
38 |
39 | function obj:down()
40 | if obj.sel obj.mxn then obj.lim = obj.mxn else obj.lim = #tab end
53 | else
54 | if obj.sel == obj.maxim then
55 | obj.sel,obj.ini,obj.lim = obj.sel-1,obj.ini-1,obj.lim-1
56 | else
57 | if (#tab - obj.ini) + 1 < obj.mxn then obj.lim,obj.ini = obj.lim-1,obj.ini-1 end
58 | end
59 | end
60 | obj.maxim = #tab
61 | end
62 |
63 | if a and b then
64 | obj:set(a,b,c)
65 | end
66 |
67 | return obj
68 |
69 | end
70 |
--------------------------------------------------------------------------------