Skip to content

Commit 67baf86

Browse files
authored
Fix error when you do not have the games installed
Fixed error when you do not have the games installed: -Persona 4 Golden -Catherine -Alien Shooter
1 parent 0dc1caf commit 67baf86

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

AUTOPLUG2/scripts/psvita/aliendlc.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
AlienShooter = false
22

33
--Ckecking game Alien Shooter
4-
Alien = {
4+
AlienTB = {
55
{ id = "PCSE00445", region = "North America" },
66
{ id = "PCSB00561", region = "Europe" },
77
}
88

99
gamesAlien = {}
10-
for i=1,#Alien do
11-
if game.exists(Alien[i].id) then
10+
for i=1,#AlienTB do
11+
if game.exists(AlienTB[i].id) then
1212
AlienShooter = true
13-
table.insert(gamesAlien,Alien[i])
13+
table.insert(gamesAlien,AlienTB[i])
1414
end
1515
end
1616

1717
function AlienShooter_DLC_Unlocker()
1818

19-
if not AlienShooter then os.message(LANGUAGE["NO_ALIENSHOOTER_GAMES"]) end
19+
if not AlienShooter then os.dialog(LANGUAGE["NO_ALIENSHOOTER_GAMES"], LANGUAGE["MENU_PSVITA_AL_DLC_UNLOCKER"]) return end
2020

2121
local AlienShooter_ID = "ALIENDLC.png"
2222

@@ -54,7 +54,7 @@ function AlienShooter_DLC_Unlocker()
5454
if selector == i then
5555
draw.fillrect(xRoot,63,w,42, color.green:a(90))
5656
end
57-
screen.print(xRoot+(w/2), 75, gamesAlien[i].id, 1, color.white, color.blue, __ACENTER)
57+
screen.print(xRoot+(w/2), 75, gamesAlien[selector].id, 1, color.white, color.blue, __ACENTER)
5858
draw.fillrect(750,435,200,42, color.shine:a(25))
5959
screen.print(940,445,gamesAlien[selector].region,1,color.white,color.blue, __ARIGHT)
6060
xRoot += w
@@ -93,7 +93,7 @@ function AlienShooter_DLC_Unlocker()
9393
end
9494

9595
if buttonskey then buttonskey:blitsprite(10, 483, saccept) end
96-
screen.print(40, 485, LANGUAGE["MENU_INSTALL_INFO"], 1, color.white, color.black, __ALEFT)
96+
screen.print(40, 485, LANGUAGE["MENU_INSTALL_INFO"], 1, color.white, color.black, __ALEFT)
9797

9898
if buttonskey then buttonskey:blitsprite(10,518,scancel) end
9999
screen.print(40,522,LANGUAGE["STRING_BACK"],1,color.white,color.black, __ALEFT)

AUTOPLUG2/scripts/psvita/catherine.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if game.exists("PCSG01179") then Catherine = true end
88

99
function Catherine_HD()
1010

11-
if not Catherine then os.message(LANGUAGE["NO_CHATERINE_GAMES"]) end
11+
if not Catherine then os.dialog(LANGUAGE["NO_CHATERINE_GAMES"], LANGUAGE["INSTALL_CATHERINE_HD_TITLE"]) return end
1212

1313
local CATHERINE_ID = "CATHERINEHD.png"
1414

@@ -46,7 +46,9 @@ function Catherine_HD()
4646
if selector == i then
4747
draw.fillrect(xRoot,63,w,42, color.green:a(90))
4848
end
49-
screen.print(xRoot+(w/2), 75, CatherineTB[i].id, 1, color.white, color.blue, __ACENTER)
49+
screen.print(xRoot+(w/2), 75, CatherineTB[selector].id, 1, color.white, color.blue, __ACENTER)
50+
draw.fillrect(750,435,200,42, color.shine:a(25))
51+
screen.print(940,445, CatherineTB[selector].region, 1, color.white, color.blue, __ARIGHT)
5052
xRoot += w
5153
end
5254

@@ -112,6 +114,13 @@ function Catherine_HD()
112114
if scroll:down() then xscroll = 10 end
113115
end
114116

117+
--L/R
118+
if buttons.released.l or buttons.released.r then
119+
if buttons.released.l then selector -= 1 else selector += 1 end
120+
if selector > #CatherineTB then selector = 1
121+
elseif selector < 1 then selector = #CatherineTB end
122+
end
123+
115124
if buttons.accept then
116125

117126
local vbuff = screen.buffertoimage()
@@ -153,7 +162,7 @@ function Patch_Catherine_install(game,res)
153162
files.copy(path_plugins..res.path, path_tai)
154163

155164
tai.put(game.id, path_tai..res.path)
156-
ReloadConfig,change = true,true
165+
ReloadConfig = true
157166

158167
if back2 then back2:blit(0,0) end
159168
message_wait(LANGUAGE["INSTALLING_CATHERINE_HD_PATCH"].."\n\n"..res.res)

AUTOPLUG2/scripts/psvita/p4golden.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ end
2020

2121
function P4Golden_HD()
2222

23-
if not P4Golden then os.message(LANGUAGE["NO_P4GOLDEN_GAMES"]) end
23+
if not P4Golden then os.dialog(LANGUAGE["NO_P4GOLDEN_GAMES"], LANGUAGE["INSTALL_P4G_HD_TITLE"]) return end
2424

2525
local P4GOLDEN_ID = "PERSONA4GOLDENHD.png"
2626

@@ -59,7 +59,7 @@ function P4Golden_HD()
5959
if selector == i then
6060
draw.fillrect(xRoot,63,w,42, color.green:a(90))
6161
end
62-
screen.print(xRoot+(w/2), 75, gamesP4[i].id, 1, color.white, color.blue, __ACENTER)
62+
screen.print(xRoot+(w/2), 75, gamesP4[selector].id, 1, color.white, color.blue, __ACENTER)
6363
draw.fillrect(750,435,200,42, color.shine:a(25))
6464
screen.print(940,445,gamesP4[selector].region,1,color.white,color.blue, __ARIGHT)
6565
xRoot += w
@@ -183,7 +183,7 @@ function Patch_P4G_install(game,res)
183183
tai.del(game.id, "p4goldenhd_1280x720.suprx")
184184

185185
tai.put(game.id, path_tai..res.path)
186-
ReloadConfig,change = true,true
186+
ReloadConfig = true
187187

188188
if back2 then back2:blit(0,0) end
189189
message_wait(LANGUAGE["INSTALLING_P4G_HD_PATCH"].."\n\n"..res.res)

0 commit comments

Comments
 (0)