docs: update documentation; patch ChangeActiveSlotInteraction

This commit is contained in:
luk
2026-02-03 16:44:06 +00:00
parent f8d7b9a781
commit 49a80ebf77
16 changed files with 531 additions and 472 deletions

View File

@@ -1,6 +1,7 @@
# UI System
The Hytale server implements a server-authoritative UI system with two main subsystems: Pages (full-screen UI) and Windows (inventory-style containers).
The Hytale server implements a server-authoritative UI system with two main subsystems: Pages (full-screen UI) and
Windows (inventory-style containers).
## Architecture Overview
@@ -19,14 +20,14 @@ UI System
### Core Classes
| Class | Package | Description |
|-------|---------|-------------|
| `CustomUIPage` | `com.hypixel.hytale.server.core.entity.entities.player.pages` | Abstract base for all custom pages |
| `BasicCustomUIPage` | Same | Simple pages without event data parsing |
| `InteractiveCustomUIPage<T>` | Same | Pages with typed event handling |
| `PageManager` | Same | Manages page state for a player |
| `UICommandBuilder` | `com.hypixel.hytale.server.core.ui.builder` | Builds UI DOM commands |
| `UIEventBuilder` | Same | Builds event bindings |
| Class | Package | Description |
|------------------------------|---------------------------------------------------------------|-----------------------------------------|
| `CustomUIPage` | `com.hypixel.hytale.server.core.entity.entities.player.pages` | Abstract base for all custom pages |
| `BasicCustomUIPage` | Same | Simple pages without event data parsing |
| `InteractiveCustomUIPage<T>` | Same | Pages with typed event handling |
| `PageManager` | Same | Manages page state for a player |
| `UICommandBuilder` | `com.hypixel.hytale.server.core.ui.builder` | Builds UI DOM commands |
| `UIEventBuilder` | Same | Builds event bindings |
### Page Lifetime
@@ -236,6 +237,7 @@ Value<Integer> border = Value.ref("Pages/Dialog.ui", "BorderWidth");
### Encoding Format
References are encoded in JSON as:
```json
{
"$Document": "Common/Button.ui",
@@ -508,36 +510,36 @@ public enum HudComponent {
### Page Packets
| Packet | ID | Direction | Description |
|--------|-----|-----------|-------------|
| `SetPage` | 216 | S->C | Set built-in page |
| `CustomHud` | 217 | S->C | Update HUD |
| `CustomPage` | 218 | S->C | Send custom page |
| `CustomPageEvent` | 219 | C->S | Page event |
| Packet | ID | Direction | Description |
|-------------------|-----|-----------|-------------------|
| `SetPage` | 216 | S->C | Set built-in page |
| `CustomHud` | 217 | S->C | Update HUD |
| `CustomPage` | 218 | S->C | Send custom page |
| `CustomPageEvent` | 219 | C->S | Page event |
### Window Packets
| Packet | ID | Direction | Description |
|--------|-----|-----------|-------------|
| `OpenWindow` | 200 | S->C | Open window |
| `UpdateWindow` | 201 | S->C | Update window |
| `CloseWindow` | 202 | S->C | Close window |
| `ClientOpenWindow` | 203 | C->S | Request window |
| `SendWindowAction` | 204 | C->S | Window action |
| Packet | ID | Direction | Description |
|--------------------|-----|-----------|----------------|
| `OpenWindow` | 200 | S->C | Open window |
| `UpdateWindow` | 201 | S->C | Update window |
| `CloseWindow` | 202 | S->C | Close window |
| `ClientOpenWindow` | 203 | C->S | Request window |
| `SendWindowAction` | 204 | C->S | Window action |
## Known UI Documents
| Path | Purpose |
|------|---------|
| `Pages/DialogPage.ui` | Dialog/conversation |
| `Pages/BarterPage.ui` | Trading interface |
| `Pages/ShopPage.ui` | Shop interface |
| `Pages/RespawnPage.ui` | Death/respawn |
| `Pages/ChangeModelPage.ui` | Model selection |
| `Pages/WarpListPage.ui` | Teleport list |
| `Pages/CommandListPage.ui` | Command help |
| `Pages/PluginListPage.ui` | Plugin list |
| `Common/TextButton.ui` | Reusable button |
| Path | Purpose |
|----------------------------|---------------------|
| `Pages/DialogPage.ui` | Dialog/conversation |
| `Pages/BarterPage.ui` | Trading interface |
| `Pages/ShopPage.ui` | Shop interface |
| `Pages/RespawnPage.ui` | Death/respawn |
| `Pages/ChangeModelPage.ui` | Model selection |
| `Pages/WarpListPage.ui` | Teleport list |
| `Pages/CommandListPage.ui` | Command help |
| `Pages/PluginListPage.ui` | Plugin list |
| `Common/TextButton.ui` | Reusable button |
## Best Practices