mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
spectate speedup key
This commit is contained in:
parent
0471e78f41
commit
bf44ebd12b
@ -63,4 +63,5 @@ gameinput-swimup = Swim upwards
|
||||
gameinput-mapzoomin = Increase map zoom
|
||||
gameinput-mapzoomout = Decrease map zoom
|
||||
gameinput-greet = Greet
|
||||
gameinput-map-locationmarkerbutton = Set a waypoint in the Map
|
||||
gameinput-map-locationmarkerbutton = Set a waypoint in the Map
|
||||
gameinput-spectatespeedboost = Spectate speed boost
|
@ -148,6 +148,8 @@ pub enum GameInput {
|
||||
MapZoomOut,
|
||||
#[strum(serialize = "gameinput.map.locationmarkerbutton")]
|
||||
MapSetMarker,
|
||||
#[strum(serialize = "gameinput.spectatespeedboost")]
|
||||
SpectateSpeedBoost,
|
||||
}
|
||||
|
||||
impl GameInput {
|
||||
|
@ -1046,6 +1046,7 @@ impl PlayState for SessionState {
|
||||
const FREEFLY_ACCEL: f32 = 120.0;
|
||||
const FREEFLY_DAMPING: f32 = 80.0;
|
||||
const FREEFLY_MAX_SPEED: f32 = 50.0;
|
||||
const FREEFLY_SPEED_BOOST: f32 = 5.0;
|
||||
|
||||
let forward = self.scene.camera().forward();
|
||||
let right = self.scene.camera().right();
|
||||
@ -1067,10 +1068,16 @@ impl PlayState for SessionState {
|
||||
}
|
||||
}
|
||||
|
||||
let boost = if self.inputs_state.contains(&GameInput::SpectateSpeedBoost) {
|
||||
FREEFLY_SPEED_BOOST
|
||||
} else {
|
||||
1.0
|
||||
};
|
||||
|
||||
let pos = self.scene.camera().get_focus_pos();
|
||||
self.scene
|
||||
.camera_mut()
|
||||
.set_focus_pos(pos + self.freefly_vel * dt);
|
||||
.set_focus_pos(pos + self.freefly_vel * dt * boost);
|
||||
|
||||
// Do not apply any movement to the player character
|
||||
self.inputs.move_dir = Vec2::zero();
|
||||
|
@ -189,6 +189,7 @@ impl ControlSettings {
|
||||
GameInput::MapZoomIn => KeyMouse::Key(VirtualKeyCode::Plus),
|
||||
GameInput::MapZoomOut => KeyMouse::Key(VirtualKeyCode::Minus),
|
||||
GameInput::MapSetMarker => KeyMouse::Mouse(MouseButton::Middle),
|
||||
GameInput::SpectateSpeedBoost => KeyMouse::Key(VirtualKeyCode::LControl),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user