-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-final-fixes.lua
More file actions
87 lines (77 loc) · 3.13 KB
/
data-final-fixes.lua
File metadata and controls
87 lines (77 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
-- data-final-fixes.lua
-- Custom GUI styles for Factorio Admin Command Center (FACC).
-- Defines the console textbox style and conditionally loads
-- the internal_names and infinite_resources scripts if enabled.
local default = data.raw["gui-style"].default
default["facc_console_input_style"] = {
type = "textbox_style",
parent = "textbox",
minimal_width = 650,
minimal_height = 200,
maximal_width = 700,
maximal_height = 400,
top_padding = 4,
bottom_padding = 4,
left_padding = 6,
right_padding = 6,
word_wrap = true
}
-- Load internal_names.lua when that setting is enabled
if settings.startup["facc-internal-names"]
and settings.startup["facc-internal-names"].value then
local ok, err = pcall(require, "internal_names")
if not ok then
error("FACC: failed to load internal_names.lua: " .. tostring(err))
end
end
-- Load infinite_resources.lua when that setting is enabled
if settings.startup["facc-infinite-resources"]
and settings.startup["facc-infinite-resources"].value then
require("scripts/startup-settings/infinite_resources")
end
-- Optional: make all mining drills effectively instant
if settings.startup["facc-instant-mining-drills"]
and settings.startup["facc-instant-mining-drills"].value then
local multiplier = 1000 -- big enough to mine almost instantly
local drills = data.raw["mining-drill"] or {}
for _, drill in pairs(drills) do
local base_speed = drill.mining_speed or 1
drill.mining_speed = base_speed * multiplier
end
end
-- Optional: make assembling machines/furnaces craft instantly
if settings.startup["facc-instant-crafting-machines"]
and settings.startup["facc-instant-crafting-machines"].value then
local multiplier = 1000000 -- force machine crafts to finish in ~1 tick
-- Prototype types that expose crafting_speed
local crafting_types = { "assembling-machine", "furnace", "rocket-silo" }
for _, type_name in ipairs(crafting_types) do
local prototypes = data.raw[type_name]
if prototypes then
for _, machine in pairs(prototypes) do
local base_speed = machine.crafting_speed or 1
machine.crafting_speed = base_speed * multiplier
end
end
end
end
-- Optional: remove electricity requirements from supported electric entities
if settings.startup["facc-remove-electricity-usage"]
and settings.startup["facc-remove-electricity-usage"].value then
require("scripts/startup-settings/remove_electricity_usage")
end
-- Optional: remove fuel requirements from supported burner/fluid entities
if settings.startup["facc-remove-fuel-usage"]
and settings.startup["facc-remove-fuel-usage"].value then
require("scripts/startup-settings/remove_fuel_usage")
end
-- Optional: remove ammo consumption from weapons/turrets
if settings.startup["facc-infinite-ammo"]
and settings.startup["facc-infinite-ammo"].value then
require("scripts/startup-settings/infinite_ammo")
end
-- Optional: remove all recipe ingredient inputs
if settings.startup["facc-ignore-recipe-inputs"]
and settings.startup["facc-ignore-recipe-inputs"].value then
require("scripts/startup-settings/ignore_recipe_inputs")
end