mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
use mount key
This commit is contained in:
parent
2928eb8d15
commit
7eba16a2d7
@ -1539,7 +1539,7 @@ impl Client {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn stand_if_mounted(&mut self) {
|
||||
pub fn stand_if_mounted(&mut self) -> bool {
|
||||
let is_sitting = self
|
||||
.state
|
||||
.ecs()
|
||||
@ -1552,6 +1552,7 @@ impl Client {
|
||||
Some(false) => {},
|
||||
None => warn!("Can't stand, client entity doesn't have a `CharacterState`"),
|
||||
}
|
||||
is_sitting.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn toggle_dance(&mut self) {
|
||||
|
@ -2128,7 +2128,7 @@ impl Hud {
|
||||
overitem_properties,
|
||||
self.pulse,
|
||||
&global_state.window.key_layout,
|
||||
vec![(Some(GameInput::Interact), i18n.get_msg("hud-sit").to_string())],
|
||||
vec![(Some(GameInput::Mount), i18n.get_msg("hud-sit").to_string())],
|
||||
)
|
||||
.x_y(0.0, 100.0)
|
||||
.position_ingame(over_pos)
|
||||
|
@ -887,7 +887,17 @@ impl PlayState for SessionState {
|
||||
let mut client = self.client.borrow_mut();
|
||||
if client.is_riding() {
|
||||
client.unmount();
|
||||
} else {
|
||||
} else if client.stand_if_mounted() { } else {
|
||||
if let Some(interactable) = &self.interactable {
|
||||
match interactable {
|
||||
Interactable::Block(_, pos, interaction) => {
|
||||
if matches!(interaction, BlockInteraction::Mount(_)) {
|
||||
client.mount_sprite(*pos)
|
||||
}
|
||||
}
|
||||
Interactable::Entity(entity) => client.mount(*entity),
|
||||
}
|
||||
}
|
||||
let player_pos = client
|
||||
.state()
|
||||
.read_storage::<Pos>()
|
||||
@ -969,8 +979,6 @@ impl PlayState for SessionState {
|
||||
}
|
||||
},
|
||||
}
|
||||
} else {
|
||||
client.stand_if_mounted()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user