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
- HUD debug info now displays current biome and site
- Quotes and escape codes can be used in command arguments
- Toggle chat with a shortcut (default is F5)
### Changed

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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