z_mirror/PipeVisualizer

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

Caleb HeuerRe-implement mouse-over visualizer775d42f

main
3.9 KiB167 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-mouseover",
17    key_sequence = "ALT + H",
18    action = "lua",
19  },
20  {
21    type = "custom-input",
22    name = "pv-color-by-fluid-system",
23    key_sequence = "CONTROL + H",
24    action = "lua",
25  },
26  {
27    type = "shortcut",
28    name = "pv-toggle-mouseover",
29    order = "c[toggles]-p[pv-toggle-mouseover]",
30    icon = {
31      filename = "__PipeVisualizer__/graphics/mouseover-dark-x32.png",
32      size = 32,
33      mipmap_count = 2,
34      flags = { "gui-icon" },
35    },
36    disabled_icon = {
37      filename = "__PipeVisualizer__/graphics/mouseover-light-x32.png",
38      size = 32,
39      mipmap_count = 2,
40      flags = { "gui-icon" },
41    },
42    small_icon = {
43      filename = "__PipeVisualizer__/graphics/mouseover-dark-x24.png",
44      size = 24,
45      mipmap_count = 2,
46      flags = { "gui-icon" },
47    },
48    disabled_small_icon = {
49      filename = "__PipeVisualizer__/graphics/mouseover-light-x24.png",
50      size = 24,
51      mipmap_count = 2,
52      flags = { "gui-icon" },
53    },
54    associated_control_input = "pv-toggle-mouseover",
55    action = "lua",
56    toggleable = true,
57  },
58  {
59    type = "shortcut",
60    name = "pv-toggle-overlay",
61    order = "c[toggles]-p[pv-toggle-overlay]",
62    icon = {
63      filename = "__PipeVisualizer__/graphics/overlay-dark-x32.png",
64      size = 32,
65      mipmap_count = 2,
66      flags = { "gui-icon" },
67    },
68    disabled_icon = {
69      filename = "__PipeVisualizer__/graphics/overlay-light-x32.png",
70      size = 32,
71      mipmap_count = 2,
72      flags = { "gui-icon" },
73    },
74    small_icon = {
75      filename = "__PipeVisualizer__/graphics/overlay-dark-x24.png",
76      size = 24,
77      mipmap_count = 2,
78      flags = { "gui-icon" },
79    },
80    disabled_small_icon = {
81      filename = "__PipeVisualizer__/graphics/overlay-light-x24.png",
82      size = 24,
83      mipmap_count = 2,
84      flags = { "gui-icon" },
85    },
86    associated_control_input = "pv-toggle-overlay",
87    action = "lua",
88    toggleable = true,
89  },
90  {
91    type = "sprite",
92    name = "pv-entity-box",
93    filename = "__PipeVisualizer__/graphics/entity-box.png",
94    size = 64,
95    scale = 0.5,
96    flags = { "icon" },
97    draw_as_glow = true,
98  },
99  {
100    type = "sprite",
101    name = "pv-overlay-box",
102    filename = "__flib__/graphics/black.png",
103    size = 1,
104    scale = 32,
105    draw_as_glow = true,
106  },
107  {
108    type = "sprite",
109    name = "pv-underground-connection",
110    filename = "__PipeVisualizer__/graphics/underground-connection.png",
111    size = 64,
112    scale = 0.5,
113    flags = { "icon" },
114    draw_as_glow = true,
115  },
116  {
117    type = "sprite",
118    name = "pv-fluid-arrow",
119    filename = "__PipeVisualizer__/graphics/fluid-arrow.png",
120    size = 48,
121    scale = 0.5,
122    flags = { "icon" },
123    draw_as_glow = true,
124  },
125  {
126    type = "sprite",
127    name = "pv-fluid-arrow-output",
128    filename = "__PipeVisualizer__/graphics/fluid-arrow-output.png",
129    size = 48,
130    scale = 0.5,
131    flags = { "icon" },
132    draw_as_glow = true,
133  },
134  {
135    type = "sprite",
136    name = "pv-fluid-arrow-input",
137    filename = "__PipeVisualizer__/graphics/fluid-arrow-input.png",
138    size = 48,
139    scale = 0.5,
140    flags = { "icon" },
141    draw_as_glow = true,
142  },
143  {
144    type = "sprite",
145    name = "pv-fluid-arrow-input-output",
146    filename = "__PipeVisualizer__/graphics/fluid-arrow-input-output.png",
147    size = 48,
148    scale = 0.5,
149    flags = { "icon" },
150    draw_as_glow = true,
151  },
152})
153
154for i = 0, 15 do
155  data:extend({
156    {
157      type = "sprite",
158      name = "pv-pipe-connections-" .. i,
159      filename = "__PipeVisualizer__/graphics/pipe-connections.png",
160      x = i * 64,
161      size = 64,
162      scale = 0.5,
163      flags = { "icon" },
164      draw_as_glow = true,
165    },
166  })
167end