Interface size setting: auto, large, medium or small on the world's pixel grid

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-06 13:21:07 +01:00
1 parent 95655a0886
commit 70f112543f
21 files changed
+50 -11

No files matched your search

+2
View File
@@ -264,6 +264,8 @@ val.medium = Střední
val.high = Vysoká val.high = Vysoká
val.normal = Normální val.normal = Normální
val.large = Velké val.large = Velké
val.small = Malé
val.auto_plain = Automaticky
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera vpřed key.cam_forward = Kamera vpřed
+2
View File
@@ -264,6 +264,8 @@ val.medium = Middel
val.high = Høj val.high = Høj
val.normal = Normal val.normal = Normal
val.large = Stor val.large = Stor
val.small = Lille
val.auto_plain = Automatisk
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera frem key.cam_forward = Kamera frem
+2
View File
@@ -263,6 +263,8 @@ val.medium = Mittel
val.high = Hoch val.high = Hoch
val.normal = Normal val.normal = Normal
val.large = Groß val.large = Groß
val.small = Klein
val.auto_plain = Automatisch
# ---- Namen der Tastenbelegung # ---- Namen der Tastenbelegung
key.cam_forward = Kamera vor key.cam_forward = Kamera vor
+2
View File
@@ -264,6 +264,8 @@ val.medium = Μεσαία
val.high = Υψηλή val.high = Υψηλή
val.normal = Κανονικό val.normal = Κανονικό
val.large = Μεγάλο val.large = Μεγάλο
val.small = Μικρό
val.auto_plain = Αυτόματο
# ---- key binding names # ---- key binding names
key.cam_forward = Κάμερα μπροστά key.cam_forward = Κάμερα μπροστά
+2
View File
@@ -264,6 +264,8 @@ val.medium = Medium
val.high = High val.high = High
val.normal = Normal val.normal = Normal
val.large = Large val.large = Large
val.small = Small
val.auto_plain = Auto
# ---- key binding names # ---- key binding names
key.cam_forward = Camera forward key.cam_forward = Camera forward
+2
View File
@@ -264,6 +264,8 @@ val.medium = Medio
val.high = Alto val.high = Alto
val.normal = Normal val.normal = Normal
val.large = Grande val.large = Grande
val.small = Pequeño
val.auto_plain = Automático
# ---- key binding names # ---- key binding names
key.cam_forward = Cámara adelante key.cam_forward = Cámara adelante
+2
View File
@@ -264,6 +264,8 @@ val.medium = Keski
val.high = Korkea val.high = Korkea
val.normal = Normaali val.normal = Normaali
val.large = Suuri val.large = Suuri
val.small = Pieni
val.auto_plain = Automaattinen
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera eteen key.cam_forward = Kamera eteen
+2
View File
@@ -264,6 +264,8 @@ val.medium = Srednje
val.high = Visoko val.high = Visoko
val.normal = Normalno val.normal = Normalno
val.large = Veliko val.large = Veliko
val.small = Malo
val.auto_plain = Automatski
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera naprijed key.cam_forward = Kamera naprijed
+2
View File
@@ -264,6 +264,8 @@ val.medium = Közepes
val.high = Magas val.high = Magas
val.normal = Normál val.normal = Normál
val.large = Nagy val.large = Nagy
val.small = Kicsi
val.auto_plain = Automatikus
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera előre key.cam_forward = Kamera előre
+2
View File
@@ -264,6 +264,8 @@ val.medium = Media
val.high = Alta val.high = Alta
val.normal = Normale val.normal = Normale
val.large = Grande val.large = Grande
val.small = Piccolo
val.auto_plain = Automatico
# ---- key binding names # ---- key binding names
key.cam_forward = Camera avanti key.cam_forward = Camera avanti
+2
View File
@@ -264,6 +264,8 @@ val.medium = Middel
val.high = Hoog val.high = Hoog
val.normal = Normaal val.normal = Normaal
val.large = Groot val.large = Groot
val.small = Klein
val.auto_plain = Automatisch
# ---- key binding names # ---- key binding names
key.cam_forward = Camera vooruit key.cam_forward = Camera vooruit
+2
View File
@@ -264,6 +264,8 @@ val.medium = Middels
val.high = Høy val.high = Høy
val.normal = Normal val.normal = Normal
val.large = Stor val.large = Stor
val.small = Liten
val.auto_plain = Automatisk
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera fram key.cam_forward = Kamera fram
+2
View File
@@ -264,6 +264,8 @@ val.medium = Médio
val.high = Alto val.high = Alto
val.normal = Normal val.normal = Normal
val.large = Grande val.large = Grande
val.small = Pequeno
val.auto_plain = Automático
# ---- key binding names # ---- key binding names
key.cam_forward = Câmara p/ frente key.cam_forward = Câmara p/ frente
+2
View File
@@ -264,6 +264,8 @@ val.medium = Mediu
val.high = Înalt val.high = Înalt
val.normal = Normal val.normal = Normal
val.large = Mare val.large = Mare
val.small = Mic
val.auto_plain = Automat
# ---- key binding names # ---- key binding names
key.cam_forward = Cameră înainte key.cam_forward = Cameră înainte
+2
View File
@@ -264,6 +264,8 @@ val.medium = Средне
val.high = Высоко val.high = Высоко
val.normal = Обычный val.normal = Обычный
val.large = Большой val.large = Большой
val.small = Маленький
val.auto_plain = Авто
# ---- key binding names # ---- key binding names
key.cam_forward = Камера вперёд key.cam_forward = Камера вперёд
+2
View File
@@ -264,6 +264,8 @@ val.medium = Stredná
val.high = Vysoká val.high = Vysoká
val.normal = Normálna val.normal = Normálna
val.large = Veľká val.large = Veľká
val.small = Malá
val.auto_plain = Automaticky
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera dopredu key.cam_forward = Kamera dopredu
+2
View File
@@ -264,6 +264,8 @@ val.medium = Средње
val.high = Високо val.high = Високо
val.normal = Нормално val.normal = Нормално
val.large = Велико val.large = Велико
val.small = Мало
val.auto_plain = Аутоматски
# ---- key binding names # ---- key binding names
key.cam_forward = Камера напред key.cam_forward = Камера напред
+2
View File
@@ -264,6 +264,8 @@ val.medium = Medel
val.high = Hög val.high = Hög
val.normal = Normal val.normal = Normal
val.large = Stor val.large = Stor
val.small = Liten
val.auto_plain = Automatisk
# ---- key binding names # ---- key binding names
key.cam_forward = Kamera framåt key.cam_forward = Kamera framåt
+6 -2
View File
@@ -976,8 +976,12 @@ async fn main() {
// 1080 device rows in landscape; a smaller screen draws in device pixels) // 1080 device rows in landscape; a smaller screen draws in device pixels)
let need: u32 = 900; let need: u32 = 900;
// measured on the shorter side: upright (portrait) the width gets those pixels and the // measured on the shorter side: upright (portrait) the width gets those pixels and the
// height grows with the screen, so the world and the menus keep their size // height grows with the screen, so the world and the menus keep their size. The setting
let short = rows * need.div_ceil(rows); // "interface size" picks the interface pixels per world pixel: large 2, medium 3, small 4
let short = match app.settings.ui_factor {
k @ 2..=4 => rows * k as u32,
_ => rows * need.div_ceil(rows),
};
let (w, h) = (screen_width().max(1.0), screen_height().max(1.0)); let (w, h) = (screen_width().max(1.0), screen_height().max(1.0));
let vrows = if h > w { (short as f32 * h / w).round() as u32 } else { short }; let vrows = if h > w { (short as f32 * h / w).round() as u32 } else { short };
ui::set_virtual_rows(vrows); ui::set_virtual_rows(vrows);
+7 -8
View File
@@ -141,13 +141,12 @@ fn item_value(it: Item, s: &Settings) -> String {
_ => "val.medium", _ => "val.medium",
}), }),
Item::Lights => s.max_lights.to_string(), Item::Lights => s.max_lights.to_string(),
Item::UiScale => { Item::UiScale => tr(match s.ui_factor {
if s.ui_factor == 0 { 2 => "val.large",
trf("val.auto", &[crate::ui::F().to_string()]) 3 => "val.medium",
} else { 4 => "val.small",
format!("{}x", s.ui_factor) _ => "val.auto_plain",
} }),
}
Item::DebugFps => onoff(s.debug_fps), Item::DebugFps => onoff(s.debug_fps),
Item::DebugFrameTime => onoff(s.debug_frame_time), Item::DebugFrameTime => onoff(s.debug_frame_time),
Item::DebugPing => onoff(s.debug_ping), Item::DebugPing => onoff(s.debug_ping),
@@ -202,7 +201,7 @@ fn item_change(it: Item, s: &mut Settings, d: i32) {
Item::Outlines => s.outlines = !s.outlines, Item::Outlines => s.outlines = !s.outlines,
Item::WallDetail => s.wall_detail = cycle(&[1u8, 2, 3], s.wall_detail, d), Item::WallDetail => s.wall_detail = cycle(&[1u8, 2, 3], s.wall_detail, d),
Item::Lights => s.max_lights = cycle(&[8u8, 16, 24], s.max_lights, d), Item::Lights => s.max_lights = cycle(&[8u8, 16, 24], s.max_lights, d),
Item::UiScale => s.ui_factor = cycle(&[0u8, 1, 2, 3, 4], s.ui_factor, d), Item::UiScale => s.ui_factor = cycle(&[0u8, 2, 3, 4], if [0, 2, 3, 4].contains(&s.ui_factor) { s.ui_factor } else { 0 }, d),
Item::RenderScale => s.pixel_rows = cycle(&[270u16, 360, 480], if [270, 360, 480].contains(&s.pixel_rows) { s.pixel_rows } else { 360 }, d), Item::RenderScale => s.pixel_rows = cycle(&[270u16, 360, 480], if [270, 360, 480].contains(&s.pixel_rows) { s.pixel_rows } else { 360 }, d),
Item::DebugFps => s.debug_fps = !s.debug_fps, Item::DebugFps => s.debug_fps = !s.debug_fps,
Item::DebugFrameTime => s.debug_frame_time = !s.debug_frame_time, Item::DebugFrameTime => s.debug_frame_time = !s.debug_frame_time,
+1 -1
View File
@@ -148,7 +148,7 @@ pub struct Settings {
pub outlines: bool, pub outlines: bool,
pub wall_detail: u8, // 1 low, 2 medium, 3 high pub wall_detail: u8, // 1 low, 2 medium, 3 high
pub max_lights: u8, // 8, 16 or 24 pub max_lights: u8, // 8, 16 or 24
pub ui_factor: u8, // interface size: 0 = automatic, 1..4 = fixed integer factor pub ui_factor: u8, // interface size: 0 = automatic, 2 large, 3 medium, 4 small (interface pixels per world pixel)
pub render_scale: u8, // old pixel-look divisor (no longer used, kept for old settings files) pub render_scale: u8, // old pixel-look divisor (no longer used, kept for old settings files)
pub pixel_rows: u16, // pixel look: rows of the world on every screen (270, 360, 480) pub pixel_rows: u16, // pixel look: rows of the world on every screen (270, 360, 480)
pub touch_ui: u8, // touch interface: 0 = automatic (after the first touch), 1 = on, 2 = off pub touch_ui: u8, // touch interface: 0 = automatic (after the first touch), 1 = on, 2 = off