Skip to content

Commit

Permalink
Rewrote all code related to LuaEntity.circuit_wire_connection_points
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Nov 10, 2024
1 parent 354be4d commit fa384d0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 42 deletions.
5 changes: 2 additions & 3 deletions prototypes/buildings/borax-mine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ for i = 1, 4 do
width = 12,
height = 12
},
--circuit_wire_connection_points = circuit_connector_definitions['borax-mine-mkxx'].points,
--circuit_connector_sprites = circuit_connector_definitions['borax-mine-mkxx'].sprites,
--circuit_wire_max_distance = default_circuit_wire_max_distance,
circuit_connector = circuit_connector_definitions["borax-mine-mkxx"],
circuit_wire_max_distance = _G.default_circuit_wire_max_distance,
graphics_set = {
animation = dry_graphics
},
Expand Down
5 changes: 2 additions & 3 deletions prototypes/buildings/niobium-mine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ ENTITY {
width = 12,
height = 12
},
--circuit_wire_connection_points = circuit_connector_definitions['niobium-mine'].points,
--circuit_connector_sprites = circuit_connector_definitions['niobium-mine'].sprites,
--circuit_wire_max_distance = default_circuit_wire_max_distance,
circuit_connector = circuit_connector_definitions["niobium-mine"],
circuit_wire_max_distance = _G.default_circuit_wire_max_distance,
graphics_set = {
animation = dry_graphics
},
Expand Down
44 changes: 8 additions & 36 deletions prototypes/buildings/tailings-pond.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ for y = 0, 2112 - 352, 352 do
end
data:extend(pictures)

local blank_png = {
filename = "__core__/graphics/empty.png",
height = 1,
priority = "extra-high",
width = 1
}

ENTITY {
type = "storage-tank",
name = "tailings-pond",
Expand All @@ -67,8 +60,7 @@ ENTITY {
dying_explosion = "storage-tank-explosion",
collision_box = {{-8.9, -8.9}, {8.9, 8.9}},
selection_box = {{-9, -9}, {9, 9}},
fluid_box =
{
fluid_box = {
volume = 1000000,
pipe_picture = {
north = {
Expand Down Expand Up @@ -120,11 +112,11 @@ ENTITY {
}
}
},
west = blank_png
west = py.empty_image()
},
pipe_covers = {
north = blank_png,
east = blank_png,
north = py.empty_image(),
east = py.empty_image(),
south = {
layers = {
{
Expand Down Expand Up @@ -213,35 +205,15 @@ ENTITY {
impact_category = "metal-large",
open_sound = {filename = "__base__/sound/car-metal-impact-1.ogg", volume = 0.15},
close_sound = {filename = "__base__/sound/car-metal-impact-1.ogg", volume = 0.15},
working_sound =
{
sound =
{
working_sound = {
sound = {
filename = "__base__/sound/storage-tank.ogg",
volume = 0.6
},
match_volume_to_activity = true,
audible_distance_modifier = 0.5,
max_sounds_per_type = 3
},
circuit_wire_connection_points = {
{
shadow = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}},
wire = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}}
},
{
shadow = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}},
wire = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}}
},
{
shadow = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}},
wire = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}}
},
{
shadow = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}},
wire = {red = {2.546875, -2.4375}, green = {2.546875, -2.4375}}
}
},
circuit_connector = circuit_connector_definitions["tailings-pond"],
circuit_wire_max_distance = 9,
circuit_connector_sprites = _G.circuit_connector_definitions["storage-tank"].sprites
}
}
12 changes: 12 additions & 0 deletions prototypes/circuit-connector-definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ circuit_connector_definitions["niobium-mine"] = circuit_connector_definitions.cr
{variation = 18, main_offset = util.by_pixel(-84, -5), shadow_offset = util.by_pixel(-78, 7), show_shadow = false}
}
)

circuit_connector_definitions["tailings-pond"] = circuit_connector_definitions.create_vector
(
universal_connector_template,
{ --Directions are horizontal in/outputs, vertical in/outputs.
--Remaining orientations are not used, but required to give the data the correct shape.
{variation = 1, main_offset = {-4.25, 3.3}, shadow_offset = {-4.25, 3.3}, show_shadow = true},
{variation = 1, main_offset = {-4.25, 3.3}, shadow_offset = {-4.25, 3.3}, show_shadow = true},
{variation = 1, main_offset = {-4.25, 3.3}, shadow_offset = {-4.25, 3.3}, show_shadow = true},
{variation = 1, main_offset = {-4.25, 3.3}, shadow_offset = {-4.25, 3.3}, show_shadow = true},
}
)

0 comments on commit fa384d0

Please sign in to comment.