# Developer

## 1. Eigene Verkehrswarntafel erstellen

Um eine eigene Verkehrswarntafel in Traffic Display zu integrieren, muss die eigene Verkehrswarntafel als Fahrzeug erstellt werden. Dabei sind folgende Extras zu belegen:

| Extra  | Funktion                                               |
| ------ | ------------------------------------------------------ |
| 1      | Warntafel in eingefahrenem Zustand                     |
| 2      | Warntafel in ausgefahrenem Zustand                     |
| 3 - 12 | Symbole, die im ausgefahrenen Zustand angezeigt werden |

Die neue Warntafel ist dann, wie jedes andere Fahrzeug auch, mittels einer Ressource und einer vehicles.meta zu initialisieren (Vergleich siehe trafficdisplay\_props).

## 2. UI Design

Im Ordner trafficdisplay/html/panels muss eine HTML Datei mit dem Spawnnamen der neuen Warntafel erstellt werden. Hier kann auch eine bereits bestehende HTML Datei kopiert und anschließend umbenannt werden.\
Das UI kann nach eigenen Wünschen gestaltet werden.

### 2.1. JavaScript Events

Folgende JavaScript Events werden bei der Bedienung übergeben:

| Event              | Daten                                                                                                                         | Funktion                                                                                                                   |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| display\_forward   | active = Symbol, welches ausgewählt wurde (int 2 - 12)                                                                        |                                                                                                                            |
| display\_backward  | active = Symbol, welches ausgewählt wurde (int 2 - 12)                                                                        |                                                                                                                            |
| display\_update    | <p>active = Warntafel ist aktiviert oder deaktiviert (true/false)<br><br>symbol = Nummer des aktiven Symbols (int 2 - 12)</p> | Wird abgerufen, wenn Änderungen an der Warntafel stattgefunden haben (Auf-/Abbau, Hotkey Auswahl, neues Symbol ausgewählt) |
| display\_confirm   | *keine*                                                                                                                       | Das ausgewählte Symbol wurde bestätigt                                                                                     |
| display\_install   | *keine*                                                                                                                       | Wird abgerufen, wenn die Warntafel aufgebaut wird                                                                          |
| display\_deinstall | *keine*                                                                                                                       | Wird abgerufen, wenn die Warntafel abgebaut wird                                                                           |


---

# 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://docs.loverp-scripts.de/love-rp-de/traffic-display/developer.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.
