Add selection_box_offsets to rail-signal prototype
Posted: Mon Nov 22, 2021 6:25 pm
WHAT
Adding/moving selection_box_offsets from RailChainSignal to RailSignalBase
WHY
There's no reason to have this property in RailChainSignal but not RailSignal. Currently, when you offset the selection box (so the median point is not 0,0), the box rotates for the 4 main directions (N,E,S,W), but for the diagonals, it default to north. Illustration:

(in this example: selection_box = {{-1.6, -0.8}, {0.01, 0.8}}, so north is offset to the left)
Solution is to bring in "selection_box_offsets", which already exists in RailChainSignal only:
selection_box_offsets = {
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0}
},
Adding/moving selection_box_offsets from RailChainSignal to RailSignalBase
WHY
There's no reason to have this property in RailChainSignal but not RailSignal. Currently, when you offset the selection box (so the median point is not 0,0), the box rotates for the 4 main directions (N,E,S,W), but for the diagonals, it default to north. Illustration:


(in this example: selection_box = {{-1.6, -0.8}, {0.01, 0.8}}, so north is offset to the left)
Solution is to bring in "selection_box_offsets", which already exists in RailChainSignal only:
selection_box_offsets = {
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0}
},