Factorio Prototype DocsVersion 2.0.26

ShortcutPrototype 'shortcut' changedExample code

Definition for a shortcut button in the shortcut bar.

This is not a custom keybinding (keyboard shortcut), for that see CustomInputPrototype.

Inherits from Prototype « PrototypeBase

Properties

action :: "toggle-alt-mode" or "undo" or "copy" or "cut" or "paste" or "import-string" or "toggle-personal-roboport" or "toggle-equipment-movement-bonus" or "spawn-item" or "lua"

If this is "lua", on_lua_shortcut is raised when the shortcut is clicked.

If this is "lua", on_lua_shortcut is raised when the shortcut is clicked.

iconsnew optional :: array[IconData]

Can't be an empty array.

Can't be an empty array.

iconchanged optional :: FileName

Path to the icon file. [...]

Path to the icon file. [...]

icon_sizenew optional :: SpriteSizeType

The size of the square icon, in pixels. [...]

The size of the square icon, in pixels. [...]

small_iconsnew optional :: array[IconData]

Can't be an empty array.

Can't be an empty array.

small_iconchanged optional :: FileName

Path to the icon file. [...]

Path to the icon file. [...]

small_icon_sizenew optional :: SpriteSizeType

The size of the small icon, in pixels. [...]

The size of the small icon, in pixels. [...]

item_to_spawn optional :: ItemID

The item to create when clicking on a shortcut with the action set to "spawn-item". [...]

The item to create when clicking on a shortcut with the action set to "spawn-item". [...]

technology_to_unlock optional :: TechnologyID

The technology that must be researched before this shortcut can be used. [...]

The technology that must be researched before this shortcut can be used. [...]

unavailable_until_unlockednew optional :: bool

If true, the shortcut will not be available until its technology_to_unlock is researched, even if it was already researched in a different game.

If true, the shortcut will not be available until its technology_to_unlock is researched, even if it was already researched in a different game.

toggleable optional :: bool

Must be enabled for the Factorio API to be able to set the toggled state on the shortcut button, see LuaPlayer::set_shortcut_toggled.

Must be enabled for the Factorio API to be able to set the toggled state on the shortcut button, see LuaPlayer::set_shortcut_toggled.

associated_control_input optional :: string

Name of a custom input or vanilla control. [...]

Name of a custom input or vanilla control. [...]

style optional :: "default" or "blue" or "red" or "green"

Inherited from Prototype
factoriopedia_alternative optional :: string

The ID type corresponding to the prototype that inherits from this. [...]

The ID type corresponding to the prototype that inherits from this. [...]

Inherited from PrototypeBase
type :: string

Specifies the kind of prototype this is. [...]

Specifies the kind of prototype this is. [...]

name :: string

Unique textual identification of the prototype. [...]

Unique textual identification of the prototype. [...]

order[overridden] optional :: Order

Used to order prototypes in inventory, recipes and GUIs. [...]

Used to order prototypes in inventory, recipes and GUIs. [...]

localised_name optional :: LocalisedString

Overwrites the name set in the locale file. [...]

Overwrites the name set in the locale file. [...]

localised_description optional :: LocalisedString

Overwrites the description set in the locale file. [...]

Overwrites the description set in the locale file. [...]

factoriopedia_descriptionnew optional :: LocalisedString

Provides additional description used in factoriopedia.

Provides additional description used in factoriopedia.

subgroupnew optional :: ItemSubGroupID

The name of an ItemSubGroup.

The name of an ItemSubGroup.

hiddennew optional :: bool
hidden_in_factoriopedianew optional :: bool
parameternew optional :: bool

Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.

Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.

factoriopedia_simulationnew optional :: SimulationDefinition

The simulation shown when looking at this prototype in the Factoriopedia GUI.

The simulation shown when looking at this prototype in the Factoriopedia GUI.

Properties

action :: "toggle-alt-mode" or "undo" or "copy" or "cut" or "paste" or "import-string" or "toggle-personal-roboport" or "toggle-equipment-movement-bonus" or "spawn-item" or "lua"

If this is "lua", on_lua_shortcut is raised when the shortcut is clicked.

icons :: array[IconData] optional new

Can't be an empty array.

icon :: FileName optional changed

Path to the icon file.

Mandatory if icons is not defined.

icon_size :: SpriteSizeType optional new

Default: 64

The size of the square icon, in pixels. E.g. 32 for a 32px by 32px icon. Must be larger than 0.

The base game uses 32px icons for shortcuts.

Only loaded if icons is not defined.

small_icons :: array[IconData] optional new

Can't be an empty array.

small_icon :: FileName optional changed

Path to the icon file. Used in the shortcut selection popup.

Mandatory if small_icons is not defined.

small_icon_size :: SpriteSizeType optional new

Default: 64

The size of the small icon, in pixels. E.g. 32 for a 32px by 32px icon. Must be larger than 0.

The base game uses 24px small icons for shortcuts.

Only loaded if small_icons is not defined.

item_to_spawn :: ItemID optional

The item to create when clicking on a shortcut with the action set to "spawn-item". The item must have the spawnable flag set.

technology_to_unlock :: TechnologyID optional

The technology that must be researched before this shortcut can be used. Once a shortcut is unlocked in one save file, it is unlocked for all future save files.

unavailable_until_unlocked :: bool optional new

Default: false

If true, the shortcut will not be available until its technology_to_unlock is researched, even if it was already researched in a different game.

toggleable :: bool optional

Default: false

Must be enabled for the Factorio API to be able to set the toggled state on the shortcut button, see LuaPlayer::set_shortcut_toggled.

associated_control_input :: string optional

Default: ""

Name of a custom input or vanilla control. This is only used to show the keybind in the tooltip of the shortcut.

style :: "default" or "blue" or "red" or "green" optional

Default: "default"

Overridden Properties

order :: Order optional

Default: ""

Used to order the shortcuts in the quick panel, which replaces the shortcut bar when using a controller (game pad). It is recommended to order modded shortcuts after the vanilla shortcuts.

Example

{
  type = "shortcut",
  name = "give-deconstruction-planner",
  order = "b[blueprints]-i[deconstruction-planner]",
  action = "spawn-item",
  localised_name = {"shortcut.make-deconstruction-planner"},
  associated_control_input = "give-deconstruction-planner",
  technology_to_unlock = "construction-robotics",
  item_to_spawn = "deconstruction-planner",
  style = "red",
  icon = "__base__/graphics/icons/shortcut-toolbar/mip/new-deconstruction-planner-x56.png",
  icon_size = 56,
  small_icon = "__base__/graphics/icons/shortcut-toolbar/mip/new-deconstruction-planner-x24.png",
  small_icon_size = 24
}

Prototypes

Types

Defines