refactor: the options screen's Opt enum lives in settings.rs
graphics_ui named options_ui::Opt for its rows, which made it depend on options_ui, one of the edges that keep the client lib in a single cycle. The enum (the option ids) moves to settings.rs; options_ui re-exports it and keeps its methods. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,7 @@ use crate::{
|
||||
graphics::{FarDetail, GraphicsApi, Overlay, Pacing, PresentMode, Preset},
|
||||
graphics_style::{Cost, STYLE},
|
||||
hud::{HudAtlas, HudBatch},
|
||||
options_ui::Opt,
|
||||
settings::Settings,
|
||||
settings::{Opt, Settings},
|
||||
text::Text,
|
||||
ui,
|
||||
};
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
//! OptionsList screens and drawn with the shared widgets.
|
||||
use std::time::Instant;
|
||||
|
||||
pub use crate::settings::Opt;
|
||||
|
||||
use crate::{
|
||||
gamepad::{self, GlyphStyle},
|
||||
hud::{HudAtlas, HudBatch, rgba},
|
||||
@@ -14,95 +16,6 @@ use crate::{
|
||||
ui,
|
||||
};
|
||||
|
||||
/// One option instance.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum Opt {
|
||||
Fov,
|
||||
RenderDistance,
|
||||
SimulationDistance,
|
||||
Sensitivity,
|
||||
WheelSensitivity,
|
||||
InvertY,
|
||||
DiscreteScroll,
|
||||
Volume(usize),
|
||||
GuiScale,
|
||||
ViewBobbing,
|
||||
Gamma,
|
||||
MaxFps,
|
||||
Vsync,
|
||||
Fullscreen,
|
||||
SmoothLighting,
|
||||
Clouds,
|
||||
CloudRange,
|
||||
Particles,
|
||||
EntityDistance,
|
||||
EntityShadows,
|
||||
BiomeBlend,
|
||||
Preset,
|
||||
Mipmaps,
|
||||
WeatherRadius,
|
||||
ChunkFade,
|
||||
Vignette,
|
||||
Autosave,
|
||||
CutoutLeaves,
|
||||
ImprovedTransparency,
|
||||
AttackIndicator,
|
||||
InactivityFps,
|
||||
ChunkBuilder,
|
||||
MenuBlur,
|
||||
ToggleCrouch,
|
||||
ToggleSprint,
|
||||
AutoJump,
|
||||
ChatVisibility,
|
||||
ChatColors,
|
||||
ChatLinks,
|
||||
ChatLinksPrompt,
|
||||
ChatOpacity,
|
||||
TextBackgroundOpacity,
|
||||
ChatScale,
|
||||
ChatWidth,
|
||||
ChatHeightFocused,
|
||||
ChatHeightUnfocused,
|
||||
ChatLineSpacing,
|
||||
AutoSuggestions,
|
||||
ReducedDebugInfo,
|
||||
HighContrast,
|
||||
ShowSubtitles,
|
||||
MusicFrequency,
|
||||
NotificationDisplayTime,
|
||||
Narrator,
|
||||
TextBackground,
|
||||
ChatDelay,
|
||||
DistortionEffects,
|
||||
FovEffects,
|
||||
DarknessPulsing,
|
||||
DamageTilt,
|
||||
GlintSpeed,
|
||||
GlintStrength,
|
||||
HideLightningFlashes,
|
||||
MonochromeLogo,
|
||||
PanoramaSpeed,
|
||||
HideSplashTexts,
|
||||
NarratorHotkey,
|
||||
RotateWithMinecarts,
|
||||
HighContrastBlockOutlines,
|
||||
ForceUnicode,
|
||||
JapaneseGlyphs,
|
||||
/// Horizon's controller settings (`horizon-controller.txt`).
|
||||
PadEnabled,
|
||||
PadVibration,
|
||||
PadAdaptiveTriggers,
|
||||
PadLightbar,
|
||||
PadLookSensitivity,
|
||||
PadInvertX,
|
||||
PadInvertY,
|
||||
PadToggleSneak,
|
||||
PadMoveDeadzone,
|
||||
PadLookDeadzone,
|
||||
PadGlyphs,
|
||||
PadMenuNav,
|
||||
PadKeyboard,
|
||||
}
|
||||
fn tr(key: &str) -> Text {
|
||||
Text::translate(key, &[])
|
||||
}
|
||||
|
||||
@@ -608,6 +608,96 @@ impl Settings {
|
||||
}
|
||||
}
|
||||
|
||||
/// One option instance.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum Opt {
|
||||
Fov,
|
||||
RenderDistance,
|
||||
SimulationDistance,
|
||||
Sensitivity,
|
||||
WheelSensitivity,
|
||||
InvertY,
|
||||
DiscreteScroll,
|
||||
Volume(usize),
|
||||
GuiScale,
|
||||
ViewBobbing,
|
||||
Gamma,
|
||||
MaxFps,
|
||||
Vsync,
|
||||
Fullscreen,
|
||||
SmoothLighting,
|
||||
Clouds,
|
||||
CloudRange,
|
||||
Particles,
|
||||
EntityDistance,
|
||||
EntityShadows,
|
||||
BiomeBlend,
|
||||
Preset,
|
||||
Mipmaps,
|
||||
WeatherRadius,
|
||||
ChunkFade,
|
||||
Vignette,
|
||||
Autosave,
|
||||
CutoutLeaves,
|
||||
ImprovedTransparency,
|
||||
AttackIndicator,
|
||||
InactivityFps,
|
||||
ChunkBuilder,
|
||||
MenuBlur,
|
||||
ToggleCrouch,
|
||||
ToggleSprint,
|
||||
AutoJump,
|
||||
ChatVisibility,
|
||||
ChatColors,
|
||||
ChatLinks,
|
||||
ChatLinksPrompt,
|
||||
ChatOpacity,
|
||||
TextBackgroundOpacity,
|
||||
ChatScale,
|
||||
ChatWidth,
|
||||
ChatHeightFocused,
|
||||
ChatHeightUnfocused,
|
||||
ChatLineSpacing,
|
||||
AutoSuggestions,
|
||||
ReducedDebugInfo,
|
||||
HighContrast,
|
||||
ShowSubtitles,
|
||||
MusicFrequency,
|
||||
NotificationDisplayTime,
|
||||
Narrator,
|
||||
TextBackground,
|
||||
ChatDelay,
|
||||
DistortionEffects,
|
||||
FovEffects,
|
||||
DarknessPulsing,
|
||||
DamageTilt,
|
||||
GlintSpeed,
|
||||
GlintStrength,
|
||||
HideLightningFlashes,
|
||||
MonochromeLogo,
|
||||
PanoramaSpeed,
|
||||
HideSplashTexts,
|
||||
NarratorHotkey,
|
||||
RotateWithMinecarts,
|
||||
HighContrastBlockOutlines,
|
||||
ForceUnicode,
|
||||
JapaneseGlyphs,
|
||||
/// Horizon's controller settings (`horizon-controller.txt`).
|
||||
PadEnabled,
|
||||
PadVibration,
|
||||
PadAdaptiveTriggers,
|
||||
PadLightbar,
|
||||
PadLookSensitivity,
|
||||
PadInvertX,
|
||||
PadInvertY,
|
||||
PadToggleSneak,
|
||||
PadMoveDeadzone,
|
||||
PadLookDeadzone,
|
||||
PadGlyphs,
|
||||
PadMenuNav,
|
||||
PadKeyboard,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user