generated from fgardt/factorio-mod-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.lua
43 lines (36 loc) · 1.11 KB
/
constants.lua
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
local prefix = "ust-"
local volume_size = prefix .. "tank_volume"
local update_rate = prefix .. "update_rate"
local graphic_mode = prefix .. "graphic_mode"
---@return number
local function get_volume()
---@diagnostic disable-next-line: return-type-mismatch
return settings.startup[volume_size].value
end
---@return "slow"|"normal"|"fast"|"insane"
local function get_rate()
---@diagnostic disable-next-line: return-type-mismatch
return settings.global[update_rate].value
end
local function is_transparent()
return settings.startup[graphic_mode].value == "transparent"
end
local function is_closed()
return settings.startup[graphic_mode].value == "closed"
end
---@class Constants
local const = {
setting = {
volume_size = volume_size,
update_rate = update_rate,
graphic_mode = graphic_mode,
get_volume = get_volume,
get_rate = get_rate,
is_transparent = is_transparent,
is_closed = is_closed,
},
prefix = prefix,
entity_name = "underground-storage-tank",
graphics_dir = "__underground-storage-tank__/graphics/",
}
return const