factorio-types 0.0.34 → 0.0.35
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 +127 -62
- package/dist/concepts.d.ts +10 -21
- package/dist/defines.d.ts +5 -1
- package/dist/events.d.ts +28 -2
- package/dist/global.d.ts +1 -1
- package/package.json +1 -1
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.80
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -35,7 +35,7 @@ interface LuaAISettings {
|
|
|
35
35
|
readonly object_name: string
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. Defaults to `0`, which equals a resolution of `1x1` tiles, centered on tile centers. Values range from `-8` to `8` inclusive, where each integer increment doubles/halves the resolution. So, a resolution of `-8` equals a grid of `256x256` tiles, and a resolution of `8` equals `1/256` of a tile.
|
|
39
39
|
*/
|
|
40
40
|
path_resolution_modifier: number
|
|
41
41
|
|
|
@@ -366,6 +366,7 @@ interface LuaBootstrap {
|
|
|
366
366
|
* - {@link script_raised_built | script_raised_built}
|
|
367
367
|
* - {@link script_raised_destroy | script_raised_destroy}
|
|
368
368
|
* - {@link script_raised_revive | script_raised_revive}
|
|
369
|
+
* - {@link script_raised_teleported | script_raised_teleported}
|
|
369
370
|
* - {@link script_raised_set_tiles | script_raised_set_tiles}
|
|
370
371
|
* @param data - Table with extra data that will be passed to the event handler. Any invalid LuaObjects will silently stop the event from being raised.
|
|
371
372
|
* @param event - ID of the event to raise.
|
|
@@ -476,6 +477,22 @@ interface LuaBootstrap {
|
|
|
476
477
|
*
|
|
477
478
|
* @param metatable - The metatable to register.
|
|
478
479
|
* @param name - The name of this metatable. Names must be unique per mod.
|
|
480
|
+
* @example
|
|
481
|
+
* The metatable first needs to be defined in the mod's root scope, then registered using this method. From then on, it will be properly restored for tables in [global](global).
|
|
482
|
+
* ```
|
|
483
|
+
* local metatable = {
|
|
484
|
+
* __index = function(key)
|
|
485
|
+
* return "no value for key " .. key
|
|
486
|
+
* end
|
|
487
|
+
* }
|
|
488
|
+
* script.register_metatable("my_metatable", metatable)
|
|
489
|
+
* ```
|
|
490
|
+
* This previously defined `metatable` can then be set on any table as usual:
|
|
491
|
+
* ```
|
|
492
|
+
* local table = {key="value"}
|
|
493
|
+
* setmetatable(table, metatable)
|
|
494
|
+
* ```
|
|
495
|
+
*
|
|
479
496
|
*/
|
|
480
497
|
register_metatable(this: void,
|
|
481
498
|
name: string,
|
|
@@ -589,7 +606,7 @@ interface LuaBurner {
|
|
|
589
606
|
readonly burnt_result_inventory: LuaInventory
|
|
590
607
|
|
|
591
608
|
/**
|
|
592
|
-
* The currently burning item.
|
|
609
|
+
* The currently burning item. Writing `nil` will void the currently burning item without producing a {@link LuaBurner::burnt_result | LuaBurner::burnt_result}.
|
|
593
610
|
* @remarks
|
|
594
611
|
* Writing to this automatically handles correcting {@link LuaBurner::remaining_burning_fuel | LuaBurner::remaining_burning_fuel}.
|
|
595
612
|
*
|
|
@@ -884,11 +901,12 @@ interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
|
|
|
884
901
|
help(this: void): void
|
|
885
902
|
|
|
886
903
|
/**
|
|
887
|
-
* Sets the signal at the given index
|
|
904
|
+
* Sets the signal at the given index.
|
|
905
|
+
* @param signal - Passing `nil` clears the signal.
|
|
888
906
|
*/
|
|
889
907
|
set_signal(this: void,
|
|
890
908
|
index: number,
|
|
891
|
-
signal
|
|
909
|
+
signal?: Signal): void
|
|
892
910
|
|
|
893
911
|
/**
|
|
894
912
|
* Turns this constant combinator on and off.
|
|
@@ -908,7 +926,7 @@ interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
|
|
|
908
926
|
parameters?: ConstantCombinatorParameters[]
|
|
909
927
|
|
|
910
928
|
/**
|
|
911
|
-
* The number of signals this constant combinator supports
|
|
929
|
+
* The number of signals this constant combinator supports.
|
|
912
930
|
*/
|
|
913
931
|
readonly signals_count: number
|
|
914
932
|
|
|
@@ -1372,7 +1390,7 @@ interface LuaControl {
|
|
|
1372
1390
|
force: ForceIdentification
|
|
1373
1391
|
|
|
1374
1392
|
/**
|
|
1375
|
-
* Unique {@link index | LuaForce::index} associated with the force of this entity.
|
|
1393
|
+
* Unique {@link index | LuaForce::index} (ID) associated with the force of this entity.
|
|
1376
1394
|
*/
|
|
1377
1395
|
readonly force_index: number
|
|
1378
1396
|
|
|
@@ -1394,18 +1412,18 @@ interface LuaControl {
|
|
|
1394
1412
|
/**
|
|
1395
1413
|
* Current mining state.
|
|
1396
1414
|
* @remarks
|
|
1397
|
-
* When the player isn't mining tiles the player will mine what ever entity is currently selected. See {@link LuaControl::selected | LuaControl::selected} and {@link LuaControl::update_selected_entity | LuaControl::update_selected_entity}.
|
|
1415
|
+
* When the player isn't mining tiles, the player will mine what ever entity is currently selected. See {@link LuaControl::selected | LuaControl::selected} and {@link LuaControl::update_selected_entity | LuaControl::update_selected_entity}.
|
|
1398
1416
|
*
|
|
1399
1417
|
*/
|
|
1400
1418
|
mining_state: {
|
|
1401
1419
|
|
|
1402
1420
|
/**
|
|
1403
|
-
* Whether the player is mining at all
|
|
1421
|
+
* Whether the player is mining at all.
|
|
1404
1422
|
*/
|
|
1405
1423
|
mining: boolean,
|
|
1406
1424
|
|
|
1407
1425
|
/**
|
|
1408
|
-
* What
|
|
1426
|
+
* What location the player is mining. Only relevant if `mining` is `true`.
|
|
1409
1427
|
*/
|
|
1410
1428
|
position?: MapPosition
|
|
1411
1429
|
}
|
|
@@ -1490,7 +1508,7 @@ interface LuaControl {
|
|
|
1490
1508
|
readonly surface: LuaSurface
|
|
1491
1509
|
|
|
1492
1510
|
/**
|
|
1493
|
-
* Unique {@link index | LuaSurface::index} associated with the surface this entity is currently on.
|
|
1511
|
+
* Unique {@link index | LuaSurface::index} (ID) associated with the surface this entity is currently on.
|
|
1494
1512
|
*/
|
|
1495
1513
|
readonly surface_index: number
|
|
1496
1514
|
|
|
@@ -2458,7 +2476,7 @@ interface LuaEntity extends LuaControl {
|
|
|
2458
2476
|
direction: defines.rail_direction): void
|
|
2459
2477
|
|
|
2460
2478
|
/**
|
|
2461
|
-
* Current recipe being assembled by this machine
|
|
2479
|
+
* Current recipe being assembled by this machine, if any.
|
|
2462
2480
|
* @remarks
|
|
2463
2481
|
* Applies to subclasses: CraftingMachine
|
|
2464
2482
|
*
|
|
@@ -2822,13 +2840,13 @@ interface LuaEntity extends LuaControl {
|
|
|
2822
2840
|
/**
|
|
2823
2841
|
* Sets the driver of this vehicle.
|
|
2824
2842
|
* @remarks
|
|
2825
|
-
* This differs
|
|
2843
|
+
* This differs from {@link LuaEntity::set_passenger | LuaEntity::set_passenger} in that the passenger can't drive the vehicle.
|
|
2826
2844
|
* Applies to subclasses: Vehicle
|
|
2827
2845
|
*
|
|
2828
|
-
* @param driver - The new driver
|
|
2846
|
+
* @param driver - The new driver. Writing `nil` ejects the current driver, if any.
|
|
2829
2847
|
*/
|
|
2830
2848
|
set_driver(this: void,
|
|
2831
|
-
driver
|
|
2849
|
+
driver?: LuaEntity | PlayerIdentification): void
|
|
2832
2850
|
|
|
2833
2851
|
/**
|
|
2834
2852
|
* Set the filter for a slot in an inserter, loader, or logistic storage container.
|
|
@@ -2877,22 +2895,23 @@ interface LuaEntity extends LuaControl {
|
|
|
2877
2895
|
/**
|
|
2878
2896
|
* Sets the passenger of this car or spidertron.
|
|
2879
2897
|
* @remarks
|
|
2880
|
-
* This differs
|
|
2898
|
+
* This differs from {@link LuaEntity::get_driver | LuaEntity::get_driver} in that the passenger can't drive the car.
|
|
2881
2899
|
* Applies to subclasses: Car,SpiderVehicle
|
|
2882
2900
|
*
|
|
2901
|
+
* @param passenger - The new passenger. Writing `nil` ejects the current passenger, if any.
|
|
2883
2902
|
*/
|
|
2884
2903
|
set_passenger(this: void,
|
|
2885
|
-
passenger
|
|
2904
|
+
passenger?: LuaEntity | PlayerIdentification): void
|
|
2886
2905
|
|
|
2887
2906
|
/**
|
|
2888
|
-
* Sets the
|
|
2907
|
+
* Sets the given recipe in this assembly machine.
|
|
2889
2908
|
* @remarks
|
|
2890
2909
|
* Applies to subclasses: AssemblingMachine
|
|
2891
2910
|
*
|
|
2892
|
-
* @param recipe - The new recipe
|
|
2911
|
+
* @param recipe - The new recipe. Writing `nil` clears the recipe, if any.
|
|
2893
2912
|
*/
|
|
2894
2913
|
set_recipe(this: void,
|
|
2895
|
-
recipe
|
|
2914
|
+
recipe?: string | LuaRecipe): void
|
|
2896
2915
|
|
|
2897
2916
|
/**
|
|
2898
2917
|
* Set a logistic requester slot.
|
|
@@ -3034,7 +3053,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3034
3053
|
auto_launch: boolean
|
|
3035
3054
|
|
|
3036
3055
|
/**
|
|
3037
|
-
* Destination of this spidertron's autopilot, if any.
|
|
3056
|
+
* Destination of this spidertron's autopilot, if any. Writing `nil` clears all destinations.
|
|
3038
3057
|
* @remarks
|
|
3039
3058
|
* Applies to subclasses: SpiderVehicle
|
|
3040
3059
|
*
|
|
@@ -3382,7 +3401,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3382
3401
|
readonly energy_generated_last_tick: number
|
|
3383
3402
|
|
|
3384
3403
|
/**
|
|
3385
|
-
* The label on this entity, if any. `nil` if this is not a spider-vehicle.
|
|
3404
|
+
* The label on this spider-vehicle entity, if any. `nil` if this is not a spider-vehicle.
|
|
3386
3405
|
*/
|
|
3387
3406
|
entity_label?: string
|
|
3388
3407
|
|
|
@@ -5148,9 +5167,9 @@ interface LuaEntityPrototype {
|
|
|
5148
5167
|
readonly item_slot_count?: number
|
|
5149
5168
|
|
|
5150
5169
|
/**
|
|
5151
|
-
* Items that when placed will produce this entity, if any. Construction bots will
|
|
5170
|
+
* Items that when placed will produce this entity, if any. Construction bots will choose the first item in the list to build this entity.
|
|
5152
5171
|
*/
|
|
5153
|
-
readonly items_to_place_this?:
|
|
5172
|
+
readonly items_to_place_this?: ItemStackDefinition[]
|
|
5154
5173
|
|
|
5155
5174
|
/**
|
|
5156
5175
|
* The item prototype names that are the inputs of this lab prototype.
|
|
@@ -6230,7 +6249,7 @@ interface LuaEquipmentGrid {
|
|
|
6230
6249
|
readonly height: number
|
|
6231
6250
|
|
|
6232
6251
|
/**
|
|
6233
|
-
*
|
|
6252
|
+
* Whether this grid's equipment movement bonus is active.
|
|
6234
6253
|
*/
|
|
6235
6254
|
inhibit_movement_bonus: boolean
|
|
6236
6255
|
|
|
@@ -7428,7 +7447,7 @@ interface LuaForce {
|
|
|
7428
7447
|
ghost_time_to_live: number
|
|
7429
7448
|
|
|
7430
7449
|
/**
|
|
7431
|
-
* This force's
|
|
7450
|
+
* This force's index in {@link LuaGameScript::forces | LuaGameScript::forces} (unique ID). It is assigned when a force is created, and remains so until it is {@link merged | on_forces_merged} (ie. deleted). Indexes of merged forces can be reused.
|
|
7432
7451
|
*/
|
|
7433
7452
|
readonly index: number
|
|
7434
7453
|
|
|
@@ -7808,7 +7827,7 @@ interface LuaGameScript {
|
|
|
7808
7827
|
variables?: {[key: string]: number}): void
|
|
7809
7828
|
|
|
7810
7829
|
/**
|
|
7811
|
-
* Force a CRC check. Tells all peers to calculate their current
|
|
7830
|
+
* Force a CRC check. Tells all peers to calculate their current CRC, which are then compared to each other. If a mismatch is detected, the game desyncs and some peers are forced to reconnect.
|
|
7812
7831
|
*/
|
|
7813
7832
|
force_crc(this: void): void
|
|
7814
7833
|
|
|
@@ -8814,7 +8833,7 @@ interface LuaGui {
|
|
|
8814
8833
|
* - `"progressbar"`: A partially filled bar that can be used to indicate progress.
|
|
8815
8834
|
* - `"table"`: An invisible container that lays out its children in a specific number of columns. The width of each column is determined by the widest element it contains.
|
|
8816
8835
|
* - `"textfield"`: A single-line box the user can type into. Relevant events: {@link on_gui_text_changed | on_gui_text_changed}, {@link on_gui_confirmed | on_gui_confirmed}
|
|
8817
|
-
* - `"radiobutton"`:
|
|
8836
|
+
* - `"radiobutton"`: An element that is similar to a `checkbox`, but with a circular appearance. Clicking a selected radio button will not deselect it. Radio buttons are not linked to each other in any way. Relevant event: {@link on_gui_checked_state_changed | on_gui_checked_state_changed}
|
|
8818
8837
|
* - `"sprite"`: An element that shows an image.
|
|
8819
8838
|
* - `"scroll-pane"`: An invisible element that is similar to a `flow`, but has the ability to show and use scroll bars.
|
|
8820
8839
|
* - `"drop-down"`: A drop-down containing strings of text. Relevant event: {@link on_gui_selection_state_changed | on_gui_selection_state_changed}
|
|
@@ -9510,6 +9529,11 @@ interface LuaGuiElement {
|
|
|
9510
9529
|
*/
|
|
9511
9530
|
position: MapPosition
|
|
9512
9531
|
|
|
9532
|
+
/**
|
|
9533
|
+
* Whether this element will raise {@link on_gui_hover | on_gui_hover} and {@link on_gui_leave | on_gui_leave}.
|
|
9534
|
+
*/
|
|
9535
|
+
raise_hover_events: boolean
|
|
9536
|
+
|
|
9513
9537
|
/**
|
|
9514
9538
|
* Whether this text-box is read-only. Defaults to `false`.
|
|
9515
9539
|
* @remarks
|
|
@@ -11255,7 +11279,7 @@ interface LuaItemStack {
|
|
|
11255
11279
|
* Applies to subclasses: BlueprintItem
|
|
11256
11280
|
*
|
|
11257
11281
|
*/
|
|
11258
|
-
readonly default_icons:
|
|
11282
|
+
readonly default_icons: BlueprintSignalIcon[]
|
|
11259
11283
|
|
|
11260
11284
|
/**
|
|
11261
11285
|
* Durability of the contained item. Automatically capped at the item's maximum durability.
|
|
@@ -13029,7 +13053,7 @@ interface LuaPlayer extends LuaControl {
|
|
|
13029
13053
|
hand_location?: ItemStackLocation
|
|
13030
13054
|
|
|
13031
13055
|
/**
|
|
13032
|
-
* This player's
|
|
13056
|
+
* This player's index in {@link LuaGameScript::players | LuaGameScript::players} (unique ID). It is assigned when a player is created, and remains so (even when the player is not {@link connected | LuaPlayer::connected}) until the player is irreversably {@link removed | on_player_removed}. Indexes of removed players can be reused.
|
|
13033
13057
|
*/
|
|
13034
13058
|
readonly index: number
|
|
13035
13059
|
|
|
@@ -13054,9 +13078,14 @@ interface LuaPlayer extends LuaControl {
|
|
|
13054
13078
|
minimap_enabled: boolean
|
|
13055
13079
|
|
|
13056
13080
|
/**
|
|
13057
|
-
* The current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings::get_player_settings | LuaSettings::get_player_settings}.
|
|
13058
|
-
*
|
|
13059
|
-
*
|
|
13081
|
+
* The current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings::get_player_settings | LuaSettings::get_player_settings}. This table becomes invalid if its associated player does.
|
|
13082
|
+
*
|
|
13083
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
|
13084
|
+
* @example
|
|
13085
|
+
* ```
|
|
13086
|
+
* -- Change the value of the "active_lifestyle" setting
|
|
13087
|
+
* player.mod_settings["active_lifestyle"] = {value = true}
|
|
13088
|
+
* ```
|
|
13060
13089
|
*
|
|
13061
13090
|
*/
|
|
13062
13091
|
readonly mod_settings: {[key: string]: ModSetting}
|
|
@@ -13460,17 +13489,11 @@ interface LuaRecipe {
|
|
|
13460
13489
|
hidden_from_flow_stats: boolean
|
|
13461
13490
|
|
|
13462
13491
|
/**
|
|
13463
|
-
*
|
|
13492
|
+
* The ingredients to this recipe.
|
|
13464
13493
|
* @example
|
|
13465
|
-
*
|
|
13494
|
+
* The ingredients of `"advanced-oil-processing"` would look like this:
|
|
13466
13495
|
* ```
|
|
13467
|
-
* {{type="
|
|
13468
|
-
* ```
|
|
13469
|
-
*
|
|
13470
|
-
* @example
|
|
13471
|
-
* What the "advanced-oil-processing" recipe would return
|
|
13472
|
-
* ```
|
|
13473
|
-
* {{type="fluid", name="crude-oil", amount=10}, {type="fluid", name="water", amount=5}}
|
|
13496
|
+
* {{type="fluid", name="crude-oil", amount=100}, {type="fluid", name="water", amount=50}}
|
|
13474
13497
|
* ```
|
|
13475
13498
|
*
|
|
13476
13499
|
*/
|
|
@@ -13499,7 +13522,13 @@ interface LuaRecipe {
|
|
|
13499
13522
|
readonly order: string
|
|
13500
13523
|
|
|
13501
13524
|
/**
|
|
13502
|
-
* The results of this recipe.
|
|
13525
|
+
* The results/products of this recipe.
|
|
13526
|
+
* @example
|
|
13527
|
+
* The products of `"advanced-oil-processing"` would look like this:
|
|
13528
|
+
* ```
|
|
13529
|
+
* {{type="fluid", name="heavy-oil", amount=25}, {type="fluid", name="light-oil", amount=45}, {type="fluid", name="petroleum-gas", amount=55}}
|
|
13530
|
+
* ```
|
|
13531
|
+
*
|
|
13503
13532
|
*/
|
|
13504
13533
|
readonly products: Product[]
|
|
13505
13534
|
|
|
@@ -13635,7 +13664,13 @@ interface LuaRecipePrototype {
|
|
|
13635
13664
|
readonly hidden_from_player_crafting: boolean
|
|
13636
13665
|
|
|
13637
13666
|
/**
|
|
13638
|
-
*
|
|
13667
|
+
* The ingredients to this recipe.
|
|
13668
|
+
* @example
|
|
13669
|
+
* The ingredients of `"advanced-oil-processing"` would look like this:
|
|
13670
|
+
* ```
|
|
13671
|
+
* {{type="fluid", name="crude-oil", amount=100}, {type="fluid", name="water", amount=50}}
|
|
13672
|
+
* ```
|
|
13673
|
+
*
|
|
13639
13674
|
*/
|
|
13640
13675
|
readonly ingredients: Ingredient[]
|
|
13641
13676
|
|
|
@@ -13672,7 +13707,13 @@ interface LuaRecipePrototype {
|
|
|
13672
13707
|
readonly overload_multiplier: number
|
|
13673
13708
|
|
|
13674
13709
|
/**
|
|
13675
|
-
* The results of this recipe.
|
|
13710
|
+
* The results/products of this recipe.
|
|
13711
|
+
* @example
|
|
13712
|
+
* The products of `"advanced-oil-processing"` would look like this:
|
|
13713
|
+
* ```
|
|
13714
|
+
* {{type="fluid", name="heavy-oil", amount=25}, {type="fluid", name="light-oil", amount=45}, {type="fluid", name="petroleum-gas", amount=55}}
|
|
13715
|
+
* ```
|
|
13716
|
+
*
|
|
13676
13717
|
*/
|
|
13677
13718
|
readonly products: Product[]
|
|
13678
13719
|
|
|
@@ -13778,8 +13819,8 @@ interface LuaRendering {
|
|
|
13778
13819
|
id: number): void
|
|
13779
13820
|
|
|
13780
13821
|
/**
|
|
13781
|
-
* Destroys all render objects.
|
|
13782
|
-
* @param mod_name - If provided, only the render objects created by this mod are destroyed.
|
|
13822
|
+
* Destroys all render objects. Passing an empty string (`""`)
|
|
13823
|
+
* @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.
|
|
13783
13824
|
*/
|
|
13784
13825
|
clear(this: void,
|
|
13785
13826
|
mod_name?: string): void
|
|
@@ -13805,6 +13846,7 @@ interface LuaRendering {
|
|
|
13805
13846
|
* @param table.target - Center of the animation.
|
|
13806
13847
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
13807
13848
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
13849
|
+
* @param table.use_target_orientation - Only used if `orientation_target` is a LuaEntity.
|
|
13808
13850
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
13809
13851
|
* @param table.x_scale - Horizontal scale of the animation. Default is 1.
|
|
13810
13852
|
* @param table.y_scale - Vertical scale of the animation. Default is 1.
|
|
@@ -13821,6 +13863,7 @@ interface LuaRendering {
|
|
|
13821
13863
|
animation_offset?: number,
|
|
13822
13864
|
orientation_target?: MapPosition | LuaEntity,
|
|
13823
13865
|
orientation_target_offset?: Vector,
|
|
13866
|
+
use_target_orientation?: boolean,
|
|
13824
13867
|
oriented_offset?: Vector,
|
|
13825
13868
|
target: MapPosition | LuaEntity,
|
|
13826
13869
|
target_offset?: Vector,
|
|
@@ -13989,6 +14032,7 @@ interface LuaRendering {
|
|
|
13989
14032
|
* @param table.target - Acts like an offset applied to all vertices that are not set to an entity.
|
|
13990
14033
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
13991
14034
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
14035
|
+
* @param table.use_target_orientation - Only used if `orientation_target` is a LuaEntity.
|
|
13992
14036
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
13993
14037
|
*/
|
|
13994
14038
|
draw_polygon(this: void,
|
|
@@ -14000,6 +14044,7 @@ interface LuaRendering {
|
|
|
14000
14044
|
orientation?: RealOrientation,
|
|
14001
14045
|
orientation_target?: MapPosition | LuaEntity,
|
|
14002
14046
|
orientation_target_offset?: Vector,
|
|
14047
|
+
use_target_orientation?: boolean,
|
|
14003
14048
|
surface: SurfaceIdentification,
|
|
14004
14049
|
time_to_live?: number,
|
|
14005
14050
|
forces?: ForceIdentification[],
|
|
@@ -14052,6 +14097,7 @@ interface LuaRendering {
|
|
|
14052
14097
|
* @param table.target - Center of the sprite.
|
|
14053
14098
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
14054
14099
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
14100
|
+
* @param table.use_target_orientation - Only used if `orientation_target` is a LuaEntity.
|
|
14055
14101
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
14056
14102
|
* @param table.x_scale - Horizontal scale of the sprite. Default is 1.
|
|
14057
14103
|
* @param table.y_scale - Vertical scale of the sprite. Default is 1.
|
|
@@ -14078,6 +14124,7 @@ interface LuaRendering {
|
|
|
14078
14124
|
render_layer?: RenderLayer,
|
|
14079
14125
|
orientation_target?: MapPosition | LuaEntity,
|
|
14080
14126
|
orientation_target_offset?: Vector,
|
|
14127
|
+
use_target_orientation?: boolean,
|
|
14081
14128
|
oriented_offset?: Vector,
|
|
14082
14129
|
target: MapPosition | LuaEntity,
|
|
14083
14130
|
target_offset?: Vector,
|
|
@@ -14142,7 +14189,7 @@ interface LuaRendering {
|
|
|
14142
14189
|
|
|
14143
14190
|
/**
|
|
14144
14191
|
* Gets an array of all valid object ids.
|
|
14145
|
-
* @param mod_name - If provided, get only the render objects created by this mod.
|
|
14192
|
+
* @param mod_name - If provided, get only the render objects created by this mod. An empty string (`""`) refers to all objects not belonging to a mod, such as those created using console commands.
|
|
14146
14193
|
*/
|
|
14147
14194
|
get_all_ids(this: void,
|
|
14148
14195
|
mod_name?: string): void
|
|
@@ -14465,6 +14512,12 @@ interface LuaRendering {
|
|
|
14465
14512
|
get_use_rich_text(this: void,
|
|
14466
14513
|
id: number): void
|
|
14467
14514
|
|
|
14515
|
+
/**
|
|
14516
|
+
* Get whether this uses the target orientation.
|
|
14517
|
+
*/
|
|
14518
|
+
get_use_target_orientation(this: void,
|
|
14519
|
+
id: number): void
|
|
14520
|
+
|
|
14468
14521
|
/**
|
|
14469
14522
|
* Get the vertical alignment of the text with this id.
|
|
14470
14523
|
* @remarks
|
|
@@ -14916,6 +14969,13 @@ interface LuaRendering {
|
|
|
14916
14969
|
id: number,
|
|
14917
14970
|
use_rich_text: boolean): void
|
|
14918
14971
|
|
|
14972
|
+
/**
|
|
14973
|
+
* Set whether this uses the target orientation.
|
|
14974
|
+
*/
|
|
14975
|
+
set_use_target_orientation(this: void,
|
|
14976
|
+
id: number,
|
|
14977
|
+
use_target_orientation: boolean): void
|
|
14978
|
+
|
|
14919
14979
|
/**
|
|
14920
14980
|
* Set the vertical alignment of the text with this id. Does nothing if this object is not a text.
|
|
14921
14981
|
* @remarks
|
|
@@ -15060,9 +15120,14 @@ interface LuaRoboportControlBehavior extends LuaControlBehavior {
|
|
|
15060
15120
|
*/
|
|
15061
15121
|
interface LuaSettings {
|
|
15062
15122
|
/**
|
|
15063
|
-
* Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as {@link LuaPlayer::mod_settings | LuaPlayer::mod_settings}.
|
|
15064
|
-
*
|
|
15065
|
-
*
|
|
15123
|
+
* Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as {@link LuaPlayer::mod_settings | LuaPlayer::mod_settings}. This table becomes invalid if its associated player does.
|
|
15124
|
+
*
|
|
15125
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
|
15126
|
+
* @example
|
|
15127
|
+
* ```
|
|
15128
|
+
* -- Change the value of the "active_lifestyle" setting
|
|
15129
|
+
* settings.get_player_settings(player_index)["active_lifestyle"] = {value = true}
|
|
15130
|
+
* ```
|
|
15066
15131
|
*
|
|
15067
15132
|
*/
|
|
15068
15133
|
get_player_settings(this: void,
|
|
@@ -15071,7 +15136,7 @@ interface LuaSettings {
|
|
|
15071
15136
|
/**
|
|
15072
15137
|
* The current global mod settings, indexed by prototype name.
|
|
15073
15138
|
*
|
|
15074
|
-
* Even though
|
|
15139
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
|
15075
15140
|
*/
|
|
15076
15141
|
readonly global: {[key: string]: ModSetting}
|
|
15077
15142
|
|
|
@@ -15083,7 +15148,7 @@ interface LuaSettings {
|
|
|
15083
15148
|
/**
|
|
15084
15149
|
* The default player mod settings for this map, indexed by prototype name.
|
|
15085
15150
|
*
|
|
15086
|
-
* Even though
|
|
15151
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
|
15087
15152
|
*/
|
|
15088
15153
|
readonly player: {[key: string]: ModSetting}
|
|
15089
15154
|
|
|
@@ -16478,7 +16543,7 @@ interface LuaSurface {
|
|
|
16478
16543
|
* @param table.entity_to_ignore - Makes the pathfinder ignore collisions with this entity if it is given.
|
|
16479
16544
|
* @param table.force - The force for which to generate the path, determining which gates can be opened for example.
|
|
16480
16545
|
* @param table.goal - The position to find a path to.
|
|
16481
|
-
* @param table.path_resolution_modifier - Defines how coarse the pathfinder's grid is
|
|
16546
|
+
* @param table.path_resolution_modifier - Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. Defaults to `0`, which equals a resolution of `1x1` tiles, centered on tile centers. Values range from `-8` to `8` inclusive, where each integer increment doubles/halves the resolution. So, a resolution of `-8` equals a grid of `256x256` tiles, and a resolution of `8` equals `1/256` of a tile.
|
|
16482
16547
|
* @param table.pathfind_flags - Flags that affect pathfinder behavior.
|
|
16483
16548
|
* @param table.radius - How close the pathfinder needs to get to its `goal` (in tiles). Defaults to `1`.
|
|
16484
16549
|
* @param table.start - The position from which to start pathfinding.
|
|
@@ -16645,12 +16710,12 @@ interface LuaSurface {
|
|
|
16645
16710
|
generate_with_lab_tiles: boolean
|
|
16646
16711
|
|
|
16647
16712
|
/**
|
|
16648
|
-
* This surface's
|
|
16713
|
+
* This surface's index in {@link LuaGameScript::surfaces | LuaGameScript::surfaces} (unique ID). It is assigned when a surface is created, and remains so until it is {@link deleted | on_surface_deleted}. Indexes of deleted surfaces can be reused.
|
|
16649
16714
|
*/
|
|
16650
16715
|
readonly index: number
|
|
16651
16716
|
|
|
16652
16717
|
/**
|
|
16653
|
-
* The generation settings for this surface. These can be modified
|
|
16718
|
+
* The generation settings for this surface. These can be modified after surface generation, but note that this will not retroactively update the surface. To manually regenerate it, {@link LuaSurface::regenerate_entity | LuaSurface::regenerate_entity}, {@link LuaSurface::regenerate_decorative | LuaSurface::regenerate_decorative}, and {@link LuaSurface::delete_chunk | LuaSurface::delete_chunk} can be used.
|
|
16654
16719
|
*/
|
|
16655
16720
|
map_gen_settings: MapGenSettings
|
|
16656
16721
|
|
|
@@ -16719,7 +16784,7 @@ interface LuaSurface {
|
|
|
16719
16784
|
wind_orientation_change: number
|
|
16720
16785
|
|
|
16721
16786
|
/**
|
|
16722
|
-
* Current wind speed.
|
|
16787
|
+
* Current wind speed in tiles per tick.
|
|
16723
16788
|
*/
|
|
16724
16789
|
wind_speed: number
|
|
16725
16790
|
|
|
@@ -16800,7 +16865,7 @@ interface LuaTechnology {
|
|
|
16800
16865
|
readonly research_unit_count: number
|
|
16801
16866
|
|
|
16802
16867
|
/**
|
|
16803
|
-
* The count formula
|
|
16868
|
+
* The count formula, if this research has any. See the {@link wiki | https://wiki.factorio.com/Prototype/Technology#Technology_data} for details.
|
|
16804
16869
|
*/
|
|
16805
16870
|
readonly research_unit_count_formula?: string
|
|
16806
16871
|
|
|
@@ -16914,7 +16979,7 @@ interface LuaTechnologyPrototype {
|
|
|
16914
16979
|
readonly research_unit_count: number
|
|
16915
16980
|
|
|
16916
16981
|
/**
|
|
16917
|
-
* The count formula
|
|
16982
|
+
* The count formula, if this research has any. See the {@link wiki | https://wiki.factorio.com/Prototype/Technology#Technology_data} for details.
|
|
16918
16983
|
*/
|
|
16919
16984
|
readonly research_unit_count_formula?: string
|
|
16920
16985
|
|
|
@@ -17085,9 +17150,9 @@ interface LuaTilePrototype {
|
|
|
17085
17150
|
readonly emissions_per_second: number
|
|
17086
17151
|
|
|
17087
17152
|
/**
|
|
17088
|
-
* Items that when placed will produce this tile
|
|
17153
|
+
* Items that when placed will produce this tile, if any. Construction bots will choose the first item in the list to build this tile.
|
|
17089
17154
|
*/
|
|
17090
|
-
readonly items_to_place_this
|
|
17155
|
+
readonly items_to_place_this?: ItemStackDefinition[]
|
|
17091
17156
|
|
|
17092
17157
|
readonly layer: number
|
|
17093
17158
|
|
|
@@ -18583,7 +18648,7 @@ interface LuaSurfaceCreateEntityParams {
|
|
|
18583
18648
|
'raise_built'?: boolean
|
|
18584
18649
|
|
|
18585
18650
|
/**
|
|
18586
|
-
* Source entity. Used for beams and highlight-boxes.
|
|
18651
|
+
* Source entity. Used for beams, projectiles, and highlight-boxes.
|
|
18587
18652
|
*/
|
|
18588
18653
|
'source'?: LuaEntity | MapPosition
|
|
18589
18654
|
|
package/dist/concepts.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.80
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -309,19 +309,6 @@ interface BlueprintEntity {
|
|
|
309
309
|
tags?: Tags
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
interface BlueprintItemIcon {
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4].
|
|
316
|
-
*/
|
|
317
|
-
index: number,
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Name of the item prototype whose icon should be used.
|
|
321
|
-
*/
|
|
322
|
-
name: string
|
|
323
|
-
}
|
|
324
|
-
|
|
325
312
|
interface BlueprintSignalIcon {
|
|
326
313
|
|
|
327
314
|
/**
|
|
@@ -1343,7 +1330,7 @@ interface ItemStackLocation {
|
|
|
1343
1330
|
*
|
|
1344
1331
|
* The template can contain placeholders such as `__1__` or `__2__`. These will be replaced by the respective parameter in the LocalisedString. The parameters themselves can be other localised strings, which will be processed recursively in the same fashion. Localised strings can not be recursed deeper than 20 levels and can not have more than 20 parameters.
|
|
1345
1332
|
*
|
|
1346
|
-
*
|
|
1333
|
+
* There are two special flags for the localised string, indicated by the key being a particular string. First, if the key is the empty string (`""`), then all parameters will be concatenated (after processing, if any are localised strings themselves). Second, if the key is a question mark (`"?"`), then the first valid parameter will be used. A parameter can be invalid if its name doesn't match any string template. If no parameters are valid, the last one is returned. This is useful to implement a fallback for missing locale templates.
|
|
1347
1334
|
*
|
|
1348
1335
|
* Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) which will not be translated, as well as a number, boolean or `nil`, which will be converted to their textual representation.
|
|
1349
1336
|
* @example
|
|
@@ -1371,6 +1358,13 @@ interface ItemStackLocation {
|
|
|
1371
1358
|
* game.print({"", {"item-name.iron-plate"}, ": ", 60})
|
|
1372
1359
|
* ```
|
|
1373
1360
|
*
|
|
1361
|
+
* @example
|
|
1362
|
+
* As an example of a localised string with fallback, consider this:
|
|
1363
|
+
* ```
|
|
1364
|
+
* {"?", {"", {"entity-description.furnace"}, "\n"}, {"item-description.furnace"}, "optional fallback"}
|
|
1365
|
+
* ```
|
|
1366
|
+
* If `entity-description.furnace` exists, it is concatenated with `"\n"` and returned. Otherwise, if `item-description.furnace` exists, it is returned as-is. Otherwise, `"optional fallback"` is returned. If this value wasn't specified, the translation result would be `"Unknown key: 'item-description.furnace'"`.
|
|
1367
|
+
*
|
|
1374
1368
|
*/
|
|
1375
1369
|
type LocalisedString = string | number | boolean | object | null | Array<string | LocalisedString>
|
|
1376
1370
|
|
|
@@ -1828,11 +1822,6 @@ interface ModChangeData {
|
|
|
1828
1822
|
old_version: string
|
|
1829
1823
|
}
|
|
1830
1824
|
|
|
1831
|
-
/**
|
|
1832
|
-
* @remarks
|
|
1833
|
-
* Runtime settings can be changed through console commands and by the mod that owns the settings by writing a new table to the ModSetting.
|
|
1834
|
-
*
|
|
1835
|
-
*/
|
|
1836
1825
|
interface ModSetting {
|
|
1837
1826
|
|
|
1838
1827
|
/**
|
|
@@ -2885,7 +2874,7 @@ interface WireConnectionDefinition {
|
|
|
2885
2874
|
target_wire_id?: defines.wire_connection_id,
|
|
2886
2875
|
|
|
2887
2876
|
/**
|
|
2888
|
-
*
|
|
2877
|
+
* The type of wire used.
|
|
2889
2878
|
*/
|
|
2890
2879
|
wire: defines.wire_type
|
|
2891
2880
|
}
|
package/dist/defines.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.80
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
|
@@ -539,6 +539,8 @@ declare namespace defines {
|
|
|
539
539
|
on_gui_closed,
|
|
540
540
|
on_gui_confirmed,
|
|
541
541
|
on_gui_elem_changed,
|
|
542
|
+
on_gui_hover,
|
|
543
|
+
on_gui_leave,
|
|
542
544
|
on_gui_location_changed,
|
|
543
545
|
on_gui_opened,
|
|
544
546
|
on_gui_selected_tab_changed,
|
|
@@ -794,6 +796,8 @@ declare namespace defines {
|
|
|
794
796
|
gui_click,
|
|
795
797
|
gui_confirmed,
|
|
796
798
|
gui_elem_changed,
|
|
799
|
+
gui_hover,
|
|
800
|
+
gui_leave,
|
|
797
801
|
gui_location_changed,
|
|
798
802
|
gui_selected_tab_changed,
|
|
799
803
|
gui_selection_state_changed,
|
package/dist/events.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.80
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -686,6 +686,32 @@ interface on_gui_elem_changed extends event {
|
|
|
686
686
|
*/
|
|
687
687
|
player_index: number
|
|
688
688
|
}
|
|
689
|
+
/**
|
|
690
|
+
* Called when {@link LuaGuiElement | LuaGuiElement} is hovered by the mouse.
|
|
691
|
+
*/
|
|
692
|
+
interface on_gui_hover extends event {
|
|
693
|
+
/**
|
|
694
|
+
* The element that is being hovered over.
|
|
695
|
+
*/
|
|
696
|
+
element: LuaGuiElement
|
|
697
|
+
/**
|
|
698
|
+
* The player whose cursor is hovering.
|
|
699
|
+
*/
|
|
700
|
+
player_index: number
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Called when the player's cursor leaves a {@link LuaGuiElement | LuaGuiElement} that was previously hovered.
|
|
704
|
+
*/
|
|
705
|
+
interface on_gui_leave extends event {
|
|
706
|
+
/**
|
|
707
|
+
* The element that was being hovered.
|
|
708
|
+
*/
|
|
709
|
+
element: LuaGuiElement
|
|
710
|
+
/**
|
|
711
|
+
* The player whose cursor was hovering.
|
|
712
|
+
*/
|
|
713
|
+
player_index: number
|
|
714
|
+
}
|
|
689
715
|
/**
|
|
690
716
|
* Called when {@link LuaGuiElement | LuaGuiElement} element location is changed (related to frames in `player.gui.screen`).
|
|
691
717
|
*/
|
|
@@ -1210,7 +1236,7 @@ interface on_player_created extends event {
|
|
|
1210
1236
|
player_index: number
|
|
1211
1237
|
}
|
|
1212
1238
|
/**
|
|
1213
|
-
* Called after a
|
|
1239
|
+
* Called after a player's {@link cursor stack | LuaControl::cursor_stack} changed in some way.
|
|
1214
1240
|
*/
|
|
1215
1241
|
interface on_player_cursor_stack_changed extends event {
|
|
1216
1242
|
player_index: number
|
package/dist/global.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.80
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|