mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
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:
commit
5ec99290f2
@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Removed
|
||||
|
||||
- Obsolete localization keys
|
||||
- Help Window option in interface settings
|
||||
|
||||
### Fixed
|
||||
|
||||
|
@ -13,7 +13,7 @@ gameinput-slot9 = Hotbar Slot 9
|
||||
gameinput-slot10 = Hotbar Slot 10
|
||||
gameinput-swaploadout = Swap Loadout
|
||||
gameinput-togglecursor = Toggle Cursor
|
||||
gameinput-help = Toggle Help Window
|
||||
gameinput-controls = Controls
|
||||
gameinput-toggleinterface = Toggle Interface
|
||||
gameinput-toggledebug = Toggle FPS and Debug Info
|
||||
gameinput-toggle_egui_debug = Toggle EGUI Debug Info
|
||||
|
@ -4,7 +4,6 @@ hud-settings-press_behavior-toggle = Toggle
|
||||
hud-settings-press_behavior-hold = Hold
|
||||
hud-settings-autopress_behavior-toggle = Toggle
|
||||
hud-settings-autopress_behavior-auto = Auto
|
||||
hud-settings-help_window = Help Window
|
||||
hud-settings-debug_info = Debug Info
|
||||
hud-settings-show_hitboxes = Show hitboxes
|
||||
hud-settings-show_chat = Show chat
|
||||
|
@ -178,9 +178,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings {
|
||||
map.entry(settings.game_buttons.settings)
|
||||
.or_default()
|
||||
.push(GameInput::Settings);
|
||||
map.entry(settings.game_buttons.help)
|
||||
map.entry(settings.game_buttons.controls)
|
||||
.or_default()
|
||||
.push(GameInput::Help);
|
||||
.push(GameInput::Controls);
|
||||
map.entry(settings.game_buttons.toggle_interface)
|
||||
.or_default()
|
||||
.push(GameInput::ToggleInterface);
|
||||
@ -413,9 +413,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings {
|
||||
map.entry(settings.game_layer_buttons.settings)
|
||||
.or_default()
|
||||
.push(GameInput::Settings);
|
||||
map.entry(settings.game_layer_buttons.help)
|
||||
map.entry(settings.game_layer_buttons.controls)
|
||||
.or_default()
|
||||
.push(GameInput::Help);
|
||||
.push(GameInput::Controls);
|
||||
map.entry(settings.game_layer_buttons.toggle_interface)
|
||||
.or_default()
|
||||
.push(GameInput::ToggleInterface);
|
||||
|
@ -103,10 +103,10 @@ pub enum GameInput {
|
||||
Spellbook,
|
||||
#[strum(serialize = "gameinput-settings")]
|
||||
Settings,
|
||||
#[strum(serialize = "gameinput-controls")]
|
||||
Controls,
|
||||
#[strum(serialize = "gameinput-toggleinterface")]
|
||||
ToggleInterface,
|
||||
#[strum(serialize = "gameinput-help")]
|
||||
Help,
|
||||
#[strum(serialize = "gameinput-toggledebug")]
|
||||
ToggleDebug,
|
||||
#[cfg(feature = "egui-ui")]
|
||||
|
@ -890,7 +890,6 @@ impl TradeAmountInput {
|
||||
pub struct Show {
|
||||
ui: bool,
|
||||
intro: bool,
|
||||
help: bool,
|
||||
crafting: bool,
|
||||
bag: bool,
|
||||
bag_inv: bool,
|
||||
@ -1075,7 +1074,6 @@ impl Show {
|
||||
}
|
||||
|
||||
// TODO: Add self updating key-bindings element
|
||||
//fn toggle_help(&mut self) { self.help = !self.help }
|
||||
|
||||
fn any_window_requires_cursor(&self) -> bool {
|
||||
self.bag
|
||||
@ -1085,7 +1083,6 @@ impl Show {
|
||||
|| self.social
|
||||
|| self.crafting
|
||||
|| self.diary
|
||||
|| self.help
|
||||
|| self.intro
|
||||
|| self.quest
|
||||
|| !matches!(self.open_windows, Windows::None)
|
||||
@ -1096,7 +1093,6 @@ impl Show {
|
||||
self.bag = false;
|
||||
self.trade = false;
|
||||
self.esc_menu = false;
|
||||
self.help = false;
|
||||
self.intro = false;
|
||||
self.map = false;
|
||||
self.social = false;
|
||||
@ -1382,7 +1378,6 @@ impl Hud {
|
||||
//intro: false,
|
||||
//intro_2: false,
|
||||
show: Show {
|
||||
help: false,
|
||||
intro: false,
|
||||
bag: false,
|
||||
bag_inv: false,
|
||||
@ -1599,30 +1594,28 @@ impl Hud {
|
||||
5.0 * dt.as_secs_f32(),
|
||||
);
|
||||
|
||||
if !self.show.help {
|
||||
Image::new(
|
||||
// TODO: Do we want to match on this every frame?
|
||||
match global_state.settings.interface.crosshair_type {
|
||||
CrosshairType::Round => self.imgs.crosshair_outer_round,
|
||||
CrosshairType::RoundEdges => self.imgs.crosshair_outer_round_edges,
|
||||
CrosshairType::Edges => self.imgs.crosshair_outer_edges,
|
||||
},
|
||||
)
|
||||
.w_h(21.0 * 1.5, 21.0 * 1.5)
|
||||
.middle_of(ui_widgets.window)
|
||||
.color(Some(Color::Rgba(
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
self.crosshair_opacity * global_state.settings.interface.crosshair_opacity,
|
||||
)))
|
||||
.set(self.ids.crosshair_outer, ui_widgets);
|
||||
Image::new(self.imgs.crosshair_inner)
|
||||
.w_h(21.0 * 2.0, 21.0 * 2.0)
|
||||
.middle_of(self.ids.crosshair_outer)
|
||||
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.6)))
|
||||
.set(self.ids.crosshair_inner, ui_widgets);
|
||||
}
|
||||
Image::new(
|
||||
// TODO: Do we want to match on this every frame?
|
||||
match global_state.settings.interface.crosshair_type {
|
||||
CrosshairType::Round => self.imgs.crosshair_outer_round,
|
||||
CrosshairType::RoundEdges => self.imgs.crosshair_outer_round_edges,
|
||||
CrosshairType::Edges => self.imgs.crosshair_outer_edges,
|
||||
},
|
||||
)
|
||||
.w_h(21.0 * 1.5, 21.0 * 1.5)
|
||||
.middle_of(ui_widgets.window)
|
||||
.color(Some(Color::Rgba(
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
self.crosshair_opacity * global_state.settings.interface.crosshair_opacity,
|
||||
)))
|
||||
.set(self.ids.crosshair_outer, ui_widgets);
|
||||
Image::new(self.imgs.crosshair_inner)
|
||||
.w_h(21.0 * 2.0, 21.0 * 2.0)
|
||||
.middle_of(self.ids.crosshair_outer)
|
||||
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.6)))
|
||||
.set(self.ids.crosshair_inner, ui_widgets);
|
||||
}
|
||||
|
||||
// Max amount the sct font size increases when "flashing"
|
||||
@ -2996,8 +2989,12 @@ impl Hud {
|
||||
}
|
||||
|
||||
if global_state.settings.interface.toggle_hotkey_hints {
|
||||
// Help Window
|
||||
if let Some(help_key) = global_state.settings.controls.get_binding(GameInput::Help) {
|
||||
// Controls, Keybindings
|
||||
if let Some(help_key) = global_state
|
||||
.settings
|
||||
.controls
|
||||
.get_binding(GameInput::Controls)
|
||||
{
|
||||
Text::new(&i18n.get_msg_ctx(
|
||||
"hud-press_key_to_show_keybindings_fmt",
|
||||
&i18n::fluent_args! {
|
||||
@ -3616,18 +3613,6 @@ impl Hud {
|
||||
self.show.chat_tab_settings_index = tab;
|
||||
},
|
||||
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));
|
||||
},
|
||||
}
|
||||
@ -4803,7 +4788,7 @@ impl Hud {
|
||||
self.show.toggle_settings(global_state);
|
||||
true
|
||||
},
|
||||
GameInput::Help if state => {
|
||||
GameInput::Controls if state => {
|
||||
self.show.toggle_settings(global_state);
|
||||
self.show.settings_tab = SettingsTab::Controls;
|
||||
true
|
||||
|
@ -2,7 +2,7 @@ use super::{ScaleChange, RESET_BUTTONS_HEIGHT, RESET_BUTTONS_WIDTH};
|
||||
|
||||
use crate::{
|
||||
hud::{
|
||||
img_ids::Imgs, BarNumbers, BuffPosition, CrosshairType, ShortcutNumbers, Show, MENU_BG,
|
||||
img_ids::Imgs, BarNumbers, BuffPosition, CrosshairType, ShortcutNumbers, MENU_BG,
|
||||
TEXT_COLOR,
|
||||
},
|
||||
session::settings_change::{Interface as InterfaceChange, Interface::*},
|
||||
@ -23,8 +23,6 @@ widget_ids! {
|
||||
window_r,
|
||||
window_scrollbar,
|
||||
reset_interface_button,
|
||||
button_help,
|
||||
show_help_label,
|
||||
ui_scale_label,
|
||||
ui_scale_slider,
|
||||
ui_scale_value,
|
||||
@ -116,7 +114,6 @@ widget_ids! {
|
||||
#[derive(WidgetCommon)]
|
||||
pub struct Interface<'a> {
|
||||
global_state: &'a GlobalState,
|
||||
show: &'a Show,
|
||||
imgs: &'a Imgs,
|
||||
fonts: &'a Fonts,
|
||||
localized_strings: &'a Localization,
|
||||
@ -126,14 +123,12 @@ pub struct Interface<'a> {
|
||||
impl<'a> Interface<'a> {
|
||||
pub fn new(
|
||||
global_state: &'a GlobalState,
|
||||
show: &'a Show,
|
||||
imgs: &'a Imgs,
|
||||
fonts: &'a Fonts,
|
||||
localized_strings: &'a Localization,
|
||||
) -> Self {
|
||||
Self {
|
||||
global_state,
|
||||
show,
|
||||
imgs,
|
||||
fonts,
|
||||
localized_strings,
|
||||
@ -192,30 +187,6 @@ impl<'a> Widget for Interface<'a> {
|
||||
.color(TEXT_COLOR)
|
||||
.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
|
||||
let show_tips = ToggleButton::new(
|
||||
self.global_state.settings.interface.loading_tips,
|
||||
@ -223,7 +194,7 @@ impl<'a> Widget for Interface<'a> {
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
.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)
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.load_tips_button, ui);
|
||||
|
@ -256,14 +256,13 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
|
||||
// Content Area
|
||||
let global_state = self.global_state;
|
||||
let show = self.show;
|
||||
let imgs = self.imgs;
|
||||
let fonts = self.fonts;
|
||||
let localized_strings = self.localized_strings;
|
||||
match self.show.settings_tab {
|
||||
SettingsTab::Interface => {
|
||||
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)
|
||||
.wh_of(state.ids.settings_content_align)
|
||||
.set(state.ids.interface, ui)
|
||||
|
@ -115,7 +115,7 @@ impl Screen {
|
||||
};
|
||||
let keys = i18n::fluent_args! {
|
||||
"gameinput-togglelantern" => key(GameInput::ToggleLantern),
|
||||
"gameinput-help" => key(GameInput::Help),
|
||||
"gameinput-controls" => key(GameInput::Controls),
|
||||
"gameinput-settings" => key(GameInput::Settings),
|
||||
"gameinput-social" => key(GameInput::Social),
|
||||
"gameinput-dance" => key(GameInput::Dance),
|
||||
|
@ -118,7 +118,6 @@ pub enum Interface {
|
||||
SpeechBubbleSelf(bool),
|
||||
SpeechBubbleDarkMode(bool),
|
||||
SpeechBubbleIcon(bool),
|
||||
ToggleHelp(bool),
|
||||
ToggleDebug(bool),
|
||||
ToggleHitboxes(bool),
|
||||
ToggleChat(bool),
|
||||
@ -589,9 +588,6 @@ impl SettingsChange {
|
||||
Interface::SpeechBubbleIcon(sbi) => {
|
||||
settings.interface.speech_bubble_icon = sbi;
|
||||
},
|
||||
Interface::ToggleHelp(_) => {
|
||||
// implemented in hud
|
||||
},
|
||||
Interface::ToggleDebug(toggle_debug) => {
|
||||
settings.interface.toggle_debug = toggle_debug;
|
||||
},
|
||||
|
@ -156,7 +156,7 @@ impl ControlSettings {
|
||||
GameInput::Crafting => Some(KeyMouse::Key(VirtualKeyCode::C)),
|
||||
GameInput::Spellbook => Some(KeyMouse::Key(VirtualKeyCode::P)),
|
||||
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::ToggleDebug => Some(KeyMouse::Key(VirtualKeyCode::F3)),
|
||||
#[cfg(feature = "egui-ui")]
|
||||
|
@ -112,7 +112,7 @@ pub mod con_settings {
|
||||
pub crafting: LayerEntry,
|
||||
pub spellbook: LayerEntry,
|
||||
pub settings: LayerEntry,
|
||||
pub help: LayerEntry,
|
||||
pub controls: LayerEntry,
|
||||
pub toggle_interface: LayerEntry,
|
||||
pub toggle_debug: LayerEntry,
|
||||
#[cfg(feature = "egui-ui")]
|
||||
@ -259,7 +259,7 @@ pub mod con_settings {
|
||||
mod1: Button::Simple(GilButton::RightTrigger),
|
||||
mod2: Button::Simple(GilButton::Unknown),
|
||||
},
|
||||
help: LayerEntry {
|
||||
controls: LayerEntry {
|
||||
button: Button::Simple(GilButton::Start),
|
||||
mod1: Button::Simple(GilButton::LeftTrigger),
|
||||
mod2: Button::Simple(GilButton::Unknown),
|
||||
@ -329,7 +329,7 @@ pub mod con_settings {
|
||||
pub crafting: Button,
|
||||
pub spellbook: Button,
|
||||
pub settings: Button,
|
||||
pub help: Button,
|
||||
pub controls: Button,
|
||||
pub toggle_interface: Button,
|
||||
pub toggle_debug: Button,
|
||||
#[cfg(feature = "egui-ui")]
|
||||
@ -434,7 +434,7 @@ pub mod con_settings {
|
||||
crafting: Button::Simple(GilButton::Unknown),
|
||||
spellbook: 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_debug: Button::Simple(GilButton::Unknown),
|
||||
#[cfg(feature = "egui-ui")]
|
||||
|
Loading…
Reference in New Issue
Block a user