Launcher : résolution de la fenêtre et bouton Réparer ; doc alignée

- Launcher : « Résolution de la fenêtre » en liste (mêmes résolutions que
  le menu F12, plus celle de l'écran), écrit window_width / window_height
  à la place du curseur ×N.
- Launcher : bouton « Réparer » sur la ligne d'un pack Upscayl
  (hd_export.py --reparer avec le modèle du pack).
- TEXTURES, GUIDE FR/EN : fermer jeux et applis 3D pendant la création du
  pack, dépannage écrans noirs et images manquantes, 24 images de
  cinématique faites avec les décors ; résolution et --resolution.
- MODS.en, SETTINGS.en : alignés sur 53efd91, 671b04f, 72aafba, d9644fa
  et 7d8cb34.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
linkatplugandClaude Opus 5.5 committed 2026-12-05 12:05:21 +01:00
1 parent d9644fa8d0
commit 313435132d
10 files changed
+146 -24

No files matched your search

+75 -4
View File
@@ -501,6 +501,43 @@ fn play_button(ui: &mut egui::Ui, label: &str, enabled: bool) -> egui::Response
}
}
/// résolutions proposées pour la fenêtre : mêmes listes que le menu F12 du jeu (runtime/menu.c)
const RESOLUTIONS: &[(u32, u32)] = &[
(960, 720), (1280, 960), (1440, 1080), (1600, 1200), (1920, 1440), (2560, 1920), (2880, 2160), // 4:3
(1280, 800), (1680, 1050), (1920, 1200), (2560, 1600), // 16:10
(1280, 720), (1600, 900), (1920, 1080), (2560, 1440), (3840, 2160), // 16:9
];
/// liste déroulante de la taille de fenêtre en pixels (window_width / window_height) : résolutions courantes
/// qui tiennent à l'écran, celle de l'écran, et la taille actuelle (y compris l'ancien réglage ×N)
fn resolution_combo(ui: &mut egui::Ui, gs: &mut settings::GameSettings, screen: Option<(u32, u32)>, en: bool) {
let cur = if gs.window_width > 0 && gs.window_height > 0 {
(gs.window_width, gs.window_height)
} else {
(320 * gs.window_scale, if gs.aspect_43 { 240 } else { 200 } * gs.window_scale)
};
let mut list: Vec<(u32, u32)> =
RESOLUTIONS.iter().copied().filter(|&(w, h)| screen.map_or(true, |(sw, sh)| w <= sw && h <= sh)).collect();
if let Some(s) = screen {
list.push(s);
}
list.push(cur);
list.sort();
list.dedup();
let label = |r: (u32, u32)| {
let note = if Some(r) == screen { if en { " (screen)" } else { " (écran)" } } else { "" };
format!("{} × {}{note}", r.0, r.1)
};
egui::ComboBox::from_id_salt("resolution").selected_text(label(cur)).show_ui(ui, |ui| {
for r in list {
if ui.selectable_label(r == cur, label(r)).clicked() {
gs.window_width = r.0;
gs.window_height = r.1;
}
}
});
}
/// dessine une texture en « cover » (recadrée pour remplir le rectangle), pixels 1:1,2 comme sur un écran 4:3
fn paint_cover(p: &egui::Painter, rect: Rect, tex: &egui::TextureHandle, alpha: f32, drift: f32) {
paint_cover_in(p, rect, tex, Rect::from_min_max(egui::pos2(0.0, 0.0), egui::pos2(1.0, 1.0)), alpha, drift)
@@ -861,6 +898,20 @@ impl App {
self.start_task("hd", vec![cmd]);
}
/// refait seulement les images vides d'un pack (hd_export.py --reparer), avec le modèle du pack
fn repair_hd_pack(&mut self, target: PathBuf, model: String) {
let Some(game) = self.checks.game_dir.clone() else { return };
let mut cmd = format!(
"python -I tools\\hd_export.py \"{}\" \"{}\" --reparer --upscayl {model}",
game.display(),
target.join("hd").display()
);
if let Some(bin) = &self.upscayl {
cmd.push_str(&format!(" --upscayl-bin \"{}\"", bin.display()));
}
self.start_task("hd", vec![cmd]);
}
fn mods_card(&mut self, ui: &mut egui::Ui) {
let en = self.cfg.lang == Lang::En;
let tr = |fr: &'static str, e: &'static str| if en { e } else { fr };
@@ -871,6 +922,7 @@ impl App {
let mut refresh = false;
let mut create = false;
let mut add_sprites: Option<(PathBuf, String)> = None;
let mut repair: Option<(PathBuf, String)> = None;
let mut export = false;
let mut new_mod = false;
card(ui, |ui| {
@@ -936,6 +988,20 @@ impl App {
add_sprites = Some((m.path.clone(), model.clone()));
}
}
// images ratées (vides) après un plantage du pilote ou un export interrompu
if let (Some(model), true, true) = (&m.model, m.hd_images + m.hd_sprites > 0, self.upscayl.is_some()) {
if ui
.add_enabled(can_create, egui::Button::new(tr("Réparer", "Repair")).small())
.on_hover_text(if en {
format!("Redoes only the empty pictures of the pack (after a crash or an interrupted export), with its model ({model}). Close games and 3D apps meanwhile.")
} else {
format!("Refait seulement les images vides du pack (après un plantage ou un export interrompu), avec son modèle ({model}). Fermez jeux et applis 3D pendant ce temps.")
})
.clicked()
{
repair = Some((m.path.clone(), model.clone()));
}
}
if m.files > 0 {
ui.label(RichText::new(format!("{} {}", m.files, tr("fichiers", "files"))).color(OK).small());
}
@@ -1055,6 +1121,9 @@ impl App {
if let Some((path, model)) = add_sprites {
self.create_hd_pack(Some(path), model, false, true);
}
if let Some((path, model)) = repair {
self.repair_hd_pack(path, model);
}
if export {
self.export_originals();
}
@@ -1934,6 +2003,10 @@ impl App {
ui.add_space(4.0);
// réglages partagés avec le jeu : figés pendant une partie (le menu F12 écrit le même fichier)
let running = self.game_running;
// taille de l'écran en pixels réels (monitor_size est en points)
let screen = ui.ctx().input(|i| {
i.viewport().monitor_size.map(|s| ((s.x * i.pixels_per_point).round() as u32, (s.y * i.pixels_per_point).round() as u32))
});
let gs = &mut self.gs;
ui.add_enabled_ui(!running, |ui| {
egui::CollapsingHeader::new(RichText::new(tr("Affichage", "Display")).strong())
@@ -1950,10 +2023,8 @@ impl App {
ui.checkbox(&mut gs.aspect_43, tr("Format 4:3 (comme un écran VGA)", "4:3 aspect (like a VGA screen)"));
ui.checkbox(&mut gs.vsync, tr("Synchronisation verticale", "Vertical sync"));
ui.horizontal(|ui| {
ui.label(tr("Fenêtre", "Window"));
ui.add(egui::Slider::new(&mut gs.window_scale, 1..=16).suffix("×"));
let h = if gs.aspect_43 { 240 } else { 200 };
ui.label(RichText::new(format!("{}×{}", 320 * gs.window_scale, h * gs.window_scale)).weak());
ui.label(tr("Résolution de la fenêtre", "Window resolution"));
resolution_combo(ui, gs, screen, en);
});
});
egui::CollapsingHeader::new(RichText::new(tr("Volumes", "Volume")).strong())
+13
View File
@@ -11,6 +11,9 @@ pub const VOLUMES: [&str; 4] = ["master_volume", "music_volume", "voice_volume",
pub struct GameSettings {
pub fullscreen: bool,
pub window_scale: u32,
/// taille de la fenêtre en pixels ; 0 = `window_scale` est utilisé
pub window_width: u32,
pub window_height: u32,
pub filter: usize,
pub aspect_43: bool,
pub vsync: bool,
@@ -32,6 +35,8 @@ impl Default for GameSettings {
Self {
fullscreen: false,
window_scale: 3,
window_width: 0,
window_height: 0,
filter: 0,
aspect_43: true,
vsync: false,
@@ -97,6 +102,12 @@ impl GameSettings {
("display", "window_scale") => {
s.window_scale = v.parse().map(|n: u32| n.clamp(1, 16)).unwrap_or(s.window_scale)
}
("display", "window_width") => {
s.window_width = v.parse().map(|n: u32| n.min(16384)).unwrap_or(s.window_width)
}
("display", "window_height") => {
s.window_height = v.parse().map(|n: u32| n.min(16384)).unwrap_or(s.window_height)
}
("display", "filter") => {
s.filter = FILTERS.iter().position(|f| f.eq_ignore_ascii_case(v)).unwrap_or(s.filter)
}
@@ -126,6 +137,8 @@ impl GameSettings {
let mut e = vec![
("display", "fullscreen", b(self.fullscreen)),
("display", "window_scale", self.window_scale.to_string()),
("display", "window_width", self.window_width.to_string()),
("display", "window_height", self.window_height.to_string()),
("display", "filter", FILTERS[self.filter].to_string()),
("display", "aspect_43", b(self.aspect_43)),
("display", "vsync", b(self.vsync)),