Skip to content

Commit

Permalink
Some changes and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ONElua authored Dec 24, 2024
1 parent 0326bf0 commit 6d75459
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 25 deletions.
50 changes: 50 additions & 0 deletions ONEMenuVita/addons/stars.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--[[
ONEMenu
Application, themes and files manager.
Licensed by Creative Commons Attribution-ShareAlike 4.0
http://creativecommons.org/licenses/by-sa/4.0/
Designed By Gdljjrod & DevDavisNunez.
Collaborators: BaltazaR4 & Wzjk.
]]

--[[
Particles FX library.
Draw a shower of particles.
Licensed by GNU General Public License v3.0
Designed By:
- DevDavisNunez (https://twitter.com/DevDavisNunez).
]]

stars = {math={}} -- module stars! :D

function stars.init(c)
math.randomseed(os.clock())
--stars.obj = image.new(3,3,c or color.new(255,255,255))
stars.color = c or color.new(255,255,255)
for i=1,100 do
stars.math[i] = {x=math.random(0,960), y=math.random(0,544), s=(math.random(0,3)+math.random(0,2)), a=math.random(0,255)}
end
end

function stars.render()
for i=1,100 do
stars.math[i].y+=stars.math[i].s
stars.math[i].a-=1
if stars.math[i].y>=544 then
stars.math[i].x=math.random(0,960)
stars.math[i].y=0
end
if stars.math[i].a<=0 then
stars.math[i].a=255
end
--stars.obj:blit(stars.math[i].x, stars.math[i].y,stars.math[i].a)
draw.circle(stars.math[i].x, stars.math[i].y, 3, stars.color:a(stars.math[i].a))
end
end

stars.init(color.white)
Binary file modified ONEMenuVita/eboot.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion ONEMenuVita/git/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ APP_PROJECT = "ONEMenu-for-PSVita"
APP_VPK = "ONEMenuVita"

APP_VERSION_MAJOR = 0x03 -- major.minor
APP_VERSION_MINOR = 0x19
APP_VERSION_MINOR = 0x20

APP_VERSION = ((APP_VERSION_MAJOR << 0x18) | (APP_VERSION_MINOR << 0x10)) -- Union Binary
32 changes: 30 additions & 2 deletions ONEMenuVita/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,44 @@ end
function Scanning()

-- Init with Max CPU/GPU
__CPU = os.cpu()
--__CPU = os.cpu()
--os.cpu(444)
__GPU = os.gpuclock()
--__GPU = os.gpuclock()
-- os.gpuclock(166)

--id, type, version, dev, path, title
local list_tmp = game.list(__GAME_LIST_ALL)
table.sort(list_tmp,SortSdkId)

local list = {}

--[[
--Detected gamecard
if files.exists("gro0:") then
local device_info = os.devinfo("gro0:")
if device_info then
local listf = files.listdirs("gro0:app")
if listf then
local sfo = game.info(listf[1].path.."/sce_sys/param.sfo")
if sfo then
res = game.details(sfo.ID)
if res then
os.message(" version :"..res.version.." sdk: "..res.sdk)
else
os.message("no detecta game.details")
end
end
-- table.insert(list,
-- { id = sfo.TITLE_ID or listf[1].name, type = sfo.CATEGORY, version = sfo.APP_VER, dev = "gro0", path = listf[1].path, title = sfo.TITLE,
-- sdk = sfo.TITLE_ID }
-- )
end
end
end
]]

for i=1,#list_tmp do
if files.exists(list_tmp[i].path) then
if list_tmp[i].title then list_tmp[i].title = list_tmp[i].title:gsub("\n"," ") end
Expand Down
4 changes: 2 additions & 2 deletions ONEMenuVita/sce_sys/livearea/contents/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
<frame id="frame3">
<liveitem>
<text align="left" text-align="left" word-wrap="off" ellipsis="on">
<str size="26" color="#ffffff" shadow="on">v3.19</str>
<str size="26" color="#ffffff" shadow="on">v3.20</str>
</text>
</liveitem>
</frame>

<frame id="frame4">
<liveitem>
<text valign="top" align="left" text-align="left" text-valign="top" line-space="2" ellipsis="on">
<str size="22" shadow="on">gdljjrod Team ONElua® - ONElua.x10.mx - 2023</str>
<str size="22" shadow="on">gdljjrod Team ONElua® - ONElua.x10.mx - 2024</str>
</text>
</liveitem>
</frame>
Expand Down
Binary file modified ONEMenuVita/sce_sys/param.sfo
Binary file not shown.
6 changes: 6 additions & 0 deletions ONEMenuVita/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ if __UPDATE == 1 then
dofile("git/updater.lua")
end

day = tonumber(os.date("%d"))
month = tonumber(os.date("%m"))
snow = false
if (month == 12 and (day >= 20 and day <= 25)) then snow = true end
dofile("addons/stars.lua")

dofile("system/scroll.lua")

-- Load Theme Application
Expand Down
2 changes: 2 additions & 0 deletions ONEMenuVita/system/appmanager/appman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ function appman.launch()
touch.read()
swipe.read()

if snow then stars.render() end

while IMAGE_PORT_I:available() > 0 do -- While have availables request.
local entry = IMAGE_PORT_I:pop() -- Recibimos peticiones..
if static_void[entry.y][entry.x].path_img == entry.path then -- Check ident
Expand Down
2 changes: 1 addition & 1 deletion ONEMenuVita/system/appmanager/appsystem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function system.run()
while true do
buttons.read()
touch.read()

if snow then stars.render() end
if pic1_sys then

if crono_alpha < 155 then
Expand Down
2 changes: 2 additions & 0 deletions ONEMenuVita/system/appmanager/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ function main_draw()
if theme.data["back"] then theme.data["back"]:blit(0,0) end
end

if snow then stars.render() end

for i=appman[cat].scroll.ini,appman[cat].scroll.lim do

if i==appman[cat].scroll.sel then
Expand Down
2 changes: 1 addition & 1 deletion ONEMenuVita/system/appmanager/system.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function SubSystem()
while true do
buttons.read()
if theme.data["back"] then theme.data["back"]:blit(0,0) end

if snow then stars.render() end
draw.fillrect(0,0,960,544,color.black:a(105))

screen.print(480,15,STRINGS_SUBMENU_TITLE,1,theme.style.TITLECOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
Expand Down
11 changes: 6 additions & 5 deletions ONEMenuVita/system/explorer/callbacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ end

-- CallBack Extraction
function onExtract7zFiles(filename,size,num,numfiles)

if bufftmp then bufftmp:blit(0,0) elseif theme.data["list"] then theme.data["list"]:blit(0,0) end
if theme.data["list"] then theme.data["list"]:blit(0,0) end
-- if bufftmp then bufftmp:blit(0,0) elseif theme.data["list"] then theme.data["list"]:blit(0,0) end
draw.fillrect(0,0,__DISPLAYW,30, theme.style.CBACKSBARCOLOR)

if explorer.dst then
Expand All @@ -104,8 +104,8 @@ function onExtract7zFiles(filename,size,num,numfiles)
end

function onExtractFiles(size,written,file,totalsize,totalwritten)

if bufftmp then bufftmp:blit(0,0) elseif theme.data["list"] then theme.data["list"]:blit(0,0) end
if theme.data["list"] then theme.data["list"]:blit(0,0) end
-- if bufftmp then bufftmp:blit(0,0) elseif theme.data["list"] then theme.data["list"]:blit(0,0) end
draw.fillrect(0,0,__DISPLAYW,30, theme.style.CBACKSBARCOLOR)

if explorer.dst then
Expand Down Expand Up @@ -163,7 +163,8 @@ function onCompressZip(size,written,file)
end

function onScanningFiles(file,unsize,position,unsafe)
if bufftmp then bufftmp:blit(0,0) elseif theme.data["list"] then theme.data["list"]:blit(0,0) end
if theme.data["list"] then theme.data["list"]:blit(0,0) end
-- if bufftmp then bufftmp:blit(0,0) elseif theme.data["list"] then theme.data["list"]:blit(0,0) end
draw.fillrect(0,0,__DISPLAYW,30, theme.style.CBACKSBARCOLOR)

local ccc=color.white
Expand Down
7 changes: 5 additions & 2 deletions ONEMenuVita/system/explorer/commons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,11 @@ function show_msg_pbp(handle)
screen.print(960/2,y+40,tostring(sfo.TITLE) or "UNK",1,theme.style.TXTCOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
end
screen.print(960/2,y+60,tostring(sfo.DISC_ID) or tostring(sfo.TITLE_ID),1,theme.style.TXTCOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
if sfo.CATEGORY then
screen.print(960/2,y+80,tostring(sfo.CATEGORY) or "UNK",1,theme.style.TXTCOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
if sfo.CATEGORY then
screen.print(960/2,y+80,tostring(sfo.CATEGORY) or "UNK",1,theme.style.TXTCOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
end
if sfo.APP_VER then
screen.print(960/2,y+100,tostring(sfo.APP_VER) or "UNK",1,theme.style.TXTCOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
end
end

Expand Down
15 changes: 10 additions & 5 deletions ONEMenuVita/system/explorer/customthemes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ function customthemes()
while i > 0 do
if list[i].id:sub(1,9) != "ux0:/theme" then
list[i].info = themes.info(list[i].id.."/".."theme.xml")
if list[i].home then
list[i].preview = image.load(list[i].id.."/"..list[i].home)
if list[i].preview then
list[i].preview:resize(252,151)
if list[i].info then
if list[i].home then
list[i].preview = image.load(list[i].id.."/"..list[i].home)
if list[i].preview then
list[i].preview:resize(252,151)
end
end
else
themes.delete(list[i].id)
table.remove(list,i)
end
else
table.remove(list,i)
Expand All @@ -46,7 +51,7 @@ function customthemes()
while true do

buttons.read()

if snow then stars.render() end
if themesimg then themesimg:blit(0,0) elseif theme.data["back"] then theme.data["back"]:blit(0,0) end

screen.print(480,15,STRINGS_CUSTOMTHEMES_TITLE,1,theme.style.TITLECOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
Expand Down
8 changes: 4 additions & 4 deletions ONEMenuVita/system/explorer/explorer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function show_explorer_list(first_path)

buttons.read()
if theme.data["list"] then theme.data["list"]:blit(0,0) end

if snow then stars.render() end
movx = menu_ctx.x + menu_ctx.w

if screen.textwidth(Root[Dev] or "",1) > 860 then
Expand Down Expand Up @@ -382,16 +382,16 @@ function handle_files(cnt)
show_scan(cnt)
elseif extension == "mp3" or extension == "wav" or extension == "ogg" then
MusicPlayer(cnt)
elseif extension == "txt" or extension == "lua" or extension == "ini" or extension == "sfo" or extension == "xml" or extension == "inf" or extension == "cfg" or extension == "lpl" then
elseif extension == "txt" or extension == "psv" or extension == "lua" or extension == "ini" or extension == "sfo" or extension == "xml" or extension == "inf" or extension == "cfg" or extension == "lpl" then
visortxt(cnt,true)
elseif extension == "mp4" then
VideoPlayer(cnt)
end
if extension == "pbp" or extension == "iso" or extension == "cso" or extension == "bin" then
show_msg_pbp(cnt)
end
if (extension == "md" or extension == "bin") and game.exists("RETROVITA") then
--launch_Retrovita("RETROVITA",sega,cnt)
if extension == "md" and game.exists("RETROVITA") then
launch_Retrovita("RETROVITA",sega,cnt)
end


Expand Down
2 changes: 1 addition & 1 deletion ONEMenuVita/system/explorer/system.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function SubSystem2()
while true do
buttons.read()
if theme.data["back"] then theme.data["back"]:blit(0,0) end

if snow then stars.render() end
draw.fillrect(0,0,960,544,color.black:a(105))

screen.print(480,15,STRINGS_SUBMENU_TITLE,1,theme.style.TITLECOLOR,theme.style.TXTBKGCOLOR,__ACENTER)
Expand Down
2 changes: 1 addition & 1 deletion ONEMenuVita/system/themes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function theme.manager()
while true do
buttons.read()
if themesimg then themesimg:blit(0,0) elseif theme.data["back"] then theme.data["back"]:blit(0,0) end

if snow then stars.render() end
screen.print(480,15,({STRINGS_SUBMENU_THEMES, STRINGS_THEMES_ONLINE })[sect],1,theme.style.TITLECOLOR,color.gray,__ACENTER)
local y = 70
for i=scr[sect].ini,scr[sect].lim do
Expand Down

0 comments on commit 6d75459

Please sign in to comment.