Use translucent Minecraft menu background and preserve opaque map ground
build / mod (push) Successful in 30m37s
build / mod (push) Successful in 30m37s
This commit is contained in:
@@ -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<Shape> = Vec::with_capacity(2048);
|
||||
s.push(fill(0.0, 0.0, w, h, 0xFF0C_100A));
|
||||
let mut labs: Vec<Lab> = Vec::new();
|
||||
let mut taken: Vec<[f32; 4]> = ui.blocked.clone();
|
||||
taken.extend(hover_taken);
|
||||
|
||||
+18
-18
@@ -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<Shape> {
|
||||
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));
|
||||
|
||||
+1
-1
Submodule horizon updated: 2656f35af7...0437d907e0
Reference in New Issue
Block a user