ScreenBranch

From SMTheming Wiki

Revision as of 22:10, 26 May 2010 by AJ 187 (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ScreenBranch is a StepMania 3.9-only screen used for branching purposes.

Contents

Metrics

As this is a conditional screen, the metrics can vary.

Name Value Type Explanation
Choices list of Strings Sets up names for Condition and NextScreen.
ConditionN Lua expression Sets up test for condition N. A list of valid conditionals and explanations can be found at Tutorials:Conditionals/StepMania 3.9.
NextScreenN screen,ScreenName Sets up screen for condition N. This metric must set screen, but you can also run other GameCommands (style, etc.) in here as well.

Sample Implementation

[ScreenBranchGameplay]
Class=ScreenBranch
Choices=1,2
Condition1=IsExtraStage() or IsExtraStage2()
Condition2=true
NextScreen1=screen,ScreenStageExtra
NextScreen2=screen,ScreenStage

Screen Messages

ScreenBranch handles the following message:

  • SM_GoToNextScreen

StepMania 4 replacement

To create branches in SM4, you usually make a function in the Scripts directory and point NextScreen/PrevScreen to that. An example of applying this to a ScreenSelectMaster:

{theme}/Scripts/BranchExample.lua
function GetSelectMusicScreen()
	return GAMESTATE:IsCourseMode() and "ScreenSelectCourse" or "ScreenSelectMusic"
end;
{theme}/Metrics.ini
[ScreenSelectMode]
# ...
Choice1="playmode,regular;screen,"..GetSelectMusicScreen()
Choice2="playmode,nonstop;screen,"..GetSelectMusicScreen()
# ...