Ok, we've been down this road before, and it's probably about 10 years too late, but I'm here to tell you how to add NEW screens through the addon folder.
I have attached the demo in the attachments on this post. This is what we are using for "Week 1" of the SWBF1 Speedruns challenges.
I didn't copy my code straight up but you can copy that section from ifs_sp, and then modify one of the fields, like add a button to the list, you should be able to modify the screen accordingly.
After this, you can then save and munge your addme.lua file.
You're then going to create a folder in addon (I use challenge) then just drop it in there.
There's plenty of extensibility too... obviously I wouldn't recommend locking people out of screens, but using it for modification. It's a much slimmer way to modify (or create new) screens we already have WITHOUT a total conversion mod. As you can see from my attachment, it's 3 KB to add A WHOLE NEW (very basic) MODE
In a future episode, we will be talking about how to tie more screens together and make the script extremely generic for your purposes. This way is the "hard-coded way" which is really convenient for one or two screens, but we can leverage some ScriptCB_SetDCMap() calls to go even further.
I have attached the demo in the attachments on this post. This is what we are using for "Week 1" of the SWBF1 Speedruns challenges.
- You need to modify how the ifs_movietrans_PushScreen() function works.
- You need to define a new screen in the addme.lua file
Code Select
--Original concept by BAD_AL, modified by Dark_Phantom
--This modifies the ifs_movietrans_PushScreen function, or more accurately, catches one situation where we want to switch the screen.
origMovieTrans = ifs_movietrans_PushScreen
ifs_movietrans_PushScreen = function(screenName)
if( screenName == ifs_sp ) then --THIS IS NOT A STRING
--ScriptCB_PushScreen("ifs_sp2") --you can use this to just push the new screen if you don't have a movie transition
origMovieTrans(ifs_sp2)
else
origMovieTrans(screenName)
end
end
--Now we add the new screen...
ifs_sp2_vbutton_layout = {
--...
}
ifs_sp2 = NewIFShellScreen {
--...
}
ifs_sp2.CurButton = AddVerticalButtons(ifs_sp2.buttons,ifs_sp2_vbutton_layout)
AddIFScreen(ifs_sp2,"ifs_sp2")
I didn't copy my code straight up but you can copy that section from ifs_sp, and then modify one of the fields, like add a button to the list, you should be able to modify the screen accordingly.
After this, you can then save and munge your addme.lua file.
You're then going to create a folder in addon (I use challenge) then just drop it in there.
There's plenty of extensibility too... obviously I wouldn't recommend locking people out of screens, but using it for modification. It's a much slimmer way to modify (or create new) screens we already have WITHOUT a total conversion mod. As you can see from my attachment, it's 3 KB to add A WHOLE NEW (very basic) MODE
In a future episode, we will be talking about how to tie more screens together and make the script extremely generic for your purposes. This way is the "hard-coded way" which is really convenient for one or two screens, but we can leverage some ScriptCB_SetDCMap() calls to go even further.