From 817b5b7e9f1bba475005b33822b76c8c95e5bba0 Mon Sep 17 00:00:00 2001 From: chexit Date: Sat, 5 Dec 2026 22:24:33 +0300 Subject: [PATCH] Use translucent Minecraft menu background and preserve opaque map ground --- airdef-mod/src/map.rs | 1 + airdef-mod/src/menu_ui.rs | 36 ++++++++++++++++++------------------ horizon | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/airdef-mod/src/map.rs b/airdef-mod/src/map.rs index 1e41ced..a92222e 100644 --- a/airdef-mod/src/map.rs +++ b/airdef-mod/src/map.rs @@ -1776,6 +1776,7 @@ impl AirDef { hover_card(&self.sim, ui, h, crate::player().map(|p| DVec3::new(p.x, p.y, p.z)), &mut panels, &mut hover_taken); } let mut s: Vec = Vec::with_capacity(2048); + s.push(fill(0.0, 0.0, w, h, 0xFF0C_100A)); let mut labs: Vec = Vec::new(); let mut taken: Vec<[f32; 4]> = ui.blocked.clone(); taken.extend(hover_taken); diff --git a/airdef-mod/src/menu_ui.rs b/airdef-mod/src/menu_ui.rs index f93f38b..8736b39 100644 --- a/airdef-mod/src/menu_ui.rs +++ b/airdef-mod/src/menu_ui.rs @@ -9,21 +9,20 @@ use crate::{ use horizon_mod_sdk::render::{self, CanvasEvent, FillShape, Point, Rect, Shape, TextShape}; use std::collections::HashMap; -const BG_BACKDROP: u32 = 0x8C06_0A0F; -const BG_WINDOW: u32 = 0xF210_1720; -const BG_HEADER: u32 = 0xFF0B_1118; -const BG_TABS: u32 = 0xFF0E_151E; -const BG_TAB_ACT: u32 = 0xFF17_2533; -const BG_TAB_HOV: u32 = 0xFF15_202B; -const BG_PANEL: u32 = 0xFF0C_131B; -const BG_ROW: u32 = 0xFF14_1E29; -const BG_ROW_HOV: u32 = 0xFF1C_2A39; -const BG_ROW_ACT: u32 = 0xFF19_2C38; -const BG_TRACK: u32 = 0xFF0A_1016; -const BG_THUMB: u32 = 0xFF3A_5266; +const BG_WINDOW: u32 = 0x780B_1017; +const BG_HEADER: u32 = 0x9609_0E14; +const BG_TABS: u32 = 0x8A0B_1119; +const BG_TAB_ACT: u32 = 0xB817_2533; +const BG_TAB_HOV: u32 = 0xA015_202B; +const BG_PANEL: u32 = 0x700A_1017; +const BG_ROW: u32 = 0x8814_1E29; +const BG_ROW_HOV: u32 = 0xB01C_2A39; +const BG_ROW_ACT: u32 = 0xBA19_2C38; +const BG_TRACK: u32 = 0x700A_1016; +const BG_THUMB: u32 = 0xCC3A_5266; -const BORDER_WIN: u32 = 0xFF2A_3B4C; -const BORDER_PANEL: u32 = 0xFF1E_2C3A; +const BORDER_WIN: u32 = 0xAA2A_3B4C; +const BORDER_PANEL: u32 = 0x991E_2C3A; const ACCENT: u32 = 0xFF6A_DCD2; const TEXT_BRIGHT: u32 = 0xFFEAF7FA; @@ -639,13 +638,11 @@ impl AirDef { pub(crate) fn menu_shapes(&mut self, page: Page) -> Vec { let mut s = Vec::new(); self.menu_ui.clear_hits(); - let (sw, sh) = self.menu_ui.size; let win = self.menu_ui.window_rect(); self.menu_ui.window_rect = win; let [wx, wy, ww, wh] = win; - // Dimmed backdrop + window shell. - s.push(fill(0.0, 0.0, sw, sh, BG_BACKDROP)); + // Translucent window shell over the engine's darkened world backdrop. s.push(fill(wx, wy, ww, wh, BG_WINDOW)); s.extend(frame(wx, wy, ww, wh, 1.0, BORDER_WIN)); @@ -1735,7 +1732,10 @@ mod tests { app.open_menu(Page::Main); assert_eq!(app.menu, Some(Page::Post)); let shapes = app.menu_shapes(app.menu.unwrap()); - assert!(!shapes.is_empty()); + let Some(Shape::Fill(first)) = shapes.first() else { + panic!("expected translucent window fill as first menu shape"); + }; + assert!((first.color >> 24) < 0xFF && first.rect.w < app.menu_ui.size.0); // Switch via category tab action -> Настройки. app.menu_act(MenuAct::Tab(Category::Settings)); diff --git a/horizon b/horizon index 2656f35..0437d90 160000 --- a/horizon +++ b/horizon @@ -1 +1 @@ -Subproject commit 2656f35af71be3472a88d3c7dcf505deb92cbd8d +Subproject commit 0437d907e0313e3b2a5e73d704f1d56c01e19771