Prototype/SelectionTool: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(0.16)
(Updated styling of prototype doc migration note)
 
(19 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==Basics==
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/prototypes/SelectionToolPrototype.html https://lua-api.factorio.com/latest/prototypes/SelectionToolPrototype.html]
Used in the base game as a base for the blueprint item and the deconstruction item. Extends [[Prototype/ItemWithLabel]].
 
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
 
 
 
{{Prototype parent|Prototype/ItemWithLabel}}
Used in the base game as a base for the blueprint item and the deconstruction item.
 
{{Prototype TOC|selection-tool}}
 
== Extensions ==
* [[Prototype/BlueprintItem]] '''blueprint'''
* [[Prototype/CopyPasteTool]] '''copy-paste-tool'''
* [[Prototype/DeconstructionItem]] '''deconstruction-item'''
* [[Prototype/UpgradeItem]] '''upgrade-item'''


== Mandatory properties ==
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/ItemWithLabel]].
This prototype inherits all the properties from [[Prototype/ItemWithLabel]].


=== selection_color ===
{{Prototype property|selection_color|[[Types/Color|Color]]}}
'''Type''': [[Types/Color]]
 
The color of the rectangle used when standard selection is done in-game.
The color of the rectangle used when standard selection is done in-game.


=== alt_selection_color ===
{{Prototype property|alt_selection_color|[[Types/Color|Color]]}}
'''Type''': [[Types/Color]]
 
The color of the rectangle used when alt-selection is done in-game.
The color of the rectangle used when alt-selection is done in-game.


=== selection_mode ===
{{Prototype property|selection_mode|[[Types/table|table]] of [[Types/string|string]]}}
'''Type''': [[Types/table]] of [[Types/string]]
 
A list of selection mode flags that define how the selection tool selects things in-game.
A list of selection mode flags that define how the selection tool selects things in-game.


Line 25: Line 33:
! Flag !! meaning
! Flag !! meaning
|-
|-
| blueprint  || The normal rules for acceptable entities in blueprints
| blueprint  || Selects entities and tiles as if selecting them for a blueprint.
|-
| deconstruct || Selects entities and tiles as if selecting them for deconstruction.
|-
| cancel-deconstruct || Selects entities and tiles as if selecting them for deconstruction cancellation.
|-
| items || Selects items on the ground.
|-
| trees || Selects trees.
|-
| buildable-type || Selects entities which are considered [https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.is_building a building], plus landmines.
|-
| nothing || Selects no entities or tiles, but is useful to select an area.
|-
|-
| deconstruct || The normal rules for acceptable entities for deconstruction
| items-to-place || Selects entities and tiles that can be built by an item.
|-
|-
| cancel-deconstruct || The normal rules for acceptable entities for cancel deconstruction
| any-entity || Selects all entities.
|-
|-
| items || Item entities
| any-tile || Selects all tiles.
|-
|-
| trees || Trees
| same-force || Selects entities with the same force as the selecting player.
|-
|-
| buildable-type || Buildable entities as defined by the game
| not-same-force || Selects entities with a different force as the selecting player.
|-
|-
| tiles || Any tiles
| friend || Selects entities from a friendly force.
|-
|-
| items-to-place || The entity has an item that builds the entity
| enemy || Selects entities from an enemy force.
|-
|-
| any-entity || Any entity
| upgrade || Selects entities as if selecting them for upgrading.
|-
|-
| any-tile || Any tile
| cancel-upgrade || Selects entities as if selecting them for upgrade cancellation.
|-
|-
| matches-force || The entity force matches that of the player doing the selection
| downgrade || Selects entities as if selecting them for downgrading.
|}
 
=== alt_selection_mode ===
'''Type''': [[Types/table]] of [[Types/string]]
 
A list of selection mode flags that define how the selection tool alt-selects things in-game. Possible values are identical to normal selection_mode.
 
=== selection_cursor_box_type ===
'''Type''': [[Types/string]]
 
The type of cursor box used to render selection of entities/tiles when standard selecting.
 
Possible values are:
{| class="wikitable"
|-
|-
! Flag !! meaning
| entity-with-health || Selects entities that are an [[Prototype/EntityWithHealth]].
|-
|-
| entity || The normal entity selection box. Yellow by default.
| entity-with-force || Deprecated. Replaced by "is-military-target".
|-
|-
| electricity || The selection box used to specify electric poles an entity is connected to. Light blue by default.
| is-military-target || Selects entities which are [[Prototype/EntityWithOwner#is_military_target]].
|-
|-
| copy || The selection box used when doing entity copy-paste. Green by default.
| entity-with-owner || Selects entities that are an [[Prototype/EntityWithOwner]].
|-
|-
| not-allowed || The selection box used when specifying colliding entities. Red by default.
| avoid-rolling-stock || Selects entities that are not a [[Prototype/RollingStock]].
|-
|-
| pair ||  
| entity-ghost || Selects entities that are an [[Prototype/EntityGhost]].
|-
|-
| logistics ||  
| tile-ghost || Selects entities that are a [[Prototype/TileGhost]].
|}
|}


=== alt_selection_cursor_box_type ===
{{Prototype property|alt_selection_mode|[[Types/table|table]] of [[Types/string|string]]}}
'''Type''': [[Types/string]]
A list of selection mode flags that define how the selection tool alt-selects things in-game. Possible values are identical to normal selection_mode.


The type of cursor box used to render selection of entities/tiles when alt selecting. Possible values are identical to normal selection_cursor_box_type.
{{Prototype property|selection_cursor_box_type|[[Types/CursorBoxType|CursorBoxType]]}}
The type of cursor box used to render selection of entities/tiles when standard selecting.
 
{{Prototype property|alt_selection_cursor_box_type|[[Types/CursorBoxType|CursorBoxType]]}}
The type of cursor box used to render selection of entities/tiles when alt selecting.


== Optional properties ==
== Optional properties ==


=== always_include_tiles ===
{{Prototype property|reverse_selection_color|[[Types/Color|Color]]|Value of <code>selection_color</code>|optional=true}}
'''Type''': [[Types/bool]]


'''Default''': false
{{Prototype property|alt_reverse_selection_color|[[Types/Color|Color]]|Value of <code>reverse_selection_color</code>|optional=true}}


{{Prototype property|selection_count_button_color|[[Types/Color|Color]]|Value of <code>selection_color</code>|optional=true}}
{{Prototype property|alt_selection_count_button_color|[[Types/Color|Color]]|Value of <code>alt_selection_color</code>|optional=true}}
{{Prototype property|reverse_selection_count_button_color|[[Types/Color|Color]]|Value of <code>reverse_selection_color</code>|optional=true}}
{{Prototype property|alt_reverse_selection_count_button_color|[[Types/Color|Color]]|Value of <code>alt_reverse_selection_color</code>|optional=true}}
{{Prototype property|chart_selection_color|[[Types/Color|Color]]|Value of <code>selection_color</code>|optional=true}}
{{Prototype property|chart_alt_selection_color|[[Types/Color|Color]]|Value of <code>alt_selection_color</code>|optional=true}}
{{Prototype property|chart_reverse_selection_color|[[Types/Color|Color]]|Value of <code>reverse_selection_color</code>|optional=true}}
{{Prototype property|chart_alt_reverse_selection_color|[[Types/Color|Color]]|Value of <code>alt_reverse_selection_color</code>|optional=true}}
{{Prototype property|reverse_selection_mode|[[Types/table|table]] of [[Types/string|string]]|Value of <code>selection_mode</code>|optional=true}}
A list of selection mode flags that define how the selection tool reverse-selects things in-game. Possible values are identical to normal selection_mode.
{{Prototype property|alt_reverse_selection_mode|[[Types/table|table]] of [[Types/string|string]]|Value of <code>reverse_selection_mode</code>|optional=true}}
A list of selection mode flags that define how the selection tool alt-reverse-selects things in-game (using {{Keybinding|shift|rmb}}). Possible values are identical to normal selection_mode.
{{Prototype property|reverse_selection_cursor_box_type|[[Types/CursorBoxType|CursorBoxType]]|Value of <code>selection_cursor_box_type</code>|optional=true}}
The type of cursor box used to render selection of entities/tiles when reverse-selecting.
{{Prototype property|alt_reverse_selection_cursor_box_type|[[Types/CursorBoxType|CursorBoxType]]|Value of <code>reverse_selection_cursor_box_type</code>|optional=true}}
The type of cursor box used to render selection of entities/tiles when alt-reverse-selecting  (using {{Keybinding|shift|rmb}}).
{{Prototype property|always_include_tiles|[[Types/bool|bool]]|false|optional=true}}
If tiles should be included in the selection regardless of entities also being in the selection. This is a visual only setting.
If tiles should be included in the selection regardless of entities also being in the selection. This is a visual only setting.


=== show_in_library ===
{{Prototype property|mouse_cursor|[[Types/string|string]]|"selection-tool-cursor"|optional=true}}
'''Type''': [[Types/bool]]
Name of a [[Prototype/MouseCursor]].
 
{{Prototype property|entity_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Entity]] names.
 
{{Prototype property|alt_entity_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Entity]] names.
 
{{Prototype property|reverse_entity_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Entity]] names.
 
{{Prototype property|alt_reverse_entity_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Entity]] names.
 
{{Prototype property|entity_type_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
 
{{Prototype property|alt_entity_type_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
 
{{Prototype property|reverse_entity_type_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
 
{{Prototype property|alt_reverse_entity_type_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
 
{{Prototype property|tile_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Tile]] names.
 
{{Prototype property|alt_tile_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Tile]] names.
 
{{Prototype property|reverse_tile_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Tile]] names.
 
{{Prototype property|alt_reverse_tile_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
Array of [[Prototype/Tile]] names.
 
{{Prototype property|entity_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".
 
{{Prototype property|alt_entity_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".
 
{{Prototype property|reverse_entity_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".
 
{{Prototype property|alt_reverse_entity_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".
 
{{Prototype property|tile_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".
 
{{Prototype property|alt_tile_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".


'''Default''': false
{{Prototype property|reverse_tile_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".


Whether this is shown in the blueprint library.
{{Prototype property|alt_reverse_tile_filter_mode|[[Types/string|string]]|"whitelist"|optional=true}}
One of "whitelist" and "blacklist".

Latest revision as of 10:43, 21 September 2023

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/SelectionToolPrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.


Prototype definitions » PrototypeBase » Prototype/Item » Prototype/ItemWithLabel » Prototype/SelectionTool


Used in the base game as a base for the blueprint item and the deconstruction item.


Prototype/SelectionTool — selection-tool
alt_selection_color::Color
alt_selection_cursor_box_type::CursorBoxType
alt_selection_mode::table of string
selection_color::Color
selection_cursor_box_type::CursorBoxType
selection_mode::table of string
alt_entity_filter_mode::string (optional)
alt_entity_filters::table of string (optional)
alt_entity_type_filters::table of string (optional)
alt_reverse_entity_filter_mode::string (optional)
alt_reverse_entity_filters::table of string (optional)
alt_reverse_entity_type_filters::table of string (optional)
alt_reverse_selection_color::Color (optional)
alt_reverse_selection_count_button_color::Color (optional)
alt_reverse_selection_cursor_box_type::CursorBoxType (optional)
alt_reverse_selection_mode::table of string (optional)
alt_reverse_tile_filter_mode::string (optional)
alt_reverse_tile_filters::table of string (optional)
alt_selection_count_button_color::Color (optional)
alt_tile_filter_mode::string (optional)
alt_tile_filters::table of string (optional)
always_include_tiles::bool (optional)
chart_alt_reverse_selection_color::Color (optional)
chart_alt_selection_color::Color (optional)
chart_reverse_selection_color::Color (optional)
chart_selection_color::Color (optional)
entity_filter_mode::string (optional)
entity_filters::table of string (optional)
entity_type_filters::table of string (optional)
mouse_cursor::string (optional)
reverse_entity_filter_mode::string (optional)
reverse_entity_filters::table of string (optional)
reverse_entity_type_filters::table of string (optional)
reverse_selection_color::Color (optional)
reverse_selection_count_button_color::Color (optional)
reverse_selection_cursor_box_type::CursorBoxType (optional)
reverse_selection_mode::table of string (optional)
reverse_tile_filter_mode::string (optional)
reverse_tile_filters::table of string (optional)
selection_count_button_color::Color (optional)
tile_filter_mode::string (optional)
tile_filters::table of string (optional)
Inherited from Prototype/ItemWithLabel
default_label_color::Color (optional)
draw_label_for_cursor_render::bool (optional)
Inherited from Prototype/Item
icons, icon, icon_size (IconSpecification)::IconSpecification
stack_size::ItemCountType
burnt_result::string (optional)
close_sound::Sound (optional)
dark_background_icons, dark_background_icon, icon_size (IconSpecification)::IconSpecification (optional)
default_request_amount::ItemCountType (optional)
flags::ItemPrototypeFlags (optional)
fuel_acceleration_multiplier::double (optional)
fuel_category::string (optional)
fuel_emissions_multiplier::double (optional)
fuel_glow_color::Color (optional)
fuel_top_speed_multiplier::double (optional)
fuel_value::Energy (optional)
open_sound::Sound (optional)
pictures::SpriteVariations (optional)
place_as_tile::PlaceAsTile (optional)
place_result::string (optional)
placed_as_equipment_result::string (optional)
rocket_launch_product::ItemProductPrototype (optional)
rocket_launch_products::table (array) of ItemProductPrototype (optional)
subgroup::string (optional)
wire_count::ItemCountType (optional)
Inherited from PrototypeBase
name::string
type::string
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)

Extensions

Mandatory properties

This prototype inherits all the properties from Prototype/ItemWithLabel.

selection_color

Type: Color
The color of the rectangle used when standard selection is done in-game.

alt_selection_color

Type: Color
The color of the rectangle used when alt-selection is done in-game.

selection_mode

Type: table of string
A list of selection mode flags that define how the selection tool selects things in-game.

Possible values are:

Flag meaning
blueprint Selects entities and tiles as if selecting them for a blueprint.
deconstruct Selects entities and tiles as if selecting them for deconstruction.
cancel-deconstruct Selects entities and tiles as if selecting them for deconstruction cancellation.
items Selects items on the ground.
trees Selects trees.
buildable-type Selects entities which are considered a building, plus landmines.
nothing Selects no entities or tiles, but is useful to select an area.
items-to-place Selects entities and tiles that can be built by an item.
any-entity Selects all entities.
any-tile Selects all tiles.
same-force Selects entities with the same force as the selecting player.
not-same-force Selects entities with a different force as the selecting player.
friend Selects entities from a friendly force.
enemy Selects entities from an enemy force.
upgrade Selects entities as if selecting them for upgrading.
cancel-upgrade Selects entities as if selecting them for upgrade cancellation.
downgrade Selects entities as if selecting them for downgrading.
entity-with-health Selects entities that are an Prototype/EntityWithHealth.
entity-with-force Deprecated. Replaced by "is-military-target".
is-military-target Selects entities which are Prototype/EntityWithOwner#is_military_target.
entity-with-owner Selects entities that are an Prototype/EntityWithOwner.
avoid-rolling-stock Selects entities that are not a Prototype/RollingStock.
entity-ghost Selects entities that are an Prototype/EntityGhost.
tile-ghost Selects entities that are a Prototype/TileGhost.

alt_selection_mode

Type: table of string
A list of selection mode flags that define how the selection tool alt-selects things in-game. Possible values are identical to normal selection_mode.

selection_cursor_box_type

Type: CursorBoxType
The type of cursor box used to render selection of entities/tiles when standard selecting.

alt_selection_cursor_box_type

Type: CursorBoxType
The type of cursor box used to render selection of entities/tiles when alt selecting.

Optional properties

reverse_selection_color

Type: Color
Default: Value of selection_color

alt_reverse_selection_color

Type: Color
Default: Value of reverse_selection_color

selection_count_button_color

Type: Color
Default: Value of selection_color

alt_selection_count_button_color

Type: Color
Default: Value of alt_selection_color

reverse_selection_count_button_color

Type: Color
Default: Value of reverse_selection_color

alt_reverse_selection_count_button_color

Type: Color
Default: Value of alt_reverse_selection_color

chart_selection_color

Type: Color
Default: Value of selection_color

chart_alt_selection_color

Type: Color
Default: Value of alt_selection_color

chart_reverse_selection_color

Type: Color
Default: Value of reverse_selection_color

chart_alt_reverse_selection_color

Type: Color
Default: Value of alt_reverse_selection_color

reverse_selection_mode

Type: table of string
Default: Value of selection_mode
A list of selection mode flags that define how the selection tool reverse-selects things in-game. Possible values are identical to normal selection_mode.

alt_reverse_selection_mode

Type: table of string
Default: Value of reverse_selection_mode
A list of selection mode flags that define how the selection tool alt-reverse-selects things in-game (using SHIFT + Right mouse button). Possible values are identical to normal selection_mode.

reverse_selection_cursor_box_type

Type: CursorBoxType
Default: Value of selection_cursor_box_type
The type of cursor box used to render selection of entities/tiles when reverse-selecting.

alt_reverse_selection_cursor_box_type

Type: CursorBoxType
Default: Value of reverse_selection_cursor_box_type
The type of cursor box used to render selection of entities/tiles when alt-reverse-selecting (using SHIFT + Right mouse button).

always_include_tiles

Type: bool
Default: false
If tiles should be included in the selection regardless of entities also being in the selection. This is a visual only setting.

mouse_cursor

Type: string
Default: "selection-tool-cursor"
Name of a Prototype/MouseCursor.

entity_filters

Type: table of string
Array of Prototype/Entity names.

alt_entity_filters

Type: table of string
Array of Prototype/Entity names.

reverse_entity_filters

Type: table of string
Array of Prototype/Entity names.

alt_reverse_entity_filters

Type: table of string
Array of Prototype/Entity names.

entity_type_filters

Type: table of string

alt_entity_type_filters

Type: table of string

reverse_entity_type_filters

Type: table of string

alt_reverse_entity_type_filters

Type: table of string

tile_filters

Type: table of string
Array of Prototype/Tile names.

alt_tile_filters

Type: table of string
Array of Prototype/Tile names.

reverse_tile_filters

Type: table of string
Array of Prototype/Tile names.

alt_reverse_tile_filters

Type: table of string
Array of Prototype/Tile names.

entity_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".

alt_entity_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".

reverse_entity_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".

alt_reverse_entity_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".

tile_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".

alt_tile_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".

reverse_tile_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".

alt_reverse_tile_filter_mode

Type: string
Default: "whitelist"
One of "whitelist" and "blacklist".