From 8fa5c3866328ea6ae2879a0b750f3726a9a4eeba Mon Sep 17 00:00:00 2001 From: Cosmic <84875247+Online5277@users.noreply.github.com> Date: Fri, 16 Oct 2026 21:42:01 -0400 Subject: [PATCH] Add an optional Fullbright extra --- crates/horizon-client/src/extras.rs | 18 ++++++++++++++++-- crates/horizon-client/src/game/options.rs | 1 + crates/horizon-client/src/gfx.rs | 6 ++++++ docs/extras.md | 7 ++++++- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/crates/horizon-client/src/extras.rs b/crates/horizon-client/src/extras.rs index 264456c1a..ee142486c 100644 --- a/crates/horizon-client/src/extras.rs +++ b/crates/horizon-client/src/extras.rs @@ -68,6 +68,7 @@ impl Corner { #[derive(Clone, Debug, PartialEq)] pub struct Extras { + pub fullbright: bool, pub zoom: bool, /// A vanilla key name (`key.keyboard.z`). pub zoom_key: String, @@ -108,6 +109,7 @@ pub struct Extras { impl Default for Extras { fn default() -> Self { Self { + fullbright: false, zoom: false, zoom_key: "key.keyboard.z".into(), zoom_level: 4, @@ -155,6 +157,7 @@ impl Extras { _ => d, }; match key.trim() { + "fullbright" => e.fullbright = flag(e.fullbright), "zoom" => e.zoom = flag(e.zoom), "zoomKey" if value.starts_with("key.") => e.zoom_key = value.to_owned(), "zoomLevel" => { @@ -198,7 +201,8 @@ impl Extras { } pub fn serialize(&self) -> String { format!( - "zoom:{}\nzoomKey:{}\nzoomLevel:{}\nzoomSmooth:{}\nzoomSensitivity:{}\nfps:{}\nfpsCorner:{}\nfpsLows:{}\nkeystrokes:{}\nkeystrokesCorner:{}\nkeystrokesCps:{}\nminimap:{}\nminimapCorner:{}\nminimapSize:{}\nminimapShape:{}\nminimapZoom:{}\nminimapRotate:{}\nautoReconnect:{}\nmouseTweaks:{}\nmouseTweaksWheel:{}\nsort:{}\nsortKey:{}\n", + "fullbright:{}\nzoom:{}\nzoomKey:{}\nzoomLevel:{}\nzoomSmooth:{}\nzoomSensitivity:{}\nfps:{}\nfpsCorner:{}\nfpsLows:{}\nkeystrokes:{}\nkeystrokesCorner:{}\nkeystrokesCps:{}\nminimap:{}\nminimapCorner:{}\nminimapSize:{}\nminimapShape:{}\nminimapZoom:{}\nminimapRotate:{}\nautoReconnect:{}\nmouseTweaks:{}\nmouseTweaksWheel:{}\nsort:{}\nsortKey:{}\n", + bool_text(self.fullbright), bool_text(self.zoom), self.zoom_key, self.zoom_level, @@ -418,6 +422,7 @@ impl Cps { /// The settings the Extras page shows, one per row. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Item { + Fullbright, Zoom, ZoomKey, ZoomLevel, @@ -445,6 +450,8 @@ pub enum Item { pub fn rows() -> Vec> { use Item::*; vec![ + Err("Lighting"), + Ok(Fullbright), Err("Zoom"), Ok(Zoom), Ok(ZoomKey), @@ -493,6 +500,7 @@ fn next(all: &[T], current: T, back: bool) -> T { impl Item { pub fn caption(self) -> &'static str { match self { + Item::Fullbright => "Fullbright", Item::Zoom => "Zoom", Item::ZoomKey => "Zoom key", Item::ZoomLevel => "Starting zoom", @@ -518,6 +526,7 @@ impl Item { /// What the row says under its caption. pub fn description(self) -> &'static str { match self { + Item::Fullbright => "Show blocks and entities at full light, even in dark areas.", Item::Zoom => "Hold the zoom key to zoom; the wheel changes it while held.", Item::ZoomKey => "Click, then press a key. Escape unbinds it.", Item::ZoomLevel => "The zoom the key starts at.", @@ -556,7 +565,7 @@ impl Item { pub fn cost(self) -> Option { use crate::graphics_style::Cost; match self { - Item::Zoom | Item::Fps | Item::Keystrokes => Some(Cost::None), + Item::Fullbright | Item::Zoom | Item::Fps | Item::Keystrokes => Some(Cost::None), Item::Minimap => Some(Cost::Low), Item::AutoReconnect | Item::MouseTweaks | Item::Sort => Some(Cost::None), _ => None, @@ -565,6 +574,7 @@ impl Item { /// On/off items and their value. pub fn switch(self, e: &Extras) -> Option { Some(match self { + Item::Fullbright => e.fullbright, Item::Zoom => e.zoom, Item::ZoomSmooth => e.zoom_smooth, Item::ZoomSensitivity => e.zoom_sensitivity, @@ -606,6 +616,7 @@ impl Item { /// A click (`back` for the right button). The zoom key binds instead. pub fn cycle(self, e: &mut Extras, back: bool) { match self { + Item::Fullbright => e.fullbright = !e.fullbright, Item::Zoom => e.zoom = !e.zoom, Item::ZoomSmooth => e.zoom_smooth = !e.zoom_smooth, Item::ZoomSensitivity => e.zoom_sensitivity = !e.zoom_sensitivity, @@ -651,11 +662,14 @@ mod tests { #[test] fn everything_is_off_by_default_and_round_trips() { let d = Extras::default(); + assert!(!d.fullbright); assert!(!d.zoom && !d.fps && !d.keystrokes && !d.minimap && !d.auto_reconnect); assert!(!d.mouse_tweaks && !d.sort); assert_eq!(Extras::parse(""), d); assert_eq!(Extras::parse(&d.serialize()), d); let mut e = d.clone(); + Item::Fullbright.cycle(&mut e, false); + assert_eq!(Item::Fullbright.switch(&e), Some(true)); e.zoom = true; e.zoom_key = "key.keyboard.c".into(); e.zoom_level = 6; diff --git a/crates/horizon-client/src/game/options.rs b/crates/horizon-client/src/game/options.rs index dcc7bb23b..86a2f789e 100644 --- a/crates/horizon-client/src/game/options.rs +++ b/crates/horizon-client/src/game/options.rs @@ -244,6 +244,7 @@ impl Game<'_> { let s = &self.settings; if let Some(r) = self.renderer.as_mut() { r.gamma = s.gamma; + r.fullbright = s.extras.fullbright; r.set_present_mode(s.vsync, s.horizon.present_mode); r.animated_textures = s.horizon.animated_textures; r.set_mipmap_levels(s.mipmap_levels.max(0) as u32); diff --git a/crates/horizon-client/src/gfx.rs b/crates/horizon-client/src/gfx.rs index 4401ea22d..26f596185 100644 --- a/crates/horizon-client/src/gfx.rs +++ b/crates/horizon-client/src/gfx.rs @@ -348,6 +348,8 @@ pub struct Renderer { pub screenshot_result: Option>, /// Brightness option (lightmap gamma), 0..1. pub gamma: f32, + /// Optional full-light lightmap (Horizon Extras). + pub fullbright: bool, /// Advance animated block textures (Horizon setting; vanilla always does). pub animated_textures: bool, present_modes: Vec, @@ -1616,6 +1618,7 @@ impl Renderer { screenshot: None, screenshot_result: None, gamma: 0.5, + fullbright: false, animated_textures: true, present_modes, }) @@ -1972,6 +1975,9 @@ impl Renderer { pixels[i + 3] = 255; } } + if self.fullbright { + pixels.fill(255); + } // The lightmap changes with the time of day, flicker and effects, // not every frame: upload only what differs from the texture. if pixels == self.lightmap_pixels && self.lightmap_uploaded { diff --git a/docs/extras.md b/docs/extras.md index 4129a88eb..3c952d5ac 100644 --- a/docs/extras.md +++ b/docs/extras.md @@ -1,6 +1,6 @@ # Horizon extras -Optional conveniences built into the client: zoom, a minimap, an FPS counter, a +Optional conveniences built into the client: fullbright, zoom, a minimap, an FPS counter, a keystroke overlay, auto-reconnect, Mouse Tweaks-style inventory controls and inventory sorting. **Every one is off by default**: a fresh install looks and behaves exactly like vanilla 26.3, and turning an extra off @@ -36,6 +36,11 @@ Horizon category in Controls, and adding one would put a non-vanilla mapping int ## The extras +### Fullbright (`fullbright`, default off) +- Displays blocks and entities with a fully bright lightmap, including in dark caves. +- Turning it off restores the normal lightmap using the current brightness, + time of day and effects. The brightness slider keeps its normal range. + ### Zoom (`zoom`, default off) - Hold the zoom key (default **Z**, unused by every vanilla 26.3 key mapping; C is `key.saveToolbarActivator`) to zoom. The key does nothing while zoom is off.