mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add keybinding for zooming the camera
This commit is contained in:
parent
02e67a0f4a
commit
5ef300c72c
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Hardwood in tropical forests, frostwood in cold forests, and iron wood on the top of giant trees
|
- Hardwood in tropical forests, frostwood in cold forests, and iron wood on the top of giant trees
|
||||||
- Recipe for shovel, which is used to dig in mud and graves
|
- Recipe for shovel, which is used to dig in mud and graves
|
||||||
- Recipe for a new leather pack
|
- Recipe for a new leather pack
|
||||||
|
- Keybinds for zooming the camera (Defaults: ']' for zooming in and '[' for zooming out)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -49,6 +49,8 @@ gameinput-togglewield = Toggle Wield
|
|||||||
gameinput-interact = Interact
|
gameinput-interact = Interact
|
||||||
gameinput-freelook = Free Look
|
gameinput-freelook = Free Look
|
||||||
gameinput-autowalk = Auto Walk/Swim
|
gameinput-autowalk = Auto Walk/Swim
|
||||||
|
gameinput-zoomin = Camera zoom in
|
||||||
|
gameinput-zoomout = Camera zoom out
|
||||||
gameinput-zoomlock = Camera zoom lock
|
gameinput-zoomlock = Camera zoom lock
|
||||||
gameinput-cameraclamp = Camera Clamp
|
gameinput-cameraclamp = Camera Clamp
|
||||||
gameinput-dance = Dance
|
gameinput-dance = Dance
|
||||||
|
@ -132,6 +132,10 @@ pub enum GameInput {
|
|||||||
FreeLook,
|
FreeLook,
|
||||||
#[strum(serialize = "gameinput-autowalk")]
|
#[strum(serialize = "gameinput-autowalk")]
|
||||||
AutoWalk,
|
AutoWalk,
|
||||||
|
#[strum(serialize = "gameinput-zoomin")]
|
||||||
|
ZoomIn,
|
||||||
|
#[strum(serialize = "gameinput-zoomout")]
|
||||||
|
ZoomOut,
|
||||||
#[strum(serialize = "gameinput-zoomlock")]
|
#[strum(serialize = "gameinput-zoomlock")]
|
||||||
ZoomLock,
|
ZoomLock,
|
||||||
#[strum(serialize = "gameinput-cameraclamp")]
|
#[strum(serialize = "gameinput-cameraclamp")]
|
||||||
|
@ -1067,6 +1067,30 @@ impl PlayState for SessionState {
|
|||||||
self.key_state.auto_walk =
|
self.key_state.auto_walk =
|
||||||
self.auto_walk && !self.client.borrow().is_gliding();
|
self.auto_walk && !self.client.borrow().is_gliding();
|
||||||
},
|
},
|
||||||
|
GameInput::ZoomIn => {
|
||||||
|
if state {
|
||||||
|
if self.zoom_lock {
|
||||||
|
self.hud.zoom_lock_reminder();
|
||||||
|
} else {
|
||||||
|
self.scene.handle_input_event(
|
||||||
|
Event::Zoom(-30.0),
|
||||||
|
&self.client.borrow(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
GameInput::ZoomOut => {
|
||||||
|
if state {
|
||||||
|
if self.zoom_lock {
|
||||||
|
self.hud.zoom_lock_reminder();
|
||||||
|
} else {
|
||||||
|
self.scene.handle_input_event(
|
||||||
|
Event::Zoom(30.0),
|
||||||
|
&self.client.borrow(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
GameInput::ZoomLock => {
|
GameInput::ZoomLock => {
|
||||||
if state {
|
if state {
|
||||||
global_state.settings.gameplay.zoom_lock ^= true;
|
global_state.settings.gameplay.zoom_lock ^= true;
|
||||||
|
@ -170,6 +170,8 @@ impl ControlSettings {
|
|||||||
GameInput::ToggleWield => Some(KeyMouse::Key(VirtualKeyCode::R)),
|
GameInput::ToggleWield => Some(KeyMouse::Key(VirtualKeyCode::R)),
|
||||||
GameInput::FreeLook => Some(KeyMouse::Key(VirtualKeyCode::L)),
|
GameInput::FreeLook => Some(KeyMouse::Key(VirtualKeyCode::L)),
|
||||||
GameInput::AutoWalk => Some(KeyMouse::Key(VirtualKeyCode::Period)),
|
GameInput::AutoWalk => Some(KeyMouse::Key(VirtualKeyCode::Period)),
|
||||||
|
GameInput::ZoomIn => Some(KeyMouse::Key(VirtualKeyCode::RBracket)),
|
||||||
|
GameInput::ZoomOut => Some(KeyMouse::Key(VirtualKeyCode::LBracket)),
|
||||||
GameInput::ZoomLock => None,
|
GameInput::ZoomLock => None,
|
||||||
GameInput::CameraClamp => Some(KeyMouse::Key(VirtualKeyCode::Apostrophe)),
|
GameInput::CameraClamp => Some(KeyMouse::Key(VirtualKeyCode::Apostrophe)),
|
||||||
GameInput::CycleCamera => Some(KeyMouse::Key(VirtualKeyCode::Key0)),
|
GameInput::CycleCamera => Some(KeyMouse::Key(VirtualKeyCode::Key0)),
|
||||||
|
Loading…
Reference in New Issue
Block a user