├── ONETROPHY
├── eboot.bin
├── git
│ ├── shared.lua
│ ├── thread_net.lua
│ ├── updater.lua
│ └── updater
│ │ ├── param.sfo
│ │ ├── script.lua
│ │ └── update.png
├── lang
│ ├── Chinese_S.txt
│ ├── Chinese_T.txt
│ ├── RUSSIAN.txt
│ └── english_us.txt
├── resources
│ ├── Background.png
│ ├── Splash.png
│ ├── Trophies.png
│ ├── buttons.png
│ └── buttons2.png
├── sce_sys
│ ├── icon0.png
│ ├── livearea
│ │ └── contents
│ │ │ ├── bg0.png
│ │ │ ├── startup.png
│ │ │ └── template.xml
│ └── param.sfo
├── script.lua
└── system
│ ├── commons.lua
│ ├── scroll.lua
│ ├── trophies_group.lua
│ ├── trophies_list.lua
│ └── trophies_title.lua
├── README.md
├── SCREENSHOOT1.png
├── SCREENSHOOT2.png
├── SCREENSHOOT3.png
└── version
/ONETROPHY/eboot.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/eboot.bin
--------------------------------------------------------------------------------
/ONETROPHY/git/shared.lua:
--------------------------------------------------------------------------------
1 | -- Constants
2 |
3 | APP_REPO = "ONElua"
4 | APP_PROJECT = "TrophyManager"
5 | APP_VPK = "TrophyManager"
6 |
7 | APP_VERSION_MAJOR = 0x01 -- major.minor
8 | APP_VERSION_MINOR = 0x03
9 |
10 | APP_VERSION = ((APP_VERSION_MAJOR << 0x18) | (APP_VERSION_MINOR << 0x10)) -- Union Binary
11 |
--------------------------------------------------------------------------------
/ONETROPHY/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=14&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
--------------------------------------------------------------------------------
/ONETROPHY/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) end
21 | screen.flip()
22 |
23 | 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
24 | buttons.homepopup(0)
25 |
26 | if update then update:blit(0,0) end
27 |
28 | local url = "http://devdavisnunez.x10.mx/wikihb/download/?id=14"
29 | local path2vpk = "ux0:data/"..APP_PROJECT..".vpk"
30 | local onAppInstallOld = onAppInstall
31 | function onAppInstall(step, size_argv, written, file, totalsize, totalwritten)
32 | return 10 -- Ok code
33 | end
34 | local onNetGetFileOld = onNetGetFile
35 | function onNetGetFile(size,written,speed)
36 |
37 | if update then update:blit(0,0) end
38 |
39 | screen.print(10,10,"Downloading Update...")
40 | screen.print(480,470,tostring(files.sizeformat(written or 0)).." / "..tostring(files.sizeformat(size or 0)),1,color.white, color.blue:a(135),__ACENTER)
41 |
42 | l = (written*940)/size
43 | screen.print(3+l,495,math.floor((written*100)/size).."%",0.8,0xFFFFFFFF,0x0,__ACENTER)
44 | draw.fillrect(10,524,l,6,color.new(0,255,0))
45 | draw.circle(10+l,526,6,color.new(0,255,0),30)
46 |
47 | screen.flip()
48 |
49 | buttons.read()
50 | --if buttons.cancel then return 0 end --Cancel or Abort
51 | return 1;
52 | end
53 |
54 | if http.download(url, path2vpk).success then
55 | os.delay(500)
56 | if files.exists(path2vpk) then
57 | files.mkdir("ux0:/data/1luapkg")
58 | files.copy("eboot.bin","ux0:/data/1luapkg")
59 | files.copy("git/updater/script.lua","ux0:/data/1luapkg/")
60 | files.copy("git/updater/update.png","ux0:/data/1luapkg/")
61 | files.copy("git/updater/param.sfo","ux0:/data/1luapkg/sce_sys/")
62 | game.installdir("ux0:/data/1luapkg")
63 | files.delete("ux0:/data/1luapkg")
64 | game.launch(string.format("ONEUPDATE&%s&%s",os.titleid(),path2vpk)) -- Goto installer extern!
65 | end
66 | end
67 | onAppInstall = onAppInstallOld
68 | onNetGetFile = onNetGetFileOld
69 | buttons.homepopup(1)
70 | end
71 | end
72 | end
73 |
74 | THID = thread.new("git/thread_net.lua")
75 |
--------------------------------------------------------------------------------
/ONETROPHY/git/updater/param.sfo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/git/updater/param.sfo
--------------------------------------------------------------------------------
/ONETROPHY/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(925,10,"Percent Total: "..math.floor((totalwritten*100)/totalsize).." %",1.0,color.white, color.black, __ARIGHT)
38 | screen.print(10,35,"File: "..tostring(file))
39 | screen.print(10,55,"Percent: "..math.floor((written*100)/size_argv).." %")
40 | draw.fillrect(0,544-30,(totalwritten*960)/totalsize,30, color.new(0,255,0))
41 | screen.flip()
42 | elseif step == 4 then -- Promote or install
43 | if update then update:blit(0,0) end
44 | draw.fillrect(0,0,960,30, color.green:a(100))
45 | screen.print(10,10,"Installing...")
46 | screen.flip()
47 | end
48 | end
49 |
50 | game.install(args[3])
51 | files.delete(args[3])
52 |
53 | buttons.homepopup(1)
54 |
55 | game.launch(args[2])
--------------------------------------------------------------------------------
/ONETROPHY/git/updater/update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/git/updater/update.png
--------------------------------------------------------------------------------
/ONETROPHY/lang/Chinese_S.txt:
--------------------------------------------------------------------------------
1 | -----------------------------------------------Texts
2 |
3 | STRINGS_MARK_TROPHIES = "标记/取消标记 奖杯"
4 | STRINGS_DEL_TROPHIES = "删除奖杯"
5 | STRINGS_SHOW_DETAILS = "显示详情"
6 | STRINGS_EMPTY = "没有奖杯!!!"
7 | STRINGS_SORT = "Sort: "
8 |
9 | STRINGS_RELOAD_TROPHIES = "需要先与奖杯气泡同步\n\n(非联网上传)"
10 | STRINGS_GAME_NOT_INSTALLED = "游戏还没安装!!!"
11 | STRINGS_SUB_TROPHIES = "Sub-奖杯:"
12 |
13 | STRINGS_TROPHY_TYPE = "奖杯:"
14 | STRINGS_TROPHY_STATUS = "数据:"
15 | STRINGS_TROPHY_HIDDEN = "隐藏:"
16 | STRINGS_TROPHY_UNLOCKED = "已解锁"
17 | STRINGS_TROPHY_LOCKED = "锁定"
18 |
19 | STRINGS_TROPHY_PLATINUM = "铂金"
20 | STRINGS_TROPHY_GOLD = "黄金"
21 | STRINGS_TROPHY_SILVER = "白银"
22 | STRINGS_TROPHY_BRONZE = "青铜"
23 |
24 | --Sort
25 | STRING_SORT_ID = "Trophy id"
26 | STRING_SORT_UNLOCKED = "Unlocked"
27 | STRING_SORT_HIDDEN = "Hidden"
28 | STRING_SORT_GROUP = "Group"
29 | STRING_SORT_TITLE = "Title"
30 | STRING_SORT_PROGRESS = "Progress"
31 |
32 | STRINGS_DELETE_QUESTION = "你确定要消除这些奖杯吗?"
33 | STRINGS_HIDDEN_YES = "是"
34 | STRINGS_HIDDEN_NO = "否"
35 |
36 | --color yellow
37 | STRINGS_TROPHY_WARNING_HIDDEN = "隐藏"
38 |
39 | --Wifi is on
40 | STRINGS_TROPHY_OPENAPP = "奖杯应用"
41 | STRINGS_TROPHY_WIFI_ON = "记得关闭WI-FI,以防止上传奖杯"
--------------------------------------------------------------------------------
/ONETROPHY/lang/Chinese_T.txt:
--------------------------------------------------------------------------------
1 | -----------------------------------------------Texts
2 |
3 | STRINGS_MARK_TROPHIES = "標記/取消標記 獎杯"
4 | STRINGS_DEL_TROPHIES = "刪除獎杯"
5 | STRINGS_SHOW_DETAILS = "顯示詳情"
6 | STRINGS_EMPTY = "沒有獎杯!!!"
7 | STRINGS_SORT = "Sort: "
8 |
9 | STRINGS_RELOAD_TROPHIES = "需要先與獎杯氣泡同歩\n\n(非聯網上傳)"
10 | STRINGS_GAME_NOT_INSTALLED = "遊戲还沒安裝!!!"
11 | STRINGS_SUB_TROPHIES = "Sub-獎杯:"
12 |
13 | STRINGS_TROPHY_TYPE = "獎杯:"
14 | STRINGS_TROPHY_STATUS = "數據:"
15 | STRINGS_TROPHY_HIDDEN = "隱藏:"
16 | STRINGS_TROPHY_UNLOCKED = "已解鎖"
17 | STRINGS_TROPHY_LOCKED = "鎖定"
18 |
19 | STRINGS_TROPHY_PLATINUM = "鉑金"
20 | STRINGS_TROPHY_GOLD = "黃金"
21 | STRINGS_TROPHY_SILVER = "白銀"
22 | STRINGS_TROPHY_BRONZE = "青銅"
23 |
24 | --Sort
25 | STRING_SORT_ID = "Trophy id"
26 | STRING_SORT_UNLOCKED = "Unlocked"
27 | STRING_SORT_HIDDEN = "Hidden"
28 | STRING_SORT_GROUP = "Group"
29 | STRING_SORT_TITLE = "Title"
30 | STRING_SORT_PROGRESS = "Progress"
31 |
32 | STRINGS_DELETE_QUESTION = "你確定要消除這些獎杯嗎?"
33 | STRINGS_HIDDEN_YES = "是"
34 | STRINGS_HIDDEN_NO = "否"
35 |
36 | --color yellow
37 | STRINGS_TROPHY_WARNING_HIDDEN = "隱藏"
38 |
39 | --Wifi is on
40 | STRINGS_TROPHY_OPENAPP = "獎杯應用"
41 | STRINGS_TROPHY_WIFI_ON = "記得關閉WI-FI,以防止上傳獎杯"
--------------------------------------------------------------------------------
/ONETROPHY/lang/RUSSIAN.txt:
--------------------------------------------------------------------------------
1 | -----------------------------------------------Texts
2 |
3 | STRINGS_MARK_TROPHIES = "Отметить/Снять трофеи"
4 | STRINGS_DEL_TROPHIES = "Удалить трофеи"
5 | STRINGS_SHOW_DETAILS = "Показать подробности"
6 | STRINGS_EMPTY = "Нет трофеев !!!"
7 |
8 | STRINGS_RELOAD_TROPHIES = "Необходимо сначало синхронизировать трофеи \n\nиз приложения Трофеи"
9 | STRINGS_GAME_NOT_INSTALLED = "Игра не установлена !!!"
10 | STRINGS_SUB_TROPHIES = "Доп-трофеи:"
11 |
12 | STRINGS_TROPHY_TYPE = "Трофей:"
13 | STRINGS_TROPHY_STATUS = "Статус:"
14 | STRINGS_TROPHY_HIDDEN = "Скрытый:"
15 | STRINGS_TROPHY_UNLOCKED = "Разблокирован"
16 | STRINGS_TROPHY_LOCKED = "Заблокирован"
17 |
18 | STRINGS_TROPHY_PLATINUM = "Платина"
19 | STRINGS_TROPHY_GOLD = "Золото"
20 | STRINGS_TROPHY_SILVER = "Серебро"
21 | STRINGS_TROPHY_BRONZE = "Бронза"
22 |
23 | STRINGS_DELETE_QUESTION = "Хочешь удалить эти трофеи?"
24 | STRINGS_HIDDEN_YES = "Да"
25 | STRINGS_HIDDEN_NO = "Нет"
26 |
27 | --color yellow
28 | STRINGS_TROPHY_WARNING_HIDDEN = "СКРЫТЫЙ"
29 |
30 | --Wifi is on
31 | STRINGS_TROPHY_OPENAPP = "Трофеи"
32 | STRINGS_TROPHY_WIFI_ON = "Не забудь отключить Wi-Fi, чтобы не синхронизировать трофеи"
33 |
--------------------------------------------------------------------------------
/ONETROPHY/lang/english_us.txt:
--------------------------------------------------------------------------------
1 | -----------------------------------------------Texts
2 |
3 | STRINGS_MARK_TROPHIES = "Mark/Unmark Trophies"
4 | STRINGS_DEL_TROPHIES = "Delete Trophies"
5 | STRINGS_SHOW_DETAILS = "Show Details"
6 | STRINGS_EMPTY = "Not Trophies !!!"
7 | STRINGS_SORT = "Sort: "
8 |
9 | STRINGS_RELOAD_TROPHIES = "It is necessary to first synchronize the Trophies\n\nfrom the APP Trophies."
10 | STRINGS_GAME_NOT_INSTALLED = "Game not installed !!!"
11 | STRINGS_SUB_TROPHIES = "Sub-Trophies:"
12 |
13 | STRINGS_TROPHY_TYPE = "Trophy:"
14 | STRINGS_TROPHY_STATUS = "Status:"
15 | STRINGS_TROPHY_HIDDEN = "Hidden:"
16 | STRINGS_TROPHY_UNLOCKED = "Unlocked"
17 | STRINGS_TROPHY_LOCKED = "Locked"
18 |
19 | STRINGS_TROPHY_PLATINUM = "Platinum"
20 | STRINGS_TROPHY_GOLD = "Gold"
21 | STRINGS_TROPHY_SILVER = "Silver"
22 | STRINGS_TROPHY_BRONZE = "Bronze"
23 |
24 | --Sort
25 | STRING_SORT_ID = "Trophy id"
26 | STRING_SORT_UNLOCKED = "Unlocked"
27 | STRING_SORT_HIDDEN = "Hidden"
28 | STRING_SORT_GROUP = "Group"
29 | STRING_SORT_TITLE = "Title"
30 | STRING_SORT_PROGRESS = "Progress"
31 |
32 | STRINGS_DELETE_QUESTION = "Do you want to eliminate this Trophies ?"
33 | STRINGS_HIDDEN_YES = "Yes"
34 | STRINGS_HIDDEN_NO = "No"
35 |
36 | --color yellow
37 | STRINGS_TROPHY_WARNING_HIDDEN = "HIDDEN"
38 |
39 | --Wifi is on
40 | STRINGS_TROPHY_OPENAPP = "Trophies App"
41 | STRINGS_TROPHY_WIFI_ON = "Remember To disable WI-FI to prevent synching trophies"
--------------------------------------------------------------------------------
/ONETROPHY/resources/Background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/resources/Background.png
--------------------------------------------------------------------------------
/ONETROPHY/resources/Splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/resources/Splash.png
--------------------------------------------------------------------------------
/ONETROPHY/resources/Trophies.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/resources/Trophies.png
--------------------------------------------------------------------------------
/ONETROPHY/resources/buttons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/resources/buttons.png
--------------------------------------------------------------------------------
/ONETROPHY/resources/buttons2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/resources/buttons2.png
--------------------------------------------------------------------------------
/ONETROPHY/sce_sys/icon0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/sce_sys/icon0.png
--------------------------------------------------------------------------------
/ONETROPHY/sce_sys/livearea/contents/bg0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/sce_sys/livearea/contents/bg0.png
--------------------------------------------------------------------------------
/ONETROPHY/sce_sys/livearea/contents/startup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/sce_sys/livearea/contents/startup.png
--------------------------------------------------------------------------------
/ONETROPHY/sce_sys/livearea/contents/template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bg0.png
6 |
7 |
8 | startup.png
9 |
10 |
11 |
12 |
13 |
14 | Trophy Manager
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Trophy Manager v1.03 ®2023 Team ONElua gdljjrod - ONElua.x10.mx
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ONETROPHY/sce_sys/param.sfo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/ONETROPHY/sce_sys/param.sfo
--------------------------------------------------------------------------------
/ONETROPHY/script.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ----------Trophy Manager------------
3 | Create and organize your direct adrenaline bubbles.
4 |
5 | Licensed by GNU General Public License v3.0
6 |
7 | Designed By:
8 | - Gdljjrod (https://twitter.com/gdljjrod).
9 | ]]
10 |
11 | --Show splash
12 | splash.zoom("resources/splash.png")
13 |
14 | --Update
15 | dofile("git/shared.lua")
16 | local wstrength = wlan.strength()
17 | if wstrength then
18 | if wstrength > 55 then dofile("git/updater.lua") end
19 | end
20 |
21 | game.close()
22 |
23 | dofile("system/commons.lua")
24 | dofile("system/scroll.lua")
25 | dofile("system/trophies_title.lua")
26 | dofile("system/trophies_group.lua")
27 | dofile("system/trophies_list.lua")
28 |
29 | trophies_title()
--------------------------------------------------------------------------------
/ONETROPHY/system/commons.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ----------Trophy Manager------------
3 | Create and organize your direct adrenaline bubbles.
4 |
5 | Licensed by GNU General Public License v3.0
6 |
7 | Designed By:
8 | - Gdljjrod (https://twitter.com/gdljjrod).
9 | ]]
10 |
11 | --Load palette
12 | color.loadpalette()
13 |
14 | flag_delete_db = false
15 |
16 | --Load prx for mount
17 | if files.exists("modules/kernel.skprx") then
18 | if os.requirek("modules/kernel.skprx")==1 then __kernel = true end
19 | else
20 | if os.requirek("ux0:VitaShell/module/kernel.skprx")==1 then __kernel = true end
21 | end
22 |
23 | if files.exists("modules/user.suprx") then
24 | if os.requireu("modules/user.suprx")==1 then __user = true end
25 | else
26 | if os.requireu("ux0:VitaShell/module/user.suprx")==1 then __user = true end
27 | end
28 |
29 | -- Creamos carpeta de trabajo para los idiomas
30 | __PATH_LANG = "ux0:data/ONETROPHY/lang/"
31 | __PATH_FONT = "ux0:data/ONETROPHY/font/"
32 | files.mkdir(__PATH_LANG)
33 | files.mkdir(__PATH_FONT)
34 | __LANG = os.language()
35 |
36 | -- Loading language file
37 | dofile("lang/english_us.txt")
38 | if not files.exists(__PATH_LANG.."english_us.txt") then files.copy("lang/english_us.txt",__PATH_LANG) end
39 | if files.exists(__PATH_LANG..__LANG..".txt") then dofile(__PATH_LANG..__LANG..".txt") end
40 |
41 | -- Loading custom font
42 | fnt = font.load(__PATH_FONT.."font.ttf") or font.load(__PATH_FONT.."font.pgf") or font.load(__PATH_FONT.."font.pvf")
43 | if fnt then font.setdefault(fnt) end
44 |
45 | --buttons asignation
46 | accept,cancel = "cross","circle"
47 | if buttons.assign()==0 then
48 | accept,cancel = "circle","cross"
49 | end
50 |
51 | --Load resources
52 | back = image.load("resources/background.png")
53 | img_trophies = image.load("resources/trophies.png",60,60)
54 | buttonskey = image.load("resources/buttons.png",20,20)
55 | buttonskey2 = image.load("resources/buttons2.png",30,20)
56 |
57 | --sorts
58 | _SORT_L = { STRING_SORT_ID, STRING_SORT_UNLOCKED, STRING_SORT_HIDDEN }
59 | _SORT_G = { STRING_SORT_GROUP, STRING_SORT_PROGRESS }
60 | _SORT_T = { STRING_SORT_TITLE, STRING_SORT_PROGRESS }
61 |
62 | --Constants
63 | ICONS_TROPHY = "ux0:user/00/trophy/conf/"
64 | CONF_TROPHY = "ur0:user/00/trophy/conf/"
65 | DATA_TROPHY = "ur0:user/00/trophy/data/"
66 | TROP_TROPHY = "ur0:user/00/trophy/data/sce_trop"
67 | DB_TROPHY = "ur0:user/00/trophy/db"
68 |
69 | function draw.offsetgradrect(x,y,sx,sy,c1,c2,c3,c4,offset)
70 | local sizey = sy/2
71 | draw.gradrect(x,y,sx,sizey + offset,c1,c2,c3,c4)
72 | draw.gradrect(x,y + sizey - offset,sx,sizey + offset,c3,c4,c1,c2)
73 | end
--------------------------------------------------------------------------------
/ONETROPHY/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 2018
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 |
--------------------------------------------------------------------------------
/ONETROPHY/system/trophies_group.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ----------Trophy Manager------------
3 | Create and organize your direct adrenaline bubbles.
4 |
5 | Licensed by GNU General Public License v3.0
6 |
7 | Designed By:
8 | - Gdljjrod (https://twitter.com/gdljjrod).
9 | ]]
10 |
11 | --[[
12 | "npcommid" ID special for Trophy
13 | "total" Total of trophies
14 | "platinum","gold","silver","bronze", Total of trophies for each type
15 | "title","details", Title and description of the trophies (Sub-Trophies)
16 | "group" if there is a group of trophies
17 | "progress" Progress (%)
18 | "unlockT" Total of unlocked trophies
19 | "unlockP" Total of unlocked trophies: Platinum
20 | "unlockG" Total of unlocked trophies: Gold
21 | "unlockS" Total of unlocked trophies: Silver
22 | "unlockB" Total of unlocked trophies: Bronze
23 | ]]
24 |
25 | local trophyG = {}
26 |
27 | function get_trophiesG(obj)
28 |
29 | local tmp = trophy.info(__GROUP)
30 |
31 | if tmp then
32 | for i=1, #tmp do
33 |
34 | if tmp[i].npcommid == obj.npcommid then
35 | tmp[i].total = tonumber(tmp[i].total)
36 | tmp[i].group = tonumber(tmp[i].group)
37 | tmp[i].progress = tonumber(tmp[i].progress)
38 | tmp[i].unlockT = tonumber(tmp[i].unlockT)
39 | table.insert(trophyG,tmp[i])
40 | end
41 | end
42 | end
43 | end
44 |
45 | function trophies_group(obj)
46 |
47 | trophyG = {}
48 | get_trophiesG(obj)
49 |
50 | if trophyG and #trophyG > 0 then
51 | table.sort(trophyG, function (a,b) return string.lower(a.group) 530 then
71 | init_scroll = screen.print(init_scroll,35,obj.title,1,color.white,color.black,__SLEFT,520)
72 | else
73 | screen.print(25,35,obj.title,1,color.white,color.black)
74 | end
75 | screen.print(955,10,"("..scroll.maxim..")",1,color.red,color.black, __ARIGHT)
76 |
77 | if scroll.maxim > 0 and trophyG then
78 |
79 | local y=95
80 | for i=scroll.ini, scroll.lim do
81 |
82 | if i == scroll.sel then
83 | if scroll.maxim >= maxim then
84 | draw.offsetgradrect(20,y-3,810,60,color.shine:a(75),color.shine:a(135),0x0,0x0,21)
85 | else
86 | draw.offsetgradrect(5,y-3,825,60,color.shine:a(75),color.shine:a(135),0x0,0x0,21)
87 | end
88 |
89 | screen.print(560 + 30, 65, trophyG[scroll.sel].platinum,1,color.white,color.black, __ACENTER)
90 | screen.print(630 + 30, 65, trophyG[scroll.sel].gold,1,color.white,color.black, __ACENTER)
91 | screen.print(700 + 30, 65, trophyG[scroll.sel].silver,1,color.white,color.black, __ACENTER)
92 | screen.print(770 + 30, 65, trophyG[scroll.sel].bronze,1,color.white,color.black, __ACENTER)
93 | screen.print(955, 65, trophyG[scroll.sel].total.."/"..obj.total,1,color.white,color.black, __ARIGHT)
94 |
95 | if not obj.exist then
96 | screen.print(480,460,STRINGS_GAME_NOT_INSTALLED,1.5,color.red:a(150),color.black, __ACENTER)
97 | end
98 |
99 | if screen.textwidth( trophyG[scroll.sel].details,1) > 945 then
100 | d_scroll = screen.print(d_scroll,510,trophyG[scroll.sel].details,1,color.white,color.black, __SLEFT,920)
101 | else
102 | screen.print(480,510,trophyG[scroll.sel].details,1,color.white,color.black, __ACENTER)
103 | end
104 |
105 | end
106 |
107 | --Bar Scroll
108 | if scroll.maxim >= maxim then -- Draw Scroll Bar
109 | local ybar,h=93, (maxim*(inter + 15))-7
110 | draw.fillrect(5, ybar-2, 8, h, color.shine:a(50))
111 | --if scroll.maxim >= maxim then -- Draw Scroll Bar
112 | local pos_height = math.max(h/scroll.maxim, maxim)
113 | draw.fillrect(5, ybar-2 + ((h-pos_height)/(scroll.maxim-1))*(scroll.sel-1), 8, pos_height, color.new(0,255,0))
114 | --end
115 | end
116 |
117 | --Title
118 | if screen.textwidth(trophyG[i].title,1) > 530 then
119 | t_scroll = screen.print(t_scroll,y,trophyG[i].title,1,color.white,color.black,__SLEFT,520)
120 | else
121 | screen.print(25,y,trophyG[i].title,1,color.white,color.black)
122 | end
123 |
124 | --Progress
125 | draw.fillrect(25, y + (inter/2), 200, 20, color.shine:a(80))
126 | draw.fillrect(25, y + (inter/2) , math.map(trophyG[i].progress, 0, 100, 0, 200 ), 20, color.green:a(80))
127 | draw.rect(25, y + (inter/2), 200, 20, color.white:a(200))
128 | screen.print(235, y + (inter/2), trophyG[i].progress.."%",1,color.white,color.black)
129 |
130 | --Unlocked Trophies
131 | draw.rect(560, y + (inter/2)-30, 270, 60, color.white:a(125))
132 | screen.print(560 + 30, y + (inter/2)-5, trophyG[i].unlockP,1,color.white,color.black, __ACENTER)
133 | screen.print(630 + 30, y + (inter/2)-5, trophyG[i].unlockG,1,color.white,color.black, __ACENTER)
134 | screen.print(700 + 30, y + (inter/2)-5, trophyG[i].unlockS,1,color.white,color.black, __ACENTER)
135 | screen.print(770 + 30, y + (inter/2)-5, trophyG[i].unlockB,1,color.white,color.black, __ACENTER)
136 |
137 | --Blit icon0
138 | if not trophyG[i].icon0 then
139 | if trophyG[i].group == -1 then
140 | trophyG[i].icon0 = image.load(CONF_TROPHY..trophyG[i].npcommid.."/ICON0.PNG")
141 | else
142 | trophyG[i].icon0 = image.load(CONF_TROPHY..trophyG[i].npcommid.."/GR"..string.rep("0", 3 - string.len(trophyG[i].group))..trophyG[i].group..".PNG")
143 | end
144 |
145 | if trophyG[i].icon0 then
146 | trophyG[i].icon0:resize(120,62)
147 | trophyG[i].icon0:center()
148 | end
149 | else
150 | trophyG[i].icon0:blit(955 - (trophyG[i].icon0:getw()/2), y + (inter/2))
151 | end
152 |
153 | if buttonskey2 then buttonskey2:blitsprite(5,467,0) end
154 | screen.print(40,470,STRINGS_SORT.._SORT_G[sort_G],1,color.white,color.black,__ALEFT)
155 |
156 | y+=inter + 15
157 |
158 | end --for
159 |
160 | else
161 | screen.print(480,272,STRINGS_EMPTY,1.5,color.yellow,color.black,__ACENTER)
162 | end
163 |
164 | screen.flip()
165 |
166 | ----------------------------------Controls-------------------------------
167 | if scroll.maxim > 0 and trophyG then
168 |
169 | if (buttons.up or buttons.held.l or buttons.analogly<-60) then
170 | if scroll:up() then d_scroll,t_scroll,init_scroll = 25,25,25 end
171 | end
172 |
173 | if (buttons.down or buttons.held.r or buttons.analogly>60) then
174 | if scroll:down() then d_scroll,t_scroll,init_scroll = 25,25,25 end
175 | end
176 |
177 | if buttons[accept] then
178 | trophies_list(trophyG[scroll.sel])
179 | end
180 |
181 | if buttons.select then
182 | if sort_G == 2 then
183 | sort_G = 1
184 | table.sort(trophyG, function (a,b) return string.lower(a.group)(b.progress) end)
188 | end
189 | end
190 |
191 | end
192 |
193 | if buttons[cancel] then
194 | trophyG = {}
195 |
196 | collectgarbage("collect")
197 | os.delay(250)
198 |
199 | return true
200 | end
201 |
202 | end
203 | end
204 |
--------------------------------------------------------------------------------
/ONETROPHY/system/trophies_list.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ----------Trophy Manager------------
3 | Create and organize your direct adrenaline bubbles.
4 |
5 | Licensed by GNU General Public License v3.0
6 |
7 | Designed By:
8 | - Gdljjrod (https://twitter.com/gdljjrod).
9 | ]]
10 |
11 | --[[
12 | "groupid" Group ID
13 | "trophyid" id
14 | "unlocked", Unlocked/locked
15 | "type", trophy grade
16 | "hidden" 1/0
17 | "title","details" Title and description of the trophies
18 |
19 | ]]
20 |
21 | local trophyL,gid = {},-1
22 |
23 | local trophies_type = {
24 | name = {STRINGS_TROPHY_PLATINUM, STRINGS_TROPHY_GOLD, STRINGS_TROPHY_SILVER, STRINGS_TROPHY_BRONZE },
25 | num = { 0,1,2,3,4,5 },
26 | win = {STRINGS_TROPHY_LOCKED, STRINGS_TROPHY_UNLOCKED },
27 | hid = {STRINGS_HIDDEN_NO, STRINGS_HIDDEN_YES }
28 | }
29 |
30 | function get_trophiesL(obj)
31 |
32 | if obj.group > 0 then gid = obj.group end
33 | local tmp = trophy.list(obj.npcommid, gid)
34 |
35 | if tmp and #tmp> 0 then
36 |
37 | for i=1, #tmp do
38 | tmp[i].trophyid = tonumber(tmp[i].trophyid)
39 | tmp[i].groupid = tonumber(tmp[i].groupid)
40 | tmp[i].unlocked = tonumber(tmp[i].unlocked)
41 | tmp[i].type = tonumber(tmp[i].type)
42 | tmp[i].hidden = tonumber(tmp[i].hidden)
43 | if tmp[i].hidden == 1 then
44 | if tmp[i].unlocked == 1 then tmp[i].view = true else tmp[i].view = false end
45 | else
46 | tmp[i].view = true
47 | end
48 |
49 | tmp[i].pathicon = ICONS_TROPHY..obj.npcommid.."/TROP"..string.rep("0", 3 - string.len(tmp[i].trophyid))..tmp[i].trophyid..".PNG"
50 | table.insert(trophyL,tmp[i])
51 | end
52 |
53 | end
54 |
55 | end
56 |
57 | function trophies_list(obj)
58 |
59 | --Clean
60 | trophyL,gid,icon,icon_lock = {},-1,nil,nil
61 |
62 | get_trophiesL(obj)
63 |
64 | if trophyL and #trophyL > 0 then
65 |
66 | if gid == -1 then
67 | icon = image.load(CONF_TROPHY..obj.npcommid.."/ICON0.PNG")
68 | else
69 | icon = image.load(CONF_TROPHY..obj.npcommid.."/GR"..string.rep("0", 3 - string.len(gid))..gid..".PNG")
70 | end
71 | if icon then icon:resize(960,544) end
72 |
73 | table.sort(trophyL, function (a,b) return a.trophyid 870 then
87 | init_scroll = screen.print(init_scroll,35,obj.title,1,color.white,color.black,__SLEFT,860)
88 | else
89 | screen.print(25,35,obj.title,1,color.white,color.black)
90 | end
91 | screen.print(955,10,"("..scroll.maxim..")",1,color.red,color.black, __ARIGHT)
92 |
93 | if scroll.maxim > 0 and trophyL then
94 |
95 | local y=85
96 | for i=scroll.ini, scroll.lim do
97 |
98 | if i == scroll.sel then
99 | if scroll.maxim >= maxim then
100 | draw.offsetgradrect(20,y-3,870,60,color.shine:a(75),color.shine:a(135),0x0,0x0,21)
101 | else
102 | draw.offsetgradrect(5,y-3,885,60,color.shine:a(75),color.shine:a(135),0x0,0x0,21)
103 | end
104 |
105 | if trophyL[scroll.sel].view then
106 | if screen.textwidth( trophyL[scroll.sel].details,1) > 945 then
107 | d_scroll = screen.print(d_scroll,510,trophyL[scroll.sel].details,1,color.white,color.black, __SLEFT,920)
108 | else
109 | screen.print(480,510,trophyL[scroll.sel].details,1,color.white,color.black, __ACENTER)
110 | end
111 |
112 | else
113 | screen.print(480,510,STRINGS_TROPHY_WARNING_HIDDEN,1.5,color.yellow,color.black, __ACENTER)
114 | end
115 |
116 | end
117 |
118 | --Bar Scroll
119 | if scroll.maxim >= maxim then
120 | local ybar,h=83, (maxim*(inter + 15))-5
121 | draw.fillrect(5, ybar-2, 8, h, color.shine:a(50))
122 | --if scroll.maxim >= maxim then -- Draw Scroll Bar
123 | local pos_height = math.max(h/scroll.maxim, maxim)
124 | draw.fillrect(5, ybar-2 + ((h-pos_height)/(scroll.maxim-1))*(scroll.sel-1), 8, pos_height, color.green:a(125))
125 | --end
126 | end
127 |
128 | --Title
129 | if screen.textwidth( string.rep("0", 3 - string.len(trophyL[i].trophyid + 1))..(trophyL[i].trophyid + 1).." "..trophyL[i].title,1) > 800 then
130 | t_scroll = screen.print(t_scroll,y+2,string.rep("0", 3 - string.len(trophyL[i].trophyid + 1))..(trophyL[i].trophyid + 1).." "..trophyL[i].title,1,color.white,color.blue,__SLEFT,790)
131 | else
132 | screen.print(25,y+2,string.rep("0", 3 - string.len(trophyL[i].trophyid + 1))..(trophyL[i].trophyid + 1).." "..trophyL[i].title,1,color.white,color.blue)
133 | end
134 |
135 | if trophyL[i].unlocked == 0 then cc=color.white else cc=color.green:a(200) end
136 | screen.print(25, y + (inter/2), STRINGS_TROPHY_TYPE.." "..trophies_type.name[trophyL[i].type].." "..STRINGS_TROPHY_STATUS.." "..trophies_type.win[trophyL[i].unlocked + 1].." "..STRINGS_TROPHY_HIDDEN.." "..trophies_type.hid[trophyL[i].hidden+1],1,cc,color.blue:a(85))
137 |
138 | --Blit icon
139 | if not trophyL[i].icon then
140 | trophyL[i].icon = image.load(trophyL[i].pathicon)
141 |
142 | if trophyL[i].icon then
143 | trophyL[i].icon:resize(60,60)
144 | trophyL[i].icon:center()
145 | end
146 | end
147 |
148 | --Show Trophies
149 | if trophyL[i].view then
150 | if trophyL[i].icon then
151 | trophyL[i].icon:blit(955 - (trophyL[i].icon:getw()/2), y + (inter/2))
152 | else
153 | draw.fillrect(895, y-2,60,60,color.shine:a(75))
154 | end
155 | else
156 | if img_trophies then img_trophies:blitsprite(895,y-2, 5)
157 | else draw.fillrect(895, y-2,60,60,color.shine:a(75)) end
158 | end
159 |
160 | if trophyL[i].unlocked == 0 then
161 | if img_trophies then img_trophies:blitsprite(830,y-2,4)
162 | else draw.fillrect(830, y-2,60,60,color.shine:a(75)) end
163 | else
164 | --Trophy Grade
165 | if img_trophies then
166 | img_trophies:blitsprite(830,y-2, trophies_type.num[trophyL[i].type])
167 | else
168 | draw.fillrect(830, y-2,60,60,color.shine:a(75))
169 | end
170 | end
171 |
172 | if trophyL[scroll.sel].hidden == 1 then
173 | if buttonskey then buttonskey:blitsprite(10,447,2) end --[]
174 | screen.print(40,450,STRINGS_SHOW_DETAILS,1,color.white,color.black,__ALEFT)
175 | end
176 |
177 | if buttonskey2 then buttonskey2:blitsprite(5,467,0) end
178 | screen.print(40,470,STRINGS_SORT.._SORT_L[sort_L],1,color.white,color.black,__ALEFT)
179 |
180 | y+=inter + 15
181 |
182 | end --for
183 |
184 | else
185 | screen.print(480,272,STRINGS_EMPTY,1.5,color.yellow,color.black,__ACENTER)
186 | end
187 |
188 | screen.flip()
189 |
190 | ----------------------------------Controls-------------------------------
191 | if scroll.maxim > 0 and trophyL then
192 |
193 | if (buttons.up or buttons.held.l or buttons.analogly<-60) then
194 | if scroll:up() then d_scroll,t_scroll,init_scroll = 25,25,25 end
195 | end
196 |
197 | if (buttons.down or buttons.held.r or buttons.analogly>60) then
198 | if scroll:down() then d_scroll,t_scroll,init_scroll = 25,25,25 end
199 | end
200 |
201 | if buttons.square and (trophyL[scroll.sel].unlocked == 0 and trophyL[scroll.sel].hidden == 1) then
202 | --if trophyL[scroll.sel].unlocked == 0 then
203 | --if trophyL[scroll.sel].hidden == 1 then
204 | trophyL[scroll.sel].view = not trophyL[scroll.sel].view
205 | --end
206 | --end
207 | end
208 |
209 | if buttons.select then
210 | if sort_L == 1 then
211 | sort_L = 2
212 | table.sort(trophyL, function (a,b) return a.unlocked>b.unlocked end)
213 | elseif sort_L == 2 then
214 | sort_L = 3
215 | table.sort(trophyL, function (a,b) return a.hidden>b.hidden end)
216 | elseif sort_L == 3 then
217 | sort_L = 1
218 | table.sort(trophyL, function (a,b) return a.trophyid 0 then
88 | table.sort(trophyT, function (a,b) return string.lower(a.title) 0 and trophyT then
113 |
114 | local y=95
115 | for i=scroll.ini, scroll.lim do
116 |
117 | if i == scroll.sel then
118 | if scroll.maxim >= maxim then
119 | draw.offsetgradrect(20,y-3,810,60,color.shine:a(75),color.shine:a(135),0x0,0x0,21)
120 | else
121 | draw.offsetgradrect(5,y-3,825,60,color.shine:a(75),color.shine:a(135),0x0,0x0,21)
122 | end
123 |
124 | screen.print(560 + 30, 65, trophyT[scroll.sel].platinum,1,color.white,color.black, __ACENTER)
125 | screen.print(630 + 30, 65, trophyT[scroll.sel].gold,1,color.white,color.black, __ACENTER)
126 | screen.print(700 + 30, 65, trophyT[scroll.sel].silver,1,color.white,color.black, __ACENTER)
127 | screen.print(770 + 30, 65, trophyT[scroll.sel].bronze,1,color.white,color.black, __ACENTER)
128 | screen.print(955, 65, trophyT[scroll.sel].total,1,color.white,color.black, __ARIGHT)
129 |
130 | if not trophyT[scroll.sel].exist then
131 | screen.print(950,460,trophyT[scroll.sel].ID.." "..STRINGS_GAME_NOT_INSTALLED,1.5,color.red:a(150),color.black, __ARIGHT)
132 | end
133 |
134 | if screen.textwidth(trophyT[scroll.sel].details,1) > 945 then
135 | d_scroll = screen.print(d_scroll,520,trophyT[scroll.sel].details,1,color.white,color.black, __SLEFT,920)
136 | else
137 | screen.print(480,520,trophyT[scroll.sel].details,1,color.white,color.black, __ACENTER)
138 | end
139 |
140 | end
141 |
142 | --Bar Scroll
143 | if scroll.maxim >= maxim then -- Draw Scroll Bar
144 | local ybar,h=93, (maxim*(inter + 15))-7
145 | draw.fillrect(5, ybar-2, 8, h, color.shine:a(50))
146 | --if scroll.maxim >= maxim then -- Draw Scroll Bar
147 | local pos_height = math.max(h/scroll.maxim, maxim)
148 | draw.fillrect(5, ybar-2 + ((h-pos_height)/(scroll.maxim-1))*(scroll.sel-1), 8, pos_height, color.new(0,255,0))
149 | --end
150 | end
151 |
152 | --Title
153 | if screen.textwidth(trophyT[i].title,1) > 530 then
154 | t_scroll = screen.print(t_scroll,y,trophyT[i].title,1,color.white,color.black,__SLEFT,520)
155 | else
156 | screen.print(25,y,trophyT[i].title,1,color.white,color.black)
157 | end
158 |
159 | --Progress
160 | draw.fillrect(25, y + (inter/2), 200, 20, color.shine:a(80))
161 | draw.fillrect(25, y + (inter/2) , math.map(trophyT[i].progress, 0, 100, 0, 200 ), 20, color.green:a(80))
162 | draw.rect(25, y + (inter/2), 200, 20, color.white:a(200))
163 | screen.print(235, y + (inter/2), trophyT[i].progress.."%",1,color.white,color.black)
164 |
165 | --Sub-Trophies
166 | if trophyT[i].group > 0 then
167 | screen.print(320, y + (inter/2), STRINGS_SUB_TROPHIES.." "..trophyT[i].group,1,color.white,color.black)
168 | end
169 |
170 | --Unlocked Trophies
171 | if trophyT[i].del then cgrad = color.red else cgrad = color.white:a(125) end
172 | draw.rect(560, y + (inter/2)-30, 270, 60, cgrad)
173 | screen.print(560 + 30, y + (inter/2)-5, trophyT[i].unlockP,1,color.white,color.black, __ACENTER)
174 | screen.print(630 + 30, y + (inter/2)-5, trophyT[i].unlockG,1,color.white,color.black, __ACENTER)
175 | screen.print(700 + 30, y + (inter/2)-5, trophyT[i].unlockS,1,color.white,color.black, __ACENTER)
176 | screen.print(770 + 30, y + (inter/2)-5, trophyT[i].unlockB,1,color.white,color.black, __ACENTER)
177 |
178 | if trophyT[i].del then draw.offsetgradrect(5,y-3,825,60,color.red:a(60),color.red:a(75),0x0,0x0,10) end
179 |
180 | --Blit icon0
181 | if not trophyT[i].icon0 then
182 | trophyT[i].icon0 = image.load(CONF_TROPHY..trophyT[i].npcommid.."/ICON0.PNG")
183 | if trophyT[i].icon0 then
184 | trophyT[i].icon0:resize(120,62)
185 | trophyT[i].icon0:center()
186 | end
187 | else
188 | trophyT[i].icon0:blit(955 - (trophyT[i].icon0:getw()/2), y + (inter/2))
189 | end
190 |
191 | if buttonskey then buttonskey:blitsprite(10,437,2) end --[]
192 | screen.print(40,440,STRINGS_MARK_TROPHIES,1,color.white,color.black,__ALEFT)
193 |
194 | if buttonskey2 then buttonskey2:blitsprite(5,460,1) end --Start
195 | screen.print(40,462,STRINGS_DEL_TROPHIES,1,color.white,color.black, __ALEFT)
196 |
197 | if buttonskey2 then buttonskey2:blitsprite(5,483,0) end --select
198 | screen.print(40,485,STRINGS_SORT.._SORT_T[sort_T],1,color.white,color.black,__ALEFT)
199 |
200 | y+=inter + 15
201 |
202 | end --for
203 |
204 | else
205 | screen.print(480,202,STRINGS_EMPTY,1.5,color.yellow,color.black,__ACENTER)
206 |
207 | screen.print(480,252,STRINGS_RELOAD_TROPHIES,1,color.white,color.black,__ACENTER)
208 |
209 | if wlan.isconnected() then
210 | screen.print(480,352,STRINGS_TROPHY_WIFI_ON,1.5,color.yellow,color.black,__ACENTER)
211 | end
212 |
213 | end
214 |
215 | if buttonskey then buttonskey:blitsprite(940,483,1) end --Triangle
216 | screen.print(935,485,STRINGS_TROPHY_OPENAPP,1,color.white,color.black,__ARIGHT)
217 |
218 | screen.flip()
219 |
220 | ----------------------------------Controls-------------------------------
221 | if scroll.maxim > 0 and trophyT then
222 |
223 | if (buttons.up or buttons.held.l or buttons.analogly<-60) then
224 | if scroll:up() then d_scroll,t_scroll = 25,25 end
225 | end
226 |
227 | if (buttons.down or buttons.held.r or buttons.analogly>60) then
228 | if scroll:down() then d_scroll,t_scroll = 25,25 end
229 | end
230 |
231 | --Mark/Unmark
232 | if buttons.square then
233 | trophyT[scroll.sel].del = not trophyT[scroll.sel].del
234 | if trophyT[scroll.sel].del then delete+=1 else delete-=1 end
235 | end
236 |
237 | --Delete trophies
238 | if buttons.start then
239 | if os.message(STRINGS_DELETE_QUESTION, 1) == 1 then
240 | if delete <= 1 then
241 | --ux0
242 | files.delete(ICONS_TROPHY..trophyT[scroll.sel].npcommid)
243 | --ur0
244 | files.delete(CONF_TROPHY..trophyT[scroll.sel].npcommid)
245 | files.delete(DATA_TROPHY..trophyT[scroll.sel].npcommid)
246 | trophyT[scroll.sel].icon0, delete = nil,0
247 | scroll:delete(trophyT)
248 |
249 | else
250 | --Batch
251 | for i=scroll.maxim,1,-1 do
252 | if trophyT[i].del then
253 | --ux0
254 | files.delete(ICONS_TROPHY..trophyT[i].npcommid)
255 | --ur0
256 | files.delete(CONF_TROPHY..trophyT[i].npcommid)
257 | files.delete(DATA_TROPHY..trophyT[i].npcommid)
258 | trophyT[i].icon0 = nil
259 | table.remove(trophyT,i)
260 | end
261 | end
262 | scroll:set(trophyT,maxim)
263 | delete = 0
264 |
265 | end
266 | files.delete(TROP_TROPHY)
267 | flag_delete_db = true
268 | end
269 | end
270 |
271 | if buttons.select then
272 | if sort_T == 2 then
273 | sort_T = 1
274 | table.sort(trophyT, function (a,b) return string.lower(a.title)(b.progress) end)
278 | end
279 | end
280 |
281 | if buttons[accept] then
282 | if trophyT[scroll.sel].group > 0 then
283 | trophies_group(trophyT[scroll.sel])
284 | else
285 | trophies_list(trophyT[scroll.sel])
286 | end
287 | end
288 |
289 | end
290 |
291 | --Open Trophy APP
292 | if buttons.triangle then
293 | if wlan.isconnected() then os.message(STRINGS_TROPHY_WIFI_ON)
294 | else
295 | if flag_delete_db then files.delete(DB_TROPHY) end
296 | os.delay(500)
297 | if flag_delete_db then buttons.homepopup(0) else buttons.homepopup(1) end
298 |
299 | os.uri("pstc:")
300 | end
301 | end
302 |
303 | if buttons[cancel] then
304 | if flag_delete_db then files.delete(DB_TROPHY) end
305 | buttons.homepopup(1)
306 | os.exit()
307 | end
308 |
309 | end
310 | end
311 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Trophy Manager
2 | ** This app allows you to preview the trophies and their status for each game and delete trophies as desired.**
3 |
4 | 
5 |
6 | ### Description ###
7 | *This Homebrew could help you delete the game trophies you won't like to synch.*
8 |
9 | ## IMPORTANT ##
10 | **Everytime a trophy Is deleted, the trophy app/bubble must be launched to update the trophy db, we highly recomend you to disable the wifi in the PS Vita before launching the trophy app/bubble for this matter.**
11 |
12 | ### Changelog 1.03 ###
13 | - Support for trophies in homebrews and ports.
14 |
15 | ### Changelog 1.02 ###
16 | - Support for custom font in ux0:data/ONETROPHY/font/font.pgf.
17 |
18 | ### Changelog 1.01 ###
19 | - Now you can open the Trophies application.
20 |
21 | ### Changelog 1.00 ###
22 | -Initial Version.
23 |
24 | ### Controls ###
25 | *Trophy Manager does recognize the accept/cancel buttons according to console region.*
26 |
27 | *Main Screen*
28 |
29 | - **Square:** Multi Selection.
30 | - **Start:** Delete selected trophies.
31 | - **Select:** Sort List: Title, Progress.
32 |
33 | 
34 |
35 | *Trophy Screen*
36 | - **Square:** To preview details for a hidden trophy.
37 | - **Select:** Sort List: Trophyid, Unlocked, Hidden.
38 |
39 | ### NOTE: ###
40 | *This app Is based from Trophax app, but Trophy Manager does not unlock trophies.*
41 |
42 | 
43 |
44 | ### Credits ###
45 | - Silica for his Trophax app
46 | - Graphics By WZ-JK.
47 |
48 |
49 | ## Donation ##
50 | In case you want to support the work of the team on the vita, you can always donate for some coffee. Any amount is highly appreciated:
51 |
52 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YHZ5XBWEXP8ZY&lc=MX&item_name=ONElua%20Team%20Projects&item_number=AdrenalineBubbleManager¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
53 |
--------------------------------------------------------------------------------
/SCREENSHOOT1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/SCREENSHOOT1.png
--------------------------------------------------------------------------------
/SCREENSHOOT2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/SCREENSHOOT2.png
--------------------------------------------------------------------------------
/SCREENSHOOT3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ONElua/TrophyManager/788a988ad2ceb458327ae25a3ea969d64e36ad99/SCREENSHOOT3.png
--------------------------------------------------------------------------------
/version:
--------------------------------------------------------------------------------
1 | 16973824
--------------------------------------------------------------------------------