inventory update
Build / build (push) Has been cancelled

This commit is contained in:
gpatruno
2026-06-05 20:33:23 +02:00
parent 7e81dccb0e
commit 02d2af0993
28 changed files with 3281 additions and 91 deletions
+52 -23
View File
@@ -78,7 +78,8 @@ src/main/resources/Common/UI/Custom/
├── Pages/
│ ├── MmorpgPlayerShell.ui # Fenêtre à onglets (coquille)
│ ├── MmorpgCharacterTab.ui # Onglet Personnage
│ ├── MmorpgInventoryTab.ui # Onglet Inventaire
│ ├── MmorpgInventoryPage.ui # 🟡 Début — inventaire MMORPG (coquille + grille)
│ ├── MmorpgInventoryTab.ui # Onglet Inventaire (futur, dans coquille à onglets)
│ └── MmorpgSkillTreeTab.ui # Onglet Arbre de compétences
└── Widgets/
├── MmorpgProgressBar.ui # Barre réutilisable (vie, mana, XP)
@@ -91,8 +92,11 @@ src/main/resources/Common/UI/Custom/
| Composant UI | Classe Java | Statut |
|--------------|-------------|--------|
| Barre capacités | `AbilityBarHud` + `AbilityBarService` | ✅ Actif |
| Profil joueur (liste) | `PlayerInfoPage` | ✅ Actif (layout base-game) |
| Coquille à onglets | `PlayerMenuPage` | 🔲 M1 |
| Profil joueur (fallback) | `PlayerInfoPage` | ✅ Actif (`/mmorpg menucustom`) |
| Menu à onglets | `PlayerMenuPage` | ✅ Actif (`/mmorpg menu`) |
| Onglet Personnage | `MmorpgCharacterTab.ui` | ✅ Actif |
| Onglet Inventaire | `MmorpgInventoryTab.ui` + `PlayerInventoryReader` | ✅ Actif |
| Onglet Compétences | `MmorpgSkillsTab.ui` | ✅ Actif (capacités classe + branches M1) |
| Barres vitales HUD | `VitalsHud` + `VitalsHudService` | 🔲 M1 |
| Buff tray | `BuffTrayHud` | 🔲 M1 |
| Hotbar étendue | `HotbarHud` | 🔲 M2 |
@@ -193,9 +197,12 @@ l'inventaire natif ou des interactions custom futures.
| Slot | ID | Touche | Mise à jour |
|------|-----|--------|-------------|
| 1 | `#Slot1Name`, `#Slot1Key` | Ability 1 | Nom + cooldown (`Charge (3s)`) |
| 2 | `#Slot2Name`, `#Slot2Key` | Ability 2 | idem |
| 3 | `#Slot3Name`, `#Slot3Key` | Ability 3 | idem |
| 1 | `#Slot1Name`, `#Slot1Key` | Q (Use Ability 1) | Nom + cooldown (`Charge (3s)`) |
| 2 | `#Slot2Name`, `#Slot2Key` | E (Use Ability 2) | idem |
| 3 | `#Slot3Name`, `#Slot3Key` | R (Use Ability 3) | idem |
Les labels `#Slot*Key` / `#Ability*Key` sont remplis par `AbilitySlotKeys` avec les raccourcis
Hytale par défaut (`[Q]`, `[E]`, `[R]`). Le serveur ne connaît pas les rebinding client.
**Commande debug :** `/mmorpg hud` — force la synchronisation.
@@ -203,8 +210,8 @@ l'inventaire natif ou des interactions custom futures.
## 2. Menus joueur
Ouverture cible : **`C`** ou `/mmorpg menu` → coquille à onglets.
État actuel : `/mmorpg menu` ouvre `PlayerInfoPage` (liste verticale, layout `WarpListPage.ui`).
Ouverture : **`/mmorpg menu`** → coquille à onglets (`PlayerMenuPage`).
Fallback chat : `/mmorpg info` si la page UI échoue.
### 2.1 Coquille — `MmorpgPlayerShell.ui`
@@ -247,18 +254,24 @@ pouvoirs / métiers / social.
### 2.3 Onglet Inventaire
**Fichier cible :** `Pages/MmorpgInventoryTab.ui`
**Fichier inventaire :** `Pages/MmorpgInventoryPage.ui` — document **racine** pour l'onglet Inventaire (`/mmorpg inventory`)
**Fichier coquille :** `Pages/MmorpgPlayerShell.ui` — Personnage / Compétences uniquement
> Un plugin serveur **ne peut pas modifier l'inventaire natif**. Cet onglet est une **vue MMORPG**
> complémentaire (items tagués, équipement RPG, filtres).
> Relié à l'inventaire **vanilla** via `ItemGrid.InventorySectionId` (sac, barre rapide, armure, utilitaire).
> **`InventorySectionId` ne fonctionne pas** dans une coquille imbriquée : l'inventaire doit être le document
> racine (`MmorpgInventoryPage.ui`). Changement d'onglet vers/depuis Inventaire → `rebuild()` complet.
> Ne pas appeler `#Grid.Slots` depuis le serveur — le client rejette cette commande et déconnecte.
> Glisser-déposer synchronisé ; panneau détails au clic.
| Zone | Description |
|------|-------------|
| `#EquipmentPaperDoll` | Silhouette : tête, torse, mains, jambes, arme principale / secondaire |
| `#InventoryGrid` | Grille 8×5 (40 slots) — items avec rareté (bordure couleur) |
| `#ItemDetails` | Panneau droit : nom, stats, description, boutons Utiliser / Jeter |
| `#CategoryTabs` | Filtres : Tout, Équipement, Consommables, Matériaux, Quête |
| `#WeightBar` | Encumbrance (futur) |
| Zone | ID | Section vanilla |
|------|-----|-----------------|
| Armure | `#ArmorGrid` | `ARMOR_SECTION_ID` (-3) |
| Utilitaire | `#UtilityGrid` | `UTILITY_SECTION_ID` (-5) |
| Sac | `#StorageGrid` | `STORAGE_SECTION_ID` (-2), 9×4 |
| Barre rapide | `#HotbarGrid` | `HOTBAR_SECTION_ID` (-1) |
| Détails | `#ItemDetails` | Clic / survol slot → `PlayerInventoryReader` |
**À venir :** filtres par catégorie, stats MMORPG sur items tagués, boutons Utiliser / Jeter.
**Ergonomie :**
@@ -378,7 +391,7 @@ sequenceDiagram
|-------|--------------|----------------------|
| **M0** ✅ | `MmorpgAbilityBar.ui`, `PlayerInfoPage`, `/mmorpg hud` | Classes, capacités |
| **M1** | `MmorpgVitalsHud`, `MmorpgBuffTray`, `MmorpgPlayerShell` + onglet Personnage | Stats vie/mana, buffs |
| **M2** | Onglet Inventaire MMORPG, `MmorpgHotbarHud` | Items tagués, équipement |
| **M2** | Onglet Inventaire MMORPG, `MmorpgHotbarHud` | Items tagués, équipement**début** : `MmorpgInventoryPage.ui` |
| **M3** | Onglet Arbre de compétences | Points de compétence, déblocages |
| **M4** | Quêtes dans HUD, tooltips riches | Module quêtes |
@@ -399,10 +412,26 @@ sequenceDiagram
---
## 8. Références projet
## 8. Références
- Code HUD actif : `src/main/java/com/disklexar/mmorpg/ui/`
- Asset barre capacités : `src/main/resources/Common/UI/Custom/MmorpgAbilityBar.ui`
- Scaffold pages : `assetpack/ui/Pages/MmorpgPlayerInfo.ui`
### Documentation Custom UI (officielle / guides)
- [Custom UI — vue d'ensemble](https://hytalemodding.dev/en/docs/official-documentation/custom-ui) — HUD vs pages, `append` / `set`, sélecteurs
- [Layout](https://hytalemodding.dev/en/docs/official-documentation/custom-ui/layout) — `Anchor`, `LayoutMode`, `FlexWeight` (utilisé pour le panneau inventaire 3 colonnes)
- [Common Styling](https://hytalemodding.dev/en/docs/official-documentation/custom-ui/common-styling) — `Common.ui`, styles vanilla réutilisables
- [Guide plugin UI](https://hytalemodding.dev/en/docs/guides/plugin/ui) — chemin `Common/UI/Custom`, `IncludesAssetPack`, mode diagnostic client
**Rappels appris en production :**
- `CustomUIHud` : uniquement `append(document)` + `set()` — pas de `appendInline` / `clear` (crash client).
- Propriétés dynamiques : préférer `ProgressBar.Value` plutôt que `Group.Width` (rejeté par le client).
- Ancrage HUD : le groupe racine doit avoir `Anchor: (Left: …, Width: …)` sinon centrage écran.
### Fichiers projet
- Code UI : `src/main/java/com/disklexar/mmorpg/ui/`
- HUD vitals + capacités : `src/main/resources/Common/UI/Custom/MmorpgAbilityBar.ui`
- Inventaire (début) : `src/main/resources/Common/UI/Custom/Pages/MmorpgInventoryPage.ui`
- Profil (scaffold) : `src/main/resources/Common/UI/Custom/Pages/MmorpgPlayerInfo.ui`
- Guide asset pack : [assetpack/README.md](../assetpack/README.md)
- Architecture : [ARCHITECTURE.md](ARCHITECTURE.md)