Module:Build bracket/Paths and Module:Build bracket/Paths/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>MusikBot II
m Protected "Module:Build bracket/Paths": High-risk template or module: 8490 transclusions (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
 
imported>Pbrks
No edit summary
 
Line 131: Line 131:
     end
     end
     local hasBottom =
     local hasBottom =
         (sRow - 1 >= 1) and e[sRow - 1] and e[sRow - 1].ctype == "line" and
         (sRow >= 1) and e[sRow] and e[sRow].ctype == "line" and
         (e[sRow - 1].border == "bottom" or e[sRow - 1].border == "both")
         (e[sRow].border == "bottom" or e[sRow].border == "both")
     local hasTop =
     local hasTop =
         (sRow + 1 <= config.r) and e[sRow + 1] and e[sRow + 1].ctype == "line" and
         (sRow + 1 <= config.r) and e[sRow + 1] and e[sRow + 1].ctype == "line" and
Line 488: Line 488:
local function finalizeThroughLineColors()
local function finalizeThroughLineColors()
     for teamCol = config.minc + 1, config.c do
     for teamCol = config.minc + 1, config.c do
         local leftPathCol = teamCol - 1
         local leftPathCol = teamCol - 1
         local rightPathCol = teamCol
         local rightPathCol = teamCol
         local Ent = state.entries[teamCol]
         local Ent = state.entries[teamCol]
Line 495: Line 495:
                 local hasBottom, hasTop = throughEdgesMaskAt(teamCol, sRow)
                 local hasBottom, hasTop = throughEdgesMaskAt(teamCol, sRow)


                 if hasBottom and Ent[sRow - 1] and Ent[sRow - 1].ctype == "line" then
                 if hasBottom and Ent[sRow] and Ent[sRow].ctype == "line" then
                     -- bottom edges at row sRow (left k=3, right k=1) use edge=3
                     -- bottom edges at row sRow (left k=3, right k=1) use edge=3
                     local wL, cL = getEdge(leftPathCol, sRow, 3, 3)
                     local wL, cL = getEdge(leftPathCol, sRow, 3, 3)
                     local wR, cR = getEdge(rightPathCol, sRow, 1, 3)
                     local wR, cR = getEdge(rightPathCol, sRow, 1, 3)
                     Ent[sRow - 1].color = (wL ~= 0 and wR ~= 0 and cL == cR) and cL or nil
                     Ent[sRow].color = (wL ~= 0 and wR ~= 0 and cL == cR) and cL or nil
                 end
                 end


                 if hasTop and Ent[sRow + 1] and Ent[sRow + 1].ctype == "line" then
                 if hasTop and Ent[sRow + 1] and Ent[sRow + 1].ctype == "line" then
                     -- top edges at row sRow+1 use edge=1
                     -- top edges at row sRow+1 use edge=1 (unchanged)
                     local wL, cL = getEdge(leftPathCol, sRow + 1, 3, 1)
                     local wL, cL = getEdge(leftPathCol, sRow + 1, 3, 1)
                     local wR, cR = getEdge(rightPathCol, sRow + 1, 1, 1)
                     local wR, cR = getEdge(rightPathCol, sRow + 1, 1, 1)
                     Ent[sRow + 1].color = (wL ~= 0 and wR ~= 0 and cL == cR) and cL or nil
                     Ent[sRow + 1].color = (wL ~= 0 and wR ~= 0 and cL == cR) and cL or nil
Line 615: Line 615:


             -- bounds guards
             -- bounds guards
             if hasBottom and (i - 1) >= 1 then
             if hasBottom then
                Ent[i - 1] = {ctype = "line", border = "bottom"}
    Ent[i] = { ctype = "line", border = "bottom" }
                Ent[i] = Ent[i] or {ctype = "blank"}
end
            end
             if hasTop and (i + 1) <= R then
             if hasTop and (i + 1) <= R then
                Ent[i + 1] = {ctype = "line", border = "top"}
    Ent[i + 1] = { ctype = "line", border = "top" }
                if (i + 2) <= R then
    if (i + 2) <= R then
                    Ent[i + 2] = Ent[i + 2] or {ctype = "blank"}
        Ent[i + 2] = Ent[i + 2] or { ctype = "blank" }
                end
    end
            end
end
         end
         end
     end
     end