ScreenSelectProfile manages selection of profiles for gameplay. Most of the interactions done in this screen are done via Lua, interfaced with some dedicated functions provided by the engine.
The ScreenSelectProfile screen from Soundwaves.
The following are the metrics that this screen uses (from _fallback
):
Fallback="ScreenWithMenuElements"
Class="ScreenSelectProfile"
LoginScreenName="ScreenOutFoxOnlineLoginFromSelect"
#
ScreenOnCommand=%function(self) self:lockinput(1); end;
#
NextScreen=Branch.AfterSelectProfile()
PrevScreen=Branch.TitleMenu()
StartScreen=Branch.AfterSelectProfile()
#
TimerSeconds=30
LockInputSecs=0.35
#
CodeNames=SelectProfileKeys()
CodeUp="+MenuUp"
CodeUp2="+Up"
CodeUp3="+MenuLeft"
CodeUp4="+Left"
CodeDown="+MenuDown"
CodeDown2="+Down"
CodeDown3="+MenuRight"
CodeDown4="+Right"
CodeStart="+Start"
CodeBack="Back"
CodeCenter="Center"
CodeDownLeft="DownLeft"
CodeDownRight="DownRight"
If the client is connected to OutFox Online, upon making a selection and calling Finish()
, the engine will verify if the selected profiles are eligible for automatic login.
If a selected profile is not eligible (a.k.a they don't have a token assigned to them), if they have the "Allow Guest Profiles" option enabled on ScreenNetworkOptions, the game will automatically overwrite the NextScreen to the value of LoginScreenName
.
These functions belong to the Screen, so to access them, you'll need to get the Screen object via SCREENMAN:GetTopScreen()
.
Sets the profile for the player pn
with the index index
.
-- This will set the first profile available to Player 1.
SCREENMAN:GetTopScreen():SetProfileIndex(PLAYER_1, 0)
Gets the profile index (int
) that the current player has.
local ind = SCREENMAN:GetTopScreen():GetProfileIndex(PLAYER_1)
Trace("Player 1's index is ".. ind)
Tells the screen that we're with profile selection, and must start performing load operations. This command can end up as a no-op if certain conditions are met:
SCREENMAN:GetTopScreen():Finish()
Cancels operation and backs out from the screen.
SCREENMAN:GetTopScreen():Cancel()