Didn't wait long after I gave my permission, eh? A good start, though.
Ah, so you added duration. However, why did you add a
j variable? Oh, because things are out of sync with what you did, so you used an extra variable to make up for that.
Turning MsgDuration into a table is fine. Though, now looking over my old code prior to your changes, I see a few things I could fix up a little...
function NewMsg(Index)
MsgTmr= MsgDuration[Index]
Line[1]= L1[Index]
Line[2]= L2[Index]
Line[3]= L3[Index]
MY= y[Index]
end
function DispMsg()
if MsgTmr > 0 then
MsgTmr= MsgTmr - 1
for n= 1, 3 do
if Line[n] then
gui.text(MX,MY+9*(n-1),Line[n])
end
end
end
end
while t[i] do
if t[i] <= movie.framecount() then
NewMsg(i)
i= i+1
end
DispMsg()
snes9x.frameadvance()
end
Just find the proper spot for these to replace older code, get rid of all the j variables, and you'll be on your way. Additionally, defining empty strings are now optional.
In any case, it's slightly less messy and a little easier to make future changes if any are needed.
I haven't been following any progress here, due to the fact it would involve tracking down the ROM, but seeing these subtitles makes me want to see what's going on now.
Perhaps I should add a little something to make it load-state stable... Stick this somewhere before all the text, and hopefully it'll work.
function FindIndex()
MsgTmr= 0
i= 1
while t[i] and (t[i] < movie.framecount()) do
i= i+1
end
end
savestate.registerload(FindIndex)