# UI `[Client]`

A module to manage UI elements from the game.

## JO Functions

### jo.ui.finishTimer()

Terminates the Timer's UI and destroys associated resources <br>

#### Syntax

```lua
jo.ui.finishTimer()
```

---

### jo.ui.initTimer()

Initializes the timer's UI <br>

#### Syntax

```lua
jo.ui.initTimer()
```

#### Return Value

Type : _number_

> The state machine identifier

---

### jo.ui.startTimer()

Starts the timer's UI <br>

#### Syntax

```lua
jo.ui.startTimer(time, low)
```

#### Parameters

`time` : _integer_
> The time in seconds for the timer
>

`low` : _integer_ `[Optional]`
> The threshold in seconds at which the timer color will turn red
>

---

### jo.ui.stopTimer()

Stops the Timer's UI before it finishes naturally <br>

#### Syntax

```lua
jo.ui.stopTimer()
```

---

### jo.ui.updateRank()

Updates the rank element on the top left of weapon wheel <br>

#### Syntax

```lua
jo.ui.updateRank(level, xp, xpRequired)
```

#### Parameters

`level` : _integer_
> The level printed in the left of the element
>

`xp` : _integer_
> The current xp amount
>

`xpRequired` : _integer_
> The amount of XP required to level up
>

## Internal Variables and Structures

The Timer UI system uses the following internal variables and structures, which should not be modified directly:

- `jo.ui.TimerUI.data.uiFlowblock` - Reference to the UI flowblock component
- `jo.ui.TimerUI.data.container` - Reference to the databinding container
- `jo.ui.TimerUI.data.timer` - Reference to the timer's databinding entry
- `jo.ui.TimerUI.data.show` - Reference to the visibility databinding entry
- `jo.ui.TimerUI.data.stateMachine` - Identifier for the UI state machine
- `jo.ui.TimerUI.data.time` - Current timer value in seconds

These variables are essential for the proper functioning and state management of the Timer UI system. Modifying them directly may cause unexpected behavior.
