This commit is contained in:
Navid Sassan 2025-12-09 23:25:34 +01:00
parent 7c1eb85053
commit 89a5f6d02e

View File

@ -935,11 +935,19 @@ local function updateDisplay()
if maxFuel <= 0 then maxFuel = 1 end -- SAFETY: prevent division by zero
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.setTextColor(colors.white)
mon.write("Fuel Used: ")
mon.setTextColor(colors.brown)
mon.write(formatPercent(fuelPercent))
mon.setTextColor(fuelColor)
mon.write(formatPercent(fuelPercent) .. " (Shutdown: " .. formatPercent(CONFIG.fuel_shutdown_threshold) .. ")")
y = y + 1
drawProgressBar(mon, 1, y, w - 2, fuelPercent, 1, colors.brown, colors.green)