z_mirror/PipeVisualizer

git clone https://git.raiguard.me/z_mirror/PipeVisualizer

Caleb HeuerDraw everything with sprites!f906db3

2.0
3.8 KiB160 linesraw
1data:extend({
2  {
3    type = "custom-input",
4    name = "pv-visualize-selected",
5    key_sequence = "H",
6    action = "lua",
7  },
8  {
9    type = "custom-input",
10    name = "pv-toggle-overlay",
11    key_sequence = "SHIFT + H",
12    action = "lua",
13  },
14  {
15    type = "custom-input",
16    name = "pv-toggle-hover",
17    key_sequence = "",
18    action = "lua",
19  },
20  {
21    type = "shortcut",
22    name = "pv-toggle-hover",
23    icon = {
24      filename = "__PipeVisualizer__/graphics/hover-dark-x32.png",
25      size = 32,
26      mipmap_count = 2,
27      flags = { "gui-icon" },
28    },
29    disabled_icon = {
30      filename = "__PipeVisualizer__/graphics/hover-light-x32.png",
31      size = 32,
32      mipmap_count = 2,
33      flags = { "gui-icon" },
34    },
35    small_icon = {
36      filename = "__PipeVisualizer__/graphics/hover-dark-x24.png",
37      size = 24,
38      mipmap_count = 2,
39      flags = { "gui-icon" },
40    },
41    disabled_small_icon = {
42      filename = "__PipeVisualizer__/graphics/hover-light-x24.png",
43      size = 24,
44      mipmap_count = 2,
45      flags = { "gui-icon" },
46    },
47    associated_control_input = "pv-toggle-hover",
48    action = "lua",
49    toggleable = true,
50  },
51  {
52    type = "shortcut",
53    name = "pv-toggle-overlay",
54    icon = {
55      filename = "__PipeVisualizer__/graphics/overlay-dark-x32.png",
56      size = 32,
57      mipmap_count = 2,
58      flags = { "gui-icon" },
59    },
60    disabled_icon = {
61      filename = "__PipeVisualizer__/graphics/overlay-light-x32.png",
62      size = 32,
63      mipmap_count = 2,
64      flags = { "gui-icon" },
65    },
66    small_icon = {
67      filename = "__PipeVisualizer__/graphics/overlay-dark-x24.png",
68      size = 24,
69      mipmap_count = 2,
70      flags = { "gui-icon" },
71    },
72    disabled_small_icon = {
73      filename = "__PipeVisualizer__/graphics/overlay-light-x24.png",
74      size = 24,
75      mipmap_count = 2,
76      flags = { "gui-icon" },
77    },
78    associated_control_input = "pv-toggle-overlay",
79    action = "lua",
80    toggleable = true,
81  },
82})
83
84local storage_tank = table.deepcopy(data.raw["storage-tank"]["storage-tank"])
85storage_tank.name = "cursed-storage-tank"
86storage_tank.fluid_box.pipe_connections[1].max_underground_distance = 5
87storage_tank.fluid_box.pipe_connections[3].max_underground_distance = 5
88data:extend({ storage_tank })
89
90data:extend({
91  {
92    type = "sprite",
93    name = "pv-entity-box",
94    filename = "__PipeVisualizer__/graphics/entity-box.png",
95    size = 64,
96    scale = 0.5,
97    flags = { "icon" },
98    draw_as_glow = true,
99  },
100  {
101    type = "sprite",
102    name = "pv-underground-connection",
103    filename = "__PipeVisualizer__/graphics/underground-connection.png",
104    size = 64,
105    scale = 0.5,
106    flags = { "icon" },
107    draw_as_glow = true,
108  },
109  {
110    type = "sprite",
111    name = "pv-fluid-arrow",
112    filename = "__PipeVisualizer__/graphics/fluid-arrow.png",
113    size = 48,
114    scale = 0.5,
115    flags = { "icon" },
116    draw_as_glow = true,
117  },
118  {
119    type = "sprite",
120    name = "pv-fluid-arrow-output",
121    filename = "__PipeVisualizer__/graphics/fluid-arrow-output.png",
122    size = 48,
123    scale = 0.5,
124    flags = { "icon" },
125    draw_as_glow = true,
126  },
127  {
128    type = "sprite",
129    name = "pv-fluid-arrow-input",
130    filename = "__PipeVisualizer__/graphics/fluid-arrow-input.png",
131    size = 48,
132    scale = 0.5,
133    flags = { "icon" },
134    draw_as_glow = true,
135  },
136  {
137    type = "sprite",
138    name = "pv-fluid-arrow-input-output",
139    filename = "__PipeVisualizer__/graphics/fluid-arrow-input-output.png",
140    size = 48,
141    scale = 0.5,
142    flags = { "icon" },
143    draw_as_glow = true,
144  },
145})
146
147for i = 0, 15 do
148  data:extend({
149    {
150      type = "sprite",
151      name = "pv-pipe-connections-" .. i,
152      filename = "__PipeVisualizer__/graphics/pipe-connections.png",
153      x = i * 64,
154      size = 64,
155      scale = 0.5,
156      flags = { "icon" },
157      draw_as_glow = true,
158    },
159  })
160end