Launcher : archive sans .git, version lue dans VERSION et lien vers les releases GitHub

La mise à jour par git reste désactivée dans une archive (choix de l'utilisateur) ; build_zig.bat et
recomp/src comptent désormais parmi les fichiers du moteur (jeu à recompiler s'ils changent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
linkatplugandClaude Opus 5.5 committed 2026-12-06 10:59:52 +01:00
1 parent eced0b8603
commit b1a299e0b2
2 files changed
+16 -2

No files matched your search

+4
View File
@@ -3443,10 +3443,14 @@ impl App {
return;
};
if !u.git {
if !u.version.is_empty() {
ui.label(RichText::new(format!("Version {}", u.version)).weak().small());
}
ui.label(RichText::new(tr(
"Projet installé sans Git (archive ZIP) : pas de mise à jour automatique. Téléchargez la nouvelle version, ou installez le projet avec git clone (guide, section 3).",
"Project installed without Git (ZIP archive): no automatic update. Download the new version, or install the project with git clone (guide, section 3).",
)).weak());
ui.hyperlink_to(tr("Versions publiées (GitHub)", "Published versions (GitHub)"), updates::RELEASES_URL);
return;
}
ui.label(RichText::new(format!("{} {} · {}", tr("Branche", "Branch"), u.branch, u.head)).weak().small());
+12 -2
View File
@@ -14,7 +14,11 @@ const NO_WINDOW: u32 = 0x0800_0000;
pub const LAUNCHER_COMMIT: &str = env!("DTR_LAUNCHER_COMMIT");
/// fichiers dont dépend le jeu compilé : un changement demande de le recompiler
pub const ENGINE: [&str; 6] = ["runtime", "tools/recomp.py", "tools/le.py", "tools/version.py", "build.bat", "assets/icon"];
pub const ENGINE: [&str; 8] =
["runtime", "tools/recomp.py", "tools/le.py", "tools/version.py", "build.bat", "build_zig.bat", "recomp/src", "assets/icon"];
/// page des releases : seule voie de mise à jour d'une archive (pas de .git)
pub const RELEASES_URL: &str = "https://github.com/Linkatplug/DoubleTroubleRecomp/releases";
pub const LAUNCHER: [&str; 1] = ["launcher"];
/// fichier du dossier de compilation qui retient le commit compilé
@@ -24,6 +28,8 @@ pub const STAMP: &str = "commit.txt";
pub struct Info {
/// le projet est un clone Git (sinon : installé depuis un ZIP, pas de mise à jour automatique)
pub git: bool,
/// version de l'archive de release (fichier VERSION, écrit par tools/paquet_release.sh) ; vide sinon
pub version: String,
pub branch: String,
/// commit actuel, court
pub head: String,
@@ -73,7 +79,11 @@ fn changed(root: &Path, from: &str, to: &str, paths: &[&str]) -> Result<bool, St
/// état des mises à jour ; `fetch` : interroger le dépôt (réseau), sinon seulement l'état local
pub fn check(root: &Path, build_dir: &Path, fetch: bool) -> Info {
let mut i = Info { git: root.join(".git").exists(), ..Default::default() };
let mut i = Info {
git: root.join(".git").exists(),
version: std::fs::read_to_string(root.join("VERSION")).map(|s| s.trim().to_string()).unwrap_or_default(),
..Default::default()
};
if !i.git {
return i;
}