Comparer les révisions
| Auteur | SHA1 | Date | ||
|---|---|---|---|---|
| ||||
|
|
7d7ae54080 | |||
|
|
a354365558 | |||
|
|
16f8611827 | |||
|
|
382ad76b07 | |||
Aucun fichier ne correspond à votre recherche
@@ -15,13 +15,14 @@ Le serveur n'a pas besoin du mod (`displayTest="IGNORE_ALL_VERSION"`), et un jou
|
||||
|
||||
Les captures sont dans `livrable/captures/`.
|
||||
|
||||
## Charte
|
||||
## Charte (proposition A « sobre », branche `design/propositions`)
|
||||
|
||||
- Fond papier `#F2F0E6`, encre `#2D2A26`, filets `#DAD5C8`.
|
||||
- Police Inter (TTF fournie dans le mod, licence OFL : `LICENCE-INTER-OFL.txt`). Le grand titre utilise Inter SemiBold suréchantillonnée, agrandie ×3.
|
||||
- Aucun arrondi, aucune texture vanilla. Les boutons sont des lignes de liste séparées par des filets fins.
|
||||
- Accents francs, utilisés avec retenue : orange `#E8590C` (serveur, surtitres), vert `#2B8A3E` (en ligne), rouge `#C92A2A` (hors ligne, quitter).
|
||||
- Arrière-plan maison : `outils/fond.py` génère `textures/gui/fond.png` (courbes de niveau d'un relief imaginaire, une ligne de crête et un repère orange). La moitié gauche reste vide pour le menu.
|
||||
- Fond blanc `#FFFFFF` (alterné `#F4F4F4`), encre `#111111`, gris `#6B6B6B`, filets `#D9D9D9` (fort : 2 px d'encre au-dessus des listes). Valeurs de la charte relevée (Mind, météo, Hub).
|
||||
- Police Inter (TTF fournie dans le mod, licence OFL : `LICENCE-INTER-OFL.txt`). Grands titres en Inter SemiBold suréchantillonnée ; étiquettes en capitales espacées.
|
||||
- Aucun arrondi, aucune texture vanilla, plus d'image de fond. Les menus sont des listes numérotées séparées par des filets ; l'action principale est une ligne pleine à l'encre.
|
||||
- La couleur ne sert que de signal, toujours avec un texte : succès `#1A5C2A` sur `#F0F7F0`, alerte `#8A1C1C` sur `#FDF2F2`.
|
||||
- Accueil : à droite, l'état du serveur en grands chiffres (joueurs, latence, version, adresse), masqué si l'écran est étroit.
|
||||
- Les deux autres propositions (B, C) et les maquettes sont dans `propositions/`.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
org.gradle.parallel=true
|
||||
|
||||
mod_version=0.1.0
|
||||
mod_version=0.2.0
|
||||
mod_group_id=com.gastinelclient
|
||||
mod_id=gastinelclient
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
"""Génère l'arrière-plan de l'accueil GastinelClient (1920x1080, PNG).
|
||||
|
||||
Papier réchauffé, courbes de niveau fines (relief imaginaire façon Vercors), une ligne de crête
|
||||
à l'encre et un repère orange. La moitié gauche reste presque vide pour le menu.
|
||||
Usage : python outils/fond.py (écrit src/main/resources/assets/gastinelclient/textures/gui/fond.png)
|
||||
"""
|
||||
import os
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
W, H, SS = 1920, 1080, 2 # sur-échantillonnage x2 pour adoucir les traits
|
||||
PAPIER = np.array([242, 240, 230], float)
|
||||
FILET = np.array([218, 213, 200], float)
|
||||
FILET_FORT = np.array([196, 188, 170], float)
|
||||
|
||||
ys, xs = np.mgrid[0:H * SS, 0:W * SS].astype(float) / SS
|
||||
u, v = xs / W, ys / H
|
||||
|
||||
# Relief : un plateau (falaises) à droite + ondulations douces
|
||||
relief = (
|
||||
1.6 * np.exp(-((u - 0.78) ** 2 / 0.05 + (v - 0.62) ** 2 / 0.09))
|
||||
+ 0.9 * np.exp(-((u - 0.98) ** 2 / 0.02 + (v - 0.25) ** 2 / 0.05))
|
||||
+ 0.25 * np.sin(5.1 * u + 2.3 * v) * np.cos(3.7 * v - 1.2 * u)
|
||||
+ 0.12 * np.sin(13 * u + 7 * v + 1.0)
|
||||
)
|
||||
k = 18.0
|
||||
f = relief * k
|
||||
d = np.abs(f - np.round(f)) # distance à la courbe la plus proche
|
||||
grad = np.hypot(*np.gradient(f, 1.0 / SS)) + 1e-6
|
||||
dist_px = d / grad
|
||||
ligne = np.clip(1.2 - dist_px * 1.4, 0, 1)
|
||||
maitresse = (np.round(f).astype(int) % 5 == 0)
|
||||
|
||||
# Masque : rien sous le menu à gauche, apparition progressive vers la droite
|
||||
masque = np.clip((u - 0.34) / 0.22, 0, 1) ** 1.5
|
||||
|
||||
img = np.ones((H * SS, W * SS, 3)) * PAPIER
|
||||
coul = np.where(maitresse[..., None], FILET_FORT, FILET)
|
||||
a = (ligne * masque)[..., None]
|
||||
img = img * (1 - a) + coul * a
|
||||
|
||||
pil = Image.fromarray(img.astype(np.uint8)).resize((W, H), Image.LANCZOS)
|
||||
dr = ImageDraw.Draw(pil)
|
||||
|
||||
# Ligne de crête (encre), polyline anguleuse : pas d'arrondi
|
||||
crete = [(1010, 820), (1120, 760), (1185, 772), (1260, 690), (1330, 668), (1372, 600),
|
||||
(1460, 596), (1520, 640), (1600, 560), (1700, 548), (1770, 610), (1920, 590)]
|
||||
dr.line(crete, fill=(45, 42, 38), width=2)
|
||||
# Repère du spawn : carré orange franc + filet vertical
|
||||
sx, sy = 1460, 596
|
||||
dr.line([(sx, sy - 120), (sx, sy - 8)], fill=(45, 42, 38), width=1)
|
||||
dr.rectangle([sx - 6, sy - 6 - 120, sx + 6, sy + 6 - 120], fill=(232, 89, 12))
|
||||
# Croix de repérage dans les coins (filets fins)
|
||||
for cx, cy in [(1840, 80), (1840, 1000), (760, 80), (760, 1000)]:
|
||||
dr.line([(cx - 10, cy), (cx + 10, cy)], fill=(160, 152, 136), width=1)
|
||||
dr.line([(cx, cy - 10), (cx, cy + 10)], fill=(160, 152, 136), width=1)
|
||||
|
||||
out = os.path.join(os.path.dirname(__file__), "..", "src", "main", "resources", "assets",
|
||||
"gastinelclient", "textures", "gui", "fond.png")
|
||||
pil.save(out, optimize=True)
|
||||
print("écrit", os.path.normpath(out), pil.size)
|
||||
@@ -0,0 +1,20 @@
|
||||
# Proposition A · Sobre, fidèle à la charte (implémentée sur cette branche)
|
||||
|
||||
**Idée** : la charte relevée telle quelle (Mind, météo, Hub) : fond blanc, encre `#111`, gris `#6b6b6b`, filets `#d9d9d9`, Inter, aucun arrondi. Les menus sont des listes numérotées (01, 02…) entre filets, l'action principale est une ligne pleine à l'encre. La couleur ne sert que de signal, toujours avec un texte (vert « En ligne », rouge sombre « Sauvegarder et quitter »). L'accueil gagne un panneau « État du serveur » en grands chiffres, façon météo.
|
||||
|
||||
**Différences avec la 0.1.0** : plus de papier beige ni de fond « courbes de niveau » ni d'orange ; barre du haut « GASTINEL / Rubrique » ; titres plus grands ; étiquettes en capitales espacées ; jauges fines dans les options.
|
||||
|
||||
## Ce qui a changé dans le code (commit de cette proposition)
|
||||
- `ui/Charte` : nouvelles couleurs, fond blanc uni, `etiquette()` (capitales espacées), `carre()`, `jauge()`.
|
||||
- `ui/Bouton` : rendu MENU / PRIMAIRE revu (numéro, pastille d'état), nouveau genre `ALERTE`, CADRE blanc à filet d'encre.
|
||||
- `ecrans/EcranGastinel` : barre du haut, en-tête et pied de page.
|
||||
- `ecrans/AccueilScreen` : panneau d'état à droite (masqué si l'écran est étroit).
|
||||
- `ecrans/PauseGastinel`, `OptionsSimplesScreen`, `ServeursScreen` : restyle (jauges, trait de saisie, filets forts).
|
||||
- `core/Libelles.fraction()` + test JUnit.
|
||||
- Supprimés : `textures/gui/fond.png`, `outils/fond.py`. Version passée à 0.2.0 dans `gradle.properties`.
|
||||
|
||||
**Pas fait** (vu dans les maquettes, mais plus long) : l'écran Solo reste celui de Minecraft (la maquette montre un tableau maison, ~½ jour) ; le texte « Jouer sur le serveur Gastinel » reste le nom configuré.
|
||||
|
||||
## Effort
|
||||
Fait en une session (environ ½ jour). Build Gradle vert, tests JUnit verts ; captures en jeu (client de test sans compte, Xvfb) dans `en-jeu/`. Le jar de test `gastinelclient-neoforge-1.21.1-0.2.0.jar` est posé ici (non versionné).
|
||||
En dev, le pied de page affiche « GastinelClient 0.1.0 » : c'est la version lue par le client de développement, le jar construit porte bien 0.2.0.
|
||||
|
Après Largeur: | Hauteur: | Taille: 59 KiB |
|
Après Largeur: | Hauteur: | Taille: 59 KiB |
|
Après Largeur: | Hauteur: | Taille: 30 KiB |
|
Après Largeur: | Hauteur: | Taille: 17 KiB |
|
Après Largeur: | Hauteur: | Taille: 278 KiB |
|
Après Largeur: | Hauteur: | Taille: 279 KiB |
@@ -0,0 +1,168 @@
|
||||
<!doctype html>
|
||||
<html lang="fr"><head><meta charset="utf-8"><title>Proposition A · Sobre</title>
|
||||
<link rel="stylesheet" href="../commun/base.css">
|
||||
<style>
|
||||
:root{--fond:#fff;--alt:#f4f4f4;--encre:#111;--gris:#6b6b6b;--filet:#d9d9d9;--ok:#1a5c2a;--okf:#f0f7f0;--ko:#8a1c1c;--kof:#fdf2f2}
|
||||
.ecran{background:var(--fond);color:var(--encre)}
|
||||
.barre{position:absolute;left:0;right:0;top:0;height:72px;border-bottom:1px solid var(--filet);display:flex;align-items:center;justify-content:space-between;padding:0 120px}
|
||||
.code{font:600 15px Inter;letter-spacing:.18em;text-transform:uppercase}
|
||||
.gris{color:var(--gris)}
|
||||
.pied{position:absolute;left:120px;right:120px;bottom:0;height:72px;border-top:1px solid var(--filet);display:flex;align-items:center;justify-content:space-between;font-size:18px;color:var(--gris)}
|
||||
.pied b{color:var(--encre);font-weight:600}
|
||||
h1{font:700 128px/1 Inter;letter-spacing:-.04em}
|
||||
h2{font:700 64px/1 Inter;letter-spacing:-.02em}
|
||||
.etiq{font:600 15px Inter;letter-spacing:.08em;text-transform:uppercase;color:var(--gris)}
|
||||
.liste{border-top:2px solid var(--encre)}
|
||||
.ligne{display:flex;align-items:center;height:64px;border-bottom:1px solid var(--filet);padding:0 20px;font-size:24px;gap:20px}
|
||||
.ligne .num{font:600 14px Inter;letter-spacing:.1em;color:var(--gris);width:28px}
|
||||
.ligne .fl{margin-left:auto;font-size:24px}
|
||||
.ligne.prim{background:var(--encre);color:#fff;height:96px;border-bottom-color:var(--encre)}
|
||||
.ligne.prim .num{color:#9a9a9a}
|
||||
.ligne.prim small{display:block;font-size:18px;color:#bdbdbd;margin-top:6px}
|
||||
.carre{display:inline-block;width:12px;height:12px;background:#3fbf5f;margin-right:8px;vertical-align:1px}
|
||||
.survol{background:var(--alt);box-shadow:inset 3px 0 0 var(--encre)}
|
||||
.bouton{display:inline-flex;align-items:center;justify-content:center;height:56px;padding:0 32px;border:1px solid var(--encre);font:600 20px Inter;background:#fff}
|
||||
.bouton.noir{background:var(--encre);color:#fff}
|
||||
.bouton.off{border-color:var(--filet);color:#b3b3b3}
|
||||
.focus{outline:3px solid var(--encre);outline-offset:3px}
|
||||
table{border-collapse:collapse;width:100%}
|
||||
th{font:600 14px Inter;letter-spacing:.08em;text-transform:uppercase;color:var(--gris);text-align:left;padding:0 20px 12px;border-bottom:2px solid var(--encre)}
|
||||
td{height:72px;padding:0 20px;border-bottom:1px solid var(--filet);font-size:22px}
|
||||
tr.sel td{background:var(--encre);color:#fff}
|
||||
tr.sel td.gris{color:#bdbdbd}
|
||||
.chiffre{font:700 200px/1 Inter;letter-spacing:-.05em}
|
||||
.cases{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--filet)}
|
||||
.cases div{padding:24px 24px 24px 0;border-right:1px solid var(--filet);margin-right:24px}
|
||||
.cases div:last-child{border:0}
|
||||
.cases b{display:block;font:700 44px Inter;letter-spacing:-.02em;margin-top:10px}
|
||||
.reg{display:flex;align-items:center;height:72px;border-bottom:1px solid var(--filet);font-size:22px;gap:12px}
|
||||
.reg .v{margin-left:auto;font-weight:600;min-width:120px;text-align:right;margin-right:12px}
|
||||
.pm{width:48px;height:48px;border:1px solid var(--encre);display:flex;align-items:center;justify-content:center;font-size:26px}
|
||||
.jauge{width:200px;height:4px;background:var(--filet);position:relative;margin-right:16px}
|
||||
.jauge i{position:absolute;left:0;top:0;bottom:0;background:var(--encre)}
|
||||
.bascule{display:flex;border:1px solid var(--encre)}
|
||||
.bascule span{width:72px;height:46px;display:flex;align-items:center;justify-content:center;font-size:18px}
|
||||
.bascule .on{background:var(--encre);color:#fff}
|
||||
.signal{display:inline-block;padding:6px 12px;font-size:17px;font-weight:600}
|
||||
.signal.ok{background:var(--okf);color:var(--ok)}
|
||||
.signal.ko{background:var(--kof);color:var(--ko)}
|
||||
</style></head><body>
|
||||
|
||||
<!-- ============ TITRE ============ -->
|
||||
<p class="legende">A · Écran titre</p>
|
||||
<section class="ecran" id="titre">
|
||||
<div class="barre"><span class="code">Gastinel</span><span class="code gris">Minecraft 1.21.1 · NeoForge</span></div>
|
||||
<div style="position:absolute;left:120px;top:190px;width:640px">
|
||||
<p class="etiq" style="margin-bottom:20px">Serveur Minecraft</p>
|
||||
<h1>Gastinel</h1>
|
||||
<p class="gris" style="font-size:24px;margin:24px 0 48px">Le serveur des amis, dans le Vercors.</p>
|
||||
<div class="liste">
|
||||
<div class="ligne prim"><span class="num">01</span><div>Jouer sur le serveur Gastinel<small><span class="carre"></span>En ligne · 3 joueurs sur 20 · 15 ms</small></div><span class="fl">→</span></div>
|
||||
<div class="ligne survol"><span class="num">02</span>Solo<span class="fl">→</span></div>
|
||||
<div class="ligne"><span class="num">03</span>Autres serveurs</div>
|
||||
<div class="ligne"><span class="num">04</span>Options</div>
|
||||
<div class="ligne"><span class="num">05</span>Quitter</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="position:absolute;left:880px;top:72px;bottom:72px;border-left:1px solid var(--filet)"></div>
|
||||
<div style="position:absolute;left:960px;top:190px;width:840px">
|
||||
<p class="etiq">État du serveur · en direct</p>
|
||||
<div style="display:flex;align-items:flex-end;gap:24px;margin:24px 0 8px"><span class="chiffre">3</span><span style="font-size:36px;font-weight:600;padding-bottom:28px">/ 20 joueurs</span></div>
|
||||
<p style="margin-bottom:48px"><span class="signal ok">En ligne</span></p>
|
||||
<div class="cases">
|
||||
<div><span class="etiq">Latence</span><b>15 ms</b></div>
|
||||
<div><span class="etiq">Version</span><b>1.21.1</b></div>
|
||||
<div><span class="etiq">Adresse</span><b style="font-size:30px;padding-top:12px">gastinel.me</b></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pied"><span>GastinelClient <b>0.2.0</b></span><span>Mods</span></div>
|
||||
</section>
|
||||
|
||||
<!-- ============ SOLO ============ -->
|
||||
<p class="legende">A · Solo (choix du monde)</p>
|
||||
<section class="ecran" id="solo">
|
||||
<div class="barre"><span class="code">Gastinel <span class="gris">/ Solo</span></span><span class="code gris">← Retour</span></div>
|
||||
<div style="position:absolute;left:120px;right:120px;top:150px">
|
||||
<div style="display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:48px"><h2>Mondes</h2><span class="bouton">+ Créer un monde</span></div>
|
||||
<table>
|
||||
<tr><th>Nom</th><th>Mode</th><th>Dernière partie</th><th>Version</th></tr>
|
||||
<tr class="sel"><td><b>New World</b></td><td class="gris">Survie</td><td class="gris">Aujourd'hui, 14 h 02</td><td class="gris">1.21.1</td></tr>
|
||||
<tr><td>Test redstone</td><td class="gris">Créatif</td><td class="gris">12 octobre</td><td class="gris">1.21.1</td></tr>
|
||||
<tr><td>Vercors 1:1</td><td class="gris">Créatif</td><td class="gris">3 octobre</td><td class="gris">1.21.1</td></tr>
|
||||
<tr><td>Ancien monde</td><td class="gris">Survie</td><td class="gris">28 juin</td><td class="gris">1.20.4</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="position:absolute;left:120px;right:120px;bottom:120px;display:flex;gap:16px"><span class="bouton noir focus">Jouer « New World »</span><span class="bouton">Modifier</span><span class="bouton">Recréer</span><span class="bouton" style="margin-left:auto;color:var(--ko);border-color:var(--ko)">Supprimer</span></div>
|
||||
<div class="pied"><span>4 mondes</span><span>Entrée : jouer · Suppr : supprimer</span></div>
|
||||
</section>
|
||||
|
||||
<!-- ============ MULTI ============ -->
|
||||
<p class="legende">A · Autres serveurs (multijoueur)</p>
|
||||
<section class="ecran" id="multi">
|
||||
<div class="barre"><span class="code">Gastinel <span class="gris">/ Autres serveurs</span></span><span class="code gris">← Retour</span></div>
|
||||
<div style="position:absolute;left:120px;right:120px;top:150px">
|
||||
<h2 style="margin-bottom:48px">Autres serveurs</h2>
|
||||
<p class="etiq" style="margin-bottom:12px">Adresse</p>
|
||||
<div style="display:flex;gap:16px;align-items:center;margin-bottom:72px">
|
||||
<div style="flex:1;height:64px;border-bottom:2px solid var(--encre);display:flex;align-items:center;font-size:26px;color:#9a9a9a">play.exemple.fr</div>
|
||||
<span class="bouton noir">Rejoindre</span><span class="bouton">Enregistrer</span>
|
||||
</div>
|
||||
<table>
|
||||
<tr><th>Serveur enregistré</th><th>Adresse</th><th>État</th><th style="text-align:right">Joueurs</th></tr>
|
||||
<tr><td><b>Serveur de Léo</b></td><td class="gris">leo.ddns.net</td><td><span class="signal ok">En ligne · 42 ms</span></td><td style="text-align:right">2 / 10</td></tr>
|
||||
<tr><td><b>Hypixel</b></td><td class="gris">mc.hypixel.net</td><td><span class="signal ok">En ligne · 96 ms</span></td><td style="text-align:right">31 204</td></tr>
|
||||
<tr><td><b>Ancien serveur</b></td><td class="gris">192.168.1.20</td><td><span class="signal ko">Hors ligne</span></td><td style="text-align:right" class="gris">—</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pied"><span>Le serveur Gastinel est sur l'accueil.</span><span>Liste complète de Minecraft</span></div>
|
||||
</section>
|
||||
|
||||
<!-- ============ OPTIONS ============ -->
|
||||
<p class="legende">A · Options</p>
|
||||
<section class="ecran" id="options">
|
||||
<div class="barre"><span class="code">Gastinel <span class="gris">/ Options</span></span><span class="code gris">← Retour</span></div>
|
||||
<div style="position:absolute;left:120px;right:120px;top:150px">
|
||||
<h2 style="margin-bottom:56px">Options</h2>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:0 96px">
|
||||
<div><p class="etiq" style="padding-bottom:12px;border-bottom:2px solid var(--encre)">Image</p>
|
||||
<div class="reg">Distance d'affichage<span class="jauge" style="margin-left:auto"><i style="width:37%"></i></span><span class="v" style="margin-left:0">12 tronçons</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
<div class="reg">Champ de vision<span class="jauge" style="margin-left:auto"><i style="width:30%"></i></span><span class="v" style="margin-left:0">80°</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
<div class="reg">Luminosité<span class="jauge" style="margin-left:auto"><i style="width:50%"></i></span><span class="v" style="margin-left:0">50 %</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
<div class="reg">Taille de l'interface<span class="v">Auto</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
<div class="reg">Plein écran<span class="bascule" style="margin-left:auto"><span>Non</span><span class="on">Oui</span></span></div>
|
||||
<div class="reg">Synchro verticale<span class="bascule" style="margin-left:auto"><span class="on">Non</span><span>Oui</span></span></div>
|
||||
</div>
|
||||
<div><p class="etiq" style="padding-bottom:12px;border-bottom:2px solid var(--encre)">Son et souris</p>
|
||||
<div class="reg">Volume général<span class="jauge" style="margin-left:auto"><i style="width:80%"></i></span><span class="v" style="margin-left:0">80 %</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
<div class="reg">Musique<span class="jauge" style="margin-left:auto"><i style="width:35%"></i></span><span class="v" style="margin-left:0">35 %</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
<div class="reg">Blocs et ambiance<span class="jauge" style="margin-left:auto"><i style="width:100%"></i></span><span class="v" style="margin-left:0">100 %</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
<div class="reg">Sensibilité de la souris<span class="jauge" style="margin-left:auto"><i style="width:50%"></i></span><span class="v" style="margin-left:0">50 %</span><span class="pm">−</span><span class="pm">+</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pied"><span>Enregistré automatiquement</span><span><b>Toutes les options de Minecraft →</b></span></div>
|
||||
</section>
|
||||
|
||||
<!-- ============ PAUSE ============ -->
|
||||
<p class="legende">A · Pause</p>
|
||||
<section class="ecran monde" id="pause">
|
||||
<div style="position:absolute;inset:0;background:rgba(0,0,0,.18)"></div>
|
||||
<div style="position:absolute;left:0;top:0;bottom:0;width:800px;background:#fff;border-right:1px solid var(--encre)">
|
||||
<div class="barre" style="right:auto;width:800px"><span class="code">Gastinel</span><span class="code gris">Échap : reprendre</span></div>
|
||||
<div style="position:absolute;left:120px;right:120px;top:190px">
|
||||
<h1 style="font-size:104px;margin-bottom:48px">Pause</h1>
|
||||
<div class="liste">
|
||||
<div class="ligne prim"><span class="num">01</span><div>Reprendre<small>Monde : New World</small></div><span class="fl">→</span></div>
|
||||
<div class="ligne"><span class="num">02</span>Options</div>
|
||||
<div class="ligne survol"><span class="num">03</span>Progrès<span class="fl">→</span></div>
|
||||
<div class="ligne"><span class="num">04</span>Statistiques</div>
|
||||
<div class="ligne"><span class="num">05</span>Ouvrir en réseau local</div>
|
||||
<div class="ligne"><span class="num">06</span>Mods</div>
|
||||
</div>
|
||||
<div class="ligne" style="margin-top:40px;border-top:1px solid var(--ko);border-bottom-color:var(--ko);color:var(--ko);font-weight:600">Sauvegarder et quitter</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="../commun/nav.js"></script>
|
||||
</body></html>
|
||||
|
Après Largeur: | Hauteur: | Taille: 54 KiB |
|
Après Largeur: | Hauteur: | Taille: 55 KiB |
|
Après Largeur: | Hauteur: | Taille: 625 KiB |
|
Après Largeur: | Hauteur: | Taille: 53 KiB |
|
Après Largeur: | Hauteur: | Taille: 66 KiB |
@@ -0,0 +1,19 @@
|
||||
# Proposition B · Vercors, chaleureuse
|
||||
|
||||
**Idée** : le paysage du Vercors en plein écran derrière l'accueil, un voile sombre à gauche pour la lisibilité, un seul accent franc (orange `#e8590c`) réservé à l'action principale « Jouer ». Les autres écrans sont des cartes papier réchauffé (`#fffdf8`) posées sur le paysage ; la pause devient une carte centrée sur le monde flouté.
|
||||
|
||||
**Écarts à la charte** : fond photo et texte blanc sur l'accueil (la charte stricte est claire et monochrome) ; reste sans arrondi, Inter, filets fins. Accent unique, comme décidé pour la vidéo v2.
|
||||
|
||||
## Ce que ça change dans le code
|
||||
- `Charte` : nouvelles couleurs (papier `#fffdf8`, orange, voile), suppression du papier beige actuel.
|
||||
- `ui/Bouton` : nouveau genre `PLEIN` (aplat orange, grand) et genre `CADRE` à bordure 2 px ; survol orange.
|
||||
- `EcranGastinel.renderBackground` : image de fond `textures/gui/vercors.png` (1920×1080, ~1 Mo) avec un dégradé ; léger déplacement lent (« Ken Burns ») calculé dans `render`, coût nul.
|
||||
- `AccueilScreen` : bloc « Jouer » de 120 px, liens secondaires.
|
||||
- `OptionsSimplesScreen` : vrais curseurs (`AbstractSliderButton` restylé) au lieu de − / +.
|
||||
- `PauseGastinel` : carte centrée ; flou du monde = celui de vanilla (`renderBlurredBackground`), à garder réglable car Théo l'avait écarté (« sans flou »).
|
||||
- Solo en cartes avec vignette : il faut réécrire la liste des mondes (lecture des `LevelSummary`, vignettes `icon.png`) : c'est le plus gros morceau.
|
||||
- **Vidéo de fond** : pas de lecteur vidéo dans Minecraft ; il faudrait une bibliothèque (WaterMedia, VLC embarqué, ~30-60 Mo) ou une suite d'images. Déconseillé : une image fixe avec mouvement lent donne 90 % de l'effet.
|
||||
- **Image** : l'illustration de la maquette est un dessin maison. Pour le vrai jeu, une photo de Théo (droits OK) recadrée à 1920×1080, idéalement prise en jeu sur la carte du Vercors pour rester dans l'univers.
|
||||
|
||||
## Effort
|
||||
Environ **1,5 à 2 jours** (image et curseurs : ½ j ; cartes Solo : ½ à 1 j ; reste : ½ j). Risque moyen : écran Solo maison à maintenir à chaque version de Minecraft.
|
||||
@@ -0,0 +1,129 @@
|
||||
<!doctype html>
|
||||
<html lang="fr"><head><meta charset="utf-8"><title>Proposition B · Vercors</title>
|
||||
<link rel="stylesheet" href="../commun/base.css">
|
||||
<style>
|
||||
:root{--papier:#fffdf8;--encre:#111;--gris:#6b6b6b;--filet:#e6dfd2;--orange:#e8590c;--orange-f:#c2470a;--vert:#1a8a3c}
|
||||
.vercors{background:url(../commun/vercors.svg) center/cover no-repeat;color:#fff}
|
||||
.voile{position:absolute;inset:0;background:linear-gradient(90deg,rgba(17,14,12,.82) 0,rgba(17,14,12,.55) 38%,rgba(17,14,12,0) 62%)}
|
||||
.voile-bas{position:absolute;left:0;right:0;bottom:0;height:200px;background:linear-gradient(0deg,rgba(17,14,12,.7),rgba(17,14,12,0))}
|
||||
h1{font:800 168px/0.9 Inter;letter-spacing:-.05em}
|
||||
.sur{font:700 18px Inter;letter-spacing:.2em;text-transform:uppercase;color:var(--orange)}
|
||||
.jouer{display:flex;align-items:center;gap:28px;background:var(--orange);color:#fff;padding:0 36px;height:120px;width:640px}
|
||||
.jouer b{font:800 36px Inter;letter-spacing:-.02em;display:block}
|
||||
.jouer small{font-size:20px;opacity:.92}
|
||||
.jouer .fl{margin-left:auto;font:700 44px Inter}
|
||||
.secondaires{display:flex;flex-direction:column;margin-top:24px;width:640px}
|
||||
.secondaires div{height:64px;display:flex;align-items:center;font:600 26px Inter;border-bottom:1px solid rgba(255,255,255,.22);gap:16px}
|
||||
.secondaires .hv{color:#ffd2b8}
|
||||
.secondaires .hv::before{content:"";width:6px;height:28px;background:var(--orange)}
|
||||
.lieu{position:absolute;right:56px;bottom:40px;text-align:right;font-size:17px;color:rgba(255,255,255,.85)}
|
||||
.carte{position:absolute;background:var(--papier);color:var(--encre);border-top:8px solid var(--orange)}
|
||||
h2{font:800 64px/1 Inter;letter-spacing:-.03em}
|
||||
.etiq{font:700 15px Inter;letter-spacing:.14em;text-transform:uppercase;color:var(--gris)}
|
||||
.monde-carte{border:1px solid var(--filet);background:#fff}
|
||||
.monde-carte .img{height:190px;background:url(../commun/vercors.svg) center/cover}
|
||||
.monde-carte.sel{outline:4px solid var(--orange);outline-offset:-4px}
|
||||
.monde-carte p{padding:18px 20px 22px;font-size:18px;color:var(--gris)}
|
||||
.monde-carte p b{display:block;color:var(--encre);font:700 24px Inter;margin-bottom:6px}
|
||||
.btn{display:inline-flex;align-items:center;justify-content:center;height:60px;padding:0 32px;font:700 21px Inter;border:2px solid var(--encre)}
|
||||
.btn.or{background:var(--orange);border-color:var(--orange);color:#fff}
|
||||
.curseur{display:flex;align-items:center;gap:20px;height:76px;border-bottom:1px solid var(--filet);font-size:22px}
|
||||
.curseur .piste{margin-left:auto;width:300px;height:8px;background:#ece5d8;position:relative}
|
||||
.curseur .piste i{position:absolute;left:0;top:0;bottom:0;background:var(--orange)}
|
||||
.curseur .piste i::after{content:"";position:absolute;right:-9px;top:-8px;width:18px;height:24px;background:var(--encre)}
|
||||
.curseur .v{width:130px;text-align:right;font-weight:700}
|
||||
.oui{margin-left:auto;display:flex}
|
||||
.oui span{width:80px;height:44px;display:flex;align-items:center;justify-content:center;font-size:18px;border:2px solid var(--encre)}
|
||||
.oui .on{background:var(--encre);color:#fff}
|
||||
.pt{display:inline-block;width:12px;height:12px;background:var(--vert);margin-right:10px}
|
||||
.flou{filter:blur(6px) saturate(1.1);transform:scale(1.05)}
|
||||
</style></head><body>
|
||||
|
||||
<!-- ============ TITRE ============ -->
|
||||
<p class="legende">B · Écran titre (fond : Vercors, léger mouvement lent en jeu)</p>
|
||||
<section class="ecran vercors" id="titre">
|
||||
<div class="voile"></div><div class="voile-bas"></div>
|
||||
<div style="position:absolute;left:120px;top:200px">
|
||||
<p class="sur">Le serveur du Vercors</p>
|
||||
<h1 style="margin:22px 0 56px">Gastinel</h1>
|
||||
<div class="jouer"><div><b>Jouer</b><small><span class="pt"></span>Serveur Gastinel · 3 amis en ligne · 15 ms</small></div><span class="fl">→</span></div>
|
||||
<div class="secondaires">
|
||||
<div class="hv">Solo</div><div>Autres serveurs</div><div>Options</div><div style="color:rgba(255,255,255,.7)">Quitter</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="position:absolute;left:120px;bottom:40px;font-size:17px;color:rgba(255,255,255,.7)">Minecraft 1.21.1 · GastinelClient 0.2.0 · Mods</div>
|
||||
<div class="lieu">Mont Aiguille au lever du jour<br><span style="opacity:.7">Illustration · une vraie photo de Théo irait ici</span></div>
|
||||
</section>
|
||||
|
||||
<!-- ============ SOLO ============ -->
|
||||
<p class="legende">B · Solo : les mondes en cartes</p>
|
||||
<section class="ecran vercors" id="solo">
|
||||
<div style="position:absolute;inset:0;background:rgba(17,14,12,.55)"></div>
|
||||
<div class="carte" style="left:120px;right:120px;top:100px;bottom:100px;padding:56px 64px">
|
||||
<div style="display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:40px"><div><p class="etiq" style="color:var(--orange)">Solo</p><h2 style="margin-top:10px">Tes mondes</h2></div><span class="btn">+ Nouveau monde</span></div>
|
||||
<div style="display:grid;grid-template-columns:repeat(4,1fr);gap:28px">
|
||||
<div class="monde-carte sel"><div class="img"></div><p><b>New World</b>Survie · aujourd'hui</p></div>
|
||||
<div class="monde-carte"><div class="img" style="filter:hue-rotate(160deg)"></div><p><b>Test redstone</b>Créatif · 12 octobre</p></div>
|
||||
<div class="monde-carte"><div class="img" style="filter:grayscale(.6)"></div><p><b>Vercors 1:1</b>Créatif · 3 octobre</p></div>
|
||||
<div class="monde-carte"><div class="img" style="filter:sepia(.8)"></div><p><b>Ancien monde</b>Survie · 28 juin</p></div>
|
||||
</div>
|
||||
<div style="position:absolute;left:64px;right:64px;bottom:48px;display:flex;gap:16px"><span class="btn or">Jouer « New World »</span><span class="btn">Modifier</span><span class="btn" style="margin-left:auto;border-color:#b0a898;color:var(--gris)">Retour</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ MULTI ============ -->
|
||||
<p class="legende">B · Autres serveurs</p>
|
||||
<section class="ecran vercors" id="multi">
|
||||
<div style="position:absolute;inset:0;background:rgba(17,14,12,.55)"></div>
|
||||
<div class="carte" style="left:120px;width:900px;top:100px;bottom:100px;padding:56px 64px">
|
||||
<p class="etiq" style="color:var(--orange)">Multijoueur</p><h2 style="margin:10px 0 44px">Autres serveurs</h2>
|
||||
<div style="display:flex;gap:12px;margin-bottom:48px"><div style="flex:1;height:64px;border:2px solid var(--encre);display:flex;align-items:center;padding:0 20px;font-size:22px;color:#9a9286;background:#fff">Adresse du serveur…</div><span class="btn or" style="height:64px">Rejoindre</span></div>
|
||||
<p class="etiq" style="margin-bottom:8px">Enregistrés</p>
|
||||
<div class="curseur"><b>Serveur de Léo</b><span style="color:var(--gris);font-size:18px">leo.ddns.net</span><span style="margin-left:auto;font-size:18px"><span class="pt"></span>2 / 10</span></div>
|
||||
<div class="curseur"><b>Hypixel</b><span style="color:var(--gris);font-size:18px">mc.hypixel.net</span><span style="margin-left:auto;font-size:18px"><span class="pt"></span>31 204</span></div>
|
||||
<div class="curseur"><b>Ancien serveur</b><span style="color:var(--gris);font-size:18px">192.168.1.20</span><span style="margin-left:auto;font-size:18px;color:#a33">Hors ligne</span></div>
|
||||
<p style="position:absolute;bottom:48px;font-size:18px;color:var(--gris)">← Retour · Liste complète de Minecraft</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ OPTIONS ============ -->
|
||||
<p class="legende">B · Options (vrais curseurs)</p>
|
||||
<section class="ecran vercors" id="options">
|
||||
<div style="position:absolute;inset:0;background:rgba(17,14,12,.55)"></div>
|
||||
<div class="carte" style="left:120px;right:120px;top:100px;bottom:100px;padding:56px 64px">
|
||||
<p class="etiq" style="color:var(--orange)">Réglages</p><h2 style="margin:10px 0 36px">Options</h2>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:0 80px">
|
||||
<div><p class="etiq">Image</p>
|
||||
<div class="curseur">Distance d'affichage<span class="piste"><i style="width:37%"></i></span><span class="v">12 tronçons</span></div>
|
||||
<div class="curseur">Champ de vision<span class="piste"><i style="width:30%"></i></span><span class="v">80°</span></div>
|
||||
<div class="curseur">Luminosité<span class="piste"><i style="width:50%"></i></span><span class="v">50 %</span></div>
|
||||
<div class="curseur">Plein écran<span class="oui"><span>Non</span><span class="on">Oui</span></span></div>
|
||||
</div>
|
||||
<div><p class="etiq">Son et souris</p>
|
||||
<div class="curseur">Volume général<span class="piste"><i style="width:80%"></i></span><span class="v">80 %</span></div>
|
||||
<div class="curseur">Musique<span class="piste"><i style="width:35%"></i></span><span class="v">35 %</span></div>
|
||||
<div class="curseur">Blocs et ambiance<span class="piste"><i style="width:100%"></i></span><span class="v">100 %</span></div>
|
||||
<div class="curseur">Sensibilité<span class="piste"><i style="width:50%"></i></span><span class="v">50 %</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="position:absolute;left:64px;right:64px;bottom:48px;display:flex;gap:16px"><span class="btn or">Terminé</span><span class="btn">Toutes les options de Minecraft</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ PAUSE ============ -->
|
||||
<p class="legende">B · Pause : carte centrée, monde flouté</p>
|
||||
<section class="ecran" id="pause">
|
||||
<div class="flou" style="position:absolute;inset:0;background:url(../commun/monde.png) center/cover"></div>
|
||||
<div style="position:absolute;inset:0;background:rgba(17,14,12,.35)"></div>
|
||||
<div class="carte" style="left:660px;width:600px;top:170px;padding:48px 56px 40px">
|
||||
<p class="etiq" style="color:var(--orange)">New World</p><h2 style="margin:10px 0 36px">Pause</h2>
|
||||
<div class="jouer" style="width:auto;height:96px"><div><b style="font-size:30px">Reprendre</b></div><span class="fl" style="font-size:36px">→</span></div>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0">
|
||||
<span class="btn">Options</span><span class="btn">Progrès</span><span class="btn">Statistiques</span><span class="btn">Réseau local</span>
|
||||
</div>
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-top:28px;font-size:19px"><span style="color:var(--gris)">Mods</span><span style="color:#a33;font-weight:700">Sauvegarder et quitter</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="../commun/nav.js"></script>
|
||||
</body></html>
|
||||
|
Après Largeur: | Hauteur: | Taille: 197 KiB |
|
Après Largeur: | Hauteur: | Taille: 67 KiB |
|
Après Largeur: | Hauteur: | Taille: 565 KiB |
|
Après Largeur: | Hauteur: | Taille: 126 KiB |
|
Après Largeur: | Hauteur: | Taille: 801 KiB |
@@ -0,0 +1,18 @@
|
||||
# Proposition C · Minecraft vanilla, épurée
|
||||
|
||||
**Idée** : garder la disposition et la police de Minecraft (les joueurs s'y retrouvent tout de suite), remplacer les boutons en pierre par des aplats sombres translucides à filet clair, sans arrondi, et ne mettre la marque que là où elle sert : le mot « GASTINEL » à la place du logo, un bouton « Serveur Gastinel » en tête (filet orange), et le serveur épinglé en haut de la liste multijoueur.
|
||||
|
||||
**Écarts à la charte** : la police reste celle de Minecraft (pixel), le fond est le panorama vanilla. La charte ne se voit que par la sobriété (aplats, filets, aucun arrondi) et l'accent orange.
|
||||
|
||||
Dans les maquettes, le texte est en Inter faute de pouvoir embarquer la police de Mojang ; en jeu, ce serait la police pixel d'origine.
|
||||
|
||||
## Ce que ça change dans le code
|
||||
- Beaucoup de code **en moins** : on supprime `AccueilScreen`, `ServeursScreen`, `OptionsSimplesScreen`, `PauseGastinel` maison, ou on les réduit fortement.
|
||||
- Restyle des boutons vanilla par un **pack de ressources intégré au mod** (sprites `widget/button`, `button_highlighted`, `button_disabled` en 9-tranches : aplat noir 55 % + filet 2 px). Zéro Java pour ça.
|
||||
- `TitleScreen` : via `ScreenEvent.Init.Post`, on ajoute le bouton « Serveur Gastinel » avec son état (ping déjà écrit dans `AccueilScreen`), on retire « Realms », on remplace le logo (texture `textures/gui/title/minecraft.png` du pack intégré).
|
||||
- Multijoueur : épingler Gastinel en tête via `ServerList` au premier lancement (pas d'écran maison).
|
||||
- Options : écran vanilla restylé + un bouton « Réglages Gastinel (essentiels)… » qui ouvre l'écran simple actuel.
|
||||
- Pause : `PauseScreen` vanilla restylée, plus un bouton « Serveur Gastinel » (en solo).
|
||||
|
||||
## Effort
|
||||
Environ **1 jour**, le plus faible des trois, et le plus robuste aux mises à jour (on modifie peu d'écrans). En contrepartie, c'est le moins « à soi ».
|
||||
@@ -0,0 +1,110 @@
|
||||
<!doctype html>
|
||||
<html lang="fr"><head><meta charset="utf-8"><title>Proposition C · Vanilla épuré</title>
|
||||
<link rel="stylesheet" href="../commun/base.css">
|
||||
<style>
|
||||
/* En jeu : police d'origine de Minecraft (pixel). Ici Inter en remplacement, la police de Mojang n'étant pas redistribuable. */
|
||||
.ecran{color:#fff;font-weight:600}
|
||||
.pano{position:absolute;inset:-20px;background:url(../commun/monde.png) center/cover no-repeat;filter:blur(3px) brightness(.8)}
|
||||
.assombri{position:absolute;inset:0;background:rgba(0,0,0,.35)}
|
||||
.col{position:absolute;left:50%;transform:translateX(-50%);width:600px;display:flex;flex-direction:column;gap:12px}
|
||||
.b{height:60px;display:flex;align-items:center;justify-content:center;font-size:24px;background:rgba(0,0,0,.55);border:2px solid rgba(255,255,255,.18);text-shadow:0 2px 0 #3a3a3a}
|
||||
.b.h{border-color:#fff;background:rgba(0,0,0,.65)}
|
||||
.b.g{border-color:#e8590c;background:rgba(232,89,12,.28)}
|
||||
.b small{font-size:16px;color:#c9f5c9;margin-left:14px;font-weight:400}
|
||||
.duo{display:flex;gap:12px}.duo .b{flex:1}
|
||||
.marque{position:absolute;left:50%;transform:translateX(-50%);top:150px;text-align:center}
|
||||
.marque b{font:800 112px/1 Inter;letter-spacing:.06em;text-shadow:0 6px 0 rgba(0,0,0,.45)}
|
||||
.marque p{font-size:20px;color:#ffd84a;margin-top:12px;transform:rotate(-4deg);text-shadow:0 2px 0 #3f3500}
|
||||
.coin{position:absolute;bottom:20px;font-size:18px;color:rgba(255,255,255,.85);text-shadow:0 2px 0 #333}
|
||||
.t{text-align:center;font-size:26px;position:absolute;left:0;right:0;text-shadow:0 2px 0 #333}
|
||||
.liste{position:absolute;left:50%;transform:translateX(-50%);width:1100px;top:120px;bottom:240px;background:rgba(0,0,0,.5);border-top:2px solid rgba(255,255,255,.25);border-bottom:2px solid rgba(255,255,255,.25);padding:16px}
|
||||
.it{display:flex;gap:20px;padding:14px;border:2px solid transparent;align-items:center}
|
||||
.it.sel{border-color:#fff}
|
||||
.it .ic{width:96px;height:96px;background:url(../commun/monde.png) -600px -200px/900px auto;flex:none}
|
||||
.it b{display:block;font-size:24px;margin-bottom:6px}.it span{color:#a8a8a8;font-weight:400;font-size:19px;line-height:1.4}
|
||||
.opt{display:grid;grid-template-columns:1fr 1fr;gap:12px 24px;position:absolute;left:50%;transform:translateX(-50%);width:1240px;top:180px}
|
||||
.sl{height:60px;position:relative;background:rgba(0,0,0,.55);border:2px solid rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;font-size:22px}
|
||||
.sl i{position:absolute;top:-2px;bottom:-2px;width:16px;background:#d6d6d6;border:2px solid #fff}
|
||||
</style></head><body>
|
||||
|
||||
<!-- ============ TITRE ============ -->
|
||||
<p class="legende">C · Écran titre (disposition vanilla, marque discrète)</p>
|
||||
<section class="ecran" id="titre">
|
||||
<div class="pano"></div><div class="assombri"></div>
|
||||
<div class="marque"><b>GASTINEL</b><p>Bienvenue dans le Vercors !</p></div>
|
||||
<div class="col" style="top:440px">
|
||||
<div class="b g">Serveur Gastinel<small>■ 3/20 · 15 ms</small></div>
|
||||
<div class="b h">Solo</div>
|
||||
<div class="b">Multijoueur</div>
|
||||
<div class="b">Mods</div>
|
||||
<div class="duo" style="margin-top:24px"><div class="b">Options…</div><div class="b">Quitter</div></div>
|
||||
</div>
|
||||
<div class="coin" style="left:24px">Minecraft 1.21.1 · NeoForge</div>
|
||||
<div class="coin" style="right:24px">GastinelClient 0.2.0</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ SOLO ============ -->
|
||||
<p class="legende">C · Solo : liste vanilla, cadre allégé</p>
|
||||
<section class="ecran" id="solo">
|
||||
<div class="pano"></div><div class="assombri" style="background:rgba(0,0,0,.55)"></div>
|
||||
<p class="t" style="top:44px">Choisir un monde</p>
|
||||
<div class="liste">
|
||||
<div class="it sel"><span class="ic"></span><div><b>New World</b><span>New World (18/10/2026 14:02)<br>Survie, triche : non, version 1.21.1</span></div></div>
|
||||
<div class="it"><span class="ic" style="filter:hue-rotate(160deg)"></span><div><b>Test redstone</b><span>Test redstone (12/10/2026 21:40)<br>Créatif, version 1.21.1</span></div></div>
|
||||
<div class="it"><span class="ic" style="filter:grayscale(1)"></span><div><b>Vercors 1:1</b><span>Vercors (03/10/2026 10:15)<br>Créatif, version 1.21.1</span></div></div>
|
||||
</div>
|
||||
<div style="position:absolute;left:50%;transform:translateX(-50%);bottom:56px;width:1100px;display:grid;grid-template-columns:1fr 1fr;gap:12px">
|
||||
<div class="b h">Jouer au monde sélectionné</div><div class="b">Créer un monde</div>
|
||||
<div class="duo"><div class="b">Modifier</div><div class="b">Supprimer</div></div><div class="duo"><div class="b">Recréer</div><div class="b">Retour</div></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ MULTI ============ -->
|
||||
<p class="legende">C · Multijoueur (Gastinel épinglé en tête)</p>
|
||||
<section class="ecran" id="multi">
|
||||
<div class="pano"></div><div class="assombri" style="background:rgba(0,0,0,.55)"></div>
|
||||
<p class="t" style="top:44px">Jouer en multijoueur</p>
|
||||
<div class="liste">
|
||||
<div class="it sel" style="border-color:#e8590c"><span class="ic" style="background:#e8590c"></span><div><b>Serveur Gastinel <span style="font-size:15px;color:#ffb488">ÉPINGLÉ</span></b><span>Le serveur du Vercors<br>3/20 joueurs · 15 ms</span></div></div>
|
||||
<div class="it"><span class="ic" style="filter:hue-rotate(90deg)"></span><div><b>Serveur de Léo</b><span>leo.ddns.net<br>2/10 · 42 ms</span></div></div>
|
||||
<div class="it"><span class="ic" style="filter:grayscale(1)"></span><div><b>Ancien serveur</b><span style="color:#ff8080">Impossible de se connecter</span></div></div>
|
||||
</div>
|
||||
<div style="position:absolute;left:50%;transform:translateX(-50%);bottom:56px;width:1100px;display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px">
|
||||
<div class="b h">Rejoindre</div><div class="b">Connexion directe</div><div class="b">Ajouter un serveur</div>
|
||||
<div class="b">Modifier</div><div class="b">Supprimer</div><div class="b">Retour</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ OPTIONS ============ -->
|
||||
<p class="legende">C · Options (écran vanilla restylé)</p>
|
||||
<section class="ecran" id="options">
|
||||
<div class="pano"></div><div class="assombri" style="background:rgba(0,0,0,.55)"></div>
|
||||
<p class="t" style="top:80px">Options</p>
|
||||
<div class="opt">
|
||||
<div class="sl"><i style="left:52%"></i>Champ de vision : 80</div><div class="b">Multijoueur…</div>
|
||||
<div class="b">Personnalisation du skin…</div><div class="b">Musique et sons…</div>
|
||||
<div class="b">Graphismes…</div><div class="b">Commandes…</div>
|
||||
<div class="b">Langue…</div><div class="b">Paramètres du chat…</div>
|
||||
<div class="b">Packs de ressources…</div><div class="b">Accessibilité…</div>
|
||||
<div class="b" style="grid-column:1/3;border-color:#e8590c">Réglages Gastinel (essentiels)…</div>
|
||||
</div>
|
||||
<div class="col" style="bottom:56px"><div class="b">Terminé</div></div>
|
||||
</section>
|
||||
|
||||
<!-- ============ PAUSE ============ -->
|
||||
<p class="legende">C · Pause</p>
|
||||
<section class="ecran monde" id="pause">
|
||||
<div style="position:absolute;inset:0;background:rgba(0,0,0,.45)"></div>
|
||||
<p class="t" style="top:150px">Menu du jeu</p>
|
||||
<div class="col" style="top:240px">
|
||||
<div class="b h">Retour au jeu</div>
|
||||
<div class="duo"><div class="b">Progrès</div><div class="b">Statistiques</div></div>
|
||||
<div class="duo"><div class="b">Mods</div><div class="b">Ouvrir en LAN</div></div>
|
||||
<div class="duo"><div class="b">Options…</div><div class="b">Serveur Gastinel</div></div>
|
||||
<div class="b" style="margin-top:24px">Sauvegarder et quitter</div>
|
||||
</div>
|
||||
<div class="coin" style="right:24px">GASTINEL</div>
|
||||
</section>
|
||||
|
||||
<script src="../commun/nav.js"></script>
|
||||
</body></html>
|
||||
|
Après Largeur: | Hauteur: | Taille: 530 KiB |
|
Après Largeur: | Hauteur: | Taille: 555 KiB |
|
Après Largeur: | Hauteur: | Taille: 943 KiB |
|
Après Largeur: | Hauteur: | Taille: 554 KiB |
|
Après Largeur: | Hauteur: | Taille: 695 KiB |
@@ -0,0 +1,10 @@
|
||||
@font-face{font-family:Inter;src:url(inter-regular.ttf);font-weight:400}
|
||||
@font-face{font-family:Inter;src:url(inter-semibold.ttf);font-weight:600 800}
|
||||
*{box-sizing:border-box;margin:0;padding:0}
|
||||
html,body{background:#888}
|
||||
body{font-family:Inter,system-ui,sans-serif}
|
||||
.ecran{width:1920px;height:1080px;position:relative;overflow:hidden;margin:0 auto 40px}
|
||||
.legende{width:1920px;margin:0 auto 8px;font:600 22px Inter;color:#fff}
|
||||
body.seul .legende{display:none}
|
||||
body.seul .ecran{margin:0}
|
||||
.ecran.monde{background:url(monde.png) center/cover no-repeat,#5b7fbf}
|
||||
|
Après Largeur: | Hauteur: | Taille: 1.1 MiB |
@@ -0,0 +1,2 @@
|
||||
// #titre, #solo, ... : n'affiche que cet écran (pour le rendu PNG 1920x1080)
|
||||
if(location.hash){document.body.classList.add('seul');document.querySelectorAll('.ecran,.legende').forEach(e=>{if(e.id!==location.hash.slice(1))e.style.display='none'})}
|
||||
@@ -0,0 +1,24 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" preserveAspectRatio="xMidYMid slice">
|
||||
<!-- Illustration maison (pas une photo) : falaises du Vercors et Mont Aiguille au lever du jour. -->
|
||||
<defs>
|
||||
<linearGradient id="ciel" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3c5a7a"/><stop offset=".45" stop-color="#c98a5a"/><stop offset=".7" stop-color="#f3c58a"/><stop offset="1" stop-color="#f7dcae"/></linearGradient>
|
||||
<linearGradient id="brume" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#f7dcae" stop-opacity="0"/><stop offset="1" stop-color="#f7dcae" stop-opacity=".85"/></linearGradient>
|
||||
<radialGradient id="soleil" cx="1380" cy="620" r="420" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff2c8"/><stop offset=".15" stop-color="#ffd98a" stop-opacity=".9"/><stop offset="1" stop-color="#ffd98a" stop-opacity="0"/></radialGradient>
|
||||
</defs>
|
||||
<rect width="1920" height="1080" fill="url(#ciel)"/>
|
||||
<rect width="1920" height="1080" fill="url(#soleil)"/>
|
||||
<!-- crête lointaine : plateau et falaises -->
|
||||
<path d="M0 600 L180 585 L260 540 L520 528 L560 560 L700 555 L760 505 L1040 498 L1080 540 L1200 548 L1260 520 L1500 512 L1540 560 L1700 566 L1760 530 L1920 524 L1920 1080 L0 1080Z" fill="#9b7b8a" opacity=".75"/>
|
||||
<!-- Mont Aiguille : table aux parois verticales -->
|
||||
<path d="M1150 700 L1190 650 L1205 470 L1222 452 L1330 446 L1352 462 L1362 640 L1410 700Z" fill="#6f5a6e"/>
|
||||
<path d="M1205 470 L1222 452 L1330 446 L1352 462 L1300 470 Z" fill="#8a7083"/>
|
||||
<rect width="1920" height="1080" fill="url(#brume)" opacity=".55"/>
|
||||
<!-- falaises du plateau, plan moyen -->
|
||||
<path d="M0 760 L120 720 L160 640 L420 628 L470 690 L640 700 L700 660 L760 600 L980 592 L1020 660 L1140 720 L1500 735 L1600 700 L1650 650 L1920 640 L1920 1080 L0 1080Z" fill="#4f4a5e"/>
|
||||
<path d="M160 640 L420 628 L430 645 L170 655Z M760 600 L980 592 L990 610 L765 616Z M1650 650 L1920 640 L1920 655 L1655 665Z" fill="#6b6278"/>
|
||||
<!-- forêts -->
|
||||
<path d="M0 860 Q200 800 420 830 T860 820 T1300 845 T1920 800 L1920 1080 L0 1080Z" fill="#2f4a3a"/>
|
||||
<path d="M0 940 Q260 880 560 915 T1180 905 T1920 890 L1920 1080 L0 1080Z" fill="#253a2e"/>
|
||||
<!-- prairie -->
|
||||
<path d="M0 1010 Q480 960 980 990 T1920 975 L1920 1080 L0 1080Z" fill="#5a6b3a"/>
|
||||
</svg>
|
||||
|
Après Largeur: | Hauteur: | Taille: 2.2 KiB |
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Rend chaque écran des maquettes en PNG 1920x1080 avec Chrome sans interface.
|
||||
# Usage : sh rendre.sh [A B C]
|
||||
cd "$(dirname "$0")"
|
||||
CH="/c/Program Files/Google/Chrome/Application/chrome.exe"
|
||||
for p in ${@:-A B C}; do
|
||||
for e in titre solo multi options pause; do
|
||||
"$CH" --headless=new --disable-gpu --hide-scrollbars --force-device-scale-factor=1 \
|
||||
--allow-file-access-from-files --window-size=1920,1080 --virtual-time-budget=1500 \
|
||||
--screenshot="$(cygpath -w "$PWD/$p/$e.png")" "file:///$(cygpath -m "$PWD/$p/maquette.html")#$e" 2>/dev/null
|
||||
done
|
||||
done
|
||||
@@ -45,4 +45,10 @@ public final class Libelles {
|
||||
public static int borne(int v, int min, int max) {
|
||||
return Math.max(min, Math.min(max, v));
|
||||
}
|
||||
|
||||
/** Position de v entre min et max, ramenée dans [0, 1] (pour une jauge). */
|
||||
public static double fraction(int v, int min, int max) {
|
||||
if (max <= min) return 0;
|
||||
return Math.max(0, Math.min(1, (v - min) / (double) (max - min)));
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,8 @@ import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* Écran d'accueil Gastinel : Solo, Serveur Gastinel (un clic), Autres serveurs, Options, Quitter.
|
||||
* Le bouton du serveur affiche son état en direct (ping comme la liste multijoueur vanilla).
|
||||
* Le bouton du serveur affiche son état en direct (ping comme la liste multijoueur vanilla) ;
|
||||
* sur un écran assez large, un panneau à droite le détaille en grands chiffres (proposition A).
|
||||
*/
|
||||
public class AccueilScreen extends EcranGastinel {
|
||||
private final ServerStatusPinger pinger = new ServerStatusPinger();
|
||||
@@ -30,29 +31,32 @@ public class AccueilScreen extends EcranGastinel {
|
||||
super("Accueil", null);
|
||||
}
|
||||
|
||||
private int hautBloc() {
|
||||
return Math.max(34, (this.height - 24 - 168) / 2 + 12);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
this.gastinel = serveurGastinel();
|
||||
int m = marge(), l = colonne();
|
||||
int bloc = 46 + 32 + 4 * 21;
|
||||
int y = Math.max(14, (this.height - 24 - bloc) / 2) + 46;
|
||||
int y = hautBloc() + 58;
|
||||
|
||||
addRenderableWidget(new Bouton(m, y, l, 21, "Solo", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new SelectWorldScreen(this))));
|
||||
y += 21;
|
||||
addRenderableWidget(new Bouton(m, y, l, 32, Config.nom(), Bouton.Genre.PRIMAIRE, this::rejoindreGastinel)
|
||||
.sousTitre(this::sousTitreServeur, () -> couleurEtat));
|
||||
y += 32;
|
||||
addRenderableWidget(new Bouton(m, y, l, 21, "Autres serveurs", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new ServeursScreen(this))));
|
||||
y += 21;
|
||||
addRenderableWidget(new Bouton(m, y, l, 21, "Options", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new OptionsSimplesScreen(this))));
|
||||
y += 21;
|
||||
addRenderableWidget(new Bouton(m, y, l, 21, "Quitter", Bouton.Genre.MENU, () -> this.minecraft.stop()));
|
||||
addRenderableWidget(new Bouton(m, y, l, 30, Config.nom(), Bouton.Genre.PRIMAIRE, this::rejoindreGastinel)
|
||||
.numero(1).sousTitre(this::sousTitreServeur, () -> Charte.CLAIR).pastille(() -> enLigne() ? Charte.PASTILLE : null));
|
||||
y += 30;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Solo", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new SelectWorldScreen(this))).numero(2));
|
||||
y += 20;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Autres serveurs", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new ServeursScreen(this))).numero(3));
|
||||
y += 20;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Options", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new OptionsSimplesScreen(this))).numero(4));
|
||||
y += 20;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Quitter", Bouton.Genre.MENU, () -> this.minecraft.stop()).numero(5));
|
||||
|
||||
String mods = "Mods";
|
||||
lien(this.width - m - this.font.width(Charte.txt(mods)), this.height - 20, mods,
|
||||
lien(this.width - m - this.font.width(Charte.txt(mods)), this.height - 16, mods,
|
||||
() -> this.minecraft.setScreen(new ModListScreen(this)));
|
||||
|
||||
// Relancé à chaque retour sur l'accueil : l'état affiché reste frais.
|
||||
@@ -61,6 +65,11 @@ public class AccueilScreen extends EcranGastinel {
|
||||
lancerPing();
|
||||
}
|
||||
|
||||
private boolean enLigne() {
|
||||
ServerData d = this.gastinel;
|
||||
return d != null && d.players != null;
|
||||
}
|
||||
|
||||
/** Reprend l'entrée de la liste multijoueur si elle existe (garde le choix du pack de ressources). */
|
||||
private ServerData serveurGastinel() {
|
||||
String adr = Libelles.nettoyerAdresse(Config.adresse());
|
||||
@@ -80,13 +89,13 @@ public class AccueilScreen extends EcranGastinel {
|
||||
ServerData d = this.gastinel;
|
||||
Thread t = new Thread(() -> {
|
||||
try {
|
||||
pinger.pingServer(d, () -> {}, () -> { etat = "Hors ligne pour le moment"; couleurEtat = Charte.ROUGE; });
|
||||
pinger.pingServer(d, () -> {}, () -> { etat = "Hors ligne pour le moment"; couleurEtat = Charte.ALERTE; });
|
||||
} catch (UnknownHostException e) {
|
||||
etat = "Adresse introuvable";
|
||||
couleurEtat = Charte.ROUGE;
|
||||
couleurEtat = Charte.ALERTE;
|
||||
} catch (Exception e) {
|
||||
etat = "Hors ligne pour le moment";
|
||||
couleurEtat = Charte.ROUGE;
|
||||
couleurEtat = Charte.ALERTE;
|
||||
}
|
||||
}, "GastinelClient ping");
|
||||
t.setDaemon(true);
|
||||
@@ -96,7 +105,7 @@ public class AccueilScreen extends EcranGastinel {
|
||||
private String sousTitreServeur() {
|
||||
ServerData d = this.gastinel;
|
||||
if (d != null && d.players != null) {
|
||||
couleurEtat = Charte.VERT;
|
||||
couleurEtat = Charte.SUCCES;
|
||||
return Libelles.enLigne(d.players.online(), d.players.max(), d.ping);
|
||||
}
|
||||
return etat;
|
||||
@@ -126,11 +135,54 @@ public class AccueilScreen extends EcranGastinel {
|
||||
public void render(GuiGraphics g, int mx, int my, float pt) {
|
||||
super.render(g, mx, my, pt);
|
||||
int m = marge(), l = colonne();
|
||||
int bloc = 46 + 32 + 4 * 21;
|
||||
int y = Math.max(14, (this.height - 24 - bloc) / 2);
|
||||
Charte.texte(g, this.font, Charte.gras("SERVEUR MINECRAFT"), m, y, Charte.ORANGE);
|
||||
Charte.grandTitre(g, this.font, "Gastinel", m - 1, y + 12, 3f, Charte.ENCRE);
|
||||
Charte.filet(g, m, m + l, y + 45, Charte.ENCRE);
|
||||
int y = hautBloc();
|
||||
barre(g, m, this.width, null);
|
||||
Charte.etiquette(g, this.font, "Serveur Minecraft", m, y, Charte.DOUX);
|
||||
Charte.grandTitre(g, this.font, "Gastinel", m - 2, y + 12, 4f, Charte.ENCRE);
|
||||
Charte.filet(g, m, m + l, y + 57, Charte.ENCRE);
|
||||
Charte.filet(g, m, m + l, y + 56, Charte.ENCRE); // filet fort de 2 px au-dessus de la liste
|
||||
panneauEtat(g, m, l, y);
|
||||
piedDePage(g);
|
||||
}
|
||||
|
||||
/** Panneau de droite : état du serveur en grands chiffres. Masqué si l'écran est trop étroit. */
|
||||
private void panneauEtat(GuiGraphics g, int m, int l, int y) {
|
||||
int xs = m + l + m;
|
||||
int x = xs + m, larg = this.width - m - x;
|
||||
if (larg < 150) return;
|
||||
g.fill(xs, 25, xs + 1, this.height - 22, Charte.FILET);
|
||||
Charte.etiquette(g, this.font, "État du serveur · en direct", x, y, Charte.DOUX);
|
||||
ServerData d = this.gastinel;
|
||||
boolean ok = enLigne();
|
||||
String grand = ok ? String.valueOf(d.players.online()) : "—";
|
||||
Charte.grandTitre(g, this.font, grand, x - 2, y + 16, 6f, Charte.ENCRE);
|
||||
int lg = (int) (this.font.width(Charte.titre(grand)) * 6f);
|
||||
if (ok) {
|
||||
Charte.texte(g, this.font, Charte.gras("/ " + d.players.max() + (d.players.max() > 1 ? " joueurs" : " joueur")),
|
||||
x + lg + 6, y + 56, Charte.ENCRE);
|
||||
}
|
||||
// Signal : texte coloré sur fond pâle, jamais la couleur seule.
|
||||
String sig = ok ? "En ligne" : etat;
|
||||
int ls = this.font.width(Charte.gras(sig)) + 10, sy = y + 76;
|
||||
g.fill(x, sy, x + ls, sy + 14, ok ? Charte.SUCCES_FOND : (couleurEtat == Charte.ALERTE ? Charte.ALERTE_FOND : Charte.ALTERNE));
|
||||
Charte.texte(g, this.font, Charte.gras(sig), x + 5, sy + 3, ok ? Charte.SUCCES : couleurEtat);
|
||||
// Trois cases séparées par des filets
|
||||
int cy = sy + 30, lc = Math.min(90, larg * 2 / 7); // la 3e case (adresse) prend le reste
|
||||
Charte.filet(g, x, x + larg, cy, Charte.FILET);
|
||||
String[][] cases = {
|
||||
{"Latence", ok && d.ping >= 0 ? d.ping + " ms" : "—"},
|
||||
{"Version", d != null && d.version != null && ok ? d.version.getString() : "1.21.1"},
|
||||
{"Adresse", Libelles.adresseCourte(d != null ? d.ip : Config.adresse())}};
|
||||
for (int i = 0; i < 3; i++) {
|
||||
int cx = x + i * lc;
|
||||
if (i > 0) g.fill(cx - 8, cy, cx - 7, cy + 40, Charte.FILET);
|
||||
Charte.etiquette(g, this.font, cases[i][0], cx, cy + 10, Charte.DOUX);
|
||||
String v = cases[i][1];
|
||||
// Valeur venue du serveur (ping) : bornée avant la boucle, sinon une chaîne énorme la rend coûteuse à chaque image.
|
||||
if (v.length() > 32) v = v.substring(0, 32);
|
||||
int lv = i < 2 ? lc - 12 : larg - 2 * lc;
|
||||
while (v.length() > 1 && this.font.width(Charte.titre(v)) * 1.5f > lv) v = v.substring(0, v.length() - 1);
|
||||
Charte.grandTitre(g, this.font, v, cx, cy + 24, 1.5f, Charte.ENCRE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import net.minecraft.network.chat.Component;
|
||||
import net.neoforged.fml.ModList;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/** Base des écrans Gastinel hors partie : fond maison, marges, pied de page. */
|
||||
/** Base des écrans Gastinel : fond blanc, barre du haut, en-tête, pied de page. */
|
||||
public abstract class EcranGastinel extends Screen {
|
||||
@Nullable protected final Screen parent;
|
||||
|
||||
@@ -30,24 +30,32 @@ public abstract class EcranGastinel extends Screen {
|
||||
@Override
|
||||
public void renderBackground(GuiGraphics g, int mx, int my, float pt) {
|
||||
if (this.minecraft != null && this.minecraft.level != null) {
|
||||
// En partie : voile de papier (pas de flou), le monde reste deviné derrière.
|
||||
g.fill(0, 0, this.width, this.height, 0xF0F2F0E6);
|
||||
// En partie : voile blanc presque opaque (pas de flou), le monde reste deviné derrière.
|
||||
g.fill(0, 0, this.width, this.height, 0xF5FFFFFF);
|
||||
} else {
|
||||
Charte.fond(g, this.width, this.height);
|
||||
}
|
||||
}
|
||||
|
||||
/** En-tête : petit libellé orange + titre. Renvoie le y sous l'en-tête. */
|
||||
protected int entete(GuiGraphics g, int x, int y, String surtitre, String titre) {
|
||||
Charte.texte(g, this.font, Charte.gras(surtitre.toUpperCase()), x, y, Charte.ORANGE);
|
||||
Charte.grandTitre(g, this.font, titre, x, y + 14, 2f, Charte.ENCRE);
|
||||
Charte.filet(g, x, x + colonne(), y + 38, Charte.ENCRE);
|
||||
/** Barre du haut : « GASTINEL / Rubrique » à gauche, filet sur toute la largeur. */
|
||||
protected void barre(GuiGraphics g, int x, int largeur, String rubrique) {
|
||||
int l = Charte.etiquette(g, this.font, "Gastinel", x, 9, Charte.ENCRE);
|
||||
if (rubrique != null && !rubrique.isEmpty()) {
|
||||
Charte.etiquette(g, this.font, "/ " + rubrique, x + l + 4, 9, Charte.DOUX);
|
||||
}
|
||||
Charte.filet(g, 0, largeur, 24, Charte.FILET);
|
||||
}
|
||||
|
||||
/** En-tête : barre du haut + grand titre. Renvoie le y sous l'en-tête (y + 46, comme avant). */
|
||||
protected int entete(GuiGraphics g, int x, int y, String rubrique, String titre) {
|
||||
barre(g, x, this.width, rubrique);
|
||||
Charte.grandTitre(g, this.font, titre, x - 1, y + 18, 2f, Charte.ENCRE);
|
||||
return y + 46;
|
||||
}
|
||||
|
||||
protected void piedDePage(GuiGraphics g) {
|
||||
int m = marge(), y = this.height - 18;
|
||||
Charte.filet(g, m, this.width - m, y - 5, Charte.FILET);
|
||||
int m = marge(), y = this.height - 14;
|
||||
Charte.filet(g, m, this.width - m, y - 8, Charte.FILET);
|
||||
String v = ModList.get().getModContainerById("gastinelclient")
|
||||
.map(c -> c.getModInfo().getVersion().toString()).orElse("?");
|
||||
Charte.texte(g, this.font, Charte.txt("Minecraft " + SharedConstants.getCurrentVersion().getName()
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.sounds.SoundSource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.DoubleSupplier;
|
||||
import java.util.function.IntFunction;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -21,7 +22,7 @@ import java.util.function.Supplier;
|
||||
* des curseurs vanilla. « Toutes les options » ouvre l'écran complet de Minecraft.
|
||||
*/
|
||||
public class OptionsSimplesScreen extends EcranGastinel {
|
||||
private record Ligne(String nom, Supplier<String> valeur, int x, int y, int l) {}
|
||||
private record Ligne(String nom, Supplier<String> valeur, int x, int y, int l, DoubleSupplier part) {}
|
||||
private record Rubrique(String nom, int x, int y) {}
|
||||
|
||||
private final List<Ligne> lignes = new ArrayList<>();
|
||||
@@ -56,9 +57,9 @@ public class OptionsSimplesScreen extends EcranGastinel {
|
||||
y = pasDouble(x2, y, l, "Blocs et ambiance", o().getSoundSourceOptionInstance(SoundSource.BLOCKS), 0.05);
|
||||
pasDouble(x2, y, l, "Sensibilité de la souris", o().sensitivity(), 0.05);
|
||||
|
||||
lien(m, this.height - 20, "← Retour", this::onClose);
|
||||
lien(m, this.height - 16, "← Retour", this::onClose);
|
||||
String tout = "Toutes les options de Minecraft";
|
||||
lien(this.width - m - this.font.width(Charte.txt(tout)), this.height - 20, tout,
|
||||
lien(this.width - m - this.font.width(Charte.txt(tout)), this.height - 16, tout,
|
||||
() -> this.minecraft.setScreen(new OptionsScreen(this, o())));
|
||||
}
|
||||
|
||||
@@ -70,12 +71,22 @@ public class OptionsSimplesScreen extends EcranGastinel {
|
||||
/** Pas entier, borné sur les limites de l'option (une valeur hors bornes serait remise par défaut). */
|
||||
private int pas(int x, int y, int l, String nom, OptionInstance<Integer> opt, int pas, IntFunction<String> format) {
|
||||
Runnable apres = opt == o().guiScale() ? () -> this.minecraft.resizeDisplay() : () -> {};
|
||||
ajouterPas(x, y, l, nom, () -> format.apply(opt.get()),
|
||||
ajouterPas(x, y, l, nom, () -> format.apply(opt.get()), fraction(opt),
|
||||
() -> { opt.set(borner(opt, opt.get() - pas)); apres.run(); },
|
||||
() -> { opt.set(borner(opt, opt.get() + pas)); apres.run(); });
|
||||
return y + 20;
|
||||
}
|
||||
|
||||
/** Position dans les bornes de l'option, pour la jauge ; null si les bornes sont inconnues (ex. taille de l'interface). */
|
||||
private DoubleSupplier fraction(OptionInstance<Integer> opt) {
|
||||
if (opt == o().guiScale()) return null;
|
||||
int min, max;
|
||||
if (opt.values() instanceof OptionInstance.IntRange r) { min = r.minInclusive(); max = r.maxInclusive(); }
|
||||
else if (opt.values() instanceof OptionInstance.ClampingLazyMaxIntRange r) { min = r.minInclusive(); max = r.maxInclusive(); }
|
||||
else return null;
|
||||
return () -> Libelles.fraction(opt.get(), min, max);
|
||||
}
|
||||
|
||||
private static int borner(OptionInstance<Integer> opt, int v) {
|
||||
if (opt.values() instanceof OptionInstance.IntRange r) return Libelles.borne(v, r.minInclusive(), r.maxInclusive());
|
||||
if (opt.values() instanceof OptionInstance.ClampingLazyMaxIntRange r) return Libelles.borne(v, r.minInclusive(), r.maxInclusive());
|
||||
@@ -83,20 +94,20 @@ public class OptionsSimplesScreen extends EcranGastinel {
|
||||
}
|
||||
|
||||
private int pasDouble(int x, int y, int l, String nom, OptionInstance<Double> opt, double pas) {
|
||||
ajouterPas(x, y, l, nom, () -> Libelles.pourcent(opt.get()),
|
||||
ajouterPas(x, y, l, nom, () -> Libelles.pourcent(opt.get()), opt::get,
|
||||
() -> opt.set(Libelles.pas01(opt.get(), -pas)),
|
||||
() -> opt.set(Libelles.pas01(opt.get(), pas)));
|
||||
return y + 20;
|
||||
}
|
||||
|
||||
private void ajouterPas(int x, int y, int l, String nom, Supplier<String> valeur, Runnable moins, Runnable plus) {
|
||||
lignes.add(new Ligne(nom, valeur, x, y, l - 42));
|
||||
private void ajouterPas(int x, int y, int l, String nom, Supplier<String> valeur, DoubleSupplier part, Runnable moins, Runnable plus) {
|
||||
lignes.add(new Ligne(nom, valeur, x, y, l - 42, part));
|
||||
addRenderableWidget(new Bouton(x + l - 38, y + 2, 17, 15, "−", Bouton.Genre.CADRE, moins));
|
||||
addRenderableWidget(new Bouton(x + l - 17, y + 2, 17, 15, "+", Bouton.Genre.CADRE, plus));
|
||||
}
|
||||
|
||||
private int bascule(int x, int y, int l, String nom, OptionInstance<Boolean> opt) {
|
||||
lignes.add(new Ligne(nom, () -> "", x, y, l - 42));
|
||||
lignes.add(new Ligne(nom, () -> "", x, y, l - 42, null));
|
||||
Bouton[] b = new Bouton[1];
|
||||
b[0] = addRenderableWidget(new Bouton(x + l - 38, y + 2, 38, 15, opt.get() ? "Oui" : "Non", Bouton.Genre.CADRE, () -> {
|
||||
opt.set(!opt.get());
|
||||
@@ -108,26 +119,31 @@ public class OptionsSimplesScreen extends EcranGastinel {
|
||||
@Override
|
||||
public void render(GuiGraphics g, int mx, int my, float pt) {
|
||||
super.render(g, mx, my, pt);
|
||||
entete(g, marge(), 16, "Réglages", "Options");
|
||||
entete(g, marge(), 16, "Options", "Options");
|
||||
int m = marge();
|
||||
int l = Math.min(colonne(), (this.width - 2 * m - 24) / 2);
|
||||
for (Rubrique r : rubriques) {
|
||||
Charte.texte(g, this.font, Charte.gras(r.nom().toUpperCase()), r.x(), r.y(), Charte.DOUX);
|
||||
Charte.etiquette(g, this.font, r.nom(), r.x(), r.y(), Charte.DOUX);
|
||||
Charte.filet(g, r.x(), r.x() + l, r.y() + 11, Charte.ENCRE);
|
||||
Charte.filet(g, r.x(), r.x() + l, r.y() + 12, Charte.ENCRE);
|
||||
}
|
||||
for (Ligne li : lignes) {
|
||||
Charte.texte(g, this.font, Charte.txt(li.nom()), li.x(), li.y() + 6, Charte.ENCRE);
|
||||
String v = li.valeur().get();
|
||||
int vx = li.x() + li.l();
|
||||
if (!v.isEmpty()) {
|
||||
int w = this.font.width(Charte.gras(v));
|
||||
Charte.texte(g, this.font, Charte.gras(v), li.x() + li.l() - w, li.y() + 6, Charte.ENCRE);
|
||||
vx -= this.font.width(Charte.gras(v));
|
||||
Charte.texte(g, this.font, Charte.gras(v), vx, li.y() + 6, Charte.ENCRE);
|
||||
}
|
||||
if (li.part() != null) {
|
||||
// Jauge entre le nom et la valeur, seulement s'il y a la place.
|
||||
int debut = li.x() + this.font.width(Charte.txt(li.nom())) + 8, fin = vx - 8;
|
||||
int lj = Math.min(60, fin - debut);
|
||||
if (lj >= 20) Charte.jauge(g, fin - lj, li.y() + 9, lj, li.part().getAsDouble());
|
||||
}
|
||||
Charte.filet(g, li.x(), li.x() + li.l() + 42, li.y() + 19, Charte.FILET);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(GuiGraphics g, int mx, int my, float pt) {
|
||||
super.renderBackground(g, mx, my, pt);
|
||||
// Deux colonnes : on estompe les courbes de niveau pour que les réglages restent lisibles.
|
||||
if (this.minecraft.level == null) g.fill(0, 0, this.width, this.height, 0xC8F2F0E6);
|
||||
Charte.filet(g, m, this.width - m, this.height - 22, Charte.FILET);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.network.chat.Component;
|
||||
import net.neoforged.neoforge.client.gui.ModListScreen;
|
||||
|
||||
/**
|
||||
* Menu pause simplifié : un panneau de papier à gauche, le monde visible à droite (sans flou).
|
||||
* Menu pause simplifié : un panneau blanc à gauche, le monde visible à droite (sans flou).
|
||||
* Reprendre, Options, Progrès, Statistiques, (Ouvrir en réseau local), Mods, Quitter.
|
||||
*/
|
||||
public class PauseGastinel extends EcranGastinel {
|
||||
@@ -26,37 +26,38 @@ public class PauseGastinel extends EcranGastinel {
|
||||
|
||||
private int haut() {
|
||||
int n = 5 + (lanPossible() ? 1 : 0);
|
||||
return Math.max(14, (this.height - (46 + 30 + n * 20 + 12 + 20)) / 2);
|
||||
return Math.max(14, (this.height - (58 + 30 + n * 20 + 14 + 20)) / 2 + 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
int m = marge(), l = colonne();
|
||||
boolean solo = this.minecraft.isLocalServer();
|
||||
int y = haut() + 46;
|
||||
int y = haut() + 58;
|
||||
int n = 1;
|
||||
|
||||
addRenderableWidget(new Bouton(m, y, l, 30, "Reprendre", Bouton.Genre.PRIMAIRE, this::reprendre)
|
||||
.sousTitre(this::lieu, () -> Charte.DOUX));
|
||||
.numero(n++).sousTitre(this::lieu, () -> Charte.CLAIR));
|
||||
y += 30;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Options", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new OptionsSimplesScreen(this))));
|
||||
() -> this.minecraft.setScreen(new OptionsSimplesScreen(this))).numero(n++));
|
||||
y += 20;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Progrès", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new AdvancementsScreen(this.minecraft.player.connection.getAdvancements(), this))));
|
||||
() -> this.minecraft.setScreen(new AdvancementsScreen(this.minecraft.player.connection.getAdvancements(), this))).numero(n++));
|
||||
y += 20;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Statistiques", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new StatsScreen(this, this.minecraft.player.getStats()))));
|
||||
() -> this.minecraft.setScreen(new StatsScreen(this, this.minecraft.player.getStats()))).numero(n++));
|
||||
y += 20;
|
||||
if (lanPossible()) {
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Ouvrir en réseau local", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new ShareToLanScreen(this))));
|
||||
() -> this.minecraft.setScreen(new ShareToLanScreen(this))).numero(n++));
|
||||
y += 20;
|
||||
}
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, "Mods", Bouton.Genre.MENU,
|
||||
() -> this.minecraft.setScreen(new ModListScreen(this))));
|
||||
y += 20 + 12;
|
||||
() -> this.minecraft.setScreen(new ModListScreen(this))).numero(n++));
|
||||
y += 20 + 14;
|
||||
addRenderableWidget(new Bouton(m, y, l, 20, solo ? "Sauvegarder et quitter" : "Se déconnecter",
|
||||
Bouton.Genre.PRIMAIRE, this::quitter).accent(Charte.ROUGE));
|
||||
Bouton.Genre.ALERTE, this::quitter));
|
||||
}
|
||||
|
||||
private boolean lanPossible() {
|
||||
@@ -96,8 +97,8 @@ public class PauseGastinel extends EcranGastinel {
|
||||
@Override
|
||||
public void renderBackground(GuiGraphics g, int mx, int my, float pt) {
|
||||
int p = panneau();
|
||||
g.fill(0, 0, this.width, this.height, 0x33000000); // monde légèrement assombri, sans flou
|
||||
g.fill(0, 0, p, this.height, 0xF2F2F0E6);
|
||||
g.fill(0, 0, this.width, this.height, 0x2E000000); // monde légèrement assombri, sans flou
|
||||
g.fill(0, 0, p, this.height, Charte.FOND);
|
||||
g.fill(p, 0, p + 1, this.height, Charte.ENCRE);
|
||||
}
|
||||
|
||||
@@ -105,8 +106,12 @@ public class PauseGastinel extends EcranGastinel {
|
||||
public void render(GuiGraphics g, int mx, int my, float pt) {
|
||||
super.render(g, mx, my, pt);
|
||||
int m = marge(), l = colonne(), y = haut();
|
||||
Charte.texte(g, this.font, Charte.gras("GASTINEL"), m, y, Charte.ORANGE);
|
||||
Charte.grandTitre(g, this.font, "Pause", m - 1, y + 12, 3f, Charte.ENCRE);
|
||||
Charte.filet(g, m, m + l, y + 45, Charte.ENCRE);
|
||||
Charte.etiquette(g, this.font, "Gastinel", m, 9, Charte.ENCRE);
|
||||
String echap = "Échap : reprendre";
|
||||
Charte.etiquette(g, this.font, echap, m + l - Charte.largeurEtiquette(this.font, echap), 9, Charte.DOUX);
|
||||
Charte.filet(g, 0, panneau(), 24, Charte.FILET);
|
||||
Charte.grandTitre(g, this.font, "Pause", m - 2, y, 4f, Charte.ENCRE);
|
||||
Charte.filet(g, m, m + l, y + 56, Charte.ENCRE);
|
||||
Charte.filet(g, m, m + l, y + 57, Charte.ENCRE);
|
||||
}
|
||||
}
|
||||
@@ -86,9 +86,9 @@ public class ServeursScreen extends EcranGastinel {
|
||||
}
|
||||
}
|
||||
|
||||
lien(m, this.height - 20, "← Retour", this::onClose);
|
||||
lien(m, this.height - 16, "← Retour", this::onClose);
|
||||
String complet = "Liste complète de Minecraft (modifier, supprimer)";
|
||||
lien(this.width - m - this.font.width(Charte.txt(complet)), this.height - 20, complet,
|
||||
lien(this.width - m - this.font.width(Charte.txt(complet)), this.height - 16, complet,
|
||||
() -> this.minecraft.setScreen(new JoinMultiplayerScreen(this)));
|
||||
}
|
||||
|
||||
@@ -139,18 +139,24 @@ public class ServeursScreen extends EcranGastinel {
|
||||
int m = marge(), l = colonne();
|
||||
int y = entete(g, m, 16, "Multijoueur", "Autres serveurs");
|
||||
// Case d'adresse : cadre fin dessiné par nous (pas de bordure vanilla)
|
||||
g.renderOutline(m, y, l, 22, adresse != null && adresse.isFocused() ? Charte.ENCRE : Charte.FILET_FORT);
|
||||
// Case d'adresse : simple trait de 2 px dessous (à l'encre quand elle a le focus).
|
||||
int c = adresse != null && adresse.isFocused() ? Charte.ENCRE : Charte.FILET_FORT;
|
||||
g.fill(m, y + 20, m + l, y + 22, c);
|
||||
int ly = y + 26 + 30;
|
||||
Charte.texte(g, this.font, Charte.gras("ENREGISTRÉS"), m, ly, Charte.DOUX);
|
||||
int le = Charte.etiquette(g, this.font, "Enregistrés", m, ly, Charte.DOUX), fin = m + l;
|
||||
if (!message.isEmpty()) {
|
||||
Charte.texte(g, this.font, Charte.txt(message), m + this.font.width(Charte.gras("ENREGISTRÉS")) + 10, ly, Charte.DOUX);
|
||||
Charte.texte(g, this.font, Charte.txt(message), m + le + 10, ly, Charte.DOUX);
|
||||
fin = Math.max(fin, m + le + 10 + this.font.width(Charte.txt(message)));
|
||||
}
|
||||
Charte.filet(g, m, fin, ly + 11, Charte.ENCRE);
|
||||
Charte.filet(g, m, fin, ly + 12, Charte.ENCRE);
|
||||
Charte.filet(g, m, this.width - m, this.height - 22, Charte.FILET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(GuiGraphics g, int mx, int my, float pt) {
|
||||
super.renderBackground(g, mx, my, pt);
|
||||
int m = marge(), l = colonne();
|
||||
g.fill(m, 16 + 46, m + l, 16 + 46 + 22, Charte.CARTE);
|
||||
g.fill(m, 16 + 46, m + l, 16 + 46 + 20, Charte.ALTERNE);
|
||||
}
|
||||
}
|
||||
@@ -10,19 +10,22 @@ import net.minecraft.network.chat.Component;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Bouton plat de la charte : angles droits, filets fins, pas de texture.
|
||||
* MENU : ligne de liste alignée à gauche ; PRIMAIRE : comme MENU avec barre d'accent et sous-titre ;
|
||||
* CADRE : petit bouton encadré centré ; LIEN : texte seul souligné au survol.
|
||||
* Bouton plat de la charte : angles droits, filets de 1 px, pas de texture.
|
||||
* MENU : ligne de liste (numéro gris, texte, filet dessous ; survol = fond alterné + barre d'encre + flèche).
|
||||
* PRIMAIRE : ligne pleine à l'encre, texte blanc, sous-titre gris clair.
|
||||
* ALERTE : ligne au texte rouge sombre entre deux filets rouges (quitter).
|
||||
* CADRE : bouton encadré 1 px, plein à l'encre au survol. LIEN : texte seul souligné au survol.
|
||||
*/
|
||||
public class Bouton extends AbstractButton {
|
||||
public enum Genre { MENU, PRIMAIRE, CADRE, LIEN }
|
||||
public enum Genre { MENU, PRIMAIRE, ALERTE, CADRE, LIEN }
|
||||
|
||||
private final Genre genre;
|
||||
private final Runnable action;
|
||||
private Supplier<String> sousTitre = null;
|
||||
private Supplier<Integer> couleurSousTitre = () -> Charte.DOUX;
|
||||
private int accent = Charte.ORANGE;
|
||||
private Supplier<Integer> pastille = null;
|
||||
private String droite = null;
|
||||
private int numero = 0;
|
||||
|
||||
public Bouton(int x, int y, int l, int h, String texte, Genre genre, Runnable action) {
|
||||
super(x, y, l, h, Component.literal(texte));
|
||||
@@ -36,7 +39,11 @@ public class Bouton extends AbstractButton {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Bouton accent(int c) { this.accent = c; return this; }
|
||||
/** Petit carré de couleur devant le sous-titre (état du serveur) ; null = pas de carré. */
|
||||
public Bouton pastille(Supplier<Integer> c) { this.pastille = c; return this; }
|
||||
|
||||
/** Numéro gris « 01 » en tête de ligne (0 = aucun). */
|
||||
public Bouton numero(int n) { this.numero = n; return this; }
|
||||
|
||||
/** Petit texte gris aligné à droite (ex. adresse d'un serveur). */
|
||||
public Bouton droite(String s) { this.droite = s; return this; }
|
||||
@@ -49,38 +56,58 @@ public class Bouton extends AbstractButton {
|
||||
Font f = Minecraft.getInstance().font;
|
||||
boolean s = this.active && this.isHoveredOrFocused();
|
||||
int x = getX(), y = getY(), l = getWidth(), h = getHeight();
|
||||
int encre = this.active ? Charte.ENCRE : Charte.FILET_FORT;
|
||||
String t = getMessage().getString();
|
||||
int ty = y + (h - 8) / 2;
|
||||
switch (genre) {
|
||||
case MENU, PRIMAIRE -> {
|
||||
if (s) g.fill(x, y, x + l, y + h, Charte.SURVOL);
|
||||
boolean prim = genre == Genre.PRIMAIRE;
|
||||
if (prim || s) g.fill(x, y, x + (prim ? 3 : 2), y + h, prim ? accent : Charte.ENCRE);
|
||||
int tx = x + 12;
|
||||
int encre = prim ? Charte.FOND : (this.active ? Charte.ENCRE : Charte.FILET_FORT);
|
||||
if (prim) g.fill(x, y, x + l, y + h, Charte.ENCRE);
|
||||
else if (s) {
|
||||
g.fill(x, y, x + l, y + h, Charte.ALTERNE);
|
||||
g.fill(x, y, x + 1, y + h, Charte.ENCRE);
|
||||
}
|
||||
int tx = x + 8;
|
||||
if (numero > 0) {
|
||||
Charte.texte(g, f, Charte.gras(String.format("%02d", numero)), tx, ty, prim ? Charte.FILET_FORT : Charte.DOUX);
|
||||
tx += 22;
|
||||
}
|
||||
if (sousTitre != null) {
|
||||
Charte.texte(g, f, Charte.gras(t), tx, y + h / 2 - 10, encre);
|
||||
Charte.texte(g, f, Charte.txt(sousTitre.get()), tx, y + h / 2 + 2, couleurSousTitre.get());
|
||||
Charte.texte(g, f, Charte.txt(t), tx, y + h / 2 - 10, encre);
|
||||
int sx = tx;
|
||||
if (pastille != null && pastille.get() != null) {
|
||||
Charte.carre(g, sx, y + h / 2 + 4, 5, pastille.get());
|
||||
sx += 9;
|
||||
}
|
||||
Charte.texte(g, f, Charte.txt(sousTitre.get()), sx, y + h / 2 + 2, couleurSousTitre.get());
|
||||
} else {
|
||||
Charte.texte(g, f, prim ? Charte.gras(t) : Charte.txt(t), tx, y + (h - 8) / 2, encre);
|
||||
Charte.texte(g, f, Charte.txt(t), tx, ty, encre);
|
||||
}
|
||||
if (droite != null) {
|
||||
Component d = Charte.txt(droite);
|
||||
Charte.texte(g, f, d, x + l - 22 - f.width(d), y + (h - 8) / 2, Charte.DOUX);
|
||||
Charte.texte(g, f, d, x + l - 22 - f.width(d), ty, Charte.DOUX);
|
||||
}
|
||||
if (s) Charte.texte(g, f, Charte.txt("→"), x + l - 14, y + (h - 8) / 2, Charte.ENCRE);
|
||||
Charte.filet(g, x, x + l, y + h - 1, Charte.FILET);
|
||||
if (s || prim) Charte.texte(g, f, Charte.txt("→"), x + l - 14, ty, encre);
|
||||
if (!prim) Charte.filet(g, x, x + l, y + h - 1, Charte.FILET);
|
||||
}
|
||||
case ALERTE -> {
|
||||
if (s) g.fill(x, y, x + l, y + h, Charte.ALERTE_FOND);
|
||||
Charte.filet(g, x, x + l, y, Charte.ALERTE);
|
||||
Charte.filet(g, x, x + l, y + h - 1, Charte.ALERTE);
|
||||
Charte.texte(g, f, Charte.gras(t), x + 8, ty, Charte.ALERTE);
|
||||
if (s) Charte.texte(g, f, Charte.txt("→"), x + l - 14, ty, Charte.ALERTE);
|
||||
}
|
||||
case CADRE -> {
|
||||
if (s) g.fill(x, y, x + l, y + h, Charte.ENCRE);
|
||||
else g.fill(x, y, x + l, y + h, Charte.CARTE);
|
||||
g.renderOutline(x, y, l, h, s ? Charte.ENCRE : Charte.FILET_FORT);
|
||||
int encre = this.active ? Charte.ENCRE : Charte.FILET_FORT;
|
||||
g.fill(x, y, x + l, y + h, s ? Charte.ENCRE : Charte.FOND);
|
||||
g.renderOutline(x, y, l, h, this.active ? Charte.ENCRE : Charte.FILET);
|
||||
Component c = Charte.txt(t);
|
||||
Charte.texte(g, f, c, x + (l - f.width(c)) / 2, y + (h - 8) / 2, s ? Charte.PAPIER : encre);
|
||||
Charte.texte(g, f, c, x + (l - f.width(c)) / 2, ty, s ? Charte.FOND : encre);
|
||||
}
|
||||
case LIEN -> {
|
||||
Component c = Charte.txt(t);
|
||||
Charte.texte(g, f, c, x, y + (h - 8) / 2, s ? Charte.ENCRE : Charte.DOUX);
|
||||
if (s) Charte.filet(g, x, x + f.width(c), y + (h - 8) / 2 + 9, Charte.ENCRE);
|
||||
Charte.texte(g, f, c, x, ty, s ? Charte.ENCRE : Charte.DOUX);
|
||||
if (s) Charte.filet(g, x, x + f.width(c), ty + 9, Charte.ENCRE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,30 +8,31 @@ import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Charte Gastinel : papier réchauffé, encre presque noire, filets fins, aucun arrondi,
|
||||
* police Inter, et quelques couleurs franches réservées aux éléments clés.
|
||||
* Charte Gastinel (proposition A, « sobre ») : fond blanc, encre #111, gris #6b6b6b, filets #d9d9d9,
|
||||
* police Inter, aucun arrondi, filets de 1 px. La couleur ne sert que de signal (en ligne, hors ligne).
|
||||
* Valeurs reprises de la charte relevée (Mind, météo, Hub).
|
||||
*/
|
||||
public final class Charte {
|
||||
private Charte() {}
|
||||
|
||||
// Couleurs (ARGB)
|
||||
public static final int PAPIER = 0xFFF2F0E6;
|
||||
public static final int CARTE = 0xFFF8F7F1;
|
||||
public static final int SURVOL = 0xFFE9E5D9;
|
||||
public static final int ENCRE = 0xFF2D2A26;
|
||||
public static final int DOUX = 0xFF6F6A61;
|
||||
public static final int FILET = 0xFFDAD5C8;
|
||||
public static final int FILET_FORT = 0xFFB9B1A0;
|
||||
// Accents francs (avec retenue)
|
||||
public static final int ORANGE = 0xFFE8590C;
|
||||
public static final int VERT = 0xFF2B8A3E;
|
||||
public static final int ROUGE = 0xFFC92A2A;
|
||||
public static final int FOND = 0xFFFFFFFF;
|
||||
public static final int ALTERNE = 0xFFF4F4F4;
|
||||
public static final int ENCRE = 0xFF111111;
|
||||
public static final int DOUX = 0xFF6B6B6B;
|
||||
public static final int CLAIR = 0xFFBDBDBD; // texte secondaire sur fond encre
|
||||
public static final int FILET = 0xFFD9D9D9;
|
||||
public static final int FILET_FORT = 0xFF8C8C8C;
|
||||
// Signaux (jamais seuls : toujours avec un texte)
|
||||
public static final int SUCCES = 0xFF1A5C2A;
|
||||
public static final int SUCCES_FOND = 0xFFF0F7F0;
|
||||
public static final int ALERTE = 0xFF8A1C1C;
|
||||
public static final int ALERTE_FOND = 0xFFFDF2F2;
|
||||
public static final int PASTILLE = 0xFF3FBF5F; // carré « en ligne » sur fond encre
|
||||
|
||||
public static final ResourceLocation INTER = rl("inter");
|
||||
public static final ResourceLocation INTER_GRAS = rl("inter_gras");
|
||||
public static final ResourceLocation INTER_TITRE = rl("inter_titre");
|
||||
public static final ResourceLocation FOND = rl("textures/gui/fond.png");
|
||||
private static final int FOND_L = 1920, FOND_H = 1080;
|
||||
|
||||
private static ResourceLocation rl(String p) {
|
||||
return ResourceLocation.fromNamespaceAndPath(GastinelClient.MODID, p);
|
||||
@@ -63,12 +64,37 @@ public final class Charte {
|
||||
g.pose().popPose();
|
||||
}
|
||||
|
||||
/** Arrière-plan « à lui » : papier + courbes de niveau, calé à droite, recouvrant tout l'écran. */
|
||||
/** Arrière-plan : blanc uni. */
|
||||
public static void fond(GuiGraphics g, int w, int h) {
|
||||
g.fill(0, 0, w, h, PAPIER);
|
||||
float k = Math.max(w / (float) FOND_L, h / (float) FOND_H);
|
||||
int dw = Math.round(FOND_L * k), dh = Math.round(FOND_H * k);
|
||||
g.blit(FOND, w - dw, (h - dh) / 2, dw, dh, 0f, 0f, FOND_L, FOND_H, FOND_L, FOND_H);
|
||||
g.fill(0, 0, w, h, FOND);
|
||||
}
|
||||
|
||||
/** Étiquette en capitales, lettrage espacé (« GASTINEL », « ÉTAT DU SERVEUR »). Renvoie la largeur. */
|
||||
public static int etiquette(GuiGraphics g, Font f, String s, int x, int y, int couleur) {
|
||||
int cx = x;
|
||||
for (char ch : s.toUpperCase().toCharArray()) {
|
||||
Component c = gras(String.valueOf(ch));
|
||||
g.drawString(f, c, cx, y, couleur, false);
|
||||
cx += f.width(c) + 1;
|
||||
}
|
||||
return cx - x;
|
||||
}
|
||||
|
||||
public static int largeurEtiquette(Font f, String s) {
|
||||
int l = 0;
|
||||
for (char ch : s.toUpperCase().toCharArray()) l += f.width(gras(String.valueOf(ch))) + 1;
|
||||
return l;
|
||||
}
|
||||
|
||||
/** Pastille carrée (aucun arrondi). */
|
||||
public static void carre(GuiGraphics g, int x, int y, int c, int couleur) {
|
||||
g.fill(x, y, x + c, y + c, couleur);
|
||||
}
|
||||
|
||||
/** Jauge fine : piste grise, partie remplie à l'encre. */
|
||||
public static void jauge(GuiGraphics g, int x, int y, int l, double part) {
|
||||
g.fill(x, y, x + l, y + 2, FILET);
|
||||
g.fill(x, y, x + (int) Math.round(l * Math.max(0, Math.min(1, part))), y + 2, ENCRE);
|
||||
}
|
||||
|
||||
/** Filet horizontal fin. */
|
||||
|
||||
|
Avant Largeur: | Hauteur: | Taille: 438 KiB |
@@ -26,5 +26,8 @@ class LibellesTest {
|
||||
assertEquals(1.0, Libelles.pas01(0.98, 0.05));
|
||||
assertEquals(0.0, Libelles.pas01(0.02, -0.05));
|
||||
assertEquals(32, Libelles.borne(40, 2, 32));
|
||||
assertEquals(0.5, Libelles.fraction(17, 2, 32));
|
||||
assertEquals(1.0, Libelles.fraction(40, 2, 32));
|
||||
assertEquals(0.0, Libelles.fraction(5, 5, 5));
|
||||
}
|
||||
}
|
||||