factorio-types 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes.d.ts +210 -150
- package/dist/concepts.d.ts +474 -529
- package/dist/core.d.ts +3 -0
- package/dist/defines.d.ts +5 -1
- package/dist/events.d.ts +3 -3
- package/dist/global.d.ts +1 -1
- package/dist/prototypes.d.ts +99 -31
- package/dist/types.d.ts +153 -11
- package/package.json +2 -2
package/dist/classes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 1.1.
|
|
5
|
+
// Factorio version 1.1.102
|
|
6
6
|
// API version 4
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -1679,9 +1679,9 @@ interface LuaCustomInputPrototype {
|
|
|
1679
1679
|
readonly alternative_key_sequence?: string
|
|
1680
1680
|
|
|
1681
1681
|
/**
|
|
1682
|
-
* The consuming type
|
|
1682
|
+
* The consuming type.
|
|
1683
1683
|
*/
|
|
1684
|
-
readonly consuming:
|
|
1684
|
+
readonly consuming: 'none' | 'game-only'
|
|
1685
1685
|
|
|
1686
1686
|
/**
|
|
1687
1687
|
* The default controller alternative key sequence for this custom input, if any
|
|
@@ -2140,7 +2140,7 @@ interface LuaEntity extends LuaControl {
|
|
|
2140
2140
|
* @param damage - The amount of damage to be done.
|
|
2141
2141
|
* @param dealer - The entity to consider as the damage dealer. Needs to be on the same surface as the entity being damaged.
|
|
2142
2142
|
* @param force - The force that will be doing the damage.
|
|
2143
|
-
* @param type - The type of damage to be done, defaults to "impact"
|
|
2143
|
+
* @param type - The type of damage to be done, defaults to `"impact"`. Can't be `nil`.
|
|
2144
2144
|
* @returns the total damage actually applied after resistances.
|
|
2145
2145
|
*/
|
|
2146
2146
|
damage(this: void,
|
|
@@ -2893,7 +2893,7 @@ interface LuaEntity extends LuaControl {
|
|
|
2893
2893
|
by_player?: PlayerIdentification,
|
|
2894
2894
|
spill_items?: boolean,
|
|
2895
2895
|
enable_looted?: boolean,
|
|
2896
|
-
force?:
|
|
2896
|
+
force?: ForceIdentification
|
|
2897
2897
|
}): LuaMultiReturn<[boolean, {[key: string]: number} | null]>
|
|
2898
2898
|
|
|
2899
2899
|
/**
|
|
@@ -3007,7 +3007,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3007
3007
|
* @returns Any items removed from this entity as a result of setting the recipe.
|
|
3008
3008
|
*/
|
|
3009
3009
|
set_recipe(this: void,
|
|
3010
|
-
recipe
|
|
3010
|
+
recipe: string | LuaRecipe | null): {[key: string]: number}
|
|
3011
3011
|
|
|
3012
3012
|
/**
|
|
3013
3013
|
* Set a logistic requester slot.
|
|
@@ -3211,7 +3211,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3211
3211
|
/**
|
|
3212
3212
|
* Gives what is the current shape of a transport-belt.
|
|
3213
3213
|
* @remarks
|
|
3214
|
-
* Can also be used on entity ghost if it contains transport-belt
|
|
3214
|
+
* Can also be used on entity ghost if it contains transport-belt.
|
|
3215
3215
|
* Applies to subclasses: TransportBelt
|
|
3216
3216
|
*
|
|
3217
3217
|
*/
|
|
@@ -3427,7 +3427,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3427
3427
|
readonly distraction_command?: Command
|
|
3428
3428
|
|
|
3429
3429
|
/**
|
|
3430
|
-
* Gives a draw data of the given entity if it supports such data
|
|
3430
|
+
* Gives a draw data of the given entity if it supports such data.
|
|
3431
3431
|
* @remarks
|
|
3432
3432
|
* Applies to subclasses: RollingStock
|
|
3433
3433
|
*
|
|
@@ -3637,7 +3637,16 @@ interface LuaEntity extends LuaControl {
|
|
|
3637
3637
|
readonly ghost_unit_number?: number
|
|
3638
3638
|
|
|
3639
3639
|
/**
|
|
3640
|
-
* Returns a {@link rich text | https://wiki.factorio.com/Rich_text} string containing this entity's position and surface name as a gps tag. Printing it will ping the location of the entity.
|
|
3640
|
+
* Returns a {@link rich text | https://wiki.factorio.com/Rich_text} string containing this entity's position and surface name as a gps tag. {@link Printing | runtime:LuaGameScript::print} it will ping the location of the entity.
|
|
3641
|
+
* @example
|
|
3642
|
+
* ```
|
|
3643
|
+
* -- called on a LuaEntity on the default surface it returns:
|
|
3644
|
+
* entity.gps_tag -- => "[gps=-4,-9]"
|
|
3645
|
+
*
|
|
3646
|
+
* -- called on a LuaEntity on "custom-surface" it returns:
|
|
3647
|
+
* different_entity.gps_tag -- => "[gps=1,-5,custom-surface]"
|
|
3648
|
+
* ```
|
|
3649
|
+
*
|
|
3641
3650
|
*/
|
|
3642
3651
|
readonly gps_tag: string
|
|
3643
3652
|
|
|
@@ -3689,7 +3698,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3689
3698
|
* Applies to subclasses: HighlightBox
|
|
3690
3699
|
*
|
|
3691
3700
|
*/
|
|
3692
|
-
highlight_box_type:
|
|
3701
|
+
highlight_box_type: CursorBoxRenderType
|
|
3693
3702
|
|
|
3694
3703
|
/**
|
|
3695
3704
|
* The filters for this infinity container.
|
|
@@ -3709,12 +3718,12 @@ interface LuaEntity extends LuaControl {
|
|
|
3709
3718
|
initial_amount?: number
|
|
3710
3719
|
|
|
3711
3720
|
/**
|
|
3712
|
-
* The filter mode for this filter inserter.
|
|
3721
|
+
* The filter mode for this filter inserter. `nil` if this inserter doesn't use filters.
|
|
3713
3722
|
* @remarks
|
|
3714
3723
|
* Applies to subclasses: Inserter
|
|
3715
3724
|
*
|
|
3716
3725
|
*/
|
|
3717
|
-
inserter_filter_mode?:
|
|
3726
|
+
inserter_filter_mode?: 'whitelist' | 'blacklist'
|
|
3718
3727
|
|
|
3719
3728
|
/**
|
|
3720
3729
|
* Sets the stack size limit on this inserter. If the stack size is > than the force stack size limit the value is ignored.
|
|
@@ -3748,7 +3757,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3748
3757
|
readonly is_entity_with_owner: boolean
|
|
3749
3758
|
|
|
3750
3759
|
/**
|
|
3751
|
-
* If the rolling stock is facing train's front
|
|
3760
|
+
* If the rolling stock is facing train's front.
|
|
3752
3761
|
* @remarks
|
|
3753
3762
|
* Applies to subclasses: RollingStock
|
|
3754
3763
|
*
|
|
@@ -3778,7 +3787,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3778
3787
|
*
|
|
3779
3788
|
* Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
|
|
3780
3789
|
* @remarks
|
|
3781
|
-
* Applies to subclasses: EntityWithOwner
|
|
3790
|
+
* Applies to subclasses: EntityWithOwner,DeconstructibleTileProxy,TileGhost
|
|
3782
3791
|
*
|
|
3783
3792
|
*/
|
|
3784
3793
|
last_user?: LuaPlayer | PlayerIdentification
|
|
@@ -3791,22 +3800,22 @@ interface LuaEntity extends LuaControl {
|
|
|
3791
3800
|
/**
|
|
3792
3801
|
* Neighbour to which this linked belt is connected to, if any.
|
|
3793
3802
|
* @remarks
|
|
3794
|
-
* Can also be used on entity ghost if it contains linked-belt
|
|
3795
|
-
* May return entity ghost which contains linked belt to which connection is made
|
|
3803
|
+
* Can also be used on entity ghost if it contains linked-belt.
|
|
3804
|
+
* May return entity ghost which contains linked belt to which connection is made.
|
|
3796
3805
|
* Applies to subclasses: LinkedBelt
|
|
3797
3806
|
*
|
|
3798
3807
|
*/
|
|
3799
3808
|
readonly linked_belt_neighbour?: LuaEntity
|
|
3800
3809
|
|
|
3801
3810
|
/**
|
|
3802
|
-
* Type of linked belt
|
|
3811
|
+
* Type of linked belt. Changing type will also flip direction so the belt is out of the same side.
|
|
3803
3812
|
* @remarks
|
|
3804
|
-
* Can only be changed when linked belt is disconnected (has no neighbour set)
|
|
3805
|
-
* Can also be used on entity ghost if it contains linked-belt
|
|
3813
|
+
* Can only be changed when linked belt is disconnected (has no neighbour set).
|
|
3814
|
+
* Can also be used on entity ghost if it contains linked-belt.
|
|
3806
3815
|
* Applies to subclasses: LinkedBelt
|
|
3807
3816
|
*
|
|
3808
3817
|
*/
|
|
3809
|
-
linked_belt_type:
|
|
3818
|
+
linked_belt_type: 'input' | 'output'
|
|
3810
3819
|
|
|
3811
3820
|
/**
|
|
3812
3821
|
* The container entity this loader is pointing at/pulling from depending on the {@link LuaEntity::loader_type | runtime:LuaEntity::loader_type}, if any.
|
|
@@ -4169,20 +4178,20 @@ interface LuaEntity extends LuaControl {
|
|
|
4169
4178
|
splitter_filter?: LuaItemPrototype
|
|
4170
4179
|
|
|
4171
4180
|
/**
|
|
4172
|
-
* The input priority for this splitter.
|
|
4181
|
+
* The input priority for this splitter.
|
|
4173
4182
|
* @remarks
|
|
4174
4183
|
* Applies to subclasses: Splitter
|
|
4175
4184
|
*
|
|
4176
4185
|
*/
|
|
4177
|
-
splitter_input_priority:
|
|
4186
|
+
splitter_input_priority: 'left' | 'none' | 'right'
|
|
4178
4187
|
|
|
4179
4188
|
/**
|
|
4180
|
-
* The output priority for this splitter.
|
|
4189
|
+
* The output priority for this splitter.
|
|
4181
4190
|
* @remarks
|
|
4182
4191
|
* Applies to subclasses: Splitter
|
|
4183
4192
|
*
|
|
4184
4193
|
*/
|
|
4185
|
-
splitter_output_priority:
|
|
4194
|
+
splitter_output_priority: 'left' | 'none' | 'right'
|
|
4186
4195
|
|
|
4187
4196
|
/**
|
|
4188
4197
|
* @remarks
|
|
@@ -4829,16 +4838,16 @@ interface LuaEntityPrototype {
|
|
|
4829
4838
|
readonly count_as_rock_for_filtered_deconstruction?: boolean
|
|
4830
4839
|
|
|
4831
4840
|
/**
|
|
4832
|
-
* The crafting categories this entity prototype supports.
|
|
4841
|
+
* The {@link crafting categories | runtime:LuaRecipeCategoryPrototype} this entity prototype supports.
|
|
4833
4842
|
* @remarks
|
|
4834
4843
|
* The value in the dictionary is meaningless and exists just to allow for easy lookup.
|
|
4835
|
-
* Applies to subclasses: CraftingMachine
|
|
4844
|
+
* Applies to subclasses: CraftingMachine,Character
|
|
4836
4845
|
*
|
|
4837
4846
|
*/
|
|
4838
4847
|
readonly crafting_categories?: {[key: string]: boolean}
|
|
4839
4848
|
|
|
4840
4849
|
/**
|
|
4841
|
-
* The crafting speed
|
|
4850
|
+
* The crafting speed.
|
|
4842
4851
|
* @remarks
|
|
4843
4852
|
* Applies to subclasses: CraftingMachine
|
|
4844
4853
|
*
|
|
@@ -5405,12 +5414,12 @@ interface LuaEntityPrototype {
|
|
|
5405
5414
|
readonly localised_name: LocalisedString
|
|
5406
5415
|
|
|
5407
5416
|
/**
|
|
5408
|
-
* The logistic mode of this logistic container.
|
|
5417
|
+
* The logistic mode of this logistic container.
|
|
5409
5418
|
* @remarks
|
|
5410
5419
|
* Applies to subclasses: LogisticContainer
|
|
5411
5420
|
*
|
|
5412
5421
|
*/
|
|
5413
|
-
readonly logistic_mode?:
|
|
5422
|
+
readonly logistic_mode?: 'requester' | 'active-provider' | 'passive-provider' | 'buffer' | 'storage' | 'none'
|
|
5414
5423
|
|
|
5415
5424
|
/**
|
|
5416
5425
|
* The logistic parameters for this roboport.
|
|
@@ -5820,6 +5829,9 @@ interface LuaEntityPrototype {
|
|
|
5820
5829
|
*/
|
|
5821
5830
|
readonly remains_when_mined: LuaEntityPrototype[]
|
|
5822
5831
|
|
|
5832
|
+
/**
|
|
5833
|
+
* Whether this entity should remove decoratives that collide with it when this entity is built. Possible values are `"automatic"`, `"true"` and `"false"`.
|
|
5834
|
+
*/
|
|
5823
5835
|
readonly remove_decoratives: string
|
|
5824
5836
|
|
|
5825
5837
|
/**
|
|
@@ -5847,7 +5859,7 @@ interface LuaEntityPrototype {
|
|
|
5847
5859
|
readonly resistances?: {[key: string]: Resistance}
|
|
5848
5860
|
|
|
5849
5861
|
/**
|
|
5850
|
-
* The resource categories this character or mining drill supports.
|
|
5862
|
+
* The {@link resource categories | runtime:LuaResourceCategoryPrototype} this character or mining drill supports.
|
|
5851
5863
|
* @remarks
|
|
5852
5864
|
* The value in the dictionary is meaningless and exists just to allow for easy lookup.
|
|
5853
5865
|
* Applies to subclasses: MiningDrill,Character
|
|
@@ -7007,9 +7019,9 @@ interface LuaFluidBoxPrototype {
|
|
|
7007
7019
|
readonly pipe_connections: FluidBoxConnection[]
|
|
7008
7020
|
|
|
7009
7021
|
/**
|
|
7010
|
-
* The production type.
|
|
7022
|
+
* The production type.
|
|
7011
7023
|
*/
|
|
7012
|
-
readonly production_type:
|
|
7024
|
+
readonly production_type: 'input' | 'input-output' | 'output' | 'none'
|
|
7013
7025
|
|
|
7014
7026
|
/**
|
|
7015
7027
|
* The render layer.
|
|
@@ -7457,6 +7469,9 @@ interface LuaForce {
|
|
|
7457
7469
|
|
|
7458
7470
|
/**
|
|
7459
7471
|
* Play a sound for every player in this force.
|
|
7472
|
+
* @remarks
|
|
7473
|
+
* The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this force.
|
|
7474
|
+
*
|
|
7460
7475
|
* @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
|
|
7461
7476
|
* @param table.path - The sound to play.
|
|
7462
7477
|
* @param table.position - Where the sound should be played. If not given, it's played at the current position of each player.
|
|
@@ -8048,7 +8063,7 @@ interface LuaGameScript {
|
|
|
8048
8063
|
* @param surface - The surface to be deleted. Currently the primary surface (1, 'nauvis') cannot be deleted.
|
|
8049
8064
|
*/
|
|
8050
8065
|
delete_surface(this: void,
|
|
8051
|
-
surface:
|
|
8066
|
+
surface: SurfaceIdentification): void
|
|
8052
8067
|
|
|
8053
8068
|
/**
|
|
8054
8069
|
* Converts the given direction into the string version of the direction.
|
|
@@ -8105,6 +8120,9 @@ interface LuaGameScript {
|
|
|
8105
8120
|
get_active_entities_count(this: void,
|
|
8106
8121
|
surface?: SurfaceIdentification): number
|
|
8107
8122
|
|
|
8123
|
+
/**
|
|
8124
|
+
* Gets an entity by its name tag. Entity name tags can be set in the entity "extra settings" GUI in the map editor.
|
|
8125
|
+
*/
|
|
8108
8126
|
get_entity_by_tag(this: void,
|
|
8109
8127
|
tag: string): LuaEntity | null
|
|
8110
8128
|
|
|
@@ -8351,6 +8369,9 @@ interface LuaGameScript {
|
|
|
8351
8369
|
|
|
8352
8370
|
/**
|
|
8353
8371
|
* Play a sound for every player in the game.
|
|
8372
|
+
* @remarks
|
|
8373
|
+
* The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
|
|
8374
|
+
*
|
|
8354
8375
|
* @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
|
|
8355
8376
|
* @param table.path - The sound to play.
|
|
8356
8377
|
* @param table.position - Where the sound should be played. If not given, it's played at the current position of each player.
|
|
@@ -8414,7 +8435,7 @@ interface LuaGameScript {
|
|
|
8414
8435
|
* @param players - List of players to remove. If not specified, remove all offline players.
|
|
8415
8436
|
*/
|
|
8416
8437
|
remove_offline_players(this: void,
|
|
8417
|
-
players?:
|
|
8438
|
+
players?: PlayerIdentification[]): void
|
|
8418
8439
|
|
|
8419
8440
|
/**
|
|
8420
8441
|
* Remove a file or directory in the `script-output` folder, located in the game's {@link user data directory | https://wiki.factorio.com/User_data_directory}. Can be used to remove files created by {@link LuaGameScript::write_file | runtime:LuaGameScript::write_file}.
|
|
@@ -8425,9 +8446,32 @@ interface LuaGameScript {
|
|
|
8425
8446
|
|
|
8426
8447
|
/**
|
|
8427
8448
|
* Direct access to Trains Pathfinder. Allows to search rail paths or querying which stops are accessible
|
|
8449
|
+
* @param table.allow_path_within_segment_back - Only relevant if `from_back` is given. Defaults to `true`. Providing false will cause the pathfinder to reject a path that starts on back and ends within the same segment as the path would be too short to provide correct alignment with a goal.
|
|
8450
|
+
* @param table.allow_path_within_segment_front - Only relevant if `from_front` is given. Defaults to `true`. Providing false will cause the pathfinder to reject a path that starts on front and ends within the same segment as the path would be too short to provide correct alignment with a goal.
|
|
8451
|
+
* @param table.from_back - Manually provided starting back of the train.
|
|
8452
|
+
* @param table.from_front - Manually provided starting front of the train.
|
|
8453
|
+
* @param table.in_chain_signal_section - Defaults to `false`. If set to true, pathfinder will not return a path that cannot have its beginning immediately reserved. A path that cannot have its beginning immediately reserved could cause a train to stop inside of an intersection.
|
|
8454
|
+
* @param table.return_path - Only relevant if request type is `"path"`. Returning a full path is expensive due to multiple LuaEntity created. In order for path to be returned, true must be provided here. Defaults to false in which case a path will not be provided.
|
|
8455
|
+
* @param table.search_direction - Only relevant if none of `from_front`/`from_back` was provided in which case `from_front` and `from_back` are deduced from the train. Selects which train ends should be considered as starts. Defaults to `"any-direction-with-locomotives"`.
|
|
8456
|
+
* @param table.steps_limit - Maximum amount of steps pathfinder is allowed to perform.
|
|
8457
|
+
* @param table.train - Mandatory if `from_front` and `from_back` are not provided, optional otherwise. Selects a context for the pathfinder to decide which train to exclude from penalties and which signals are considered possible to reacquire. If `from_front` and `from_back` are not provided, then it is also used to collect front and back ends for the search
|
|
8458
|
+
* @param table.type - Request type. Determines the return type of the method. Defaults to `"path"`.
|
|
8459
|
+
* @returns The type of the returned value depends on `type`.
|
|
8428
8460
|
*/
|
|
8429
8461
|
request_train_path(this: void,
|
|
8430
|
-
|
|
8462
|
+
table: {
|
|
8463
|
+
goals: Array<TrainStopGoal | RailEnd>,
|
|
8464
|
+
in_chain_signal_section?: boolean,
|
|
8465
|
+
train?: LuaTrain,
|
|
8466
|
+
type?: TrainPathRequestType,
|
|
8467
|
+
return_path?: boolean,
|
|
8468
|
+
from_front?: RailEnd,
|
|
8469
|
+
allow_path_within_segment_front?: boolean,
|
|
8470
|
+
from_back?: RailEnd,
|
|
8471
|
+
allow_path_within_segment_back?: boolean,
|
|
8472
|
+
search_direction?: 'respect-movement-direction' | 'any-direction-with-locomotives',
|
|
8473
|
+
steps_limit?: number
|
|
8474
|
+
}): TrainPathFinderPathResult | TrainPathAnyGoalResult | TrainPathAllGoalsResult
|
|
8431
8475
|
|
|
8432
8476
|
/**
|
|
8433
8477
|
* Reset scenario state (game_finished, player_won, etc.).
|
|
@@ -8928,7 +8972,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
|
|
|
8928
8972
|
/**
|
|
8929
8973
|
* The circuit condition. Writing `nil` clears the circuit condition.
|
|
8930
8974
|
* @example
|
|
8931
|
-
* Tell an entity to be active (
|
|
8975
|
+
* Tell an entity to be active (for example a lamp to be lit) when it receives a circuit signal of more than 4 chain signals.
|
|
8932
8976
|
* ```
|
|
8933
8977
|
* a_behavior.circuit_condition = {condition={comparator=">",
|
|
8934
8978
|
* first_signal={type="item", name="rail-chain-signal"},
|
|
@@ -8951,7 +8995,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
|
|
|
8951
8995
|
/**
|
|
8952
8996
|
* The logistic condition. Writing `nil` clears the logistic condition.
|
|
8953
8997
|
* @example
|
|
8954
|
-
* Tell an entity to be active (
|
|
8998
|
+
* Tell an entity to be active (for example a lamp to be lit) when the logistics network it's connected to has more than four chain signals.
|
|
8955
8999
|
* ```
|
|
8956
9000
|
* a_behavior.logistic_condition = {condition={comparator=">",
|
|
8957
9001
|
* first_signal={type="item", name="rail-chain-signal"},
|
|
@@ -8983,16 +9027,19 @@ interface LuaGroup {
|
|
|
8983
9027
|
help(this: void): string
|
|
8984
9028
|
|
|
8985
9029
|
/**
|
|
8986
|
-
* The parent group
|
|
9030
|
+
* The parent group.
|
|
9031
|
+
* @remarks
|
|
9032
|
+
* Applies to subclasses: ItemSubGroup
|
|
9033
|
+
*
|
|
8987
9034
|
*/
|
|
8988
|
-
readonly group
|
|
9035
|
+
readonly group: LuaGroup
|
|
8989
9036
|
|
|
8990
9037
|
/**
|
|
8991
9038
|
* Localised name of the group.
|
|
8992
9039
|
*/
|
|
8993
|
-
readonly localised_name
|
|
9040
|
+
readonly localised_name: LocalisedString
|
|
8994
9041
|
|
|
8995
|
-
readonly name
|
|
9042
|
+
readonly name: string
|
|
8996
9043
|
|
|
8997
9044
|
/**
|
|
8998
9045
|
* The 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.
|
|
@@ -9005,16 +9052,22 @@ interface LuaGroup {
|
|
|
9005
9052
|
readonly order: string
|
|
9006
9053
|
|
|
9007
9054
|
/**
|
|
9008
|
-
* The additional order value used in recipe ordering.
|
|
9055
|
+
* The additional order value used in recipe ordering.
|
|
9056
|
+
* @remarks
|
|
9057
|
+
* Applies to subclasses: ItemGroup
|
|
9058
|
+
*
|
|
9009
9059
|
*/
|
|
9010
|
-
readonly order_in_recipe
|
|
9060
|
+
readonly order_in_recipe: string
|
|
9011
9061
|
|
|
9012
9062
|
/**
|
|
9013
|
-
* Subgroups of this group.
|
|
9063
|
+
* Subgroups of this group.
|
|
9064
|
+
* @remarks
|
|
9065
|
+
* Applies to subclasses: ItemGroup
|
|
9066
|
+
*
|
|
9014
9067
|
*/
|
|
9015
|
-
readonly subgroups
|
|
9068
|
+
readonly subgroups: LuaGroup[]
|
|
9016
9069
|
|
|
9017
|
-
readonly type
|
|
9070
|
+
readonly type: string
|
|
9018
9071
|
|
|
9019
9072
|
/**
|
|
9020
9073
|
* Is 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.
|
|
@@ -9304,11 +9357,11 @@ interface LuaGuiElement {
|
|
|
9304
9357
|
* Applies to subclasses: scroll-pane
|
|
9305
9358
|
*
|
|
9306
9359
|
* @param element - The element to scroll to.
|
|
9307
|
-
* @param scroll_mode - Where the element should be positioned in the scroll-pane.
|
|
9360
|
+
* @param scroll_mode - Where the element should be positioned in the scroll-pane. Defaults to `"in-view"`.
|
|
9308
9361
|
*/
|
|
9309
9362
|
scroll_to_element(this: void,
|
|
9310
9363
|
element: LuaGuiElement,
|
|
9311
|
-
scroll_mode?:
|
|
9364
|
+
scroll_mode?: 'in-view' | 'top-third'): void
|
|
9312
9365
|
|
|
9313
9366
|
/**
|
|
9314
9367
|
* Scrolls the scroll bar such that the specified listbox item is visible to the player.
|
|
@@ -9316,11 +9369,11 @@ interface LuaGuiElement {
|
|
|
9316
9369
|
* Applies to subclasses: list-box
|
|
9317
9370
|
*
|
|
9318
9371
|
* @param index - The item index to scroll to.
|
|
9319
|
-
* @param scroll_mode - Where the item should be positioned in the list-box.
|
|
9372
|
+
* @param scroll_mode - Where the item should be positioned in the list-box. Defaults to `"in-view"`.
|
|
9320
9373
|
*/
|
|
9321
9374
|
scroll_to_item(this: void,
|
|
9322
9375
|
index: number,
|
|
9323
|
-
scroll_mode?:
|
|
9376
|
+
scroll_mode?: 'in-view' | 'top-third'): void
|
|
9324
9377
|
|
|
9325
9378
|
/**
|
|
9326
9379
|
* Scrolls this scroll bar to the left.
|
|
@@ -9527,12 +9580,12 @@ interface LuaGuiElement {
|
|
|
9527
9580
|
readonly column_count: number
|
|
9528
9581
|
|
|
9529
9582
|
/**
|
|
9530
|
-
* Direction of this element's layout.
|
|
9583
|
+
* Direction of this element's layout.
|
|
9531
9584
|
* @remarks
|
|
9532
9585
|
* Applies to subclasses: frame,flow,line
|
|
9533
9586
|
*
|
|
9534
9587
|
*/
|
|
9535
|
-
readonly direction:
|
|
9588
|
+
readonly direction: GuiDirection
|
|
9536
9589
|
|
|
9537
9590
|
/**
|
|
9538
9591
|
* The `frame` that is being moved when dragging this GUI element, if any. This element needs to be a child of the `drag_target` at some level.
|
|
@@ -9614,7 +9667,7 @@ interface LuaGuiElement {
|
|
|
9614
9667
|
* Applies to subclasses: choose-elem-button
|
|
9615
9668
|
*
|
|
9616
9669
|
*/
|
|
9617
|
-
readonly elem_type:
|
|
9670
|
+
readonly elem_type: ElemType
|
|
9618
9671
|
|
|
9619
9672
|
/**
|
|
9620
9673
|
* The elem value of this choose-elem-button, if any.
|
|
@@ -9657,12 +9710,12 @@ interface LuaGuiElement {
|
|
|
9657
9710
|
readonly gui: LuaGui
|
|
9658
9711
|
|
|
9659
9712
|
/**
|
|
9660
|
-
* Policy of the horizontal scroll bar.
|
|
9713
|
+
* Policy of the horizontal scroll bar.
|
|
9661
9714
|
* @remarks
|
|
9662
9715
|
* Applies to subclasses: scroll-pane
|
|
9663
9716
|
*
|
|
9664
9717
|
*/
|
|
9665
|
-
horizontal_scroll_policy:
|
|
9718
|
+
horizontal_scroll_policy: ScrollPolicy
|
|
9666
9719
|
|
|
9667
9720
|
/**
|
|
9668
9721
|
* The sprite to display on this sprite-button when it is hovered.
|
|
@@ -9907,13 +9960,13 @@ interface LuaGuiElement {
|
|
|
9907
9960
|
surface_index: number
|
|
9908
9961
|
|
|
9909
9962
|
/**
|
|
9910
|
-
* The switch state
|
|
9963
|
+
* The switch state for this switch.
|
|
9911
9964
|
* @remarks
|
|
9912
9965
|
* If {@link LuaGuiElement::allow_none_state | runtime:LuaGuiElement::allow_none_state} is false this can't be set to `"none"`.
|
|
9913
9966
|
* Applies to subclasses: switch
|
|
9914
9967
|
*
|
|
9915
9968
|
*/
|
|
9916
|
-
switch_state:
|
|
9969
|
+
switch_state: SwitchState
|
|
9917
9970
|
|
|
9918
9971
|
/**
|
|
9919
9972
|
* The tabs and contents being shown in this tabbed-pane.
|
|
@@ -9976,12 +10029,12 @@ interface LuaGuiElement {
|
|
|
9976
10029
|
vertical_centering: boolean
|
|
9977
10030
|
|
|
9978
10031
|
/**
|
|
9979
|
-
* Policy of the vertical scroll bar.
|
|
10032
|
+
* Policy of the vertical scroll bar.
|
|
9980
10033
|
* @remarks
|
|
9981
10034
|
* Applies to subclasses: scroll-pane
|
|
9982
10035
|
*
|
|
9983
10036
|
*/
|
|
9984
|
-
vertical_scroll_policy:
|
|
10037
|
+
vertical_scroll_policy: ScrollPolicy
|
|
9985
10038
|
|
|
9986
10039
|
/**
|
|
9987
10040
|
* Sets whether this GUI element is visible or completely hidden, taking no space in the layout.
|
|
@@ -10240,7 +10293,7 @@ interface LuaInventory {
|
|
|
10240
10293
|
* @param item - The item to check.
|
|
10241
10294
|
*/
|
|
10242
10295
|
get_insertable_count(this: void,
|
|
10243
|
-
item: string):
|
|
10296
|
+
item: string): number
|
|
10244
10297
|
|
|
10245
10298
|
/**
|
|
10246
10299
|
* Get the number of all or some items in this inventory.
|
|
@@ -10413,10 +10466,10 @@ interface LuaItemPrototype {
|
|
|
10413
10466
|
* @remarks
|
|
10414
10467
|
* Applies to subclasses: AmmoItem
|
|
10415
10468
|
*
|
|
10416
|
-
* @param ammo_source_type -
|
|
10469
|
+
* @param ammo_source_type - Defaults to `"default"`.
|
|
10417
10470
|
*/
|
|
10418
10471
|
get_ammo_type(this: void,
|
|
10419
|
-
ammo_source_type?:
|
|
10472
|
+
ammo_source_type?: 'default' | 'player' | 'turret' | 'vehicle'): AmmoType | null
|
|
10420
10473
|
|
|
10421
10474
|
/**
|
|
10422
10475
|
* Does this prototype have a flag enabled?
|
|
@@ -10436,7 +10489,7 @@ interface LuaItemPrototype {
|
|
|
10436
10489
|
* Applies to subclasses: SelectionTool
|
|
10437
10490
|
*
|
|
10438
10491
|
*/
|
|
10439
|
-
readonly alt_entity_filter_mode?:
|
|
10492
|
+
readonly alt_entity_filter_mode?: PrototypeFilterMode
|
|
10440
10493
|
|
|
10441
10494
|
/**
|
|
10442
10495
|
* The alt entity filters used by this selection tool indexed by entity name.
|
|
@@ -10461,7 +10514,7 @@ interface LuaItemPrototype {
|
|
|
10461
10514
|
* Applies to subclasses: SelectionTool
|
|
10462
10515
|
*
|
|
10463
10516
|
*/
|
|
10464
|
-
readonly alt_reverse_alt_entity_filter_mode?:
|
|
10517
|
+
readonly alt_reverse_alt_entity_filter_mode?: PrototypeFilterMode
|
|
10465
10518
|
|
|
10466
10519
|
/**
|
|
10467
10520
|
* The alt reverse entity filters used by this selection tool indexed by entity name.
|
|
@@ -10493,7 +10546,7 @@ interface LuaItemPrototype {
|
|
|
10493
10546
|
* Applies to subclasses: SelectionTool
|
|
10494
10547
|
*
|
|
10495
10548
|
*/
|
|
10496
|
-
readonly alt_reverse_selection_cursor_box_type?:
|
|
10549
|
+
readonly alt_reverse_selection_cursor_box_type?: CursorBoxRenderType
|
|
10497
10550
|
|
|
10498
10551
|
/**
|
|
10499
10552
|
* Flags that affect which entities will be selected during alt reverse selection.
|
|
@@ -10509,7 +10562,7 @@ interface LuaItemPrototype {
|
|
|
10509
10562
|
* Applies to subclasses: SelectionTool
|
|
10510
10563
|
*
|
|
10511
10564
|
*/
|
|
10512
|
-
readonly alt_reverse_tile_filter_mode?:
|
|
10565
|
+
readonly alt_reverse_tile_filter_mode?: PrototypeFilterMode
|
|
10513
10566
|
|
|
10514
10567
|
/**
|
|
10515
10568
|
* The alt reverse tile filters used by this selection tool indexed by tile name.
|
|
@@ -10532,7 +10585,7 @@ interface LuaItemPrototype {
|
|
|
10532
10585
|
* Applies to subclasses: SelectionTool
|
|
10533
10586
|
*
|
|
10534
10587
|
*/
|
|
10535
|
-
readonly alt_selection_cursor_box_type?:
|
|
10588
|
+
readonly alt_selection_cursor_box_type?: CursorBoxRenderType
|
|
10536
10589
|
|
|
10537
10590
|
/**
|
|
10538
10591
|
* Flags that affect which entities will be selected during alternate selection.
|
|
@@ -10548,7 +10601,7 @@ interface LuaItemPrototype {
|
|
|
10548
10601
|
* Applies to subclasses: SelectionTool
|
|
10549
10602
|
*
|
|
10550
10603
|
*/
|
|
10551
|
-
readonly alt_tile_filter_mode?:
|
|
10604
|
+
readonly alt_tile_filter_mode?: PrototypeFilterMode
|
|
10552
10605
|
|
|
10553
10606
|
/**
|
|
10554
10607
|
* The alt tile filters used by this selection tool indexed by tile name.
|
|
@@ -10651,7 +10704,7 @@ interface LuaItemPrototype {
|
|
|
10651
10704
|
* Applies to subclasses: SelectionTool
|
|
10652
10705
|
*
|
|
10653
10706
|
*/
|
|
10654
|
-
readonly entity_filter_mode?:
|
|
10707
|
+
readonly entity_filter_mode?: PrototypeFilterMode
|
|
10655
10708
|
|
|
10656
10709
|
/**
|
|
10657
10710
|
* The number of entity filters this deconstruction item has.
|
|
@@ -10679,7 +10732,7 @@ interface LuaItemPrototype {
|
|
|
10679
10732
|
readonly entity_type_filters?: {[key: string]: boolean}
|
|
10680
10733
|
|
|
10681
10734
|
/**
|
|
10682
|
-
* The prototype of this armor equipment grid, if any.
|
|
10735
|
+
* The prototype of this armor's equipment grid, if any.
|
|
10683
10736
|
* @remarks
|
|
10684
10737
|
* Applies to subclasses: Armor
|
|
10685
10738
|
*
|
|
@@ -10700,7 +10753,7 @@ interface LuaItemPrototype {
|
|
|
10700
10753
|
* Applies to subclasses: ItemWithInventory
|
|
10701
10754
|
*
|
|
10702
10755
|
*/
|
|
10703
|
-
readonly filter_mode?:
|
|
10756
|
+
readonly filter_mode?: 'none' | 'whitelist' | 'blacklist'
|
|
10704
10757
|
|
|
10705
10758
|
/**
|
|
10706
10759
|
* The flags for this item prototype.
|
|
@@ -10751,7 +10804,7 @@ interface LuaItemPrototype {
|
|
|
10751
10804
|
* Applies to subclasses: ItemWithInventory
|
|
10752
10805
|
*
|
|
10753
10806
|
*/
|
|
10754
|
-
readonly insertion_priority_mode?:
|
|
10807
|
+
readonly insertion_priority_mode?: 'default' | 'never' | 'always' | 'when-manually-filtered'
|
|
10755
10808
|
|
|
10756
10809
|
/**
|
|
10757
10810
|
* The main inventory size for item-with-inventory-prototype.
|
|
@@ -10902,7 +10955,7 @@ interface LuaItemPrototype {
|
|
|
10902
10955
|
* Applies to subclasses: SelectionTool
|
|
10903
10956
|
*
|
|
10904
10957
|
*/
|
|
10905
|
-
readonly reverse_alt_entity_filter_mode?:
|
|
10958
|
+
readonly reverse_alt_entity_filter_mode?: PrototypeFilterMode
|
|
10906
10959
|
|
|
10907
10960
|
/**
|
|
10908
10961
|
* The reverse entity filters used by this selection tool indexed by entity name.
|
|
@@ -10934,7 +10987,7 @@ interface LuaItemPrototype {
|
|
|
10934
10987
|
* Applies to subclasses: SelectionTool
|
|
10935
10988
|
*
|
|
10936
10989
|
*/
|
|
10937
|
-
readonly reverse_selection_cursor_box_type?:
|
|
10990
|
+
readonly reverse_selection_cursor_box_type?: CursorBoxRenderType
|
|
10938
10991
|
|
|
10939
10992
|
/**
|
|
10940
10993
|
* Flags that affect which entities will be selected during reverse selection.
|
|
@@ -10950,7 +11003,7 @@ interface LuaItemPrototype {
|
|
|
10950
11003
|
* Applies to subclasses: SelectionTool
|
|
10951
11004
|
*
|
|
10952
11005
|
*/
|
|
10953
|
-
readonly reverse_tile_filter_mode?:
|
|
11006
|
+
readonly reverse_tile_filter_mode?: PrototypeFilterMode
|
|
10954
11007
|
|
|
10955
11008
|
/**
|
|
10956
11009
|
* The reverse tile filters used by this selection tool indexed by tile name.
|
|
@@ -10978,7 +11031,7 @@ interface LuaItemPrototype {
|
|
|
10978
11031
|
* Applies to subclasses: SelectionTool
|
|
10979
11032
|
*
|
|
10980
11033
|
*/
|
|
10981
|
-
readonly selection_cursor_box_type?:
|
|
11034
|
+
readonly selection_cursor_box_type?: CursorBoxRenderType
|
|
10982
11035
|
|
|
10983
11036
|
/**
|
|
10984
11037
|
* Flags that affect which entities will be selected.
|
|
@@ -11033,7 +11086,7 @@ interface LuaItemPrototype {
|
|
|
11033
11086
|
* Applies to subclasses: SelectionTool
|
|
11034
11087
|
*
|
|
11035
11088
|
*/
|
|
11036
|
-
readonly tile_filter_mode?:
|
|
11089
|
+
readonly tile_filter_mode?: PrototypeFilterMode
|
|
11037
11090
|
|
|
11038
11091
|
/**
|
|
11039
11092
|
* The number of tile filters this deconstruction item has.
|
|
@@ -11320,11 +11373,10 @@ interface LuaItemStack {
|
|
|
11320
11373
|
* Applies to subclasses: UpgradeItem
|
|
11321
11374
|
*
|
|
11322
11375
|
* @param index - The index of the mapper to read.
|
|
11323
|
-
* @param type - `"from"` or `"to"`.
|
|
11324
11376
|
*/
|
|
11325
11377
|
get_mapper(this: void,
|
|
11326
11378
|
index: number,
|
|
11327
|
-
type:
|
|
11379
|
+
type: 'from' | 'to'): UpgradeFilter
|
|
11328
11380
|
|
|
11329
11381
|
/**
|
|
11330
11382
|
* Gets the tag with the given name or returns `nil` if it doesn't exist.
|
|
@@ -11423,7 +11475,7 @@ interface LuaItemStack {
|
|
|
11423
11475
|
* Applies to subclasses: DeconstructionItem
|
|
11424
11476
|
*
|
|
11425
11477
|
* @param filter - Writing `nil` removes the filter.
|
|
11426
|
-
* @returns Whether the new filter was successfully set (
|
|
11478
|
+
* @returns Whether the new filter was successfully set (meaning it was valid).
|
|
11427
11479
|
*/
|
|
11428
11480
|
set_entity_filter(this: void,
|
|
11429
11481
|
index: number,
|
|
@@ -11436,12 +11488,11 @@ interface LuaItemStack {
|
|
|
11436
11488
|
*
|
|
11437
11489
|
* @param filter - The filter to set or `nil`
|
|
11438
11490
|
* @param index - The index of the mapper to set.
|
|
11439
|
-
* @param type - `from` or `to`.
|
|
11440
11491
|
*/
|
|
11441
11492
|
set_mapper(this: void,
|
|
11442
11493
|
index: number,
|
|
11443
|
-
type:
|
|
11444
|
-
filter: UpgradeFilter): void
|
|
11494
|
+
type: 'from' | 'to',
|
|
11495
|
+
filter: UpgradeFilter | null): void
|
|
11445
11496
|
|
|
11446
11497
|
/**
|
|
11447
11498
|
* Set this item stack to another item stack.
|
|
@@ -11466,12 +11517,12 @@ interface LuaItemStack {
|
|
|
11466
11517
|
* @remarks
|
|
11467
11518
|
* Applies to subclasses: DeconstructionItem
|
|
11468
11519
|
*
|
|
11469
|
-
* @param filter -
|
|
11470
|
-
* @returns Whether the new filter was successfully set (
|
|
11520
|
+
* @param filter - Writing `nil` removes the filter.
|
|
11521
|
+
* @returns Whether the new filter was successfully set (meaning was valid).
|
|
11471
11522
|
*/
|
|
11472
11523
|
set_tile_filter(this: void,
|
|
11473
11524
|
index: number,
|
|
11474
|
-
filter: string | LuaTilePrototype | LuaTile): boolean
|
|
11525
|
+
filter: string | LuaTilePrototype | LuaTile | null): boolean
|
|
11475
11526
|
|
|
11476
11527
|
/**
|
|
11477
11528
|
* Swaps this item stack with the given item stack if allowed.
|
|
@@ -11770,7 +11821,7 @@ interface LuaItemStack {
|
|
|
11770
11821
|
* Applies to subclasses: ItemWithInventory
|
|
11771
11822
|
*
|
|
11772
11823
|
*/
|
|
11773
|
-
prioritize_insertion_mode:
|
|
11824
|
+
prioritize_insertion_mode: 'default' | 'never' | 'always' | 'when-manually-filtered'
|
|
11774
11825
|
|
|
11775
11826
|
/**
|
|
11776
11827
|
* Prototype of the item held in this stack.
|
|
@@ -12069,11 +12120,11 @@ interface LuaLogisticNetwork {
|
|
|
12069
12120
|
/**
|
|
12070
12121
|
* Count given or all items in the network or given members.
|
|
12071
12122
|
* @param item - Item name to count. If not given, gives counts of all items in the network.
|
|
12072
|
-
* @param member - Logistic members to check
|
|
12123
|
+
* @param member - Logistic members to check. If not given, gives count in the entire network.
|
|
12073
12124
|
*/
|
|
12074
12125
|
get_item_count(this: void,
|
|
12075
12126
|
item?: string,
|
|
12076
|
-
member?:
|
|
12127
|
+
member?: 'storage' | 'providers'): number
|
|
12077
12128
|
|
|
12078
12129
|
/**
|
|
12079
12130
|
* Get the amount of items of the given type indexed by the storage member.
|
|
@@ -12097,40 +12148,40 @@ interface LuaLogisticNetwork {
|
|
|
12097
12148
|
/**
|
|
12098
12149
|
* Insert items into the logistic network. This will actually insert the items into some logistic chests.
|
|
12099
12150
|
* @param item - What to insert.
|
|
12100
|
-
* @param members - Which logistic members to insert the items to.
|
|
12151
|
+
* @param members - Which logistic members to insert the items to. `"storage-empty"` inserts into storage chests that are completely empty, `"storage-empty-slot"` inserts into storage chests that have an empty slot. If not specified, inserts items into the logistic network in the usual order.
|
|
12101
12152
|
* @returns Number of items actually inserted.
|
|
12102
12153
|
*/
|
|
12103
12154
|
insert(this: void,
|
|
12104
12155
|
item: ItemStackIdentification,
|
|
12105
|
-
members?:
|
|
12156
|
+
members?: 'storage' | 'storage-empty' | 'storage-empty-slot' | 'requester'): number
|
|
12106
12157
|
|
|
12107
12158
|
/**
|
|
12108
12159
|
* Remove items from the logistic network. This will actually remove the items from some logistic chests.
|
|
12109
12160
|
* @param item - What to remove.
|
|
12110
|
-
* @param members - Which logistic members to remove from.
|
|
12161
|
+
* @param members - Which logistic members to remove from. If not specified, removes from the network in the usual order.
|
|
12111
12162
|
* @returns Number of items removed.
|
|
12112
12163
|
*/
|
|
12113
12164
|
remove_item(this: void,
|
|
12114
12165
|
item: ItemStackIdentification,
|
|
12115
|
-
members?:
|
|
12166
|
+
members?: 'active-provider' | 'passive-provider' | 'buffer' | 'storage'): number
|
|
12116
12167
|
|
|
12117
12168
|
/**
|
|
12118
12169
|
* Find a logistic point to drop the specific item stack.
|
|
12119
|
-
* @param table.members - When given, it will find from only the specific type of member.
|
|
12120
|
-
* @param table.stack - Name of the item to
|
|
12170
|
+
* @param table.members - When given, it will find from only the specific type of member. If not specified, selects with normal priorities.
|
|
12171
|
+
* @param table.stack - Name of the item to drop off.
|
|
12121
12172
|
* @returns `nil` if no point was found.
|
|
12122
12173
|
*/
|
|
12123
12174
|
select_drop_point(this: void,
|
|
12124
12175
|
table: {
|
|
12125
12176
|
stack: ItemStackIdentification,
|
|
12126
|
-
members?:
|
|
12177
|
+
members?: 'storage' | 'storage-empty' | 'storage-empty-slot' | 'requester'
|
|
12127
12178
|
}): LuaLogisticPoint | null
|
|
12128
12179
|
|
|
12129
12180
|
/**
|
|
12130
12181
|
* Find the 'best' logistic point with this item ID and from the given position or from given chest type.
|
|
12131
12182
|
* @param table.include_buffers - Whether to consider buffer chests or not. Defaults to false. Only considered if selecting with position.
|
|
12132
|
-
* @param table.members - When given, it will find from only the specific type of member.
|
|
12133
|
-
* @param table.name - Name of the item to
|
|
12183
|
+
* @param table.members - When given, it will find from only the specific type of member. If not specified, selects with normal priorities. Not considered if position is specified.
|
|
12184
|
+
* @param table.name - Name of the item to pick up.
|
|
12134
12185
|
* @param table.position - When given, it will find the storage 'best' storage point from this position.
|
|
12135
12186
|
* @returns `nil` if no point was found.
|
|
12136
12187
|
*/
|
|
@@ -12139,7 +12190,7 @@ interface LuaLogisticNetwork {
|
|
|
12139
12190
|
name: string,
|
|
12140
12191
|
position?: MapPosition,
|
|
12141
12192
|
include_buffers?: boolean,
|
|
12142
|
-
members?:
|
|
12193
|
+
members?: 'active-provider' | 'passive-provider' | 'buffer' | 'storage'
|
|
12143
12194
|
}): LuaLogisticPoint | null
|
|
12144
12195
|
|
|
12145
12196
|
/**
|
|
@@ -13090,6 +13141,9 @@ interface LuaPlayer extends LuaControl {
|
|
|
13090
13141
|
|
|
13091
13142
|
/**
|
|
13092
13143
|
* Play a sound for this player.
|
|
13144
|
+
* @remarks
|
|
13145
|
+
* The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this player.
|
|
13146
|
+
*
|
|
13093
13147
|
* @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
|
|
13094
13148
|
* @param table.path - The sound to play.
|
|
13095
13149
|
* @param table.position - Where the sound should be played. If not given, it's played at the current position of the player.
|
|
@@ -14160,7 +14214,7 @@ interface LuaRendering {
|
|
|
14160
14214
|
id: number): void
|
|
14161
14215
|
|
|
14162
14216
|
/**
|
|
14163
|
-
* Destroys all render objects.
|
|
14217
|
+
* Destroys all render objects.
|
|
14164
14218
|
* @param mod_name - If provided, only the render objects created by this mod are destroyed. An empty string (`""`) refers to all objects not belonging to a mod, such as those created using console commands.
|
|
14165
14219
|
*/
|
|
14166
14220
|
clear(this: void,
|
|
@@ -14500,7 +14554,7 @@ interface LuaRendering {
|
|
|
14500
14554
|
* @remarks
|
|
14501
14555
|
* Not all fonts support scaling.
|
|
14502
14556
|
*
|
|
14503
|
-
* @param table.alignment - Defaults to "left".
|
|
14557
|
+
* @param table.alignment - Defaults to "left".
|
|
14504
14558
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities. Rich text does not support this option.
|
|
14505
14559
|
* @param table.font - Name of font to use. Defaults to the same font as flying-text.
|
|
14506
14560
|
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
@@ -14512,7 +14566,7 @@ interface LuaRendering {
|
|
|
14512
14566
|
* @param table.text - The text to display.
|
|
14513
14567
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
14514
14568
|
* @param table.use_rich_text - If rich text rendering is enabled. Defaults to false.
|
|
14515
|
-
* @param table.vertical_alignment - Defaults to "top".
|
|
14569
|
+
* @param table.vertical_alignment - Defaults to "top".
|
|
14516
14570
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
14517
14571
|
* @returns Id of the render object
|
|
14518
14572
|
*/
|
|
@@ -14531,8 +14585,8 @@ interface LuaRendering {
|
|
|
14531
14585
|
visible?: boolean,
|
|
14532
14586
|
draw_on_ground?: boolean,
|
|
14533
14587
|
orientation?: RealOrientation,
|
|
14534
|
-
alignment?:
|
|
14535
|
-
vertical_alignment?:
|
|
14588
|
+
alignment?: TextAlign,
|
|
14589
|
+
vertical_alignment?: VerticalTextAlign,
|
|
14536
14590
|
scale_with_zoom?: boolean,
|
|
14537
14591
|
only_in_alt_mode?: boolean,
|
|
14538
14592
|
use_rich_text?: boolean
|
|
@@ -14546,7 +14600,7 @@ interface LuaRendering {
|
|
|
14546
14600
|
* @returns `nil` if the object is not a text.
|
|
14547
14601
|
*/
|
|
14548
14602
|
get_alignment(this: void,
|
|
14549
|
-
id: number):
|
|
14603
|
+
id: number): TextAlign | null
|
|
14550
14604
|
|
|
14551
14605
|
/**
|
|
14552
14606
|
* Gets an array of all valid object ids.
|
|
@@ -14888,10 +14942,10 @@ interface LuaRendering {
|
|
|
14888
14942
|
id: number): ScriptRenderTarget | null
|
|
14889
14943
|
|
|
14890
14944
|
/**
|
|
14891
|
-
* Gets the type of the given object.
|
|
14945
|
+
* Gets the type of the given object.
|
|
14892
14946
|
*/
|
|
14893
14947
|
get_type(this: void,
|
|
14894
|
-
id: number):
|
|
14948
|
+
id: number): 'text' | 'line' | 'circle' | 'rectangle' | 'arc' | 'polygon' | 'sprite' | 'light' | 'animation'
|
|
14895
14949
|
|
|
14896
14950
|
/**
|
|
14897
14951
|
* Get if the text with this id parses rich text tags.
|
|
@@ -14918,7 +14972,7 @@ interface LuaRendering {
|
|
|
14918
14972
|
* @returns `nil` if the object is not a text.
|
|
14919
14973
|
*/
|
|
14920
14974
|
get_vertical_alignment(this: void,
|
|
14921
|
-
id: number):
|
|
14975
|
+
id: number): VerticalTextAlign | null
|
|
14922
14976
|
|
|
14923
14977
|
/**
|
|
14924
14978
|
* Get the vertices of the polygon with this id.
|
|
@@ -14983,11 +15037,10 @@ interface LuaRendering {
|
|
|
14983
15037
|
* @remarks
|
|
14984
15038
|
* Applies to subclasses: Text
|
|
14985
15039
|
*
|
|
14986
|
-
* @param alignment - "left", "right" or "center".
|
|
14987
15040
|
*/
|
|
14988
15041
|
set_alignment(this: void,
|
|
14989
15042
|
id: number,
|
|
14990
|
-
alignment:
|
|
15043
|
+
alignment: TextAlign): void
|
|
14991
15044
|
|
|
14992
15045
|
/**
|
|
14993
15046
|
* Set the angle of the arc with this id. Does nothing if this object is not a arc.
|
|
@@ -15378,11 +15431,10 @@ interface LuaRendering {
|
|
|
15378
15431
|
* @remarks
|
|
15379
15432
|
* Applies to subclasses: Text
|
|
15380
15433
|
*
|
|
15381
|
-
* @param alignment - "top", "middle", "baseline" or "bottom"
|
|
15382
15434
|
*/
|
|
15383
15435
|
set_vertical_alignment(this: void,
|
|
15384
15436
|
id: number,
|
|
15385
|
-
alignment:
|
|
15437
|
+
alignment: VerticalTextAlign): void
|
|
15386
15438
|
|
|
15387
15439
|
/**
|
|
15388
15440
|
* Set the vertices of the polygon with this id. Does nothing if this object is not a polygon.
|
|
@@ -15821,9 +15873,9 @@ interface LuaStyle {
|
|
|
15821
15873
|
height: number
|
|
15822
15874
|
|
|
15823
15875
|
/**
|
|
15824
|
-
* Horizontal align of the inner content of the widget, if any.
|
|
15876
|
+
* Horizontal align of the inner content of the widget, if any.
|
|
15825
15877
|
*/
|
|
15826
|
-
horizontal_align?:
|
|
15878
|
+
horizontal_align?: 'left' | 'center' | 'right'
|
|
15827
15879
|
|
|
15828
15880
|
/**
|
|
15829
15881
|
* Horizontal space between individual cells.
|
|
@@ -16018,9 +16070,9 @@ interface LuaStyle {
|
|
|
16018
16070
|
readonly valid: boolean
|
|
16019
16071
|
|
|
16020
16072
|
/**
|
|
16021
|
-
* Vertical align of the inner content of the widget, if any.
|
|
16073
|
+
* Vertical align of the inner content of the widget, if any.
|
|
16022
16074
|
*/
|
|
16023
|
-
vertical_align?:
|
|
16075
|
+
vertical_align?: 'top' | 'center' | 'bottom'
|
|
16024
16076
|
|
|
16025
16077
|
/**
|
|
16026
16078
|
* Vertical space between individual cells.
|
|
@@ -16088,7 +16140,7 @@ interface LuaSurface {
|
|
|
16088
16140
|
|
|
16089
16141
|
/**
|
|
16090
16142
|
* @param positions - Positions for which to calculate property values
|
|
16091
|
-
* @param property_names - Names of properties (
|
|
16143
|
+
* @param property_names - Names of properties (`"elevation"`, etc) to calculate.
|
|
16092
16144
|
* @returns Table of property value lists, keyed by property name
|
|
16093
16145
|
*/
|
|
16094
16146
|
calculate_tile_properties(this: void,
|
|
@@ -16195,7 +16247,7 @@ interface LuaSurface {
|
|
|
16195
16247
|
source_area: BoundingBox,
|
|
16196
16248
|
destination_area: BoundingBox,
|
|
16197
16249
|
destination_surface?: SurfaceIdentification,
|
|
16198
|
-
destination_force?:
|
|
16250
|
+
destination_force?: ForceIdentification,
|
|
16199
16251
|
clone_tiles?: boolean,
|
|
16200
16252
|
clone_entities?: boolean,
|
|
16201
16253
|
clone_decoratives?: boolean,
|
|
@@ -16530,7 +16582,7 @@ interface LuaSurface {
|
|
|
16530
16582
|
find_enemy_units(this: void,
|
|
16531
16583
|
center: MapPosition,
|
|
16532
16584
|
radius: number,
|
|
16533
|
-
force?:
|
|
16585
|
+
force?: ForceIdentification): LuaEntity[]
|
|
16534
16586
|
|
|
16535
16587
|
/**
|
|
16536
16588
|
* Find entities in a given area.
|
|
@@ -16732,7 +16784,7 @@ interface LuaSurface {
|
|
|
16732
16784
|
find_units(this: void,
|
|
16733
16785
|
table: {
|
|
16734
16786
|
area: BoundingBox,
|
|
16735
|
-
force:
|
|
16787
|
+
force: ForceIdentification,
|
|
16736
16788
|
condition: ForceCondition
|
|
16737
16789
|
}): LuaEntity[]
|
|
16738
16790
|
|
|
@@ -16778,7 +16830,7 @@ interface LuaSurface {
|
|
|
16778
16830
|
*/
|
|
16779
16831
|
get_entities_with_force(this: void,
|
|
16780
16832
|
position: ChunkPosition,
|
|
16781
|
-
force:
|
|
16833
|
+
force: ForceIdentification): LuaEntity[]
|
|
16782
16834
|
|
|
16783
16835
|
/**
|
|
16784
16836
|
* The hidden tile name.
|
|
@@ -16894,6 +16946,9 @@ interface LuaSurface {
|
|
|
16894
16946
|
|
|
16895
16947
|
/**
|
|
16896
16948
|
* Play a sound for every player on this surface.
|
|
16949
|
+
* @remarks
|
|
16950
|
+
* The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
|
|
16951
|
+
*
|
|
16897
16952
|
* @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
|
|
16898
16953
|
* @param table.path - The sound to play.
|
|
16899
16954
|
* @param table.position - Where the sound should be played. If not given, it's played at the current position of each player.
|
|
@@ -16995,13 +17050,13 @@ interface LuaSurface {
|
|
|
16995
17050
|
}): number
|
|
16996
17051
|
|
|
16997
17052
|
/**
|
|
16998
|
-
* Request that the game's map generator generate chunks at the given position for the given radius on this surface.
|
|
17053
|
+
* Request that the game's map generator generate chunks at the given position for the given radius on this surface. If the radius is `0`, then only the chunk at the given position is generated.
|
|
16999
17054
|
* @param position - Where to generate the new chunks.
|
|
17000
|
-
* @param radius - The chunk radius from `position` to generate new chunks in.
|
|
17055
|
+
* @param radius - The chunk radius from `position` to generate new chunks in. Defaults to `0`.
|
|
17001
17056
|
*/
|
|
17002
17057
|
request_to_generate_chunks(this: void,
|
|
17003
17058
|
position: MapPosition,
|
|
17004
|
-
radius
|
|
17059
|
+
radius?: number): void
|
|
17005
17060
|
|
|
17006
17061
|
/**
|
|
17007
17062
|
* Set generated status of a chunk. Useful when copying chunks.
|
|
@@ -17044,14 +17099,14 @@ interface LuaSurface {
|
|
|
17044
17099
|
* It is recommended to call this method once for all the tiles you want to change rather than calling it individually for every tile. As the tile correction is used after every step, calling it one by one could cause the tile correction logic to redo some of the changes. Also, many small API calls are generally more performance intensive than one big one.
|
|
17045
17100
|
*
|
|
17046
17101
|
* @param correct_tiles - If `false`, the correction logic is not applied to the changed tiles. Defaults to `true`.
|
|
17047
|
-
* @param raise_event -
|
|
17048
|
-
* @param remove_colliding_decoratives -
|
|
17049
|
-
* @param remove_colliding_entities -
|
|
17102
|
+
* @param raise_event - Defaults to `false`.
|
|
17103
|
+
* @param remove_colliding_decoratives - Defaults to `true`.
|
|
17104
|
+
* @param remove_colliding_entities - Defaults to `true`.
|
|
17050
17105
|
*/
|
|
17051
17106
|
set_tiles(this: void,
|
|
17052
17107
|
tiles: Tile[],
|
|
17053
17108
|
correct_tiles?: boolean,
|
|
17054
|
-
remove_colliding_entities?: boolean |
|
|
17109
|
+
remove_colliding_entities?: boolean | 'abort_on_collision',
|
|
17055
17110
|
remove_colliding_decoratives?: boolean,
|
|
17056
17111
|
raise_event?: boolean): void
|
|
17057
17112
|
|
|
@@ -17068,7 +17123,7 @@ interface LuaSurface {
|
|
|
17068
17123
|
position: MapPosition,
|
|
17069
17124
|
items: ItemStackIdentification,
|
|
17070
17125
|
enable_looted?: boolean,
|
|
17071
|
-
force?:
|
|
17126
|
+
force?: ForceIdentification,
|
|
17072
17127
|
allow_belts?: boolean): LuaEntity[]
|
|
17073
17128
|
|
|
17074
17129
|
/**
|
|
@@ -17191,9 +17246,6 @@ interface LuaSurface {
|
|
|
17191
17246
|
|
|
17192
17247
|
/**
|
|
17193
17248
|
* The multiplier of solar power on this surface. Cannot be less than 0.
|
|
17194
|
-
* @remarks
|
|
17195
|
-
* Solar equipment is still limited to its maximum power output.
|
|
17196
|
-
*
|
|
17197
17249
|
*/
|
|
17198
17250
|
solar_power_multiplier: number
|
|
17199
17251
|
|
|
@@ -18412,6 +18464,8 @@ interface LuaWallControlBehavior extends LuaControlBehavior {
|
|
|
18412
18464
|
*
|
|
18413
18465
|
*/
|
|
18414
18466
|
interface LuaControlSetGuiArrowParams {
|
|
18467
|
+
'margin': number
|
|
18468
|
+
|
|
18415
18469
|
/**
|
|
18416
18470
|
* Where to point to. This field determines what other fields are mandatory.
|
|
18417
18471
|
*/
|
|
@@ -18425,6 +18479,9 @@ interface LuaControlSetGuiArrowParams {
|
|
|
18425
18479
|
*
|
|
18426
18480
|
*/
|
|
18427
18481
|
interface LuaControlSetGuiArrowParamsCraftingQueue extends LuaControlSetGuiArrowParams {
|
|
18482
|
+
/**
|
|
18483
|
+
* Index in the crafting queue to point to.
|
|
18484
|
+
*/
|
|
18428
18485
|
'crafting_queueindex': number
|
|
18429
18486
|
|
|
18430
18487
|
}
|
|
@@ -18445,14 +18502,17 @@ interface LuaControlSetGuiArrowParamsEntity extends LuaControlSetGuiArrowParams
|
|
|
18445
18502
|
*
|
|
18446
18503
|
*/
|
|
18447
18504
|
interface LuaControlSetGuiArrowParamsItemStack extends LuaControlSetGuiArrowParams {
|
|
18505
|
+
/**
|
|
18506
|
+
* Which inventory the stack is in.
|
|
18507
|
+
*/
|
|
18448
18508
|
'inventory_index': defines.inventory
|
|
18449
18509
|
|
|
18450
|
-
'item_stack_index': number
|
|
18451
|
-
|
|
18452
18510
|
/**
|
|
18453
|
-
*
|
|
18511
|
+
* Which stack to point to.
|
|
18454
18512
|
*/
|
|
18455
|
-
'
|
|
18513
|
+
'item_stack_index': number
|
|
18514
|
+
|
|
18515
|
+
'source': 'player' | 'target' | 'player-quickbar' | 'player-equipment-bar'
|
|
18456
18516
|
|
|
18457
18517
|
}
|
|
18458
18518
|
|
|
@@ -18627,7 +18687,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends LuaGuiElementAddParams
|
|
|
18627
18687
|
/**
|
|
18628
18688
|
* The type of the button - one of the following values.
|
|
18629
18689
|
*/
|
|
18630
|
-
'elem_type':
|
|
18690
|
+
'elem_type': ElemType
|
|
18631
18691
|
|
|
18632
18692
|
/**
|
|
18633
18693
|
* If type is `"entity"` - the default value for the button.
|
|
@@ -18701,9 +18761,9 @@ interface LuaGuiElementAddParamsDropDown extends LuaGuiElementAddParams {
|
|
|
18701
18761
|
*/
|
|
18702
18762
|
interface LuaGuiElementAddParamsFlow extends LuaGuiElementAddParams {
|
|
18703
18763
|
/**
|
|
18704
|
-
* The initial direction of the flow's layout.
|
|
18764
|
+
* The initial direction of the flow's layout. Defaults to `"horizontal"`.
|
|
18705
18765
|
*/
|
|
18706
|
-
'direction'?:
|
|
18766
|
+
'direction'?: GuiDirection
|
|
18707
18767
|
|
|
18708
18768
|
}
|
|
18709
18769
|
|
|
@@ -18714,9 +18774,9 @@ interface LuaGuiElementAddParamsFlow extends LuaGuiElementAddParams {
|
|
|
18714
18774
|
*/
|
|
18715
18775
|
interface LuaGuiElementAddParamsFrame extends LuaGuiElementAddParams {
|
|
18716
18776
|
/**
|
|
18717
|
-
* The initial direction of the frame's layout.
|
|
18777
|
+
* The initial direction of the frame's layout. Defaults to `"horizontal"`.
|
|
18718
18778
|
*/
|
|
18719
|
-
'direction'?:
|
|
18779
|
+
'direction'?: GuiDirection
|
|
18720
18780
|
|
|
18721
18781
|
}
|
|
18722
18782
|
|
|
@@ -18729,7 +18789,7 @@ interface LuaGuiElementAddParamsLine extends LuaGuiElementAddParams {
|
|
|
18729
18789
|
/**
|
|
18730
18790
|
* The initial direction of the line. Defaults to `"horizontal"`.
|
|
18731
18791
|
*/
|
|
18732
|
-
'direction'?:
|
|
18792
|
+
'direction'?: GuiDirection
|
|
18733
18793
|
|
|
18734
18794
|
}
|
|
18735
18795
|
|
|
@@ -18817,14 +18877,14 @@ interface LuaGuiElementAddParamsRadiobutton extends LuaGuiElementAddParams {
|
|
|
18817
18877
|
*/
|
|
18818
18878
|
interface LuaGuiElementAddParamsScrollPane extends LuaGuiElementAddParams {
|
|
18819
18879
|
/**
|
|
18820
|
-
* Policy of the horizontal scroll bar.
|
|
18880
|
+
* Policy of the horizontal scroll bar. Defaults to `"auto"`.
|
|
18821
18881
|
*/
|
|
18822
|
-
'horizontal_scroll_policy'?:
|
|
18882
|
+
'horizontal_scroll_policy'?: ScrollPolicy
|
|
18823
18883
|
|
|
18824
18884
|
/**
|
|
18825
|
-
* Policy of the vertical scroll bar.
|
|
18885
|
+
* Policy of the vertical scroll bar. Defaults to `"auto"`.
|
|
18826
18886
|
*/
|
|
18827
|
-
'vertical_scroll_policy'?:
|
|
18887
|
+
'vertical_scroll_policy'?: ScrollPolicy
|
|
18828
18888
|
|
|
18829
18889
|
}
|
|
18830
18890
|
|
|
@@ -18952,9 +19012,9 @@ interface LuaGuiElementAddParamsSwitch extends LuaGuiElementAddParams {
|
|
|
18952
19012
|
'right_label_tooltip'?: LocalisedString
|
|
18953
19013
|
|
|
18954
19014
|
/**
|
|
18955
|
-
*
|
|
19015
|
+
* If set to "none", `allow_none_state` must be `true`. Defaults to `"left"`.
|
|
18956
19016
|
*/
|
|
18957
|
-
'switch_state'?:
|
|
19017
|
+
'switch_state'?: SwitchState
|
|
18958
19018
|
|
|
18959
19019
|
}
|
|
18960
19020
|
|
|
@@ -19552,9 +19612,9 @@ interface LuaSurfaceCreateEntityParamsStream extends LuaSurfaceCreateEntityParam
|
|
|
19552
19612
|
*/
|
|
19553
19613
|
interface LuaSurfaceCreateEntityParamsUndergroundBelt extends LuaSurfaceCreateEntityParams {
|
|
19554
19614
|
/**
|
|
19555
|
-
*
|
|
19615
|
+
* Defaults to `"input"`.
|
|
19556
19616
|
*/
|
|
19557
|
-
'type'?:
|
|
19617
|
+
'type'?: 'output' | 'input'
|
|
19558
19618
|
|
|
19559
19619
|
}
|
|
19560
19620
|
|