The undo queue for a player. The term item_index refers to the index of an undo item in the queue, while action_index refers to the index of one of the individual actions that make up an undo item.
Items are added to the undo queue through player actions and Lua methods that emulate player actions like LuaEntity::order_upgrade.
uint32unknownfalseThe index of the player to whom this stack belongs to.
booleanunknownfalseIs this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
stringunknownfalseThe class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
LuaUndoRedoStack.get_undo_item(index: uint32) -> Array<UndoRedoAction>
undoRedoStack.get_undo_item(index)
takes_table: falsetable_optional: falseGets an undo item from the undo stack.
index: uint32 — The index of the undo item to get, ordered from most recent to oldest.Array<UndoRedoAction>LuaUndoRedoStack.get_undo_item_count() -> uint32
undoRedoStack.get_undo_item_count()
takes_table: falsetable_optional: falseThe number undo items in the undo stack.
uint32LuaUndoRedoStack.remove_undo_item(index: uint32)
undoRedoStack.remove_undo_item(index)
takes_table: falsetable_optional: falseRemoves an undo item from the undo stack.
index: uint32 — The index of the undo item to remove, ordered from most recent to oldest.LuaUndoRedoStack.remove_undo_action(item_index: uint32, action_index: uint32)
undoRedoStack.remove_undo_action(item_index, action_index)
takes_table: falsetable_optional: falseRemoves an undo action from the specified undo item on the undo stack.
item_index: uint32 — The index of the undo item to change, ordered from most recent to oldest.action_index: uint32 — The index of the undo action to remove.LuaUndoRedoStack.get_redo_item(index: uint32) -> Array<UndoRedoAction>
undoRedoStack.get_redo_item(index)
takes_table: falsetable_optional: falseGets an undo item from the redo stack.
index: uint32 — The index of the item to get, ordered from most recent to oldest.Array<UndoRedoAction>LuaUndoRedoStack.get_redo_item_count() -> uint32
undoRedoStack.get_redo_item_count()
takes_table: falsetable_optional: falseThe number of undo items in the redo stack.
uint32LuaUndoRedoStack.remove_redo_item(index: uint32)
undoRedoStack.remove_redo_item(index)
takes_table: falsetable_optional: falseRemoves an undo item from the redo stack.
index: uint32 — The index of the undo item to remove, ordered from most recent to oldest.LuaUndoRedoStack.remove_redo_action(item_index: uint32, action_index: uint32)
undoRedoStack.remove_redo_action(item_index, action_index)
takes_table: falsetable_optional: falseRemoves an undo action from the specified undo item on the redo stack.
item_index: uint32 — The index of the undo item to change, ordered from most recent to oldest.action_index: uint32 — The index of the undo action to remove.LuaUndoRedoStack.get_undo_tags(item_index: uint32, action_index: uint32) -> Tags
undoRedoStack.get_undo_tags(item_index, action_index)
takes_table: falsetable_optional: falseGets all tags for the given undo action.
item_index: uint32 — The index of the undo item, ordered from most recent to oldest.action_index: uint32 — The index of the undo action.TagsLuaUndoRedoStack.get_undo_tag(item_index: uint32, action_index: uint32, tag_name: string) -> AnyBasic
undoRedoStack.get_undo_tag(item_index, action_index, tag_name)
takes_table: falsetable_optional: falseGets the tag with the given name from a specific undo item action, or nil if it doesn't exist.
item_index: uint32 — The index of the undo item, ordered from most recent to oldest.action_index: uint32 — The index of the undo action.tag_name: string — The name of the tag to get.AnyBasicLuaUndoRedoStack.set_undo_tag(item_index: uint32, action_index: uint32, tag_name: string, tag: AnyBasic)
undoRedoStack.set_undo_tag(item_index, action_index, tag_name, tag)
takes_table: falsetable_optional: falseSets a new tag with the given name and value on the specified undo item action.
item_index: uint32 — The index of the undo item, ordered from most recent to oldest.action_index: uint32 — The index of the undo action.tag_name: string — The name of the tag to set.tag: AnyBasic — The contents of the new tag.LuaUndoRedoStack.remove_undo_tag(item_index: uint32, action_index: uint32, tag: string) -> boolean
undoRedoStack.remove_undo_tag(item_index, action_index, tag)
takes_table: falsetable_optional: falseRemoves a tag with the given name from the specified undo item.
item_index: uint32 — The index of the undo item, ordered from most recent to oldest.action_index: uint32 — The index of the undo action.tag: string — The name of the tag to remove.boolean — Whether the tag existed and was successfully removed.LuaUndoRedoStack.get_redo_tags(item_index: uint32, action_index: uint32) -> Tags
undoRedoStack.get_redo_tags(item_index, action_index)
takes_table: falsetable_optional: falseGets all tags for the given redo action.
item_index: uint32 — The index of the redo item, ordered from most recent to oldest.action_index: uint32 — The index of the redo action.TagsLuaUndoRedoStack.get_redo_tag(item_index: uint32, action_index: uint32, tag_name: string) -> AnyBasic
undoRedoStack.get_redo_tag(item_index, action_index, tag_name)
takes_table: falsetable_optional: falseGets the tag with the given name from a specific redo item action, or nil if it doesn't exist.
item_index: uint32 — The index of the redo item, ordered from most recent to oldest.action_index: uint32 — The index of the redo action.tag_name: string — The name of the tag to get.AnyBasicLuaUndoRedoStack.set_redo_tag(item_index: uint32, action_index: uint32, tag_name: string, tag: AnyBasic)
undoRedoStack.set_redo_tag(item_index, action_index, tag_name, tag)
takes_table: falsetable_optional: falseSets a new tag with the given name and value on the specified redo item action.
item_index: uint32 — The index of the redo item, ordered from most recent to oldest.action_index: uint32 — The index of the redo action.tag_name: string — The name of the tag to set.tag: AnyBasic — The contents of the new tag.LuaUndoRedoStack.remove_redo_tag(item_index: uint32, action_index: uint32, tag: string) -> boolean
undoRedoStack.remove_redo_tag(item_index, action_index, tag)
takes_table: falsetable_optional: falseRemoves a tag with the given name from the specified redo item.
item_index: uint32 — The index of the redo item, ordered from most recent to oldest.action_index: uint32 — The index of the redo action.tag: string — The name of the tag to remove.boolean — Whether the tag existed and was successfully removed.