make states numbers instead of booleans
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user