Add white room browsing mode
This commit is contained in:
parent
794b4dc162
commit
3c5e6daf06
4 changed files with 45 additions and 3 deletions
10
room.lua
10
room.lua
|
|
@ -140,7 +140,8 @@ function Room:draw()
|
|||
-- draw only the channels the player has. Each object just exposes sprites per
|
||||
-- channel via Entity:draw(channel); a door registered on all three channels
|
||||
-- naturally draws its red sprite on the red pass, etc. No per-object logic.
|
||||
for _, channel in ipairs(self.colorsPlayerHas) do
|
||||
local drawChannels = gameWorld and gameWorld.roomBrowseMode and {"red", "green", "blue"} or self.colorsPlayerHas
|
||||
for _, channel in ipairs(drawChannels) do
|
||||
if self.player[channel] then self.player[channel]:draw(channel) end
|
||||
for _, entity in pairs(self.collideables[channel]) do entity:draw(channel) end
|
||||
-- The zoomed-out neighbourhood already draws every room directly. Calling
|
||||
|
|
@ -201,8 +202,11 @@ function Room:drawWiresAt(originX, originY, cellSize, selectedCircuit, editorCol
|
|||
table.sort(ordered)
|
||||
|
||||
love.graphics.setBlendMode("alpha")
|
||||
local visibleColors = {red = false, green = false, blue = false}
|
||||
for _, color in ipairs(self.colorsPlayerHas or {}) do visibleColors[color] = true end
|
||||
local showAllChannels = gameWorld and gameWorld.roomBrowseMode
|
||||
local visibleColors = {red = showAllChannels, green = showAllChannels, blue = showAllChannels}
|
||||
if not showAllChannels then
|
||||
for _, color in ipairs(self.colorsPlayerHas or {}) do visibleColors[color] = true end
|
||||
end
|
||||
local editorIsOn = editorView ~= nil and editorView ~= "off"
|
||||
for _, circuitId in ipairs(ordered) do
|
||||
local selected = not selectedCircuit or selectedCircuit == circuitId
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue