# Wert Racing Hud

## <mark style="background-color:orange;">INSTALLATION</mark>

1 - Upload the script folder to the location of your resources

2 - You can check the config file and customize it according to yourself

3 - **Installation successful, have a good funs**

## <mark style="background-color:red;">EXPORTS</mark>

```lua

-- # Used for the position indicator
exports['wert-racehud']:PositionUI('Update', {
    currentPosition = currentPosition, -- Current position | number or string
    maxPosition = maxPosition -- Max position | number or string
})
exports['wert-racehud']:PositionUI('Close')

-- # Used for lap indicator
exports['wert-racehud']:LapUI('Update', {
    currentLap = currentLap, -- Current lap | number or string
    maxLap = maxLap, -- Max lap | number or string
    lapHeader = lapHeader -- Lap header | string
})
exports['wert-racehud']:LapUI('Close')

-- # Used for scoreboard drivers
exports['wert-racehud']:RankUI('Update', {
    players = {
        { name = 'Player Name', flag = 'Flag URL' },
    },
    myName = 'My Character Name',
    myFlag = 'Flag URL',
    myBestTime = '01:00:00'
})
exports['wert-racehud']:RankUI('Close')

-- # Best lap information ui
exports['wert-racehud']:BesttimeUI('Update', {
    currentLap = currentLap, -- Current lap | number or string
    bestTime = bestTime, -- Best time | number or string
    calculateTime = calculateTime -- Calculate new - old | number or string
})
exports['wert-racehud']:BesttimeUI('Close')

-- # Update nitrous bar
-- nitrousLevel : Level ( number )
-- boolean : true or false
exports['wert-racehud']:UpdateNitrous(nitrousLevel, boolean)

-- # Toggle belt
exports['wert-racehud']:ToggleSeatbelt()
```

## <mark style="background-color:orange;">OPEN FILES</mark>

**Config file**

```lua
Config = {
    EnableMiniMap = false, -- # If players want to hide, they can use hud menu ( If u enable this option )
    FPSBoost = false,
    SpeedType = 'mph', -- 'kmh' or 'mph'
    weatherIconTypes = {
        [`XMAS`] = true,
        [`SNOW`] = true,
        [`SNOWLIGHT`] = true,
        [`RAIN`] = true,
    },
    kmhSpeedRate = 3.6,
    mphSpeedRate = 2.23694,
    noGearText= 'N',
    minimumEngineTemp = 35,
    hudMenuCommand = 'racehud',
    hudMenuLabel = 'Open Race Hud Menu',
    hudMenuKey = {
        active = true,
        key = 'G',
    },
}
```

**Editable client file**

```lua

function CustomGetVehicleFuel(veh) -- # Get vehicle fuel
    local amount = 50
    if GetResourceState('LegacyFuel') == 'started' then
        amount = math.floor(exports['LegacyFuel']:GetFuel(veh))
    end
    return amount
end

function LoadMiniMap() -- # Load mini map codes
    if not Config.EnableMiniMap then return end
    local posX = 0.01
    local posY = 0.0 -- 0.0152
    local width = 0.183
    local height = 0.32 --0.354
    RequestStreamedTextureDict("circlemap", false)
	while not HasStreamedTextureDictLoaded("circlemap") do Wait(100) end
    AddReplaceTexture("platform:/textures/graphics", "radarmasksm", "circlemap", "radarmasksm")
	SetMinimapClipType(1)
	SetMinimapComponentPosition('minimap', 'L', 'B', posX, posY, width, height)
	SetMinimapComponentPosition('minimap_mask', 'L', 'B', posX, posY, width, height)
	SetMinimapComponentPosition('minimap_blur', 'L', 'B', 0.012, 0.022, 0.256, 0.337)
    SetRadarBigmapEnabled(true, false)
    Wait(0)
    SetRadarBigmapEnabled(false, false)
end
```

**Lang file**

```lua
LANG = {
    position = 'POSITION',
    menuLabel = 'Hud Settings',
    showState = 'Show / Hide Hud',
    mapState = 'Show / Hide Minimap',
    gradientState = 'On / Off Gradient Colors',
    topPosition = 'Top Position (Y)',
    leftPosition = 'Left Position (X)',
    hudScale = 'General Hud Scale',
    off = 'OFF',
    on = 'ON',
}
```

## <mark style="color:green;background-color:yellow;">FINISH</mark>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wert-dev.gitbook.io/wert-dev-docs/products/standalone/wert-racing-hud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
