factorio-types 1.2.64 → 1.2.66
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 +290 -60
- package/dist/concepts.d.ts +43 -9
- package/dist/datacollection.d.ts +1 -1
- package/dist/defines.d.ts +211 -207
- package/dist/events.d.ts +56 -1
- package/dist/global.d.ts +1 -1
- package/dist/prototypes.d.ts +29 -9
- package/dist/types.d.ts +24 -31
- package/package.json +2 -2
- package/src/core.d.ts +3 -3
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 2.1.
|
|
5
|
+
// Factorio version 2.1.16
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -1648,6 +1648,24 @@ interface LuaBootstrap {
|
|
|
1648
1648
|
script.on_event(defines.events.on_built_entity,
|
|
1649
1649
|
function(event) game.print("Gotta go fast!") end,
|
|
1650
1650
|
{{filter = "name", name = "fast-inserter"}})
|
|
1651
|
+
```
|
|
1652
|
+
*/
|
|
1653
|
+
on_event(this: void, event: defines.events.on_next_day_started, handler: ((this: void, arg0: runtime.on_next_day_started) => any) | nil, filters?: EventFilter): void;
|
|
1654
|
+
/**
|
|
1655
|
+
* Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
|
|
1656
|
+
* @param event The event(s) or custom-input to invoke the handler on.
|
|
1657
|
+
* @param handler The handler for this event. Passing `nil` will unregister it.
|
|
1658
|
+
* @param filters The filters for this event. Can only be used when registering for individual events.
|
|
1659
|
+
* @example ```
|
|
1660
|
+
-- Register for the on_tick event to print the current tick to console each tick
|
|
1661
|
+
script.on_event(defines.events.on_tick,
|
|
1662
|
+
function(event) game.print(event.tick) end)
|
|
1663
|
+
```
|
|
1664
|
+
* @example ```
|
|
1665
|
+
-- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
|
|
1666
|
+
script.on_event(defines.events.on_built_entity,
|
|
1667
|
+
function(event) game.print("Gotta go fast!") end,
|
|
1668
|
+
{{filter = "name", name = "fast-inserter"}})
|
|
1651
1669
|
```
|
|
1652
1670
|
*/
|
|
1653
1671
|
on_event(this: void, event: defines.events.on_object_destroyed, handler: ((this: void, arg0: runtime.on_object_destroyed) => any) | nil, filters?: EventFilter): void;
|
|
@@ -2746,6 +2764,24 @@ interface LuaBootstrap {
|
|
|
2746
2764
|
script.on_event(defines.events.on_built_entity,
|
|
2747
2765
|
function(event) game.print("Gotta go fast!") end,
|
|
2748
2766
|
{{filter = "name", name = "fast-inserter"}})
|
|
2767
|
+
```
|
|
2768
|
+
*/
|
|
2769
|
+
on_event(this: void, event: defines.events.on_player_super_forced_selected_area, handler: ((this: void, arg0: runtime.on_player_super_forced_selected_area) => any) | nil, filters?: EventFilter): void;
|
|
2770
|
+
/**
|
|
2771
|
+
* Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
|
|
2772
|
+
* @param event The event(s) or custom-input to invoke the handler on.
|
|
2773
|
+
* @param handler The handler for this event. Passing `nil` will unregister it.
|
|
2774
|
+
* @param filters The filters for this event. Can only be used when registering for individual events.
|
|
2775
|
+
* @example ```
|
|
2776
|
+
-- Register for the on_tick event to print the current tick to console each tick
|
|
2777
|
+
script.on_event(defines.events.on_tick,
|
|
2778
|
+
function(event) game.print(event.tick) end)
|
|
2779
|
+
```
|
|
2780
|
+
* @example ```
|
|
2781
|
+
-- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
|
|
2782
|
+
script.on_event(defines.events.on_built_entity,
|
|
2783
|
+
function(event) game.print("Gotta go fast!") end,
|
|
2784
|
+
{{filter = "name", name = "fast-inserter"}})
|
|
2749
2785
|
```
|
|
2750
2786
|
*/
|
|
2751
2787
|
on_event(this: void, event: defines.events.on_player_toggled_alt_mode, handler: ((this: void, arg0: runtime.on_player_toggled_alt_mode) => any) | nil, filters?: EventFilter): void;
|
|
@@ -4785,6 +4821,7 @@ interface LuaBurner {
|
|
|
4785
4821
|
*/
|
|
4786
4822
|
interface LuaBurnerPrototype {
|
|
4787
4823
|
readonly auto_refuel: boolean;
|
|
4824
|
+
readonly burner_usage: LuaBurnerUsagePrototype;
|
|
4788
4825
|
readonly burnt_inventory_size: uint32;
|
|
4789
4826
|
readonly effectivity: double;
|
|
4790
4827
|
/**
|
|
@@ -4796,6 +4833,7 @@ interface LuaBurnerPrototype {
|
|
|
4796
4833
|
*/
|
|
4797
4834
|
readonly fuel_categories: Record<string, true>;
|
|
4798
4835
|
readonly fuel_inventory_size: uint32;
|
|
4836
|
+
readonly hide_from_stats: boolean;
|
|
4799
4837
|
readonly initial_fuel?: LuaItemPrototype;
|
|
4800
4838
|
readonly initial_fuel_percent: double;
|
|
4801
4839
|
/**
|
|
@@ -5141,13 +5179,13 @@ interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
|
|
|
5141
5179
|
* Gets section on the selected index, if it exists.
|
|
5142
5180
|
* @param section_index Index of the section.
|
|
5143
5181
|
*/
|
|
5144
|
-
get_section(this: void, section_index:
|
|
5182
|
+
get_section(this: void, section_index: LogisticSectionIndex): LuaLogisticSection | null;
|
|
5145
5183
|
/**
|
|
5146
5184
|
* Removes the given logistic section if possible. Removal may fail if the section index is out of range or the section is not {@link manual | runtime:LuaLogisticSection::is_manual}.
|
|
5147
5185
|
* @param section_index Index of the section.
|
|
5148
5186
|
* @returns Whether section was removed.
|
|
5149
5187
|
*/
|
|
5150
|
-
remove_section(this: void, section_index:
|
|
5188
|
+
remove_section(this: void, section_index: LogisticSectionIndex): boolean;
|
|
5151
5189
|
/**
|
|
5152
5190
|
* Turns this constant combinator on and off.
|
|
5153
5191
|
*/
|
|
@@ -5584,9 +5622,9 @@ interface LuaControl {
|
|
|
5584
5622
|
*
|
|
5585
5623
|
* This is the GUI that will asked to close (by firing the {@link on_gui_closed | runtime:on_gui_closed} event) when the `Esc` or `E` keys are pressed. If this attribute is non-nil, then writing `nil` or a new GUI to it will ask the existing GUI to close.
|
|
5586
5624
|
*
|
|
5587
|
-
* Write supports any of the types. Read will return the `entity`, `equipment`, `equipment-grid`, `player`, `element`, `inventory`, `item` or `nil`.
|
|
5625
|
+
* Write supports any of the types. Read will return the `entity`, `equipment`, `equipment-grid`, `player`, `element`, `inventory`, `item`, `tile`, or `nil`.
|
|
5588
5626
|
*/
|
|
5589
|
-
opened?: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | LuaInventory | LuaLogisticNetwork | defines.gui_type;
|
|
5627
|
+
opened?: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | LuaInventory | LuaLogisticNetwork | LuaTile | defines.gui_type;
|
|
5590
5628
|
readonly opened_gui_type?: defines.gui_type;
|
|
5591
5629
|
/**
|
|
5592
5630
|
* Current item-picking state.
|
|
@@ -5988,6 +6026,11 @@ interface LuaDamagePrototype extends LuaPrototypeBase {
|
|
|
5988
6026
|
* This class also provides debug session APIs, as the global object `debugadapter` in all stages.
|
|
5989
6027
|
*/
|
|
5990
6028
|
interface LuaDebugAdapter {
|
|
6029
|
+
/**
|
|
6030
|
+
* Pause execution as if a breakpoint was hit.
|
|
6031
|
+
* @param mesg If specified, this value is displayed as if it was thrown as an error.
|
|
6032
|
+
*/
|
|
6033
|
+
breakpoint(this: void, mesg?: Any): void;
|
|
5991
6034
|
/**
|
|
5992
6035
|
* Prepare a default debug view entry for a field, to assist in preparing custom listings.
|
|
5993
6036
|
* @param name The name of the field
|
|
@@ -5995,14 +6038,19 @@ interface LuaDebugAdapter {
|
|
|
5995
6038
|
*/
|
|
5996
6039
|
describe_field(this: void, name: string, value: Any): DebugVariable;
|
|
5997
6040
|
/**
|
|
5998
|
-
*
|
|
6041
|
+
* Print values to the debug console. This function also replaces the Lua builtin `print` during debug sessions.
|
|
6042
|
+
* @param args Values to print
|
|
6043
|
+
*/
|
|
6044
|
+
print(this: void, ...args: Any[]): void;
|
|
6045
|
+
/**
|
|
6046
|
+
* Start recording profiler timings. If there is a previous recording session running, it will be stopped first. This function is also available to the DAP client as the request `startProfile`, with the parameter in `argument`. A DAP event `profileRunning` will be emitted regardless of how it was called.
|
|
5999
6047
|
* @param table.show_hook_events Include events to indicate time spent in hooks
|
|
6000
6048
|
*/
|
|
6001
6049
|
start_profile(this: void, table: {
|
|
6002
6050
|
show_hook_events?: boolean;
|
|
6003
6051
|
}): void;
|
|
6004
6052
|
/**
|
|
6005
|
-
* Stop recording profiler timings and save to script_output.
|
|
6053
|
+
* Stop recording profiler timings and save to script_output. This function is also available to the DAP client as the request `stopProfile`. A DAP event `profileComplete` will be emitted with the path to the saved file, regardless of stop was called.
|
|
6006
6054
|
*/
|
|
6007
6055
|
stop_profile(this: void): void;
|
|
6008
6056
|
/**
|
|
@@ -8041,6 +8089,10 @@ interface LuaEntity extends LuaControl {
|
|
|
8041
8089
|
* Whether this loader gets items from or puts item into a container.
|
|
8042
8090
|
*/
|
|
8043
8091
|
loader_type: BeltConnectionType;
|
|
8092
|
+
/**
|
|
8093
|
+
* Additional effect applied to this entity with effect receiver. `nil` if this entity has no effect receiver.
|
|
8094
|
+
*/
|
|
8095
|
+
local_effect?: Effect;
|
|
8044
8096
|
readonly localised_description: LocalisedString;
|
|
8045
8097
|
/**
|
|
8046
8098
|
* Localised name of the entity.
|
|
@@ -8153,6 +8205,10 @@ interface LuaEntity extends LuaControl {
|
|
|
8153
8205
|
* The pollution bonus of this entity.
|
|
8154
8206
|
*/
|
|
8155
8207
|
readonly pollution_bonus: double;
|
|
8208
|
+
/**
|
|
8209
|
+
* The effects that will be applied to this entity once all upgrades are resolved. Can only be used when the entity has an effect receiver (AssemblingMachine, Furnace, Lab, MiningDrill, AgriculturalTower).
|
|
8210
|
+
*/
|
|
8211
|
+
readonly potential_effects?: Effect;
|
|
8156
8212
|
/**
|
|
8157
8213
|
* The power production specific to the ElectricEnergyInterface entity type.
|
|
8158
8214
|
*/
|
|
@@ -8804,6 +8860,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8804
8860
|
* The allowed module categories for this entity, if any.
|
|
8805
8861
|
*/
|
|
8806
8862
|
readonly allowed_module_categories?: Record<string, true>;
|
|
8863
|
+
/**
|
|
8864
|
+
* When this entity is part of blueprint, will it allow flipping of the blueprint?
|
|
8865
|
+
*/
|
|
8866
|
+
readonly allows_flipping: boolean;
|
|
8807
8867
|
/**
|
|
8808
8868
|
* Whether the lamp is always on (except when out of power or turned off by the circuit network).
|
|
8809
8869
|
*/
|
|
@@ -10739,6 +10799,7 @@ interface LuaFluidEnergySourcePrototype {
|
|
|
10739
10799
|
*/
|
|
10740
10800
|
readonly fluid_box: LuaFluidBoxPrototype;
|
|
10741
10801
|
readonly fluid_usage_per_tick: double;
|
|
10802
|
+
readonly hide_from_stats: boolean;
|
|
10742
10803
|
readonly maximum_temperature: double;
|
|
10743
10804
|
/**
|
|
10744
10805
|
* 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.
|
|
@@ -11046,6 +11107,12 @@ interface LuaForce {
|
|
|
11046
11107
|
* Gets the unlockable script state for the given ID.
|
|
11047
11108
|
*/
|
|
11048
11109
|
get_script_visible(this: void, unlockable: UnlockableID): boolean | null;
|
|
11110
|
+
/**
|
|
11111
|
+
* Gets the built space platforms at the given space location for this force.
|
|
11112
|
+
*
|
|
11113
|
+
* Note, this does not include platforms that have not yet been built.
|
|
11114
|
+
*/
|
|
11115
|
+
get_space_platforms(this: void, location: SpaceLocationID): LuaSpacePlatform[];
|
|
11049
11116
|
get_spawn_position(this: void, surface: SurfaceIdentification): MapPosition;
|
|
11050
11117
|
get_surface_hidden(this: void, surface: SurfaceIdentification): boolean;
|
|
11051
11118
|
/**
|
|
@@ -12055,41 +12122,6 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
|
|
|
12055
12122
|
*/
|
|
12056
12123
|
logistic_condition?: CircuitConditionDefinition;
|
|
12057
12124
|
}
|
|
12058
|
-
/**
|
|
12059
|
-
* Item group or subgroup.
|
|
12060
|
-
*/
|
|
12061
|
-
interface LuaGroup {
|
|
12062
|
-
/**
|
|
12063
|
-
* The parent group.
|
|
12064
|
-
*/
|
|
12065
|
-
readonly group: LuaGroup;
|
|
12066
|
-
/**
|
|
12067
|
-
* Localised name of the group.
|
|
12068
|
-
*/
|
|
12069
|
-
readonly localised_name: LocalisedString;
|
|
12070
|
-
readonly name: string;
|
|
12071
|
-
/**
|
|
12072
|
-
* 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.
|
|
12073
|
-
*/
|
|
12074
|
-
readonly object_name: string;
|
|
12075
|
-
/**
|
|
12076
|
-
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
12077
|
-
*/
|
|
12078
|
-
readonly order: string;
|
|
12079
|
-
/**
|
|
12080
|
-
* The additional order value used in recipe ordering.
|
|
12081
|
-
*/
|
|
12082
|
-
readonly order_in_recipe: string;
|
|
12083
|
-
/**
|
|
12084
|
-
* Subgroups of this group.
|
|
12085
|
-
*/
|
|
12086
|
-
readonly subgroups: LuaGroup[];
|
|
12087
|
-
readonly type: string;
|
|
12088
|
-
/**
|
|
12089
|
-
* 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.
|
|
12090
|
-
*/
|
|
12091
|
-
readonly valid: boolean;
|
|
12092
|
-
}
|
|
12093
12125
|
/**
|
|
12094
12126
|
* The root of the GUI. This type houses the root elements, `top`, `left`, `center`, `goal`, and `screen`, to which other elements can be added to be displayed on screen.
|
|
12095
12127
|
*
|
|
@@ -14230,6 +14262,37 @@ interface LuaItemCommon {
|
|
|
14230
14262
|
*/
|
|
14231
14263
|
trees_and_rocks_only: boolean;
|
|
14232
14264
|
}
|
|
14265
|
+
/**
|
|
14266
|
+
* Item group.
|
|
14267
|
+
*/
|
|
14268
|
+
interface LuaItemGroup {
|
|
14269
|
+
/**
|
|
14270
|
+
* Localised name of the group.
|
|
14271
|
+
*/
|
|
14272
|
+
readonly localised_name: LocalisedString;
|
|
14273
|
+
readonly name: string;
|
|
14274
|
+
/**
|
|
14275
|
+
* 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.
|
|
14276
|
+
*/
|
|
14277
|
+
readonly object_name: string;
|
|
14278
|
+
/**
|
|
14279
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
14280
|
+
*/
|
|
14281
|
+
readonly order: string;
|
|
14282
|
+
/**
|
|
14283
|
+
* The additional order value used in recipe ordering.
|
|
14284
|
+
*/
|
|
14285
|
+
readonly order_in_recipe: string;
|
|
14286
|
+
/**
|
|
14287
|
+
* Subgroups of this group.
|
|
14288
|
+
*/
|
|
14289
|
+
readonly subgroups: LuaItemSubGroup[];
|
|
14290
|
+
readonly type: string;
|
|
14291
|
+
/**
|
|
14292
|
+
* 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.
|
|
14293
|
+
*/
|
|
14294
|
+
readonly valid: boolean;
|
|
14295
|
+
}
|
|
14233
14296
|
/**
|
|
14234
14297
|
* Prototype of an item. For example, an item prototype can be obtained from {@link LuaPrototypes::item | runtime:LuaPrototypes::item} by its name: `prototypes.item["iron-plate"]`.
|
|
14235
14298
|
*/
|
|
@@ -14407,8 +14470,8 @@ interface LuaItemPrototype extends LuaPrototypeBase {
|
|
|
14407
14470
|
readonly ingredient_to_weight_coefficient: double;
|
|
14408
14471
|
readonly initial_items?: ItemProduct[];
|
|
14409
14472
|
readonly item_filters?: LuaItemPrototype[];
|
|
14410
|
-
readonly item_group_filters?:
|
|
14411
|
-
readonly item_subgroup_filters?:
|
|
14473
|
+
readonly item_group_filters?: LuaItemGroup[];
|
|
14474
|
+
readonly item_subgroup_filters?: LuaItemSubGroup[];
|
|
14412
14475
|
readonly lab_ignores_spoil_percent: boolean;
|
|
14413
14476
|
/**
|
|
14414
14477
|
* The localised string used when the player attempts to put items into this item with inventory that aren't allowed.
|
|
@@ -14658,6 +14721,33 @@ interface LuaItemStack extends LuaItemCommon {
|
|
|
14658
14721
|
*/
|
|
14659
14722
|
readonly valid_for_read: boolean;
|
|
14660
14723
|
}
|
|
14724
|
+
/**
|
|
14725
|
+
* Item subgroup.
|
|
14726
|
+
*/
|
|
14727
|
+
interface LuaItemSubGroup {
|
|
14728
|
+
/**
|
|
14729
|
+
* The parent group.
|
|
14730
|
+
*/
|
|
14731
|
+
readonly group: LuaItemGroup;
|
|
14732
|
+
/**
|
|
14733
|
+
* Localised name of the subgroup.
|
|
14734
|
+
*/
|
|
14735
|
+
readonly localised_name: LocalisedString;
|
|
14736
|
+
readonly name: string;
|
|
14737
|
+
/**
|
|
14738
|
+
* 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.
|
|
14739
|
+
*/
|
|
14740
|
+
readonly object_name: string;
|
|
14741
|
+
/**
|
|
14742
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
14743
|
+
*/
|
|
14744
|
+
readonly order: string;
|
|
14745
|
+
readonly type: string;
|
|
14746
|
+
/**
|
|
14747
|
+
* 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.
|
|
14748
|
+
*/
|
|
14749
|
+
readonly valid: boolean;
|
|
14750
|
+
}
|
|
14661
14751
|
/**
|
|
14662
14752
|
* Control behavior for lab.
|
|
14663
14753
|
*/
|
|
@@ -15068,13 +15158,13 @@ interface LuaLogisticPoint {
|
|
|
15068
15158
|
* Gets section on the selected index, if it exists
|
|
15069
15159
|
* @param section_index Index of the section
|
|
15070
15160
|
*/
|
|
15071
|
-
get_section(this: void, section_index:
|
|
15161
|
+
get_section(this: void, section_index: LogisticSectionIndex): LuaLogisticSection;
|
|
15072
15162
|
/**
|
|
15073
15163
|
* Removes the given logistic section if possible. Removal may fail if the section index is out of range or the section is not {@link manual | runtime:LuaLogisticSection::is_manual}.
|
|
15074
15164
|
* @param section_index Index of the section
|
|
15075
15165
|
* @returns Whether section was removed.
|
|
15076
15166
|
*/
|
|
15077
|
-
remove_section(this: void, section_index:
|
|
15167
|
+
remove_section(this: void, section_index: LogisticSectionIndex): boolean;
|
|
15078
15168
|
/**
|
|
15079
15169
|
* Whether this logistic point is active, related to disabling logistics on player/spidertron.
|
|
15080
15170
|
*
|
|
@@ -15231,13 +15321,13 @@ interface LuaLogisticSections {
|
|
|
15231
15321
|
* Gets section on the selected index, if it exists.
|
|
15232
15322
|
* @param section_index Index of the section.
|
|
15233
15323
|
*/
|
|
15234
|
-
get_section(this: void, section_index:
|
|
15324
|
+
get_section(this: void, section_index: LogisticSectionIndex): LuaLogisticSection | null;
|
|
15235
15325
|
/**
|
|
15236
15326
|
* Removes the given logistic section if possible. Removal may fail if the section index is out of range or the section is not {@link manual | runtime:LuaLogisticSection::is_manual}.
|
|
15237
15327
|
* @param section_index Index of the section.
|
|
15238
15328
|
* @returns Whether section was removed.
|
|
15239
15329
|
*/
|
|
15240
|
-
remove_section(this: void, section_index:
|
|
15330
|
+
remove_section(this: void, section_index: LogisticSectionIndex): boolean;
|
|
15241
15331
|
/**
|
|
15242
15332
|
* 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.
|
|
15243
15333
|
*/
|
|
@@ -16593,7 +16683,7 @@ interface LuaPrototypeBase {
|
|
|
16593
16683
|
/**
|
|
16594
16684
|
* Group of this prototype.
|
|
16595
16685
|
*/
|
|
16596
|
-
readonly group:
|
|
16686
|
+
readonly group: LuaItemGroup;
|
|
16597
16687
|
readonly hidden: boolean;
|
|
16598
16688
|
readonly hidden_in_factoriopedia: boolean;
|
|
16599
16689
|
readonly localised_description: LocalisedString;
|
|
@@ -16610,7 +16700,7 @@ interface LuaPrototypeBase {
|
|
|
16610
16700
|
/**
|
|
16611
16701
|
* Subgroup of this prototype.
|
|
16612
16702
|
*/
|
|
16613
|
-
readonly subgroup:
|
|
16703
|
+
readonly subgroup: LuaItemSubGroup;
|
|
16614
16704
|
/**
|
|
16615
16705
|
* Type of this prototype.
|
|
16616
16706
|
*/
|
|
@@ -16787,11 +16877,11 @@ interface LuaPrototypes {
|
|
|
16787
16877
|
/**
|
|
16788
16878
|
* A dictionary containing every ItemGroup indexed by `name`.
|
|
16789
16879
|
*/
|
|
16790
|
-
readonly item_group: Record<string,
|
|
16880
|
+
readonly item_group: Record<string, LuaItemGroup>;
|
|
16791
16881
|
/**
|
|
16792
16882
|
* A dictionary containing every ItemSubgroup indexed by `name`.
|
|
16793
16883
|
*/
|
|
16794
|
-
readonly item_subgroup: Record<string,
|
|
16884
|
+
readonly item_subgroup: Record<string, LuaItemSubGroup>;
|
|
16795
16885
|
/**
|
|
16796
16886
|
* A dictionary containing every MapGenPreset indexed by `name`.
|
|
16797
16887
|
*
|
|
@@ -16933,6 +17023,13 @@ interface LuaPumpControlBehavior extends LuaGenericOnOffControlBehavior {
|
|
|
16933
17023
|
* Prototype of a quality.
|
|
16934
17024
|
*/
|
|
16935
17025
|
interface LuaQualityPrototype extends LuaPrototypeBase {
|
|
17026
|
+
/**
|
|
17027
|
+
* Computes probabilities of rolling various qualities given a quality effect
|
|
17028
|
+
* @param quality_effect Strength of quality effect. Larger value makes it easier to roll better qualities.
|
|
17029
|
+
* @param force Force to select unlocked qualities. If not provided, all qualities are considered unlocked.
|
|
17030
|
+
* @returns Roll chances per quality. Only positive values are listed. All values should sum to 1.
|
|
17031
|
+
*/
|
|
17032
|
+
get_roll_chances(this: void, quality_effect: EffectValue, force?: ForceID): Record<string, double>;
|
|
16936
17033
|
/**
|
|
16937
17034
|
* Performs quality roll
|
|
16938
17035
|
* @param quality_effect Strength of quality effect. Larger value makes it easier to roll better qualities.
|
|
@@ -17271,7 +17368,7 @@ interface LuaRecipe {
|
|
|
17271
17368
|
/**
|
|
17272
17369
|
* Group of this recipe.
|
|
17273
17370
|
*/
|
|
17274
|
-
readonly group:
|
|
17371
|
+
readonly group: LuaItemGroup;
|
|
17275
17372
|
/**
|
|
17276
17373
|
* Is the recipe hidden? Hidden recipes don't show up in the crafting menu.
|
|
17277
17374
|
*/
|
|
@@ -17324,7 +17421,7 @@ interface LuaRecipe {
|
|
|
17324
17421
|
/**
|
|
17325
17422
|
* Subgroup of this recipe.
|
|
17326
17423
|
*/
|
|
17327
|
-
readonly subgroup:
|
|
17424
|
+
readonly subgroup: LuaItemSubGroup;
|
|
17328
17425
|
/**
|
|
17329
17426
|
* 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.
|
|
17330
17427
|
*/
|
|
@@ -19015,18 +19112,14 @@ interface LuaSimulation {
|
|
|
19015
19112
|
* @returns Position of the GUI slot on the screen, if successfully found.
|
|
19016
19113
|
*/
|
|
19017
19114
|
get_slot_position(this: void, table: {
|
|
19018
|
-
inventory_index:
|
|
19115
|
+
inventory_index: defines.inventory;
|
|
19019
19116
|
slot_index: ItemStackIndex;
|
|
19020
19117
|
inventory?: 'character' | 'entity';
|
|
19021
19118
|
}): MapPosition | null;
|
|
19022
19119
|
/**
|
|
19023
19120
|
* @returns Center of the GUI widget on the screen, if successfully found.
|
|
19024
19121
|
*/
|
|
19025
|
-
get_widget_position(this: void, table:
|
|
19026
|
-
type: SimulationWidgetType;
|
|
19027
|
-
data?: string;
|
|
19028
|
-
data2?: string;
|
|
19029
|
-
}): MapPosition | null;
|
|
19122
|
+
get_widget_position(this: void, table: LuaSimulationGetWidgetPositionParams): MapPosition | null;
|
|
19030
19123
|
/**
|
|
19031
19124
|
* Send a left mouse button click event at its current position. This is equivalent to calling {@link LuaSimulation::mouse_down | runtime:LuaSimulation::mouse_down}, then {@link LuaSimulation::mouse_up | runtime:LuaSimulation::mouse_up}.
|
|
19032
19125
|
*/
|
|
@@ -19083,6 +19176,139 @@ interface LuaSimulation {
|
|
|
19083
19176
|
*/
|
|
19084
19177
|
readonly valid: boolean;
|
|
19085
19178
|
}
|
|
19179
|
+
type LuaSimulationGetWidgetPositionParams = BaseLuaSimulationGetWidgetPositionParams | LuaSimulationGetWidgetPositionParamsCheckBox | LuaSimulationGetWidgetPositionParamsDropDown | LuaSimulationGetWidgetPositionParamsItemGroupTab | LuaSimulationGetWidgetPositionParamsLabel | LuaSimulationGetWidgetPositionParamsLogisticsButton | LuaSimulationGetWidgetPositionParamsLogisticsButtonSpace | LuaSimulationGetWidgetPositionParamsQuickbarSlot | LuaSimulationGetWidgetPositionParamsRecipeSlot | LuaSimulationGetWidgetPositionParamsSignalIdBase | LuaSimulationGetWidgetPositionParamsSimpleItemSlot | LuaSimulationGetWidgetPositionParamsSimpleItemWithQualitySlot | LuaSimulationGetWidgetPositionParamsSimpleSlot | LuaSimulationGetWidgetPositionParamsTextButton | LuaSimulationGetWidgetPositionParamsTextButtonLocalisedSubstring | LuaSimulationGetWidgetPositionParamsTextButtonSubstring | LuaSimulationGetWidgetPositionParamsTextfield;
|
|
19180
|
+
interface BaseLuaSimulationGetWidgetPositionParams {
|
|
19181
|
+
'type': 'check-box' | 'drop-down' | 'item-group-tab' | 'label' | 'logistics-button' | 'logistics-button-space' | 'quickbar-slot' | 'recipe-slot' | 'signal-id-base' | 'simple-item-slot' | 'simple-item-with-quality-slot' | 'simple-slot' | 'text-button' | 'text-button-localised-substring' | 'text-button-substring' | 'textfield';
|
|
19182
|
+
}
|
|
19183
|
+
/**
|
|
19184
|
+
*
|
|
19185
|
+
* Applies to variant case `check-box`
|
|
19186
|
+
*/
|
|
19187
|
+
interface LuaSimulationGetWidgetPositionParamsCheckBox extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19188
|
+
'type': 'check-box';
|
|
19189
|
+
'text': LocalisedString;
|
|
19190
|
+
}
|
|
19191
|
+
/**
|
|
19192
|
+
*
|
|
19193
|
+
* Applies to variant case `drop-down`
|
|
19194
|
+
*/
|
|
19195
|
+
interface LuaSimulationGetWidgetPositionParamsDropDown extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19196
|
+
'type': 'drop-down';
|
|
19197
|
+
'text'?: string;
|
|
19198
|
+
}
|
|
19199
|
+
/**
|
|
19200
|
+
*
|
|
19201
|
+
* Applies to variant case `item-group-tab`
|
|
19202
|
+
*/
|
|
19203
|
+
interface LuaSimulationGetWidgetPositionParamsItemGroupTab extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19204
|
+
'type': 'item-group-tab';
|
|
19205
|
+
'group': ItemGroupID;
|
|
19206
|
+
}
|
|
19207
|
+
/**
|
|
19208
|
+
*
|
|
19209
|
+
* Applies to variant case `label`
|
|
19210
|
+
*/
|
|
19211
|
+
interface LuaSimulationGetWidgetPositionParamsLabel extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19212
|
+
'type': 'label';
|
|
19213
|
+
'text'?: string;
|
|
19214
|
+
}
|
|
19215
|
+
/**
|
|
19216
|
+
*
|
|
19217
|
+
* Applies to variant case `logistics-button`
|
|
19218
|
+
*/
|
|
19219
|
+
interface LuaSimulationGetWidgetPositionParamsLogisticsButton extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19220
|
+
'type': 'logistics-button';
|
|
19221
|
+
'request_index': LogisticFilterIndex;
|
|
19222
|
+
}
|
|
19223
|
+
/**
|
|
19224
|
+
*
|
|
19225
|
+
* Applies to variant case `logistics-button-space`
|
|
19226
|
+
*/
|
|
19227
|
+
interface LuaSimulationGetWidgetPositionParamsLogisticsButtonSpace extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19228
|
+
'type': 'logistics-button-space';
|
|
19229
|
+
'request_index': LogisticFilterIndex;
|
|
19230
|
+
'section_index': LogisticSectionIndex;
|
|
19231
|
+
}
|
|
19232
|
+
/**
|
|
19233
|
+
*
|
|
19234
|
+
* Applies to variant case `quickbar-slot`
|
|
19235
|
+
*/
|
|
19236
|
+
interface LuaSimulationGetWidgetPositionParamsQuickbarSlot extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19237
|
+
'type': 'quickbar-slot';
|
|
19238
|
+
'filter': ItemFilter;
|
|
19239
|
+
}
|
|
19240
|
+
/**
|
|
19241
|
+
*
|
|
19242
|
+
* Applies to variant case `recipe-slot`
|
|
19243
|
+
*/
|
|
19244
|
+
interface LuaSimulationGetWidgetPositionParamsRecipeSlot extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19245
|
+
'type': 'recipe-slot';
|
|
19246
|
+
'recipe': RecipeID;
|
|
19247
|
+
}
|
|
19248
|
+
/**
|
|
19249
|
+
*
|
|
19250
|
+
* Applies to variant case `signal-id-base`
|
|
19251
|
+
*/
|
|
19252
|
+
interface LuaSimulationGetWidgetPositionParamsSignalIdBase extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19253
|
+
'type': 'signal-id-base';
|
|
19254
|
+
'id': SignalIDBase;
|
|
19255
|
+
}
|
|
19256
|
+
/**
|
|
19257
|
+
*
|
|
19258
|
+
* Applies to variant case `simple-item-slot`
|
|
19259
|
+
*/
|
|
19260
|
+
interface LuaSimulationGetWidgetPositionParamsSimpleItemSlot extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19261
|
+
'type': 'simple-item-slot';
|
|
19262
|
+
'item': ItemID;
|
|
19263
|
+
}
|
|
19264
|
+
/**
|
|
19265
|
+
*
|
|
19266
|
+
* Applies to variant case `simple-item-with-quality-slot`
|
|
19267
|
+
*/
|
|
19268
|
+
interface LuaSimulationGetWidgetPositionParamsSimpleItemWithQualitySlot extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19269
|
+
'type': 'simple-item-with-quality-slot';
|
|
19270
|
+
'filter': ItemFilter;
|
|
19271
|
+
}
|
|
19272
|
+
/**
|
|
19273
|
+
*
|
|
19274
|
+
* Applies to variant case `simple-slot`
|
|
19275
|
+
*/
|
|
19276
|
+
interface LuaSimulationGetWidgetPositionParamsSimpleSlot extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19277
|
+
'type': 'simple-slot';
|
|
19278
|
+
'item': ItemID;
|
|
19279
|
+
}
|
|
19280
|
+
/**
|
|
19281
|
+
*
|
|
19282
|
+
* Applies to variant case `text-button`
|
|
19283
|
+
*/
|
|
19284
|
+
interface LuaSimulationGetWidgetPositionParamsTextButton extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19285
|
+
'type': 'text-button';
|
|
19286
|
+
'text': string;
|
|
19287
|
+
}
|
|
19288
|
+
/**
|
|
19289
|
+
*
|
|
19290
|
+
* Applies to variant case `text-button-localised-substring`
|
|
19291
|
+
*/
|
|
19292
|
+
interface LuaSimulationGetWidgetPositionParamsTextButtonLocalisedSubstring extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19293
|
+
'type': 'text-button-localised-substring';
|
|
19294
|
+
'text': LocalisedString;
|
|
19295
|
+
}
|
|
19296
|
+
/**
|
|
19297
|
+
*
|
|
19298
|
+
* Applies to variant case `text-button-substring`
|
|
19299
|
+
*/
|
|
19300
|
+
interface LuaSimulationGetWidgetPositionParamsTextButtonSubstring extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19301
|
+
'type': 'text-button-substring';
|
|
19302
|
+
'text': string;
|
|
19303
|
+
}
|
|
19304
|
+
/**
|
|
19305
|
+
*
|
|
19306
|
+
* Applies to variant case `textfield`
|
|
19307
|
+
*/
|
|
19308
|
+
interface LuaSimulationGetWidgetPositionParamsTextfield extends BaseLuaSimulationGetWidgetPositionParams {
|
|
19309
|
+
'type': 'textfield';
|
|
19310
|
+
'text': string;
|
|
19311
|
+
}
|
|
19086
19312
|
/**
|
|
19087
19313
|
* Control behavior for entities with a single fluid box (i.e. pipe, pipe-to-ground, storage-tank).
|
|
19088
19314
|
*/
|
|
@@ -19247,6 +19473,10 @@ interface LuaSpacePlatform {
|
|
|
19247
19473
|
* Repairs the given tile if it's damaged.
|
|
19248
19474
|
*/
|
|
19249
19475
|
repair_tile(this: void, position: TilePosition, amount?: float): void;
|
|
19476
|
+
/**
|
|
19477
|
+
* The number of trips completed between space locations.
|
|
19478
|
+
*/
|
|
19479
|
+
completed_trips: uint32;
|
|
19250
19480
|
/**
|
|
19251
19481
|
* The damaged tiles on this platform.
|
|
19252
19482
|
*/
|