Module:Step vis: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 8: Line 8:
local step_pattern = step_pattern or { 5, 2, 5, 0, 5, 2, 0 }
local step_pattern = step_pattern or { 5, 2, 5, 0, 5, 2, 0 }
local left_border = "├" -- U+251C ("├")
local left_border = "├" -- U+251C ├
local right_border = "┤" -- U+2524 ("┤")
local right_border = "┤" -- U+2524 ┤
local no_border = "─" -- U+2500 ("─")
local no_border = "─" -- U+2500 ─
local double_border = "╫" -- U+256B ("╫")
local double_border = "╫" -- U+256B ╫
local double_border_left = "╟" -- U+255F ("╟")
local double_border_left = "╟" -- U+255F ╟
local double_border_right = "╢" -- U+2562 ("╢")
local double_border_right = "╢" -- U+2562 ╢
local single_border = "┼" -- U+253C ("┼")
local single_border = "┼" -- U+253C ┼
local step_visualization = ""
local step_visualization = ""
Line 36: Line 36:
elseif i == #step_pattern then
elseif i == #step_pattern then
if current_step_size == 0 then
if current_step_size == 0 then
current_step_vis = (next_step_size < 0 and "" or double_border_right)
if (previous_step_size == 0) then
step_visualization = string.sub(step_visualization, 1, -9) .. double_border_right
else
current_step_vis = double_border_right
end
else
else
current_step_vis = single_border .. string.rep(no_border, current_step_size - 1) .. right_border
current_step_vis = single_border .. string.rep(no_border, current_step_size - 1) .. right_border