include("class.lua")
include("hud.lua")

GeneralInfoGuage = class(HudGauge)

function GeneralInfoGuage:init()
    self:move(0.7, 0.75)
    self:setColor(0, 255, 0, 128)
end

function GeneralInfoGuage:drawStatus(name, status, x, y)
    self:__colorSet()
    local width = self:drawString(name .. ": ", x, y)

    if (status) then
        gr.setColor(80, 150, 50, 128)
    else
        gr.setColor(184, 134, 11, 128)
    end

    if (status) then
        self:drawString("Enabled", x + width, y)
    else
        self:drawString("Disabled", x + width, y)
    end

    return y + gr.CurrentFont.Height
end

function GeneralInfoGuage:render()
    self:setupRendering()

    local y = 0
    y = self:drawStatus("Manual control", self.script:isManual(), 0, y)

    self:doneRendering()
end

function GeneralInfoGuage:getName()
    return "General info gauge"
end

function GeneralInfoGuage:getDescription()
    return "Displays general information"
end

function GeneralInfoGuage:shouldDraw()
    return not self.hudConfig:isShowingHelp()
end

return GeneralInfoGuage
