KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Member Functions | Public Attributes | List of all members
TutorialScenario.TutorialPage Class Reference

TutorialPages are the states in the TutorialFSM finite state machine. They extend the KFSMState class, which represents a class in a more general finite state machine, to add tutorial-related features like a Callback in which you draw the GUI of the tutorial page. More...

Inheritance diagram for TutorialScenario.TutorialPage:
KFSMState

Public Member Functions

 TutorialPage (string name)
 Create a new tutorial page with a given name. Note that the name of the page is distinct from its title. More...
 
void SetAdvanceCondition (KFSMEventCondition condition)
 You can call this function and pass to it a function that takes a KFSMState and returns a boolean. That function will be called every update cycle while this tutorial page is active. If the function ever returns true, the tutorial will automatically advance to the next page. More...
 
- Public Member Functions inherited from KFSMState
 KFSMState (string name)
 Create a new KFSMState with a given name. More...
 
void AddEvent (KFSMEvent ev)
 Add an event (possible transition) to this state. More...
 
bool IsValid (KFSMEvent ev)
 Whether the given event can be triggered from this state. An event must be added to a state before it can be triggered from that state. More...
 
override string ToString ()
 

Public Attributes

KFSMEvent onAdvanceConditionMet
 Presumably, this KFSMEvent will be triggered when the function you passed to SetAdvanceCondition returns true. This should give you the opportunity to go to a page besides the default next page when the advance condition is met. More...
 
Callback OnDrawContent
 Assign this Callback to a function that uses GUILayout to draw the GUI of this tutorial page. Whatever you do here gets draw inside the tutorial window, next to the picture of the Kerbal instructor. More...
 
KFSMEvent onStepBack
 Is this event triggered when GoToLastPage is called? Perhaps it gives you a chance to go to a page besides the default previous page? More...
 
string windowTitle
 The title displayed for this page. More...
 
- Public Attributes inherited from KFSMState
int FrameCountAtStateEnter
 
string name
 The name of this state. More...
 
KFSMStateChange OnEnter
 You can assign to this field a delegate that takes a KFSMState (which will be this state). The delegate will be called when the state machine enters this state. More...
 
KFSMCallback OnFixedUpdate
 You can assign a delegate to this field, and the delegate will be called during each FixedUpdate while the state machine is in this state. More...
 
KFSMCallback OnLateUpdate
 You can assign a delegate to this field, and the delegate will be called during each LateUpdate while the state machine is in this state. More...
 
KFSMStateChange OnLeave
 You can assign to this field a delegate that takes a KFSMState. The delegate will be called when the state machine leaves this state, and the argument passed to the delegate will be the new state that the machine is transitioning to. More...
 
KFSMCallback OnUpdate
 You can assign a delegate to this field, and the delegate will be call during each Update while the state machine is in this state. More...
 
double TimeAtStateEnter
 
KFSMUpdateMode updateMode
 

Additional Inherited Members

- Protected Attributes inherited from KFSMState
List< KFSMEventstateEvents
 
- Properties inherited from KFSMState
List< KFSMEventStateEvents [get]
 The set of events that are valid for this state (i.e., the possible transitions from this state). More...
 

Detailed Description

TutorialPages are the states in the TutorialFSM finite state machine. They extend the KFSMState class, which represents a class in a more general finite state machine, to add tutorial-related features like a Callback in which you draw the GUI of the tutorial page.

See also
KFSMState

Constructor & Destructor Documentation

TutorialScenario.TutorialPage.TutorialPage ( string  name)

Create a new tutorial page with a given name. Note that the name of the page is distinct from its title.

Parameters
nameThe name of the new page.

Member Function Documentation

void TutorialScenario.TutorialPage.SetAdvanceCondition ( KFSMEventCondition  condition)

You can call this function and pass to it a function that takes a KFSMState and returns a boolean. That function will be called every update cycle while this tutorial page is active. If the function ever returns true, the tutorial will automatically advance to the next page.

Parameters
condition

Member Data Documentation

KFSMEvent TutorialScenario.TutorialPage.onAdvanceConditionMet

Presumably, this KFSMEvent will be triggered when the function you passed to SetAdvanceCondition returns true. This should give you the opportunity to go to a page besides the default next page when the advance condition is met.

Callback TutorialScenario.TutorialPage.OnDrawContent

Assign this Callback to a function that uses GUILayout to draw the GUI of this tutorial page. Whatever you do here gets draw inside the tutorial window, next to the picture of the Kerbal instructor.

KFSMEvent TutorialScenario.TutorialPage.onStepBack

Is this event triggered when GoToLastPage is called? Perhaps it gives you a chance to go to a page besides the default previous page?

string TutorialScenario.TutorialPage.windowTitle

The title displayed for this page.


The documentation for this class was generated from the following file: