z_mirror/PipeVisualizer

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

Caleb HeuerSimplify and fix bugs3206438

2.0
1.6 KiB50 linesraw
1if script.active_mods["gvv"] then
2  require("__gvv__.gvv")()
3end
4
5local handler = require("__core__/lualib/event_handler")
6
7handler.add_libraries({
8  require("__PipeVisualizer__/scripts/migrations"),
9
10  require("__PipeVisualizer__/scripts/colors"),
11  require("__PipeVisualizer__/scripts/entity-detection"),
12  require("__PipeVisualizer__/scripts/iterator"),
13  require("__PipeVisualizer__/scripts/overlay"),
14})
15
16-- local colors = {
17--   ["input-output"] = { r = 0.3, g = 0.3, a = 0.3 },
18--   ["input"] = { r = 0.3, a = 0.3 },
19--   ["output"] = { g = 0.3, a = 0.3 },
20--   ["none"] = { a = 0 },
21-- }
22-- local entities = game.player.surface.find_entities_filtered({
23--   area = area,
24-- })
25-- for _, entity in pairs(entities) do
26--   --- @cast entity LuaEntity
27--   local fluidbox = entity.fluidbox or {}
28--   for i = 1, #fluidbox do
29--     local prototypes = fluidbox.get_prototype(i --[[@as uint]])
30--     if prototypes.object_name then
31--       prototypes = { prototypes }
32--     end
33--     for _, prototype in pairs(prototypes) do
34--       for _, connection in pairs(prototype.pipe_connections) do
35--         local color = colors[connection.type]
36--         local position = connection.positions[(entity.direction / 2) + 1]
37--         rendering.draw_circle({
38--           color = color,
39--           radius = 0.2,
40--           filled = true,
41--           target = entity,
42--           target_offset = { position.x, position.y },
43--           surface = entity.surface_index,
44--         })
45--       end
46--     end
47--   end
48-- end
49
50-- /c game.player.teleport({ x = 646.60546875, y = -160.99609375 }) game.player.zoom = 0.67