make states numbers instead of booleans

This commit is contained in:
Redo0
2021-05-29 13:13:26 -05:00
parent ebc9a7f108
commit 8bb4ff4421
6 changed files with 31 additions and 45 deletions

View File

@@ -252,10 +252,10 @@ while 1 do
local numportso = 0; local numportson=0;
for k, port in pairs(group.out_ports) do
numportso = numportso+1
if Port.getstate(port) then numportson = numportson+1 end
if Port.getstate(port)==1 then numportson = numportson+1 end
end
info = "\\c5Net " .. tostring(group):match("table: 0x(.+)"):upper() .. "\n" .. (Wire.getgroup(wire).state and "\\c2On" or "\\c0Off") .. "\n" ..
info = "\\c5Net " .. tostring(group):match("table: 0x(.+)"):upper() .. "\n" .. (Wire.getgroup(wire).state==1 and "\\c2On" or "\\c0Off") .. "\n" ..
"Wires: "..numwires.."\n"..
"In Ports: " ..numportsi.."\n"..
"Out Ports: "..numportso.."\n"..
@@ -276,7 +276,7 @@ while 1 do
else
state = Port.getstate(port)
end
info = info .. (state and "\\c2" or "\\c0") .. def.ports[i].name .. (i ~= #gate.ports and " " or "")
info = info .. (state==1 and "\\c2" or "\\c0") .. def.ports[i].name .. (i ~= #gate.ports and " " or "")
end
end