Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Expansions.Missions.Editor.MissionEditorHistory Class Reference
Inheritance diagram for Expansions.Missions.Editor.MissionEditorHistory:

Classes

class  ActionStack
 Custom implementation of a stack based on a list More...
 
class  HistoryAction
 Action data holder class More...
 

Public Member Functions

delegate void ActionCallback (ConfigNode data, HistoryType type)
 

Static Public Member Functions

static void Clear ()
 Clear the editor history More...
 
static void PushUndoAction (IMEHistoryTarget target, ActionCallback callback)
 Creates a new undo action for the supplied target state More...
 
static void PushUndoAction (IMEHistoryTarget target, ActionCallback callback, bool destroyOnClear, params MonoBehaviour[] destroyTargets)
 Creates a new undo action for the supplied target state More...
 
static void Redo ()
 Redoes the last action undone in the history More...
 
static void Undo ()
 Undoes the last action stored in the history More...
 

Protected Member Functions

void ClearRedoActions ()
 Deletes all the redo history More...
 

Protected Attributes

ActionStack RedoActions
 
ActionStack UndoActions
 

Properties

bool ActionInProgress [get, set]
 
static bool HasHistory [get]
 Are there undo actions on the stack More...
 
static System.Guid HistoryStateId [get, set]
 The current position in the list of actions. More...
 
static MissionEditorHistory Instance [get, set]
 Class singleton instance More...
 

Member Function Documentation

delegate void Expansions.Missions.Editor.MissionEditorHistory.ActionCallback ( ConfigNode  data,
HistoryType  type 
)
static void Expansions.Missions.Editor.MissionEditorHistory.Clear ( )
inlinestatic

Clear the editor history

void Expansions.Missions.Editor.MissionEditorHistory.ClearRedoActions ( )
inlineprotected

Deletes all the redo history

static void Expansions.Missions.Editor.MissionEditorHistory.PushUndoAction ( IMEHistoryTarget  target,
ActionCallback  callback 
)
inlinestatic

Creates a new undo action for the supplied target state

(When the action is performed it will call the supplied ActionCallback to handle the state restore)

NOTE: All actions pushed in the same frame are merged into a single action

Parameters
target
callbackCallback delegate that gets triggered to undo this action
static void Expansions.Missions.Editor.MissionEditorHistory.PushUndoAction ( IMEHistoryTarget  target,
ActionCallback  callback,
bool  destroyOnClear,
params MonoBehaviour[]  destroyTargets 
)
inlinestatic

Creates a new undo action for the supplied target state

(When the action is performed it will call the supplied ActionCallback to handle the state restore)

This also clean ups the Redo history as every new action creates a new history path that overrides anything that could be restored before the action was performed. NOTE: All actions pushed in the same frame are merged into a single action

Parameters
target
callbackCallback delegate that gets triggered to undo this action
destroyOnClearIndicates whatever the target object should be destroyed if the redo history gets overridden
destroyTargetsIndicates the objects that should be clean as part of this, if this list is empty the target object will be destroyed instead
static void Expansions.Missions.Editor.MissionEditorHistory.Redo ( )
inlinestatic

Redoes the last action undone in the history

static void Expansions.Missions.Editor.MissionEditorHistory.Undo ( )
inlinestatic

Undoes the last action stored in the history

Member Data Documentation

ActionStack Expansions.Missions.Editor.MissionEditorHistory.RedoActions
protected
ActionStack Expansions.Missions.Editor.MissionEditorHistory.UndoActions
protected

Property Documentation

bool Expansions.Missions.Editor.MissionEditorHistory.ActionInProgress
getset
bool Expansions.Missions.Editor.MissionEditorHistory.HasHistory
staticget

Are there undo actions on the stack

System.Guid Expansions.Missions.Editor.MissionEditorHistory.HistoryStateId
staticgetset

The current position in the list of actions.

This pushed onto the stack whenever an action is pushed and a new number generated. When applying undo/redos the id is updated with the one from the applied action Used by Builder to tell when the state of the Mission is the same as when it was saved

MissionEditorHistory Expansions.Missions.Editor.MissionEditorHistory.Instance
staticgetset

Class singleton instance


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