.
This commit is contained in:
parent
7c1eb85053
commit
89a5f6d02e
@ -935,11 +935,19 @@ local function updateDisplay()
|
|||||||
if maxFuel <= 0 then maxFuel = 1 end -- SAFETY: prevent division by zero
|
if maxFuel <= 0 then maxFuel = 1 end -- SAFETY: prevent division by zero
|
||||||
local fuelPercent = fuel / maxFuel
|
local fuelPercent = fuel / maxFuel
|
||||||
|
|
||||||
|
-- Color fuel based on thresholds
|
||||||
|
local fuelColor = colors.lime
|
||||||
|
if fuelPercent >= CONFIG.fuel_shutdown_threshold then
|
||||||
|
fuelColor = colors.red
|
||||||
|
elseif fuelPercent >= CONFIG.fuel_warning_threshold then
|
||||||
|
fuelColor = colors.orange
|
||||||
|
end
|
||||||
|
|
||||||
mon.setCursorPos(1, y)
|
mon.setCursorPos(1, y)
|
||||||
mon.setTextColor(colors.white)
|
mon.setTextColor(colors.white)
|
||||||
mon.write("Fuel Used: ")
|
mon.write("Fuel Used: ")
|
||||||
mon.setTextColor(colors.brown)
|
mon.setTextColor(fuelColor)
|
||||||
mon.write(formatPercent(fuelPercent))
|
mon.write(formatPercent(fuelPercent) .. " (Shutdown: " .. formatPercent(CONFIG.fuel_shutdown_threshold) .. ")")
|
||||||
y = y + 1
|
y = y + 1
|
||||||
|
|
||||||
drawProgressBar(mon, 1, y, w - 2, fuelPercent, 1, colors.brown, colors.green)
|
drawProgressBar(mon, 1, y, w - 2, fuelPercent, 1, colors.brown, colors.green)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user