Add shortcut to toggle chat

This commit is contained in:
DanTheOne 2021-07-26 02:41:01 +02:00
parent db559176e9
commit 18b5c1c35a
7 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- AI for sceptre wielders and sceptre cultists in Tier 5 dungeons - AI for sceptre wielders and sceptre cultists in Tier 5 dungeons
- HUD debug info now displays current biome and site - HUD debug info now displays current biome and site
- Quotes and escape codes can be used in command arguments - Quotes and escape codes can be used in command arguments
- Toggle chat with a shortcut (default is F5)
### Changed ### Changed

View File

@ -21,6 +21,7 @@
"gameinput.help": "Toggle Help Window", "gameinput.help": "Toggle Help Window",
"gameinput.toggleinterface": "Toggle Interface", "gameinput.toggleinterface": "Toggle Interface",
"gameinput.toggledebug": "Toggle FPS and Debug Info", "gameinput.toggledebug": "Toggle FPS and Debug Info",
"gameinput.togglechat": "Toggle Chat",
"gameinput.screenshot": "Take Screenshot", "gameinput.screenshot": "Take Screenshot",
"gameinput.toggleingameui": "Toggle Nametags", "gameinput.toggleingameui": "Toggle Nametags",
"gameinput.fullscreen": "Toggle Fullscreen", "gameinput.fullscreen": "Toggle Fullscreen",

View File

@ -150,6 +150,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings {
map.entry(settings.game_buttons.toggle_debug) map.entry(settings.game_buttons.toggle_debug)
.or_default() .or_default()
.push(GameInput::ToggleDebug); .push(GameInput::ToggleDebug);
map.entry(settings.game_buttons.toggle_chat)
.or_default()
.push(GameInput::ToggleChat);
map.entry(settings.game_buttons.fullscreen) map.entry(settings.game_buttons.fullscreen)
.or_default() .or_default()
.push(GameInput::Fullscreen); .push(GameInput::Fullscreen);

View File

@ -106,6 +106,8 @@ pub enum GameInput {
Help, Help,
#[strum(serialize = "gameinput.toggledebug")] #[strum(serialize = "gameinput.toggledebug")]
ToggleDebug, ToggleDebug,
#[strum(serialize = "gameinput.togglechat")]
ToggleChat,
#[strum(serialize = "gameinput.fullscreen")] #[strum(serialize = "gameinput.fullscreen")]
Fullscreen, Fullscreen,
#[strum(serialize = "gameinput.screenshot")] #[strum(serialize = "gameinput.screenshot")]

View File

@ -3573,6 +3573,11 @@ impl Hud {
self.show.debug = global_state.settings.interface.toggle_debug; self.show.debug = global_state.settings.interface.toggle_debug;
true true
}, },
GameInput::ToggleChat if state => {
global_state.settings.interface.toggle_chat =
!global_state.settings.interface.toggle_chat;
true
},
GameInput::ToggleIngameUi if state => { GameInput::ToggleIngameUi if state => {
self.show.ingame = !self.show.ingame; self.show.ingame = !self.show.ingame;
true true

View File

@ -144,6 +144,7 @@ impl ControlSettings {
GameInput::Help => KeyMouse::Key(VirtualKeyCode::F1), GameInput::Help => KeyMouse::Key(VirtualKeyCode::F1),
GameInput::ToggleInterface => KeyMouse::Key(VirtualKeyCode::F2), GameInput::ToggleInterface => KeyMouse::Key(VirtualKeyCode::F2),
GameInput::ToggleDebug => KeyMouse::Key(VirtualKeyCode::F3), GameInput::ToggleDebug => KeyMouse::Key(VirtualKeyCode::F3),
GameInput::ToggleChat => KeyMouse::Key(VirtualKeyCode::F5),
GameInput::Fullscreen => KeyMouse::Key(VirtualKeyCode::F11), GameInput::Fullscreen => KeyMouse::Key(VirtualKeyCode::F11),
GameInput::Screenshot => KeyMouse::Key(VirtualKeyCode::F4), GameInput::Screenshot => KeyMouse::Key(VirtualKeyCode::F4),
GameInput::ToggleIngameUi => KeyMouse::Key(VirtualKeyCode::F6), GameInput::ToggleIngameUi => KeyMouse::Key(VirtualKeyCode::F6),

View File

@ -77,6 +77,7 @@ pub mod con_settings {
pub help: Button, pub help: Button,
pub toggle_interface: Button, pub toggle_interface: Button,
pub toggle_debug: Button, pub toggle_debug: Button,
pub toggle_chat: Button,
pub fullscreen: Button, pub fullscreen: Button,
pub screenshot: Button, pub screenshot: Button,
pub toggle_ingame_ui: Button, pub toggle_ingame_ui: Button,
@ -167,6 +168,7 @@ pub mod con_settings {
help: Button::Simple(GilButton::Unknown), help: 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),
toggle_chat: Button::Simple(GilButton::Unknown),
fullscreen: Button::Simple(GilButton::Unknown), fullscreen: Button::Simple(GilButton::Unknown),
screenshot: Button::Simple(GilButton::Unknown), screenshot: Button::Simple(GilButton::Unknown),
toggle_ingame_ui: Button::Simple(GilButton::Unknown), toggle_ingame_ui: Button::Simple(GilButton::Unknown),