StraightToSessionlist - shell utility mod

Started by Viathan, June 16, 2015, 03:32:09 PM

Previous topic - Next topic
Try to add ScriptCB_DoFile("ifs_swbfadmin") into your menu.
Ofc you have to replace swbfadmin with your scriptname (and add it to the first line if possible)

Quote from: -RepubliqueCmdr- on June 19, 2015, 04:06:24 PM
I dont suppose anyone has made a new ifs_screen before? I'm making a quick screen to experiment with.
Code as it stands:[spoiler=ifs_mods.lua]
Code (lua) Select
--Testing a new screen

function ifs_mods_fnBuildScreen(this)
local w,h = ScriptCB_GetSafeScreenInfo() -- of the usable screen
local aw,ah = ScriptCB_GetScreenInfo()
this.listbox = NewButtonWindow
{ ZPos = 200, x=0, y = 0,
ScreenRelativeX = 0.5, -- center
ScreenRelativeY = 0.5,
width = w/2,
height = h/2,
titleText = "Mod Manager",
--rotY = -35,
}
this.buttons = NewIFContainer {
ScreenRelativeX = 0.3, -- center
ScreenRelativeY = 0.5, -- center
y = 0,
--rotY =35
}

local TestButtonW = 100
local TestButtonH = 25
this.testbutton = NewIFContainer
{
ScreenRelativeX = 1.0, -- right
ScreenRelativeY = 1.0, -- bottom
y = -15, -- just above bottom
x = -TestButtonW + 25,
btn = NewClickableIFButton -- NewRoundIFButton
{
btnw = TestButtonW,
btnh = TestButtonH,
font = "gamefont_medium",
--bg_width = BackButtonW,
bg_xflipped = 1,
nocreatebackground = 1,
tag = "Test Button",

}, -- end of btn
}

--RoundIFButtonLabel_fnSetString(this.testbutton.btn,"Test Button")
end


ifs_mods_fnBuildScreen( ifs_mods )
ifs_mods_fnBuildScreen = nil

AddIFScreen(ifs_mods,"ifs_mods")
[/spoiler]
I already have the button in the main menu, but pushing to this screen on the event of it's click causes a crash does nothing (I fixed the crash)..
Quote from: Viathan on June 20, 2015, 12:53:14 AM
Try to add ScriptCB_DoFile("ifs_swbfadmin") into your menu.
Ofc you have to replace swbfadmin with your scriptname (and add it to the first line if possible)

yes I have several new pages in my shell.lvl, it's best to add the ScriptCB_DoFile line directly to the shell_interface.lua, as well as the shell.req, and then call on it using pushscreen from your chosen menu.

example

-- unlockables
ScriptCB_DoFile("ifs_unlockables")
ScriptCB_DoFile("ifs_tutorials")
ScriptCB_DoFile("ifs_credits")

---- custom shell scripts by phobos
---- Load custom scripts into memory
ScriptCB_DoFile("shell_skin") ---- shell skin changer
ScriptCB_DoFile("ifs_jwc") ---- jet wars campaign credits
ScriptCB_DoFile("ifs_zom") ---- zombie conquest menu

June 20, 2015, 11:54:50 AM #17 Last Edit: June 20, 2015, 12:07:08 PM by -RepubliqueCmdr-
Cool thanks.. Testing now.
I wish LUA had better binary functions, it would make format reading much easier.

edit- Still cant seem to get the code to take me to the page. At least it doesn't crash.

Sorry mate.
Can't fix your script, I'm not a pro in Lua. But maybe you try using a template from another script...  :confused: