Comparer les révisions
| Auteur | SHA1 | Date | ||
|---|---|---|---|---|
| ||||
|
|
43973a5dbd | |||
|
|
7d7ae54080 | |||
|
|
a354365558 | |||
|
|
16f8611827 | |||
|
|
382ad76b07 | |||
Aucun fichier ne correspond à votre recherche
@@ -1,27 +1,20 @@
|
|||||||
# GastinelClient
|
# GastinelClient
|
||||||
|
|
||||||
Mod **côté client** pour NeoForge 1.21.1 (testé avec NeoForge 21.1.234). Il remplace l'écran d'accueil et le menu pause de Minecraft par des écrans aux couleurs de Gastinel. NeoForge n'est pas modifié : le mod écoute `ScreenEvent.Opening` et ouvre ses propres écrans à la place de `TitleScreen` et de `PauseScreen`.
|
Mod **côté client** pour NeoForge 1.21.1 (testé avec NeoForge 21.1.234). Branche `design/style-c` : proposition C « vanilla épurée ». Les menus restent ceux de Minecraft (disposition, police pixel) ; le mod change leur style par ses ressources et y ajoute seulement ce qui sert à Gastinel.
|
||||||
|
|
||||||
Le serveur n'a pas besoin du mod (`displayTest="IGNORE_ALL_VERSION"`), et un joueur sans le mod peut se connecter.
|
Le serveur n'a pas besoin du mod (`displayTest="IGNORE_ALL_VERSION"`), et un joueur sans le mod peut se connecter.
|
||||||
|
|
||||||
## Écrans
|
## Ce que fait le mod
|
||||||
|
|
||||||
| Écran | Contenu |
|
| Écran | Changement |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Accueil | Solo · **Serveur Gastinel** (un clic, avec l'état en direct : « En ligne · 0/20 joueur · 15 ms ») · Autres serveurs · Options · Quitter. En pied de page : versions, lien « Mods ». |
|
| Tous | Boutons et curseurs en aplats sombres translucides à filet clair, sans arrondi (sprites `widget/button*` et `widget/slider*` dans `assets/minecraft/`, prioritaires sur ceux de Minecraft). Aucun code. |
|
||||||
| Autres serveurs | Une case d'adresse (Rejoindre / Enregistrer, Entrée = rejoindre), la liste des serveurs enregistrés (un clic pour rejoindre, avec des pages s'il y en a beaucoup) et un lien vers la liste complète de Minecraft pour modifier ou supprimer. Le serveur Gastinel n'y figure pas, puisqu'il est déjà sur l'accueil. |
|
| Accueil | Le logo devient le mot « GASTINEL » en police Minecraft ; phrases d'accueil Gastinel (`texts/splashes.txt`) ; Realms retiré ; bouton **Serveur Gastinel** en tête, filet orange, état en direct (« ■ 3/20 · 15 ms » ou « hors ligne »). |
|
||||||
| Options | Deux colonnes avec des boutons − / + : distance d'affichage, champ de vision, luminosité, taille de l'interface, plein écran, synchro verticale, volumes (général, musique, blocs), sensibilité de la souris. Un lien mène à toutes les options de Minecraft. |
|
| Multijoueur | Au premier lancement, le serveur Gastinel est ajouté à la liste ; il est ensuite toujours remis en tête, avec un filet orange. S'il est supprimé, il n'est pas rajouté. |
|
||||||
| Pause | Un panneau papier à gauche, le monde visible à droite (sans flou) : Reprendre (avec le nom du monde ou du serveur), Options, Progrès, Statistiques, Ouvrir en réseau local (en solo), Mods, Sauvegarder et quitter / Se déconnecter (retour à l'accueil Gastinel). |
|
| Options | Écran de Minecraft, plus un bouton « Réglages essentiels… » (distance, champ de vision, luminosité, sensibilité, plein écran, synchro, volumes) avec les curseurs de Minecraft. |
|
||||||
|
| Pause | Écran de Minecraft sans « Donner son avis » ni « Signaler un bug », avec un bouton « Serveur Gastinel » (sauvegarde le monde puis rejoint le serveur ; absent si on y est déjà) et « GASTINEL » discret en bas à droite. |
|
||||||
|
|
||||||
Les captures sont dans `livrable/captures/`.
|
Captures en jeu : `propositions/C/en-jeu/`.
|
||||||
|
|
||||||
## Charte
|
|
||||||
|
|
||||||
- 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.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@@ -30,8 +23,9 @@ Les captures sont dans `livrable/captures/`.
|
|||||||
```toml
|
```toml
|
||||||
serveurNom = "Serveur Gastinel"
|
serveurNom = "Serveur Gastinel"
|
||||||
serveurAdresse = "gastinel.me:25565"
|
serveurAdresse = "gastinel.me:25565"
|
||||||
remplacerAccueil = true
|
habillerAccueil = true
|
||||||
remplacerPause = true
|
habillerPause = true
|
||||||
|
serveurAjoute = false
|
||||||
```
|
```
|
||||||
|
|
||||||
Si l'adresse figure déjà dans la liste multijoueur, l'accueil reprend cette entrée, ce qui conserve le choix fait pour le pack de ressources.
|
Si l'adresse figure déjà dans la liste multijoueur, l'accueil reprend cette entrée, ce qui conserve le choix fait pour le pack de ressources.
|
||||||
@@ -48,10 +42,13 @@ Sur cornafserver : `sh outils/client-xvfb.sh`. Le script lance le client de dév
|
|||||||
|
|
||||||
```
|
```
|
||||||
src/main/java/com/gastinelclient/
|
src/main/java/com/gastinelclient/
|
||||||
GastinelClient.java @Mod(dist = CLIENT), remplacement des écrans
|
GastinelClient.java @Mod(dist = CLIENT), branche les événements d'écran
|
||||||
Config.java config client
|
Config.java config client
|
||||||
core/Libelles.java textes et calculs purs (testés)
|
core/Libelles.java textes et calculs purs (testés)
|
||||||
ui/Charte.java couleurs, polices, fond, filets
|
ecrans/Habillage.java ajouts sur l'accueil, la pause, les options, la liste multijoueur
|
||||||
ui/Bouton.java bouton plat (MENU, PRIMAIRE, CADRE, LIEN)
|
ecrans/BoutonServeur.java bouton « Serveur Gastinel » avec ping
|
||||||
ecrans/ Accueil, Serveurs, OptionsSimples, PauseGastinel, base EcranGastinel
|
ecrans/Gastinel.java entrée du serveur, épinglage, connexion
|
||||||
|
ecrans/OptionsSimplesScreen réglages essentiels (OptionsSubScreen de Minecraft)
|
||||||
|
src/main/resources/assets/minecraft/ sprites et textes qui remplacent ceux de Minecraft
|
||||||
|
outils/sprites-c.py régénère les sprites (Python, sans dépendance)
|
||||||
```
|
```
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|
||||||
mod_version=0.1.0
|
mod_version=0.3.0-c
|
||||||
mod_group_id=com.gastinelclient
|
mod_group_id=com.gastinelclient
|
||||||
mod_id=gastinelclient
|
mod_id=gastinelclient
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Lance le client de dev dans un conteneur jetable « gc-test », SANS carte graphique
|
# Lance le client de dev dans un conteneur jetable « gc-test » (autre nom : NOM=… sh outils/client-xvfb.sh), SANS carte graphique
|
||||||
# (Xvfb + Mesa llvmpipe : rendu 100 % CPU). Le conteneur reste en vie pour piloter le jeu :
|
# (Xvfb + Mesa llvmpipe : rendu 100 % CPU). Le conteneur reste en vie pour piloter le jeu :
|
||||||
# docker exec gc-test sh -c 'DISPLAY=:99 import -window root /src/captures/x.png'
|
# docker exec gc-test sh -c 'DISPLAY=:99 import -window root /src/captures/x.png'
|
||||||
# docker exec gc-test sh -c 'DISPLAY=:99 xdotool mousemove 200 500 click 1'
|
# docker exec gc-test sh -c 'DISPLAY=:99 xdotool mousemove 200 500 click 1'
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
set -e
|
set -e
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
mkdir -p captures "$HOME/.cache/gastinelclient-gradle"
|
mkdir -p captures "$HOME/.cache/gastinelclient-gradle"
|
||||||
docker rm -f gc-test >/dev/null 2>&1 || true
|
docker rm -f "${NOM:-gc-test}" >/dev/null 2>&1 || true
|
||||||
docker run -d --name gc-test --memory 8g --cpus 4 --cpu-shares 256 \
|
docker run -d --name "${NOM:-gc-test}" --memory 8g --cpus 4 --cpu-shares 256 \
|
||||||
-e GRADLE_USER_HOME=/gradle-home -e U="$(id -u)" -e G="$(id -g)" \
|
-e GRADLE_USER_HOME=/gradle-home -e U="$(id -u)" -e G="$(id -g)" \
|
||||||
-v "$HOME/.cache/gastinelclient-gradle:/gradle-home" \
|
-v "$HOME/.cache/gastinelclient-gradle:/gradle-home" \
|
||||||
-v "$(pwd):/src" -w /src \
|
-v "$(pwd):/src" -w /src \
|
||||||
@@ -22,4 +22,4 @@ echo pret > /tmp/x11
|
|||||||
setpriv --reuid=$U --regid=$G --clear-groups env HOME=/tmp sh ./gradlew --no-daemon runClient > captures/run.log 2>&1
|
setpriv --reuid=$U --regid=$G --clear-groups env HOME=/tmp sh ./gradlew --no-daemon runClient > captures/run.log 2>&1
|
||||||
echo arrete >> captures/run.log
|
echo arrete >> captures/run.log
|
||||||
sleep 100000'
|
sleep 100000'
|
||||||
echo "conteneur gc-test lancé"
|
echo "conteneur ${NOM:-gc-test} lancé"
|
||||||
@@ -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,40 @@
|
|||||||
|
"""Génère les sprites de la proposition C (boutons et curseurs plats, logo vide) sans dépendance.
|
||||||
|
Usage : python outils/sprites-c.py (écrit dans src/main/resources/assets/minecraft/textures/gui)"""
|
||||||
|
import json, os, struct, zlib
|
||||||
|
|
||||||
|
RACINE = os.path.join(os.path.dirname(__file__), "..", "src", "main", "resources", "assets", "minecraft", "textures", "gui")
|
||||||
|
|
||||||
|
def png(chemin, l, h, pixel):
|
||||||
|
brut = b"".join(b"\x00" + b"".join(bytes(pixel(x, y)) for x in range(l)) for y in range(h))
|
||||||
|
def bloc(t, d):
|
||||||
|
return struct.pack(">I", len(d)) + t + d + struct.pack(">I", zlib.crc32(t + d) & 0xFFFFFFFF)
|
||||||
|
os.makedirs(os.path.dirname(chemin), exist_ok=True)
|
||||||
|
with open(chemin, "wb") as f:
|
||||||
|
f.write(b"\x89PNG\r\n\x1a\n" + bloc(b"IHDR", struct.pack(">IIBBBBB", l, h, 8, 6, 0, 0, 0))
|
||||||
|
+ bloc(b"IDAT", zlib.compress(brut, 9)) + bloc(b"IEND", b""))
|
||||||
|
|
||||||
|
def aplat(fond, filet):
|
||||||
|
def p(l, h):
|
||||||
|
return lambda x, y: filet if x in (0, l - 1) or y in (0, h - 1) else fond
|
||||||
|
return p
|
||||||
|
|
||||||
|
def sprite(nom, l, h, fabrique):
|
||||||
|
chemin = os.path.join(RACINE, "sprites", "widget", nom + ".png")
|
||||||
|
png(chemin, l, h, fabrique(l, h))
|
||||||
|
with open(chemin + ".mcmeta", "w") as f:
|
||||||
|
json.dump({"gui": {"scaling": {"type": "nine_slice", "width": l, "height": h, "border": 1}}}, f)
|
||||||
|
|
||||||
|
NOIR = lambda a: (0, 0, 0, a)
|
||||||
|
BLANC = lambda a: (255, 255, 255, a)
|
||||||
|
# Boutons : aplat noir translucide + filet clair de 1 px de texture (3 à 4 px à l'écran), aucun arrondi.
|
||||||
|
sprite("button", 200, 20, aplat(NOIR(140), BLANC(60)))
|
||||||
|
sprite("button_highlighted", 200, 20, aplat(NOIR(170), BLANC(255)))
|
||||||
|
sprite("button_disabled", 200, 20, aplat(NOIR(90), BLANC(25)))
|
||||||
|
# Curseurs : même piste que les boutons, poignée claire pleine.
|
||||||
|
sprite("slider", 200, 20, aplat(NOIR(140), BLANC(60)))
|
||||||
|
sprite("slider_highlighted", 200, 20, aplat(NOIR(170), BLANC(160)))
|
||||||
|
sprite("slider_handle", 8, 20, aplat(BLANC(200), BLANC(255)))
|
||||||
|
sprite("slider_handle_highlighted", 8, 20, aplat(BLANC(255), BLANC(255)))
|
||||||
|
# Logo Minecraft et « Java Edition » vides : le mot GASTINEL est écrit par le mod en police Minecraft.
|
||||||
|
for nom, l, h in (("minecraft", 256, 64), ("minceraft", 256, 64), ("edition", 128, 16)):
|
||||||
|
png(os.path.join(RACINE, "title", nom + ".png"), l, h, lambda x, y: (0, 0, 0, 0))
|
||||||
@@ -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 ».
|
||||||
|
Après Largeur: | Hauteur: | Taille: 909 KiB |
|
Après Largeur: | Hauteur: | Taille: 928 KiB |
|
Après Largeur: | Hauteur: | Taille: 461 KiB |
|
Après Largeur: | Hauteur: | Taille: 502 KiB |
|
Après Largeur: | Hauteur: | Taille: 546 KiB |
|
Après Largeur: | Hauteur: | Taille: 424 KiB |
|
Après Largeur: | Hauteur: | Taille: 464 KiB |
|
Après Largeur: | Hauteur: | Taille: 463 KiB |
@@ -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
|
||||||
@@ -10,14 +10,17 @@ public final class Config {
|
|||||||
.comment("Nom affiché pour le serveur principal")
|
.comment("Nom affiché pour le serveur principal")
|
||||||
.define("serveurNom", "Serveur Gastinel");
|
.define("serveurNom", "Serveur Gastinel");
|
||||||
public static final ModConfigSpec.ConfigValue<String> SERVEUR_ADRESSE = B
|
public static final ModConfigSpec.ConfigValue<String> SERVEUR_ADRESSE = B
|
||||||
.comment("Adresse du serveur principal (bouton « Serveur Gastinel » de l'accueil)")
|
.comment("Adresse du serveur principal (bouton « Serveur Gastinel »)")
|
||||||
.define("serveurAdresse", "gastinel.me:25565");
|
.define("serveurAdresse", "gastinel.me:25565");
|
||||||
public static final ModConfigSpec.BooleanValue ACCUEIL = B
|
public static final ModConfigSpec.BooleanValue ACCUEIL = B
|
||||||
.comment("Remplacer l'écran d'accueil de Minecraft")
|
.comment("Ajouts Gastinel sur l'écran d'accueil de Minecraft (bouton serveur, titre, sans Realms)")
|
||||||
.define("remplacerAccueil", true);
|
.define("habillerAccueil", true);
|
||||||
public static final ModConfigSpec.BooleanValue PAUSE = B
|
public static final ModConfigSpec.BooleanValue PAUSE = B
|
||||||
.comment("Remplacer le menu pause de Minecraft")
|
.comment("Ajouts Gastinel sur le menu pause de Minecraft")
|
||||||
.define("remplacerPause", true);
|
.define("habillerPause", true);
|
||||||
|
public static final ModConfigSpec.BooleanValue AJOUTE = B
|
||||||
|
.comment("Le serveur Gastinel a déjà été ajouté à la liste multijoueur (on ne le rajoute pas s'il a été supprimé)")
|
||||||
|
.define("serveurAjoute", false);
|
||||||
|
|
||||||
public static final ModConfigSpec SPEC = B.build();
|
public static final ModConfigSpec SPEC = B.build();
|
||||||
|
|
||||||
@@ -28,4 +31,9 @@ public final class Config {
|
|||||||
public static String adresse() { try { return SERVEUR_ADRESSE.get(); } catch (IllegalStateException e) { return SERVEUR_ADRESSE.getDefault(); } }
|
public static String adresse() { try { return SERVEUR_ADRESSE.get(); } catch (IllegalStateException e) { return SERVEUR_ADRESSE.getDefault(); } }
|
||||||
public static boolean accueil() { try { return ACCUEIL.get(); } catch (IllegalStateException e) { return true; } }
|
public static boolean accueil() { try { return ACCUEIL.get(); } catch (IllegalStateException e) { return true; } }
|
||||||
public static boolean pause() { try { return PAUSE.get(); } catch (IllegalStateException e) { return true; } }
|
public static boolean pause() { try { return PAUSE.get(); } catch (IllegalStateException e) { return true; } }
|
||||||
|
public static boolean ajoute() { try { return AJOUTE.get(); } catch (IllegalStateException e) { return true; } }
|
||||||
|
|
||||||
|
public static void marquerAjoute() {
|
||||||
|
try { AJOUTE.set(true); SPEC.save(); } catch (IllegalStateException ignore) { /* config pas encore chargée */ }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,17 @@
|
|||||||
package com.gastinelclient;
|
package com.gastinelclient;
|
||||||
|
|
||||||
import com.gastinelclient.ecrans.AccueilScreen;
|
import com.gastinelclient.ecrans.Habillage;
|
||||||
import com.gastinelclient.ecrans.PauseGastinel;
|
|
||||||
import net.minecraft.client.gui.screens.PauseScreen;
|
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
|
||||||
import net.minecraft.client.gui.screens.TitleScreen;
|
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.bus.api.IEventBus;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
import net.neoforged.fml.ModContainer;
|
import net.neoforged.fml.ModContainer;
|
||||||
import net.neoforged.fml.common.Mod;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.neoforged.fml.config.ModConfig;
|
import net.neoforged.fml.config.ModConfig;
|
||||||
import net.neoforged.neoforge.client.event.ScreenEvent;
|
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GastinelClient : remplace l'écran d'accueil et le menu pause par les écrans Gastinel.
|
* GastinelClient, proposition C « vanilla épurée » : les écrans restent ceux de Minecraft.
|
||||||
* On ne modifie pas NeoForge : on intercepte simplement l'ouverture des écrans vanilla
|
* Le style (boutons sombres plats, logo) vient des ressources du mod, qui passent devant celles de Minecraft ;
|
||||||
* (ScreenEvent.Opening) et on en ouvre un autre à la place.
|
* le code ajoute seulement le bouton « Serveur Gastinel », retire Realms et épingle le serveur dans la liste.
|
||||||
*/
|
*/
|
||||||
@Mod(value = GastinelClient.MODID, dist = Dist.CLIENT)
|
@Mod(value = GastinelClient.MODID, dist = Dist.CLIENT)
|
||||||
public final class GastinelClient {
|
public final class GastinelClient {
|
||||||
@@ -24,18 +19,9 @@ public final class GastinelClient {
|
|||||||
|
|
||||||
public GastinelClient(IEventBus modBus, ModContainer container) {
|
public GastinelClient(IEventBus modBus, ModContainer container) {
|
||||||
container.registerConfig(ModConfig.Type.CLIENT, Config.SPEC);
|
container.registerConfig(ModConfig.Type.CLIENT, Config.SPEC);
|
||||||
NeoForge.EVENT_BUS.addListener(GastinelClient::avantOuverture);
|
NeoForge.EVENT_BUS.addListener(Habillage::avantOuverture);
|
||||||
}
|
NeoForge.EVENT_BUS.addListener(Habillage::apresInit);
|
||||||
|
NeoForge.EVENT_BUS.addListener(Habillage::apresRendu);
|
||||||
private static void avantOuverture(ScreenEvent.Opening e) {
|
NeoForge.EVENT_BUS.addListener(Habillage::fermeture);
|
||||||
Screen s = e.getNewScreen();
|
|
||||||
if (s == null) return;
|
|
||||||
// Classe exacte : on ne remplace pas un écran d'un autre mod qui hériterait de TitleScreen.
|
|
||||||
if (s.getClass() == TitleScreen.class && Config.accueil()) {
|
|
||||||
e.setNewScreen(new AccueilScreen());
|
|
||||||
} else if (s.getClass() == PauseScreen.class && ((PauseScreen) s).showsPauseMenu() && Config.pause()) {
|
|
||||||
// showsPauseMenu() == false : pause « silencieuse » (F3+Échap), on la laisse telle quelle.
|
|
||||||
e.setNewScreen(new PauseGastinel());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,12 +6,10 @@ import java.util.Locale;
|
|||||||
public final class Libelles {
|
public final class Libelles {
|
||||||
private Libelles() {}
|
private Libelles() {}
|
||||||
|
|
||||||
/** « En ligne · 3/20 joueurs · 12 ms » ; singulier pour 0 ou 1 joueur. */
|
/** État court pour le bouton « Serveur Gastinel » : « 3/20 · 12 ms ». */
|
||||||
public static String enLigne(int joueurs, int max, long pingMs) {
|
public static String etatCourt(int joueurs, int max, long pingMs) {
|
||||||
String j = joueurs <= 1 ? "joueur" : "joueurs";
|
StringBuilder sb = new StringBuilder().append(joueurs);
|
||||||
StringBuilder sb = new StringBuilder("En ligne · ").append(joueurs);
|
|
||||||
if (max > 0) sb.append('/').append(max);
|
if (max > 0) sb.append('/').append(max);
|
||||||
sb.append(' ').append(j);
|
|
||||||
if (pingMs >= 0) sb.append(" · ").append(pingMs).append(" ms");
|
if (pingMs >= 0) sb.append(" · ").append(pingMs).append(" ms");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
@@ -31,18 +29,16 @@ public final class Libelles {
|
|||||||
return s.endsWith(":25565") ? s.substring(0, s.length() - 6) : s;
|
return s.endsWith(":25565") ? s.substring(0, s.length() - 6) : s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Pourcentage arrondi : 0.456 → « 46 % » (espace insécable fine à la française). */
|
/** Même serveur, port par défaut ou non, sans tenir compte de la casse. */
|
||||||
public static String pourcent(double v) {
|
public static boolean memeServeur(String a, String b) {
|
||||||
return Math.round(Math.max(0, Math.min(1, v)) * 100) + " %";
|
return adresseCourte(a).equalsIgnoreCase(adresseCourte(b)) && !adresseCourte(a).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Ajoute un pas à une valeur dans [0, 1] en évitant les 0.30000000000000004. */
|
/** Nouvelle position des éléments d'une liste après avoir amené l'élément « i » en tête (ordre des autres conservé). */
|
||||||
public static double pas01(double v, double pas) {
|
public static int[] ordreEpingle(int taille, int i) {
|
||||||
double r = Math.round((v + pas) * 100.0) / 100.0;
|
int[] r = new int[taille];
|
||||||
return Math.max(0, Math.min(1, r));
|
r[0] = i;
|
||||||
}
|
for (int k = 0, j = 1; k < taille; k++) if (k != i) r[j++] = k;
|
||||||
|
return r;
|
||||||
public static int borne(int v, int min, int max) {
|
|
||||||
return Math.max(min, Math.min(max, v));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
package com.gastinelclient.ecrans;
|
|
||||||
|
|
||||||
import com.gastinelclient.Config;
|
|
||||||
import com.gastinelclient.core.Libelles;
|
|
||||||
import com.gastinelclient.ui.Bouton;
|
|
||||||
import com.gastinelclient.ui.Charte;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.screens.ConnectScreen;
|
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
|
||||||
import net.minecraft.client.gui.screens.worldselection.SelectWorldScreen;
|
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
|
||||||
import net.minecraft.client.multiplayer.ServerList;
|
|
||||||
import net.minecraft.client.multiplayer.ServerStatusPinger;
|
|
||||||
import net.minecraft.client.multiplayer.resolver.ServerAddress;
|
|
||||||
import net.neoforged.neoforge.client.gui.ModListScreen;
|
|
||||||
|
|
||||||
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).
|
|
||||||
*/
|
|
||||||
public class AccueilScreen extends EcranGastinel {
|
|
||||||
private final ServerStatusPinger pinger = new ServerStatusPinger();
|
|
||||||
private ServerData gastinel;
|
|
||||||
private volatile String etat = "Recherche du serveur…";
|
|
||||||
private volatile int couleurEtat = Charte.DOUX;
|
|
||||||
|
|
||||||
public AccueilScreen() {
|
|
||||||
super("Accueil", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@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;
|
|
||||||
|
|
||||||
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()));
|
|
||||||
|
|
||||||
String mods = "Mods";
|
|
||||||
lien(this.width - m - this.font.width(Charte.txt(mods)), this.height - 20, mods,
|
|
||||||
() -> this.minecraft.setScreen(new ModListScreen(this)));
|
|
||||||
|
|
||||||
// Relancé à chaque retour sur l'accueil : l'état affiché reste frais.
|
|
||||||
etat = "Recherche du serveur…";
|
|
||||||
couleurEtat = Charte.DOUX;
|
|
||||||
lancerPing();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 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());
|
|
||||||
ServerList liste = new ServerList(this.minecraft);
|
|
||||||
liste.load();
|
|
||||||
for (int i = 0; i < liste.size(); i++) {
|
|
||||||
ServerData d = liste.get(i);
|
|
||||||
if (Libelles.nettoyerAdresse(d.ip).equalsIgnoreCase(adr)
|
|
||||||
|| Libelles.adresseCourte(d.ip).equalsIgnoreCase(Libelles.adresseCourte(adr))) {
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ServerData(Config.nom(), adr, ServerData.Type.OTHER);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void lancerPing() {
|
|
||||||
ServerData d = this.gastinel;
|
|
||||||
Thread t = new Thread(() -> {
|
|
||||||
try {
|
|
||||||
pinger.pingServer(d, () -> {}, () -> { etat = "Hors ligne pour le moment"; couleurEtat = Charte.ROUGE; });
|
|
||||||
} catch (UnknownHostException e) {
|
|
||||||
etat = "Adresse introuvable";
|
|
||||||
couleurEtat = Charte.ROUGE;
|
|
||||||
} catch (Exception e) {
|
|
||||||
etat = "Hors ligne pour le moment";
|
|
||||||
couleurEtat = Charte.ROUGE;
|
|
||||||
}
|
|
||||||
}, "GastinelClient ping");
|
|
||||||
t.setDaemon(true);
|
|
||||||
t.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String sousTitreServeur() {
|
|
||||||
ServerData d = this.gastinel;
|
|
||||||
if (d != null && d.players != null) {
|
|
||||||
couleurEtat = Charte.VERT;
|
|
||||||
return Libelles.enLigne(d.players.online(), d.players.max(), d.ping);
|
|
||||||
}
|
|
||||||
return etat;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void rejoindreGastinel() {
|
|
||||||
ServerData d = this.gastinel;
|
|
||||||
ConnectScreen.startConnecting(this, this.minecraft, ServerAddress.parseString(d.ip), d, false, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
pinger.tick();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removed() {
|
|
||||||
pinger.removeAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean shouldCloseOnEsc() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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);
|
|
||||||
piedDePage(g);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.gastinelclient.ecrans;
|
||||||
|
|
||||||
|
import com.gastinelclient.Config;
|
||||||
|
import com.gastinelclient.core.Libelles;
|
||||||
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.gui.components.Button;
|
||||||
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
|
import net.minecraft.client.multiplayer.ServerStatusPinger;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bouton « Serveur Gastinel » de l'accueil : bouton vanilla (donc restylé par le pack intégré)
|
||||||
|
* avec un filet orange et l'état du serveur en direct (ping comme la liste multijoueur).
|
||||||
|
*/
|
||||||
|
public class BoutonServeur extends Button {
|
||||||
|
/** Un seul ping à la fois, gardé tant que l'accueil reste ouvert (même après un redimensionnement). */
|
||||||
|
private static Etat etat;
|
||||||
|
|
||||||
|
public BoutonServeur(int x, int y, int l, int h) {
|
||||||
|
super(x, y, l, h, Component.literal(Config.nom()), b -> Gastinel.rejoindre(Minecraft.getInstance(), Minecraft.getInstance().screen),
|
||||||
|
DEFAULT_NARRATION);
|
||||||
|
if (etat == null) etat = new Etat(Gastinel.serveur(Minecraft.getInstance()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fermer() {
|
||||||
|
if (etat != null) etat.pinger.removeAll();
|
||||||
|
etat = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void renderWidget(GuiGraphics g, int mx, int my, float pt) {
|
||||||
|
if (etat != null) {
|
||||||
|
etat.pinger.tick();
|
||||||
|
setMessage(Component.literal(Config.nom() + " ").append(etat.libelle()));
|
||||||
|
}
|
||||||
|
g.setColor(1f, 1f, 1f, this.alpha);
|
||||||
|
RenderSystem.enableBlend();
|
||||||
|
RenderSystem.enableDepthTest();
|
||||||
|
g.blitSprite(SPRITES.get(this.active, this.isHoveredOrFocused()), getX(), getY(), getWidth(), getHeight());
|
||||||
|
g.setColor(1f, 1f, 1f, 1f);
|
||||||
|
int a = Mth.ceil(this.alpha * 255f) << 24;
|
||||||
|
g.fill(getX() + 1, getY() + 1, getRight() - 1, getBottom() - 1, (Gastinel.ORANGE & 0xFFFFFF) | (Mth.ceil(this.alpha * 0x30) << 24));
|
||||||
|
g.renderOutline(getX(), getY(), getWidth(), getHeight(), (Gastinel.ORANGE & 0xFFFFFF) | a);
|
||||||
|
renderString(g, Minecraft.getInstance().font, 0xFFFFFF | a);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class Etat {
|
||||||
|
final ServerStatusPinger pinger = new ServerStatusPinger();
|
||||||
|
final ServerData d;
|
||||||
|
volatile Component repli = Component.literal("…").withStyle(ChatFormatting.GRAY);
|
||||||
|
|
||||||
|
Etat(ServerData d) {
|
||||||
|
this.d = d;
|
||||||
|
Thread t = new Thread(() -> {
|
||||||
|
try {
|
||||||
|
pinger.pingServer(d, () -> {}, () -> repli = horsLigne());
|
||||||
|
} catch (Exception e) {
|
||||||
|
repli = horsLigne();
|
||||||
|
}
|
||||||
|
}, "GastinelClient ping");
|
||||||
|
t.setDaemon(true);
|
||||||
|
t.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Component horsLigne() {
|
||||||
|
return Component.literal("hors ligne").withStyle(ChatFormatting.GRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
Component libelle() {
|
||||||
|
if (d.players != null) {
|
||||||
|
return Component.literal("■ ").withStyle(ChatFormatting.GREEN)
|
||||||
|
.append(Component.literal(Libelles.etatCourt(d.players.online(), d.players.max(), d.ping)).withStyle(ChatFormatting.GRAY));
|
||||||
|
}
|
||||||
|
return repli;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
package com.gastinelclient.ecrans;
|
|
||||||
|
|
||||||
import com.gastinelclient.ui.Bouton;
|
|
||||||
import com.gastinelclient.ui.Charte;
|
|
||||||
import net.minecraft.SharedConstants;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
|
||||||
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. */
|
|
||||||
public abstract class EcranGastinel extends Screen {
|
|
||||||
@Nullable protected final Screen parent;
|
|
||||||
|
|
||||||
protected EcranGastinel(String titre, @Nullable Screen parent) {
|
|
||||||
super(Component.literal(titre));
|
|
||||||
this.parent = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected int marge() { return Math.max(16, this.width / 16); }
|
|
||||||
|
|
||||||
protected int colonne() { return Math.min(240, Math.max(170, (int) (this.width * 0.36f))); }
|
|
||||||
|
|
||||||
protected Bouton lien(int x, int y, String texte, Runnable action) {
|
|
||||||
int l = this.font.width(Charte.txt(texte));
|
|
||||||
return this.addRenderableWidget(new Bouton(x, y, l, 12, texte, Bouton.Genre.LIEN, action));
|
|
||||||
}
|
|
||||||
|
|
||||||
@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);
|
|
||||||
} 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);
|
|
||||||
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);
|
|
||||||
String v = ModList.get().getModContainerById("gastinelclient")
|
|
||||||
.map(c -> c.getModInfo().getVersion().toString()).orElse("?");
|
|
||||||
Charte.texte(g, this.font, Charte.txt("Minecraft " + SharedConstants.getCurrentVersion().getName()
|
|
||||||
+ " · GastinelClient " + v), m, y, Charte.DOUX);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClose() {
|
|
||||||
this.minecraft.setScreen(this.parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.gastinelclient.ecrans;
|
||||||
|
|
||||||
|
import com.gastinelclient.Config;
|
||||||
|
import com.gastinelclient.core.Libelles;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.screens.ConnectScreen;
|
||||||
|
import net.minecraft.client.gui.screens.GenericMessageScreen;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.TitleScreen;
|
||||||
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
|
import net.minecraft.client.multiplayer.ServerList;
|
||||||
|
import net.minecraft.client.multiplayer.resolver.ServerAddress;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
|
/** Le serveur Gastinel : retrouver son entrée, l'épingler en tête de la liste multijoueur, le rejoindre. */
|
||||||
|
public final class Gastinel {
|
||||||
|
public static final int ORANGE = 0xFFE8650A;
|
||||||
|
|
||||||
|
private Gastinel() {}
|
||||||
|
|
||||||
|
public static boolean est(String ip) {
|
||||||
|
return Libelles.memeServeur(ip, Config.adresse());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Reprend l'entrée de la liste multijoueur si elle existe (garde le choix du pack de ressources). */
|
||||||
|
public static ServerData serveur(Minecraft mc) {
|
||||||
|
ServerList liste = new ServerList(mc);
|
||||||
|
liste.load();
|
||||||
|
for (int i = 0; i < liste.size(); i++) {
|
||||||
|
if (est(liste.get(i).ip)) return liste.get(i);
|
||||||
|
}
|
||||||
|
return new ServerData(Config.nom(), Libelles.nettoyerAdresse(Config.adresse()), ServerData.Type.OTHER);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Avant l'ouverture de la liste multijoueur : ajoute le serveur Gastinel au premier lancement,
|
||||||
|
* puis le garde en tête. S'il a été supprimé par le joueur, on ne le remet pas.
|
||||||
|
*/
|
||||||
|
public static void epingler(Minecraft mc) {
|
||||||
|
ServerList liste = new ServerList(mc);
|
||||||
|
liste.load();
|
||||||
|
int i = -1;
|
||||||
|
for (int k = 0; k < liste.size(); k++) if (est(liste.get(k).ip)) { i = k; break; }
|
||||||
|
if (i < 0) {
|
||||||
|
if (Config.ajoute()) return;
|
||||||
|
liste.add(new ServerData(Config.nom(), Libelles.nettoyerAdresse(Config.adresse()), ServerData.Type.OTHER), false);
|
||||||
|
i = liste.size() - 1;
|
||||||
|
Config.marquerAjoute();
|
||||||
|
} else if (i == 0) {
|
||||||
|
if (!Config.ajoute()) Config.marquerAjoute();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ServerData[] avant = new ServerData[liste.size()];
|
||||||
|
for (int k = 0; k < avant.length; k++) avant[k] = liste.get(k);
|
||||||
|
int[] ordre = Libelles.ordreEpingle(avant.length, i);
|
||||||
|
for (int k = 0; k < avant.length; k++) liste.replace(k, avant[ordre[k]]);
|
||||||
|
liste.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Quitte la partie en cours (sauvegarde en solo, comme le menu pause vanilla) puis rejoint le serveur Gastinel. */
|
||||||
|
public static void quitterEtRejoindre(Minecraft mc) {
|
||||||
|
boolean local = mc.isLocalServer();
|
||||||
|
if (mc.level != null) mc.level.disconnect();
|
||||||
|
if (local) mc.disconnect(new GenericMessageScreen(Component.translatable("menu.savingLevel")));
|
||||||
|
else mc.disconnect();
|
||||||
|
rejoindre(mc, new TitleScreen());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void rejoindre(Minecraft mc, Screen parent) {
|
||||||
|
ServerData d = serveur(mc);
|
||||||
|
ConnectScreen.startConnecting(parent, mc, ServerAddress.parseString(d.ip), d, false, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
package com.gastinelclient.ecrans;
|
||||||
|
|
||||||
|
import com.gastinelclient.Config;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Font;
|
||||||
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
|
import net.minecraft.client.gui.components.Button;
|
||||||
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||||
|
import net.minecraft.client.gui.screens.PauseScreen;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.TitleScreen;
|
||||||
|
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen;
|
||||||
|
import net.minecraft.client.gui.screens.multiplayer.ServerSelectionList;
|
||||||
|
import net.minecraft.client.gui.screens.options.OptionsScreen;
|
||||||
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.network.chat.contents.TranslatableContents;
|
||||||
|
import net.neoforged.neoforge.client.event.ScreenEvent;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proposition C : on garde les écrans de Minecraft (restylés par les ressources du mod)
|
||||||
|
* et on y ajoute seulement ce qui sert à Gastinel. Classe exacte partout : on ne touche pas
|
||||||
|
* aux écrans d'un autre mod qui hériteraient de ceux de Minecraft.
|
||||||
|
*/
|
||||||
|
public final class Habillage {
|
||||||
|
private Habillage() {}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------- ouverture, fermeture
|
||||||
|
|
||||||
|
public static void avantOuverture(ScreenEvent.Opening e) {
|
||||||
|
if (e.getNewScreen() != null && e.getNewScreen().getClass() == JoinMultiplayerScreen.class) {
|
||||||
|
Gastinel.epingler(Minecraft.getInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fermeture(ScreenEvent.Closing e) {
|
||||||
|
if (e.getScreen().getClass() == TitleScreen.class) BoutonServeur.fermer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------- init
|
||||||
|
|
||||||
|
public static void apresInit(ScreenEvent.Init.Post e) {
|
||||||
|
Screen s = e.getScreen();
|
||||||
|
if (s.getClass() == TitleScreen.class && Config.accueil()) accueil(e, s);
|
||||||
|
else if (s.getClass() == PauseScreen.class && ((PauseScreen) s).showsPauseMenu() && Config.pause()) pause(e, s);
|
||||||
|
else if (s.getClass() == OptionsScreen.class) options(e, s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Accueil : sans Realms ; « Serveur Gastinel » en tête, Solo et Multijoueur décalés d'une ligne (Mods prend la place de Realms). */
|
||||||
|
private static void accueil(ScreenEvent.Init.Post e, Screen s) {
|
||||||
|
AbstractWidget solo = null, multi = null, realms = null;
|
||||||
|
for (GuiEventListener l : e.getListenersList()) {
|
||||||
|
if (!(l instanceof AbstractWidget w)) continue;
|
||||||
|
switch (cle(w)) {
|
||||||
|
case "menu.singleplayer" -> solo = w;
|
||||||
|
case "menu.multiplayer" -> multi = w;
|
||||||
|
case "menu.online" -> realms = w;
|
||||||
|
default -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (solo == null || multi == null) return; // mode démo ou écran modifié par un autre mod : on n'y touche pas
|
||||||
|
int y = solo.getY();
|
||||||
|
if (realms != null) {
|
||||||
|
e.removeListener(realms);
|
||||||
|
solo.setY(y + 24);
|
||||||
|
multi.setY(y + 48);
|
||||||
|
e.addListener(new BoutonServeur(s.width / 2 - 100, y, 200, 20));
|
||||||
|
} else {
|
||||||
|
// Pas de place libérée : le bouton se met au-dessus de Solo.
|
||||||
|
e.addListener(new BoutonServeur(s.width / 2 - 100, y - 24, 200, 20));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Ordre des demi-boutons du menu pause (les autres viennent après, dans leur ordre d'origine). */
|
||||||
|
private static final Map<String, Integer> ORDRE_PAUSE = Map.of(
|
||||||
|
"gui.advancements", 0, "gui.stats", 1, "fml.menu.mods", 2,
|
||||||
|
"menu.shareToLan", 3, "menu.playerReporting", 3, "menu.options", 4, "gastinel", 5);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pause : on retire « Donner son avis » et « Signaler un bug », on ajoute « Serveur Gastinel »
|
||||||
|
* (si on n'y est pas déjà) et on range : Retour au jeu, paires de demi-boutons, Sauvegarder et quitter.
|
||||||
|
*/
|
||||||
|
private static void pause(ScreenEvent.Init.Post e, Screen s) {
|
||||||
|
Minecraft mc = Minecraft.getInstance();
|
||||||
|
List<AbstractWidget> boutons = new ArrayList<>();
|
||||||
|
for (GuiEventListener l : List.copyOf(e.getListenersList())) {
|
||||||
|
if (!(l instanceof Button b)) continue;
|
||||||
|
String c = cle(b);
|
||||||
|
if (c.equals("menu.sendFeedback") || c.equals("menu.reportBugs")) e.removeListener(b);
|
||||||
|
else boutons.add(b);
|
||||||
|
}
|
||||||
|
if (boutons.size() < 3) return;
|
||||||
|
boutons.sort(Comparator.comparingInt(AbstractWidget::getY).thenComparingInt(AbstractWidget::getX));
|
||||||
|
AbstractWidget retour = boutons.remove(0), quitter = boutons.remove(boutons.size() - 1);
|
||||||
|
ServerData actuel = mc.getCurrentServer();
|
||||||
|
Button gastinel = null;
|
||||||
|
if (actuel == null || !Gastinel.est(actuel.ip)) {
|
||||||
|
gastinel = Button.builder(Component.literal(Config.nom()), b -> Gastinel.quitterEtRejoindre(mc)).width(98).build();
|
||||||
|
e.addListener(gastinel);
|
||||||
|
boutons.add(gastinel);
|
||||||
|
}
|
||||||
|
final Button g = gastinel;
|
||||||
|
boutons.sort(Comparator.comparingInt(w -> ORDRE_PAUSE.getOrDefault(w == g ? "gastinel" : cle(w), 9)));
|
||||||
|
|
||||||
|
int x = s.width / 2 - 102, y = retour.getY();
|
||||||
|
place(retour, x, y, 204);
|
||||||
|
y += 24;
|
||||||
|
for (int i = 0; i < boutons.size(); i += 2) {
|
||||||
|
if (i + 1 < boutons.size()) {
|
||||||
|
place(boutons.get(i), x, y, 98);
|
||||||
|
place(boutons.get(i + 1), x + 106, y, 98);
|
||||||
|
} else {
|
||||||
|
place(boutons.get(i), x, y, 204);
|
||||||
|
}
|
||||||
|
y += 24;
|
||||||
|
}
|
||||||
|
place(quitter, x, y + 12, 204);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void place(AbstractWidget w, int x, int y, int l) {
|
||||||
|
w.setX(x);
|
||||||
|
w.setY(y);
|
||||||
|
w.setWidth(l);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Options vanilla : « Terminé » passe à droite, « Réglages essentiels… » (écran simple) à gauche. */
|
||||||
|
private static void options(ScreenEvent.Init.Post e, Screen s) {
|
||||||
|
for (GuiEventListener l : e.getListenersList()) {
|
||||||
|
if (l instanceof Button b && cle(b).equals("gui.done")) {
|
||||||
|
int y = b.getY();
|
||||||
|
b.setWidth(150);
|
||||||
|
b.setX(s.width / 2 + 5);
|
||||||
|
e.addListener(Button.builder(Component.literal("Réglages essentiels…"),
|
||||||
|
x -> Minecraft.getInstance().setScreen(new OptionsSimplesScreen(s)))
|
||||||
|
.bounds(s.width / 2 - 155, y, 150, 20).build());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------- rendu
|
||||||
|
|
||||||
|
public static void apresRendu(ScreenEvent.Render.Post e) {
|
||||||
|
Screen s = e.getScreen();
|
||||||
|
GuiGraphics g = e.getGuiGraphics();
|
||||||
|
Font f = Minecraft.getInstance().font;
|
||||||
|
if (s.getClass() == TitleScreen.class && Config.accueil()) {
|
||||||
|
// Le logo vanilla est remplacé par une image vide (ressources du mod) ; le mot GASTINEL en police Minecraft x4.
|
||||||
|
String t = "GASTINEL";
|
||||||
|
int l = f.width(t) * 4;
|
||||||
|
g.pose().pushPose();
|
||||||
|
g.pose().translate(s.width / 2f - l / 2f, 34, 0);
|
||||||
|
g.pose().scale(4f, 4f, 1f);
|
||||||
|
g.drawString(f, t, 0, 0, 0xFFFFFFFF, true);
|
||||||
|
g.pose().popPose();
|
||||||
|
} else if (s.getClass() == PauseScreen.class && ((PauseScreen) s).showsPauseMenu() && Config.pause()) {
|
||||||
|
String t = "GASTINEL";
|
||||||
|
g.drawString(f, t, s.width - f.width(t) - 6, s.height - 14, 0xB0FFFFFF, true);
|
||||||
|
} else if (s.getClass() == JoinMultiplayerScreen.class) {
|
||||||
|
cadreGastinel(g, s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Filet orange autour de l'entrée du serveur Gastinel dans la liste multijoueur. */
|
||||||
|
private static void cadreGastinel(GuiGraphics g, Screen s) {
|
||||||
|
for (GuiEventListener l : s.children()) {
|
||||||
|
if (!(l instanceof ServerSelectionList liste)) continue;
|
||||||
|
List<ServerSelectionList.Entry> entrees = liste.children();
|
||||||
|
for (int i = 0; i < entrees.size(); i++) {
|
||||||
|
if (entrees.get(i) instanceof ServerSelectionList.OnlineServerEntry o && Gastinel.est(o.getServerData().ip)) {
|
||||||
|
// Même calcul que AbstractSelectionList#getRowTop (protégé) ; 36 = hauteur d'une ligne de la liste multijoueur.
|
||||||
|
int haut = liste.getY() + 4 - (int) liste.getScrollAmount() + i * 36;
|
||||||
|
int gauche = liste.getX() + (liste.getWidth() - liste.getRowWidth()) / 2;
|
||||||
|
g.enableScissor(liste.getX(), liste.getY(), liste.getRight(), liste.getBottom());
|
||||||
|
g.renderOutline(gauche, haut - 2, liste.getRowWidth(), 36, Gastinel.ORANGE);
|
||||||
|
g.disableScissor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String cle(AbstractWidget w) {
|
||||||
|
return w.getMessage().getContents() instanceof TranslatableContents t ? t.getKey() : "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,137 +1,27 @@
|
|||||||
package com.gastinelclient.ecrans;
|
package com.gastinelclient.ecrans;
|
||||||
|
|
||||||
import com.gastinelclient.core.Libelles;
|
import net.minecraft.client.Minecraft;
|
||||||
import com.gastinelclient.ui.Bouton;
|
|
||||||
import com.gastinelclient.ui.Charte;
|
|
||||||
import net.minecraft.client.OptionInstance;
|
|
||||||
import net.minecraft.client.Options;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.client.gui.screens.options.OptionsScreen;
|
import net.minecraft.client.gui.screens.options.OptionsSubScreen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.IntFunction;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options essentielles sur un seul écran (image, son, souris), avec des pas − / + au lieu
|
* Les réglages essentiels sur un seul écran, avec les curseurs de Minecraft (restylés par les ressources du mod).
|
||||||
* des curseurs vanilla. « Toutes les options » ouvre l'écran complet de Minecraft.
|
* La taille de l'interface reste dans « Graphismes » : elle demande un redimensionnement géré par cet écran-là.
|
||||||
*/
|
*/
|
||||||
public class OptionsSimplesScreen extends EcranGastinel {
|
public class OptionsSimplesScreen extends OptionsSubScreen {
|
||||||
private record Ligne(String nom, Supplier<String> valeur, int x, int y, int l) {}
|
|
||||||
private record Rubrique(String nom, int x, int y) {}
|
|
||||||
|
|
||||||
private final List<Ligne> lignes = new ArrayList<>();
|
|
||||||
private final List<Rubrique> rubriques = new ArrayList<>();
|
|
||||||
|
|
||||||
public OptionsSimplesScreen(Screen parent) {
|
public OptionsSimplesScreen(Screen parent) {
|
||||||
super("Options", parent);
|
super(parent, Minecraft.getInstance().options, Component.literal("Réglages essentiels"));
|
||||||
}
|
|
||||||
|
|
||||||
private Options o() { return this.minecraft.options; }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void init() {
|
|
||||||
lignes.clear();
|
|
||||||
rubriques.clear();
|
|
||||||
int m = marge();
|
|
||||||
int l = Math.min(colonne(), (this.width - 2 * m - 24) / 2);
|
|
||||||
int x1 = m, x2 = m + l + 24;
|
|
||||||
int y0 = 16 + 46;
|
|
||||||
|
|
||||||
int y = rubrique("Image", x1, y0);
|
|
||||||
y = pas(x1, y, l, "Distance d'affichage", o().renderDistance(), 1, v -> v + " tronçons");
|
|
||||||
y = pas(x1, y, l, "Champ de vision", o().fov(), 5, v -> v + "°");
|
|
||||||
y = pasDouble(x1, y, l, "Luminosité", o().gamma(), 0.1);
|
|
||||||
y = pas(x1, y, l, "Taille de l'interface", o().guiScale(), 1, v -> v == 0 ? "Auto" : "×" + v);
|
|
||||||
y = bascule(x1, y, l, "Plein écran", o().fullscreen());
|
|
||||||
bascule(x1, y, l, "Synchro verticale", o().enableVsync());
|
|
||||||
|
|
||||||
y = rubrique("Son et souris", x2, y0);
|
|
||||||
y = pasDouble(x2, y, l, "Volume général", o().getSoundSourceOptionInstance(SoundSource.MASTER), 0.05);
|
|
||||||
y = pasDouble(x2, y, l, "Musique", o().getSoundSourceOptionInstance(SoundSource.MUSIC), 0.05);
|
|
||||||
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);
|
|
||||||
String tout = "Toutes les options de Minecraft";
|
|
||||||
lien(this.width - m - this.font.width(Charte.txt(tout)), this.height - 20, tout,
|
|
||||||
() -> this.minecraft.setScreen(new OptionsScreen(this, o())));
|
|
||||||
}
|
|
||||||
|
|
||||||
private int rubrique(String nom, int x, int y) {
|
|
||||||
rubriques.add(new Rubrique(nom, x, y));
|
|
||||||
return y + 14;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 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()),
|
|
||||||
() -> { opt.set(borner(opt, opt.get() - pas)); apres.run(); },
|
|
||||||
() -> { opt.set(borner(opt, opt.get() + pas)); apres.run(); });
|
|
||||||
return y + 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
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());
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
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()),
|
|
||||||
() -> 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));
|
|
||||||
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));
|
|
||||||
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());
|
|
||||||
b[0].setMessage(Component.literal(opt.get() ? "Oui" : "Non"));
|
|
||||||
}));
|
|
||||||
return y + 20;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics g, int mx, int my, float pt) {
|
protected void addOptions() {
|
||||||
super.render(g, mx, my, pt);
|
this.list.addSmall(
|
||||||
entete(g, marge(), 16, "Réglages", "Options");
|
this.options.renderDistance(), this.options.fov(),
|
||||||
for (Rubrique r : rubriques) {
|
this.options.gamma(), this.options.sensitivity(),
|
||||||
Charte.texte(g, this.font, Charte.gras(r.nom().toUpperCase()), r.x(), r.y(), Charte.DOUX);
|
this.options.fullscreen(), this.options.enableVsync(),
|
||||||
}
|
this.options.getSoundSourceOptionInstance(SoundSource.MASTER), this.options.getSoundSourceOptionInstance(SoundSource.MUSIC),
|
||||||
for (Ligne li : lignes) {
|
this.options.getSoundSourceOptionInstance(SoundSource.BLOCKS), this.options.getSoundSourceOptionInstance(SoundSource.AMBIENT));
|
||||||
Charte.texte(g, this.font, Charte.txt(li.nom()), li.x(), li.y() + 6, Charte.ENCRE);
|
|
||||||
String v = li.valeur().get();
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removed() {
|
|
||||||
this.minecraft.options.save();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package com.gastinelclient.ecrans;
|
|
||||||
|
|
||||||
import com.gastinelclient.ui.Bouton;
|
|
||||||
import com.gastinelclient.ui.Charte;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.screens.GenericMessageScreen;
|
|
||||||
import net.minecraft.client.gui.screens.ShareToLanScreen;
|
|
||||||
import net.minecraft.client.gui.screens.achievement.StatsScreen;
|
|
||||||
import net.minecraft.client.gui.screens.advancements.AdvancementsScreen;
|
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
|
||||||
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).
|
|
||||||
* Reprendre, Options, Progrès, Statistiques, (Ouvrir en réseau local), Mods, Quitter.
|
|
||||||
*/
|
|
||||||
public class PauseGastinel extends EcranGastinel {
|
|
||||||
private static final Component SAUVEGARDE = Component.translatable("menu.savingLevel");
|
|
||||||
|
|
||||||
public PauseGastinel() {
|
|
||||||
super("Pause", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private int panneau() { return Math.min(this.width, colonne() + 2 * marge()); }
|
|
||||||
|
|
||||||
private int haut() {
|
|
||||||
int n = 5 + (lanPossible() ? 1 : 0);
|
|
||||||
return Math.max(14, (this.height - (46 + 30 + n * 20 + 12 + 20)) / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void init() {
|
|
||||||
int m = marge(), l = colonne();
|
|
||||||
boolean solo = this.minecraft.isLocalServer();
|
|
||||||
int y = haut() + 46;
|
|
||||||
|
|
||||||
addRenderableWidget(new Bouton(m, y, l, 30, "Reprendre", Bouton.Genre.PRIMAIRE, this::reprendre)
|
|
||||||
.sousTitre(this::lieu, () -> Charte.DOUX));
|
|
||||||
y += 30;
|
|
||||||
addRenderableWidget(new Bouton(m, y, l, 20, "Options", Bouton.Genre.MENU,
|
|
||||||
() -> this.minecraft.setScreen(new OptionsSimplesScreen(this))));
|
|
||||||
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))));
|
|
||||||
y += 20;
|
|
||||||
addRenderableWidget(new Bouton(m, y, l, 20, "Statistiques", Bouton.Genre.MENU,
|
|
||||||
() -> this.minecraft.setScreen(new StatsScreen(this, this.minecraft.player.getStats()))));
|
|
||||||
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))));
|
|
||||||
y += 20;
|
|
||||||
}
|
|
||||||
addRenderableWidget(new Bouton(m, y, l, 20, "Mods", Bouton.Genre.MENU,
|
|
||||||
() -> this.minecraft.setScreen(new ModListScreen(this))));
|
|
||||||
y += 20 + 12;
|
|
||||||
addRenderableWidget(new Bouton(m, y, l, 20, solo ? "Sauvegarder et quitter" : "Se déconnecter",
|
|
||||||
Bouton.Genre.PRIMAIRE, this::quitter).accent(Charte.ROUGE));
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean lanPossible() {
|
|
||||||
return this.minecraft.hasSingleplayerServer() && !this.minecraft.getSingleplayerServer().isPublished();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String lieu() {
|
|
||||||
if (this.minecraft.hasSingleplayerServer()) {
|
|
||||||
return "Monde : " + this.minecraft.getSingleplayerServer().getWorldData().getLevelName();
|
|
||||||
}
|
|
||||||
ServerData d = this.minecraft.getCurrentServer();
|
|
||||||
return d != null ? d.name : "Multijoueur";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void reprendre() {
|
|
||||||
this.minecraft.setScreen(null);
|
|
||||||
this.minecraft.mouseHandler.grabMouse();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Même suite que PauseScreen#onDisconnect, puis retour à l'accueil Gastinel. */
|
|
||||||
private void quitter() {
|
|
||||||
boolean local = this.minecraft.isLocalServer();
|
|
||||||
this.minecraft.level.disconnect();
|
|
||||||
if (local) {
|
|
||||||
this.minecraft.disconnect(new GenericMessageScreen(SAUVEGARDE));
|
|
||||||
} else {
|
|
||||||
this.minecraft.disconnect();
|
|
||||||
}
|
|
||||||
this.minecraft.setScreen(new AccueilScreen());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClose() {
|
|
||||||
reprendre();
|
|
||||||
}
|
|
||||||
|
|
||||||
@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(p, 0, p + 1, this.height, Charte.ENCRE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
package com.gastinelclient.ecrans;
|
|
||||||
|
|
||||||
import com.gastinelclient.Config;
|
|
||||||
import com.gastinelclient.core.Libelles;
|
|
||||||
import com.gastinelclient.ui.Bouton;
|
|
||||||
import com.gastinelclient.ui.Charte;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.EditBox;
|
|
||||||
import net.minecraft.client.gui.screens.ConnectScreen;
|
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
|
||||||
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen;
|
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
|
||||||
import net.minecraft.client.multiplayer.ServerList;
|
|
||||||
import net.minecraft.client.multiplayer.resolver.ServerAddress;
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.util.FormattedCharSequence;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* « Autres serveurs », version simple : une case d'adresse (Rejoindre / Enregistrer) et la liste
|
|
||||||
* des serveurs enregistrés, un clic pour rejoindre. La liste vanilla complète reste accessible.
|
|
||||||
*/
|
|
||||||
public class ServeursScreen extends EcranGastinel {
|
|
||||||
private EditBox adresse;
|
|
||||||
private String saisie = "";
|
|
||||||
private String message = "";
|
|
||||||
private int page = 0;
|
|
||||||
|
|
||||||
public ServeursScreen(Screen parent) {
|
|
||||||
super("Autres serveurs", parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void init() {
|
|
||||||
int m = marge(), l = colonne();
|
|
||||||
int y = 16 + 46;
|
|
||||||
|
|
||||||
adresse = new EditBox(this.font, m + 5, y + 7, l - 10, 12, Component.literal("Adresse"));
|
|
||||||
adresse.setBordered(false);
|
|
||||||
adresse.setTextShadow(false);
|
|
||||||
adresse.setTextColor(Charte.ENCRE);
|
|
||||||
adresse.setMaxLength(255);
|
|
||||||
adresse.setHint(Charte.txt("Adresse, ex. play.exemple.fr").withColor(Charte.DOUX));
|
|
||||||
adresse.setFormatter((s, i) -> FormattedCharSequence.forward(s, Charte.txt("").getStyle()));
|
|
||||||
adresse.setValue(saisie);
|
|
||||||
adresse.setResponder(s -> saisie = s);
|
|
||||||
addRenderableWidget(adresse);
|
|
||||||
setInitialFocus(adresse);
|
|
||||||
y += 26;
|
|
||||||
|
|
||||||
int lb = (l - 6) / 2;
|
|
||||||
addRenderableWidget(new Bouton(m, y, lb, 18, "Rejoindre", Bouton.Genre.CADRE, this::rejoindreSaisie));
|
|
||||||
addRenderableWidget(new Bouton(m + lb + 6, y, l - lb - 6, 18, "Enregistrer", Bouton.Genre.CADRE, this::enregistrer));
|
|
||||||
y += 30;
|
|
||||||
|
|
||||||
// Liste enregistrée (sans le serveur Gastinel, déjà sur l'accueil)
|
|
||||||
List<ServerData> serveurs = new ArrayList<>();
|
|
||||||
ServerList liste = new ServerList(this.minecraft);
|
|
||||||
liste.load();
|
|
||||||
String gastinel = Libelles.adresseCourte(Config.adresse());
|
|
||||||
for (int i = 0; i < liste.size(); i++) {
|
|
||||||
ServerData d = liste.get(i);
|
|
||||||
if (!Libelles.adresseCourte(d.ip).equalsIgnoreCase(gastinel)) serveurs.add(d);
|
|
||||||
}
|
|
||||||
int bas = this.height - 46;
|
|
||||||
int parPage = Math.max(1, (bas - y - 14) / 20);
|
|
||||||
int pages = Math.max(1, (serveurs.size() + parPage - 1) / parPage);
|
|
||||||
page = Math.min(page, pages - 1);
|
|
||||||
int ligneY = y + 14;
|
|
||||||
if (serveurs.isEmpty()) {
|
|
||||||
message = message.isEmpty() ? "Aucun serveur enregistré pour l'instant." : message;
|
|
||||||
}
|
|
||||||
for (int i = page * parPage; i < Math.min(serveurs.size(), (page + 1) * parPage); i++) {
|
|
||||||
ServerData d = serveurs.get(i);
|
|
||||||
addRenderableWidget(new Bouton(m, ligneY, l, 20, d.name, Bouton.Genre.MENU, () -> rejoindre(d))
|
|
||||||
.droite(Libelles.adresseCourte(d.ip)));
|
|
||||||
ligneY += 20;
|
|
||||||
}
|
|
||||||
if (pages > 1) {
|
|
||||||
if (page > 0) lien(m, bas, "← Précédents", () -> { page--; rebuildWidgets(); });
|
|
||||||
if (page < pages - 1) {
|
|
||||||
String s = "Suivants →";
|
|
||||||
lien(m + l - this.font.width(Charte.txt(s)), bas, s, () -> { page++; rebuildWidgets(); });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lien(m, this.height - 20, "← 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,
|
|
||||||
() -> this.minecraft.setScreen(new JoinMultiplayerScreen(this)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void rejoindreSaisie() {
|
|
||||||
String a = Libelles.nettoyerAdresse(saisie);
|
|
||||||
if (!ServerAddress.isValidAddress(a)) {
|
|
||||||
message = "Adresse invalide.";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
rejoindre(new ServerData(a, a, ServerData.Type.OTHER));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void enregistrer() {
|
|
||||||
String a = Libelles.nettoyerAdresse(saisie);
|
|
||||||
if (!ServerAddress.isValidAddress(a)) {
|
|
||||||
message = "Adresse invalide.";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ServerList liste = new ServerList(this.minecraft);
|
|
||||||
liste.load();
|
|
||||||
if (liste.get(a) == null) {
|
|
||||||
liste.add(new ServerData(a, a, ServerData.Type.OTHER), false);
|
|
||||||
liste.save();
|
|
||||||
message = "Enregistré : " + a;
|
|
||||||
} else {
|
|
||||||
message = "Déjà dans la liste.";
|
|
||||||
}
|
|
||||||
saisie = "";
|
|
||||||
rebuildWidgets();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void rejoindre(ServerData d) {
|
|
||||||
ConnectScreen.startConnecting(this, this.minecraft, ServerAddress.parseString(d.ip), d, false, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean keyPressed(int key, int scan, int mods) {
|
|
||||||
if ((key == 257 || key == 335) && adresse != null && adresse.isFocused()) { // Entrée
|
|
||||||
rejoindreSaisie();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.keyPressed(key, scan, mods);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(GuiGraphics g, int mx, int my, float pt) {
|
|
||||||
super.render(g, mx, my, pt);
|
|
||||||
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);
|
|
||||||
int ly = y + 26 + 30;
|
|
||||||
Charte.texte(g, this.font, Charte.gras("ENREGISTRÉS"), m, ly, Charte.DOUX);
|
|
||||||
if (!message.isEmpty()) {
|
|
||||||
Charte.texte(g, this.font, Charte.txt(message), m + this.font.width(Charte.gras("ENREGISTRÉS")) + 10, ly, Charte.DOUX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
package com.gastinelclient.ui;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Font;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.AbstractButton;
|
|
||||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
public class Bouton extends AbstractButton {
|
|
||||||
public enum Genre { MENU, PRIMAIRE, 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 String droite = null;
|
|
||||||
|
|
||||||
public Bouton(int x, int y, int l, int h, String texte, Genre genre, Runnable action) {
|
|
||||||
super(x, y, l, h, Component.literal(texte));
|
|
||||||
this.genre = genre;
|
|
||||||
this.action = action;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Bouton sousTitre(Supplier<String> s, Supplier<Integer> couleur) {
|
|
||||||
this.sousTitre = s;
|
|
||||||
this.couleurSousTitre = couleur;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Bouton accent(int c) { this.accent = c; return this; }
|
|
||||||
|
|
||||||
/** Petit texte gris aligné à droite (ex. adresse d'un serveur). */
|
|
||||||
public Bouton droite(String s) { this.droite = s; return this; }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPress() { action.run(); }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void renderWidget(GuiGraphics g, int mx, int my, float pt) {
|
|
||||||
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();
|
|
||||||
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;
|
|
||||||
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());
|
|
||||||
} else {
|
|
||||||
Charte.texte(g, f, prim ? Charte.gras(t) : Charte.txt(t), tx, y + (h - 8) / 2, 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);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
Component c = Charte.txt(t);
|
|
||||||
Charte.texte(g, f, c, x + (l - f.width(c)) / 2, y + (h - 8) / 2, s ? Charte.PAPIER : 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateWidgetNarration(NarrationElementOutput out) {
|
|
||||||
this.defaultButtonNarrationText(out);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
package com.gastinelclient.ui;
|
|
||||||
|
|
||||||
import com.gastinelclient.GastinelClient;
|
|
||||||
import net.minecraft.client.gui.Font;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
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 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MutableComponent txt(String s) {
|
|
||||||
return Component.literal(s).withStyle(st -> st.withFont(INTER));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MutableComponent gras(String s) {
|
|
||||||
return Component.literal(s).withStyle(st -> st.withFont(INTER_GRAS));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MutableComponent titre(String s) {
|
|
||||||
return Component.literal(s).withStyle(st -> st.withFont(INTER_TITRE));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Texte sans ombre (l'ombre vanilla salit un fond clair). */
|
|
||||||
public static void texte(GuiGraphics g, Font f, Component c, int x, int y, int couleur) {
|
|
||||||
g.drawString(f, c, x, y, couleur, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Grand titre : police Inter suréchantillonnée, agrandie d'un facteur {@code echelle}. */
|
|
||||||
public static void grandTitre(GuiGraphics g, Font f, String s, int x, int y, float echelle, int couleur) {
|
|
||||||
g.pose().pushPose();
|
|
||||||
g.pose().translate(x, y, 0);
|
|
||||||
g.pose().scale(echelle, echelle, 1f);
|
|
||||||
g.drawString(f, titre(s), 0, 0, couleur, false);
|
|
||||||
g.pose().popPose();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Arrière-plan « à lui » : papier + courbes de niveau, calé à droite, recouvrant tout l'écran. */
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Filet horizontal fin. */
|
|
||||||
public static void filet(GuiGraphics g, int x1, int x2, int y, int couleur) {
|
|
||||||
g.fill(x1, y, x2, y + 1, couleur);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION AND CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[1,)"
|
loaderVersion="[1,)"
|
||||||
license="MIT (code) ; police Inter : SIL OFL 1.1"
|
license="MIT"
|
||||||
|
|
||||||
[[mods]]
|
[[mods]]
|
||||||
modId="gastinelclient"
|
modId="gastinelclient"
|
||||||
version="0.1.0"
|
version="0.3.0-c"
|
||||||
displayName="GastinelClient"
|
displayName="GastinelClient"
|
||||||
authors="Théo Gastinel"
|
authors="Théo Gastinel"
|
||||||
description='''Interface Gastinel : nouvel écran d'accueil (Solo, Serveur Gastinel en un clic, autres serveurs, options, quitter) et menus simplifiés. Mod côté client uniquement.'''
|
description='''Interface Gastinel, style « vanilla épurée » : les menus de Minecraft avec des boutons sombres plats, le bouton « Serveur Gastinel » sur l'accueil et le serveur épinglé en tête de la liste multijoueur. Mod côté client uniquement.'''
|
||||||
# Le serveur n'a pas besoin du mod (et un client sans le mod peut se connecter).
|
# Le serveur n'a pas besoin du mod (et un client sans le mod peut se connecter).
|
||||||
displayTest="IGNORE_ALL_VERSION"
|
displayTest="IGNORE_ALL_VERSION"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"providers": [
|
|
||||||
{ "type": "ttf", "file": "gastinelclient:inter-regular.ttf", "size": 9.0, "oversample": 4.0, "shift": [0.0, 1.0] },
|
|
||||||
{ "type": "reference", "id": "minecraft:default" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"providers": [
|
|
||||||
{ "type": "ttf", "file": "gastinelclient:inter-semibold.ttf", "size": 9.0, "oversample": 4.0, "shift": [0.0, 1.0] },
|
|
||||||
{ "type": "reference", "id": "minecraft:default" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"providers": [
|
|
||||||
{ "type": "ttf", "file": "gastinelclient:inter-semibold.ttf", "size": 9.0, "oversample": 12.0, "shift": [0.0, 1.0] },
|
|
||||||
{ "type": "reference", "id": "minecraft:default" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
Avant Largeur: | Hauteur: | Taille: 438 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
Bienvenue dans le Vercors !
|
||||||
|
Bienvenue sur Gastinel !
|
||||||
|
Vu depuis le Vercors !
|
||||||
|
Serveur Gastinel, un clic !
|
||||||
|
Après Largeur: | Hauteur: | Taille: 131 B |
@@ -0,0 +1 @@
|
|||||||
|
{"gui": {"scaling": {"type": "nine_slice", "width": 200, "height": 20, "border": 1}}}
|
||||||
|
Après Largeur: | Hauteur: | Taille: 132 B |
@@ -0,0 +1 @@
|
|||||||
|
{"gui": {"scaling": {"type": "nine_slice", "width": 200, "height": 20, "border": 1}}}
|
||||||
|
Après Largeur: | Hauteur: | Taille: 132 B |
@@ -0,0 +1 @@
|
|||||||
|
{"gui": {"scaling": {"type": "nine_slice", "width": 200, "height": 20, "border": 1}}}
|
||||||
|
Après Largeur: | Hauteur: | Taille: 131 B |
@@ -0,0 +1 @@
|
|||||||
|
{"gui": {"scaling": {"type": "nine_slice", "width": 200, "height": 20, "border": 1}}}
|
||||||
|
Après Largeur: | Hauteur: | Taille: 82 B |
@@ -0,0 +1 @@
|
|||||||
|
{"gui": {"scaling": {"type": "nine_slice", "width": 8, "height": 20, "border": 1}}}
|
||||||
|
Après Largeur: | Hauteur: | Taille: 76 B |
@@ -0,0 +1 @@
|
|||||||
|
{"gui": {"scaling": {"type": "nine_slice", "width": 8, "height": 20, "border": 1}}}
|
||||||
|
Après Largeur: | Hauteur: | Taille: 132 B |
@@ -0,0 +1 @@
|
|||||||
|
{"gui": {"scaling": {"type": "nine_slice", "width": 200, "height": 20, "border": 1}}}
|
||||||
|
Après Largeur: | Hauteur: | Taille: 87 B |
|
Après Largeur: | Hauteur: | Taille: 143 B |
|
Après Largeur: | Hauteur: | Taille: 143 B |
@@ -1,14 +1,16 @@
|
|||||||
package com.gastinelclient.core;
|
package com.gastinelclient.core;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
class LibellesTest {
|
class LibellesTest {
|
||||||
@Test void enLigne() {
|
@Test void etatCourt() {
|
||||||
assertEquals("En ligne · 3/20 joueurs · 12 ms", Libelles.enLigne(3, 20, 12));
|
assertEquals("3/20 · 12 ms", Libelles.etatCourt(3, 20, 12));
|
||||||
assertEquals("En ligne · 1/20 joueur · 9 ms", Libelles.enLigne(1, 20, 9));
|
assertEquals("0", Libelles.etatCourt(0, 0, -1));
|
||||||
assertEquals("En ligne · 0 joueur", Libelles.enLigne(0, 0, -1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test void adresses() {
|
@Test void adresses() {
|
||||||
@@ -17,14 +19,13 @@ class LibellesTest {
|
|||||||
assertEquals("", Libelles.nettoyerAdresse(null));
|
assertEquals("", Libelles.nettoyerAdresse(null));
|
||||||
assertEquals("gastinel.me", Libelles.adresseCourte("gastinel.me:25565"));
|
assertEquals("gastinel.me", Libelles.adresseCourte("gastinel.me:25565"));
|
||||||
assertEquals("gastinel.me:25570", Libelles.adresseCourte("gastinel.me:25570"));
|
assertEquals("gastinel.me:25570", Libelles.adresseCourte("gastinel.me:25570"));
|
||||||
|
assertTrue(Libelles.memeServeur("Gastinel.me", "gastinel.me:25565"));
|
||||||
|
assertFalse(Libelles.memeServeur("gastinel.me:25570", "gastinel.me"));
|
||||||
|
assertFalse(Libelles.memeServeur("", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test void nombres() {
|
@Test void epingle() {
|
||||||
assertEquals("46 %", Libelles.pourcent(0.456));
|
assertArrayEquals(new int[] {2, 0, 1, 3}, Libelles.ordreEpingle(4, 2));
|
||||||
assertEquals("100 %", Libelles.pourcent(1.4));
|
assertArrayEquals(new int[] {0, 1}, Libelles.ordreEpingle(2, 0));
|
||||||
assertEquals(0.3, Libelles.pas01(0.2, 0.1));
|
|
||||||
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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||