Prototype/Shortcut: Difference between revisions
(0.17) |
(more info on technology_to_unlock and item_to_create, added example) |
||
Line 20: | Line 20: | ||
'''Type''': [[Types/string]] | '''Type''': [[Types/string]] | ||
Name of a [[Prototype/Item]]. | Name of a [[Prototype/Item]]. The item to create when clicking on a shortcut with the action set to "create-blueprint-item". | ||
=== technology_to_unlock === | === technology_to_unlock === | ||
'''Type''': [[Types/string]] | '''Type''': [[Types/string]] | ||
Name of a [[Prototype/Technology]]. | Name of a [[Prototype/Technology]]. The technology that must be researched before this shortcut can be used. | ||
=== toggleable === | === toggleable === | ||
Line 49: | Line 49: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="lua">{ | |||
type = "shortcut", | |||
name = "give-deconstruction-planner", | |||
order = "b[blueprints]-g[deconstruction-planner]", | |||
action = "create-blueprint-item", | |||
localised_name = {"shortcut.make-deconstruction-planner"}, | |||
technology_to_unlock = "construction-robotics", | |||
item_to_create = "deconstruction-planner", | |||
style = "red", | |||
icon = | |||
{ | |||
filename = "__base__/graphics/icons/shortcut-toolbar/new-deconstruction-planner-x32-white.png", | |||
priority = "extra-high-no-scale", | |||
size = 32, | |||
scale = 1, | |||
flags = {"icon"} | |||
}, | |||
small_icon = | |||
{ | |||
filename = "__base__/graphics/icons/shortcut-toolbar/new-deconstruction-planner-x24.png", | |||
priority = "extra-high-no-scale", | |||
size = 24, | |||
scale = 1, | |||
flags = {"icon"} | |||
}, | |||
disabled_small_icon = | |||
{ | |||
filename = "__base__/graphics/icons/shortcut-toolbar/new-deconstruction-planner-x24-white.png", | |||
priority = "extra-high-no-scale", | |||
size = 24, | |||
scale = 1, | |||
flags = {"icon"} | |||
}, | |||
}</syntaxhighlight> |
Revision as of 18:54, 11 March 2019
Basics
Prototype type: shortcut
Definition for a shortcut in the shortcut bar of tools.
Mandatory properties
Inherits all properties from Prototype.
action
Type: Types/string
One of "toggle-alt-mode", "undo", "copy", "cut", "paste", "import-string", "toggle-personal-roboport", "toggle-equipment-movement-bonus", "create-blueprint-item" and "lua".
icon
Type: Types/Sprite
Optional properties
item_to_create
Type: Types/string
Name of a Prototype/Item. The item to create when clicking on a shortcut with the action set to "create-blueprint-item".
technology_to_unlock
Type: Types/string
Name of a Prototype/Technology. The technology that must be researched before this shortcut can be used.
toggleable
Type: Types/bool
Default: false
small_icon
Type: Types/Sprite
disabled_icon
Type: Types/Sprite
disabled_small_icon
Type: Types/Sprite
style
Type: Types/string
Default: "default"
One of "default", "blue", "red" and "green".
Example
{
type = "shortcut",
name = "give-deconstruction-planner",
order = "b[blueprints]-g[deconstruction-planner]",
action = "create-blueprint-item",
localised_name = {"shortcut.make-deconstruction-planner"},
technology_to_unlock = "construction-robotics",
item_to_create = "deconstruction-planner",
style = "red",
icon =
{
filename = "__base__/graphics/icons/shortcut-toolbar/new-deconstruction-planner-x32-white.png",
priority = "extra-high-no-scale",
size = 32,
scale = 1,
flags = {"icon"}
},
small_icon =
{
filename = "__base__/graphics/icons/shortcut-toolbar/new-deconstruction-planner-x24.png",
priority = "extra-high-no-scale",
size = 24,
scale = 1,
flags = {"icon"}
},
disabled_small_icon =
{
filename = "__base__/graphics/icons/shortcut-toolbar/new-deconstruction-planner-x24-white.png",
priority = "extra-high-no-scale",
size = 24,
scale = 1,
flags = {"icon"}
},
}