Merge branch 'coffee-compiler/remove_help_window_setting' into 'master'

Remove help window option from interface settings

See merge request veloren/veloren!4548
This commit is contained in:
Marcel 2024-08-11 13:29:51 +00:00
commit 5ec99290f2
12 changed files with 46 additions and 95 deletions

View File

@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### Removed
- Obsolete localization keys - Obsolete localization keys
- Help Window option in interface settings
### Fixed ### Fixed

View File

@ -13,7 +13,7 @@ gameinput-slot9 = Hotbar Slot 9
gameinput-slot10 = Hotbar Slot 10 gameinput-slot10 = Hotbar Slot 10
gameinput-swaploadout = Swap Loadout gameinput-swaploadout = Swap Loadout
gameinput-togglecursor = Toggle Cursor gameinput-togglecursor = Toggle Cursor
gameinput-help = Toggle Help Window gameinput-controls = Controls
gameinput-toggleinterface = Toggle Interface gameinput-toggleinterface = Toggle Interface
gameinput-toggledebug = Toggle FPS and Debug Info gameinput-toggledebug = Toggle FPS and Debug Info
gameinput-toggle_egui_debug = Toggle EGUI Debug Info gameinput-toggle_egui_debug = Toggle EGUI Debug Info

View File

@ -4,7 +4,6 @@ hud-settings-press_behavior-toggle = Toggle
hud-settings-press_behavior-hold = Hold hud-settings-press_behavior-hold = Hold
hud-settings-autopress_behavior-toggle = Toggle hud-settings-autopress_behavior-toggle = Toggle
hud-settings-autopress_behavior-auto = Auto hud-settings-autopress_behavior-auto = Auto
hud-settings-help_window = Help Window
hud-settings-debug_info = Debug Info hud-settings-debug_info = Debug Info
hud-settings-show_hitboxes = Show hitboxes hud-settings-show_hitboxes = Show hitboxes
hud-settings-show_chat = Show chat hud-settings-show_chat = Show chat

View File

@ -178,9 +178,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings {
map.entry(settings.game_buttons.settings) map.entry(settings.game_buttons.settings)
.or_default() .or_default()
.push(GameInput::Settings); .push(GameInput::Settings);
map.entry(settings.game_buttons.help) map.entry(settings.game_buttons.controls)
.or_default() .or_default()
.push(GameInput::Help); .push(GameInput::Controls);
map.entry(settings.game_buttons.toggle_interface) map.entry(settings.game_buttons.toggle_interface)
.or_default() .or_default()
.push(GameInput::ToggleInterface); .push(GameInput::ToggleInterface);
@ -413,9 +413,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings {
map.entry(settings.game_layer_buttons.settings) map.entry(settings.game_layer_buttons.settings)
.or_default() .or_default()
.push(GameInput::Settings); .push(GameInput::Settings);
map.entry(settings.game_layer_buttons.help) map.entry(settings.game_layer_buttons.controls)
.or_default() .or_default()
.push(GameInput::Help); .push(GameInput::Controls);
map.entry(settings.game_layer_buttons.toggle_interface) map.entry(settings.game_layer_buttons.toggle_interface)
.or_default() .or_default()
.push(GameInput::ToggleInterface); .push(GameInput::ToggleInterface);

View File

@ -103,10 +103,10 @@ pub enum GameInput {
Spellbook, Spellbook,
#[strum(serialize = "gameinput-settings")] #[strum(serialize = "gameinput-settings")]
Settings, Settings,
#[strum(serialize = "gameinput-controls")]
Controls,
#[strum(serialize = "gameinput-toggleinterface")] #[strum(serialize = "gameinput-toggleinterface")]
ToggleInterface, ToggleInterface,
#[strum(serialize = "gameinput-help")]
Help,
#[strum(serialize = "gameinput-toggledebug")] #[strum(serialize = "gameinput-toggledebug")]
ToggleDebug, ToggleDebug,
#[cfg(feature = "egui-ui")] #[cfg(feature = "egui-ui")]

View File

@ -890,7 +890,6 @@ impl TradeAmountInput {
pub struct Show { pub struct Show {
ui: bool, ui: bool,
intro: bool, intro: bool,
help: bool,
crafting: bool, crafting: bool,
bag: bool, bag: bool,
bag_inv: bool, bag_inv: bool,
@ -1075,7 +1074,6 @@ impl Show {
} }
// TODO: Add self updating key-bindings element // TODO: Add self updating key-bindings element
//fn toggle_help(&mut self) { self.help = !self.help }
fn any_window_requires_cursor(&self) -> bool { fn any_window_requires_cursor(&self) -> bool {
self.bag self.bag
@ -1085,7 +1083,6 @@ impl Show {
|| self.social || self.social
|| self.crafting || self.crafting
|| self.diary || self.diary
|| self.help
|| self.intro || self.intro
|| self.quest || self.quest
|| !matches!(self.open_windows, Windows::None) || !matches!(self.open_windows, Windows::None)
@ -1096,7 +1093,6 @@ impl Show {
self.bag = false; self.bag = false;
self.trade = false; self.trade = false;
self.esc_menu = false; self.esc_menu = false;
self.help = false;
self.intro = false; self.intro = false;
self.map = false; self.map = false;
self.social = false; self.social = false;
@ -1382,7 +1378,6 @@ impl Hud {
//intro: false, //intro: false,
//intro_2: false, //intro_2: false,
show: Show { show: Show {
help: false,
intro: false, intro: false,
bag: false, bag: false,
bag_inv: false, bag_inv: false,
@ -1599,30 +1594,28 @@ impl Hud {
5.0 * dt.as_secs_f32(), 5.0 * dt.as_secs_f32(),
); );
if !self.show.help { Image::new(
Image::new( // TODO: Do we want to match on this every frame?
// TODO: Do we want to match on this every frame? match global_state.settings.interface.crosshair_type {
match global_state.settings.interface.crosshair_type { CrosshairType::Round => self.imgs.crosshair_outer_round,
CrosshairType::Round => self.imgs.crosshair_outer_round, CrosshairType::RoundEdges => self.imgs.crosshair_outer_round_edges,
CrosshairType::RoundEdges => self.imgs.crosshair_outer_round_edges, CrosshairType::Edges => self.imgs.crosshair_outer_edges,
CrosshairType::Edges => self.imgs.crosshair_outer_edges, },
}, )
) .w_h(21.0 * 1.5, 21.0 * 1.5)
.w_h(21.0 * 1.5, 21.0 * 1.5) .middle_of(ui_widgets.window)
.middle_of(ui_widgets.window) .color(Some(Color::Rgba(
.color(Some(Color::Rgba( 1.0,
1.0, 1.0,
1.0, 1.0,
1.0, self.crosshair_opacity * global_state.settings.interface.crosshair_opacity,
self.crosshair_opacity * global_state.settings.interface.crosshair_opacity, )))
))) .set(self.ids.crosshair_outer, ui_widgets);
.set(self.ids.crosshair_outer, ui_widgets); Image::new(self.imgs.crosshair_inner)
Image::new(self.imgs.crosshair_inner) .w_h(21.0 * 2.0, 21.0 * 2.0)
.w_h(21.0 * 2.0, 21.0 * 2.0) .middle_of(self.ids.crosshair_outer)
.middle_of(self.ids.crosshair_outer) .color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.6)))
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.6))) .set(self.ids.crosshair_inner, ui_widgets);
.set(self.ids.crosshair_inner, ui_widgets);
}
} }
// Max amount the sct font size increases when "flashing" // Max amount the sct font size increases when "flashing"
@ -2996,8 +2989,12 @@ impl Hud {
} }
if global_state.settings.interface.toggle_hotkey_hints { if global_state.settings.interface.toggle_hotkey_hints {
// Help Window // Controls, Keybindings
if let Some(help_key) = global_state.settings.controls.get_binding(GameInput::Help) { if let Some(help_key) = global_state
.settings
.controls
.get_binding(GameInput::Controls)
{
Text::new(&i18n.get_msg_ctx( Text::new(&i18n.get_msg_ctx(
"hud-press_key_to_show_keybindings_fmt", "hud-press_key_to_show_keybindings_fmt",
&i18n::fluent_args! { &i18n::fluent_args! {
@ -3616,18 +3613,6 @@ impl Hud {
self.show.chat_tab_settings_index = tab; self.show.chat_tab_settings_index = tab;
}, },
settings_window::Event::SettingsChange(settings_change) => { settings_window::Event::SettingsChange(settings_change) => {
match &settings_change {
SettingsChange::Interface(interface_change) => match interface_change {
InterfaceChange::ToggleHelp(toggle_help) => {
self.show.help = *toggle_help;
},
InterfaceChange::ResetInterfaceSettings => {
self.show.help = false;
},
_ => {},
},
_ => {},
}
events.push(Event::SettingsChange(settings_change)); events.push(Event::SettingsChange(settings_change));
}, },
} }
@ -4803,7 +4788,7 @@ impl Hud {
self.show.toggle_settings(global_state); self.show.toggle_settings(global_state);
true true
}, },
GameInput::Help if state => { GameInput::Controls if state => {
self.show.toggle_settings(global_state); self.show.toggle_settings(global_state);
self.show.settings_tab = SettingsTab::Controls; self.show.settings_tab = SettingsTab::Controls;
true true

View File

@ -2,7 +2,7 @@ use super::{ScaleChange, RESET_BUTTONS_HEIGHT, RESET_BUTTONS_WIDTH};
use crate::{ use crate::{
hud::{ hud::{
img_ids::Imgs, BarNumbers, BuffPosition, CrosshairType, ShortcutNumbers, Show, MENU_BG, img_ids::Imgs, BarNumbers, BuffPosition, CrosshairType, ShortcutNumbers, MENU_BG,
TEXT_COLOR, TEXT_COLOR,
}, },
session::settings_change::{Interface as InterfaceChange, Interface::*}, session::settings_change::{Interface as InterfaceChange, Interface::*},
@ -23,8 +23,6 @@ widget_ids! {
window_r, window_r,
window_scrollbar, window_scrollbar,
reset_interface_button, reset_interface_button,
button_help,
show_help_label,
ui_scale_label, ui_scale_label,
ui_scale_slider, ui_scale_slider,
ui_scale_value, ui_scale_value,
@ -116,7 +114,6 @@ widget_ids! {
#[derive(WidgetCommon)] #[derive(WidgetCommon)]
pub struct Interface<'a> { pub struct Interface<'a> {
global_state: &'a GlobalState, global_state: &'a GlobalState,
show: &'a Show,
imgs: &'a Imgs, imgs: &'a Imgs,
fonts: &'a Fonts, fonts: &'a Fonts,
localized_strings: &'a Localization, localized_strings: &'a Localization,
@ -126,14 +123,12 @@ pub struct Interface<'a> {
impl<'a> Interface<'a> { impl<'a> Interface<'a> {
pub fn new( pub fn new(
global_state: &'a GlobalState, global_state: &'a GlobalState,
show: &'a Show,
imgs: &'a Imgs, imgs: &'a Imgs,
fonts: &'a Fonts, fonts: &'a Fonts,
localized_strings: &'a Localization, localized_strings: &'a Localization,
) -> Self { ) -> Self {
Self { Self {
global_state, global_state,
show,
imgs, imgs,
fonts, fonts,
localized_strings, localized_strings,
@ -192,30 +187,6 @@ impl<'a> Widget for Interface<'a> {
.color(TEXT_COLOR) .color(TEXT_COLOR)
.set(state.ids.general_txt, ui); .set(state.ids.general_txt, ui);
// Help
let show_help = ToggleButton::new(
self.show.help,
self.imgs.checkbox,
self.imgs.checkbox_checked,
)
.w_h(18.0, 18.0)
.down_from(state.ids.general_txt, 20.0)
.hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo)
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
.set(state.ids.button_help, ui);
if self.show.help != show_help {
events.push(ToggleHelp(show_help));
}
Text::new(&self.localized_strings.get_msg("hud-settings-help_window"))
.right_from(state.ids.button_help, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.button_help)
.color(TEXT_COLOR)
.set(state.ids.show_help_label, ui);
// Loading Screen Tips // Loading Screen Tips
let show_tips = ToggleButton::new( let show_tips = ToggleButton::new(
self.global_state.settings.interface.loading_tips, self.global_state.settings.interface.loading_tips,
@ -223,7 +194,7 @@ impl<'a> Widget for Interface<'a> {
self.imgs.checkbox_checked, self.imgs.checkbox_checked,
) )
.w_h(18.0, 18.0) .w_h(18.0, 18.0)
.down_from(state.ids.button_help, 8.0) .down_from(state.ids.general_txt, 20.0)
.hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo) .hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo)
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked) .press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
.set(state.ids.load_tips_button, ui); .set(state.ids.load_tips_button, ui);

View File

@ -256,14 +256,13 @@ impl<'a> Widget for SettingsWindow<'a> {
// Content Area // Content Area
let global_state = self.global_state; let global_state = self.global_state;
let show = self.show;
let imgs = self.imgs; let imgs = self.imgs;
let fonts = self.fonts; let fonts = self.fonts;
let localized_strings = self.localized_strings; let localized_strings = self.localized_strings;
match self.show.settings_tab { match self.show.settings_tab {
SettingsTab::Interface => { SettingsTab::Interface => {
for change in for change in
interface::Interface::new(global_state, show, imgs, fonts, localized_strings) interface::Interface::new(global_state, imgs, fonts, localized_strings)
.top_left_with_margins_on(state.ids.settings_content_align, 0.0, 0.0) .top_left_with_margins_on(state.ids.settings_content_align, 0.0, 0.0)
.wh_of(state.ids.settings_content_align) .wh_of(state.ids.settings_content_align)
.set(state.ids.interface, ui) .set(state.ids.interface, ui)

View File

@ -115,7 +115,7 @@ impl Screen {
}; };
let keys = i18n::fluent_args! { let keys = i18n::fluent_args! {
"gameinput-togglelantern" => key(GameInput::ToggleLantern), "gameinput-togglelantern" => key(GameInput::ToggleLantern),
"gameinput-help" => key(GameInput::Help), "gameinput-controls" => key(GameInput::Controls),
"gameinput-settings" => key(GameInput::Settings), "gameinput-settings" => key(GameInput::Settings),
"gameinput-social" => key(GameInput::Social), "gameinput-social" => key(GameInput::Social),
"gameinput-dance" => key(GameInput::Dance), "gameinput-dance" => key(GameInput::Dance),

View File

@ -118,7 +118,6 @@ pub enum Interface {
SpeechBubbleSelf(bool), SpeechBubbleSelf(bool),
SpeechBubbleDarkMode(bool), SpeechBubbleDarkMode(bool),
SpeechBubbleIcon(bool), SpeechBubbleIcon(bool),
ToggleHelp(bool),
ToggleDebug(bool), ToggleDebug(bool),
ToggleHitboxes(bool), ToggleHitboxes(bool),
ToggleChat(bool), ToggleChat(bool),
@ -589,9 +588,6 @@ impl SettingsChange {
Interface::SpeechBubbleIcon(sbi) => { Interface::SpeechBubbleIcon(sbi) => {
settings.interface.speech_bubble_icon = sbi; settings.interface.speech_bubble_icon = sbi;
}, },
Interface::ToggleHelp(_) => {
// implemented in hud
},
Interface::ToggleDebug(toggle_debug) => { Interface::ToggleDebug(toggle_debug) => {
settings.interface.toggle_debug = toggle_debug; settings.interface.toggle_debug = toggle_debug;
}, },

View File

@ -156,7 +156,7 @@ impl ControlSettings {
GameInput::Crafting => Some(KeyMouse::Key(VirtualKeyCode::C)), GameInput::Crafting => Some(KeyMouse::Key(VirtualKeyCode::C)),
GameInput::Spellbook => Some(KeyMouse::Key(VirtualKeyCode::P)), GameInput::Spellbook => Some(KeyMouse::Key(VirtualKeyCode::P)),
GameInput::Settings => Some(KeyMouse::Key(VirtualKeyCode::F10)), GameInput::Settings => Some(KeyMouse::Key(VirtualKeyCode::F10)),
GameInput::Help => Some(KeyMouse::Key(VirtualKeyCode::F1)), GameInput::Controls => Some(KeyMouse::Key(VirtualKeyCode::F1)),
GameInput::ToggleInterface => Some(KeyMouse::Key(VirtualKeyCode::F2)), GameInput::ToggleInterface => Some(KeyMouse::Key(VirtualKeyCode::F2)),
GameInput::ToggleDebug => Some(KeyMouse::Key(VirtualKeyCode::F3)), GameInput::ToggleDebug => Some(KeyMouse::Key(VirtualKeyCode::F3)),
#[cfg(feature = "egui-ui")] #[cfg(feature = "egui-ui")]

View File

@ -112,7 +112,7 @@ pub mod con_settings {
pub crafting: LayerEntry, pub crafting: LayerEntry,
pub spellbook: LayerEntry, pub spellbook: LayerEntry,
pub settings: LayerEntry, pub settings: LayerEntry,
pub help: LayerEntry, pub controls: LayerEntry,
pub toggle_interface: LayerEntry, pub toggle_interface: LayerEntry,
pub toggle_debug: LayerEntry, pub toggle_debug: LayerEntry,
#[cfg(feature = "egui-ui")] #[cfg(feature = "egui-ui")]
@ -259,7 +259,7 @@ pub mod con_settings {
mod1: Button::Simple(GilButton::RightTrigger), mod1: Button::Simple(GilButton::RightTrigger),
mod2: Button::Simple(GilButton::Unknown), mod2: Button::Simple(GilButton::Unknown),
}, },
help: LayerEntry { controls: LayerEntry {
button: Button::Simple(GilButton::Start), button: Button::Simple(GilButton::Start),
mod1: Button::Simple(GilButton::LeftTrigger), mod1: Button::Simple(GilButton::LeftTrigger),
mod2: Button::Simple(GilButton::Unknown), mod2: Button::Simple(GilButton::Unknown),
@ -329,7 +329,7 @@ pub mod con_settings {
pub crafting: Button, pub crafting: Button,
pub spellbook: Button, pub spellbook: Button,
pub settings: Button, pub settings: Button,
pub help: Button, pub controls: Button,
pub toggle_interface: Button, pub toggle_interface: Button,
pub toggle_debug: Button, pub toggle_debug: Button,
#[cfg(feature = "egui-ui")] #[cfg(feature = "egui-ui")]
@ -434,7 +434,7 @@ pub mod con_settings {
crafting: Button::Simple(GilButton::Unknown), crafting: Button::Simple(GilButton::Unknown),
spellbook: Button::Simple(GilButton::Unknown), spellbook: Button::Simple(GilButton::Unknown),
settings: Button::Simple(GilButton::Unknown), settings: Button::Simple(GilButton::Unknown),
help: Button::Simple(GilButton::Unknown), controls: Button::Simple(GilButton::Unknown),
toggle_interface: Button::Simple(GilButton::Unknown), toggle_interface: Button::Simple(GilButton::Unknown),
toggle_debug: Button::Simple(GilButton::Unknown), toggle_debug: Button::Simple(GilButton::Unknown),
#[cfg(feature = "egui-ui")] #[cfg(feature = "egui-ui")]