formatting liquids
This commit is contained in:
parent
f4bc968c8a
commit
116d28be99
|
@ -40,8 +40,8 @@ function generate_message(buffer)
|
|||
|
||||
-- format and align fuel and coolant fill
|
||||
message(buffer, '\n')
|
||||
message_aligned(buffer, 'Fuel.....:', options.compact and compact_number(f_raw) or f_raw, system.width)
|
||||
message_aligned(buffer, 'Capacity.:', options.compact and compact_number(c_raw) or c_raw, system.width)
|
||||
message_aligned(buffer, 'Fuel.....:', format_liquid(options, f_raw), system.width)
|
||||
message_aligned(buffer, 'Capacity.:', format_liquid(options, c_raw), system.width)
|
||||
|
||||
-- format and align temperatures
|
||||
message(buffer, '\n')
|
||||
|
|
|
@ -55,6 +55,11 @@ function format_temp(options, number)
|
|||
return temperature .. 'K ' .. string.rep(' ', #options.unit)
|
||||
end
|
||||
|
||||
-- format liquids as compact number and padded unit
|
||||
function format_liquid(options, number)
|
||||
return (options.compact and compact_number(number) or number) .. 'mB' .. string.rep(' ', #options.unit)
|
||||
end
|
||||
|
||||
function find_peripheral_component(name)
|
||||
for _, side in pairs(peripheral.getNames()) do
|
||||
if peripheral.getType(side) == name then
|
||||
|
|
Loading…
Reference in New Issue
Block a user