mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
don't show red text when walking
This commit is contained in:
parent
2097a499c7
commit
b60ebd4131
@ -36,7 +36,6 @@ hud-diary = Diary
|
|||||||
hud-free_look_indicator = Free look active. Press { $key } to disable.
|
hud-free_look_indicator = Free look active. Press { $key } to disable.
|
||||||
hud-camera_clamp_indicator = Camera vertical clamp active. Press { $key } to disable.
|
hud-camera_clamp_indicator = Camera vertical clamp active. Press { $key } to disable.
|
||||||
hud-auto_walk_indicator = Auto walk/swim active
|
hud-auto_walk_indicator = Auto walk/swim active
|
||||||
hud-walking_speed_indicator = Walking speed active
|
|
||||||
hud-zoom_lock_indicator-remind = Zoom locked
|
hud-zoom_lock_indicator-remind = Zoom locked
|
||||||
hud-zoom_lock_indicator-enable = Camera zoom locked
|
hud-zoom_lock_indicator-enable = Camera zoom locked
|
||||||
hud-zoom_lock_indicator-disable = Camera zoom unlocked
|
hud-zoom_lock_indicator-disable = Camera zoom unlocked
|
||||||
|
@ -913,7 +913,6 @@ pub struct Show {
|
|||||||
stats: bool,
|
stats: bool,
|
||||||
free_look: bool,
|
free_look: bool,
|
||||||
auto_walk: bool,
|
auto_walk: bool,
|
||||||
walking_speed: bool,
|
|
||||||
zoom_lock: ChangeNotification,
|
zoom_lock: ChangeNotification,
|
||||||
camera_clamp: bool,
|
camera_clamp: bool,
|
||||||
prompt_dialog: Option<PromptDialogSettings>,
|
prompt_dialog: Option<PromptDialogSettings>,
|
||||||
@ -1421,7 +1420,6 @@ impl Hud {
|
|||||||
stats: false,
|
stats: false,
|
||||||
free_look: false,
|
free_look: false,
|
||||||
auto_walk: false,
|
auto_walk: false,
|
||||||
walking_speed: false,
|
|
||||||
zoom_lock: ChangeNotification::default(),
|
zoom_lock: ChangeNotification::default(),
|
||||||
camera_clamp: false,
|
camera_clamp: false,
|
||||||
prompt_dialog: None,
|
prompt_dialog: None,
|
||||||
@ -3822,23 +3820,6 @@ impl Hud {
|
|||||||
.set(self.ids.auto_walk_txt, ui_widgets);
|
.set(self.ids.auto_walk_txt, ui_widgets);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Walking speed indicator
|
|
||||||
if self.show.walking_speed {
|
|
||||||
Text::new(&i18n.get_msg("hud-walking_speed_indicator"))
|
|
||||||
.color(TEXT_BG)
|
|
||||||
.mid_top_with_margin_on(ui_widgets.window, indicator_offset)
|
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
|
||||||
.font_size(self.fonts.cyri.scale(20))
|
|
||||||
.set(self.ids.walking_speed_bg, ui_widgets);
|
|
||||||
indicator_offset += 30.0;
|
|
||||||
Text::new(&i18n.get_msg("hud-walking_speed_indicator"))
|
|
||||||
.color(KILL_COLOR)
|
|
||||||
.top_left_with_margins_on(self.ids.walking_speed_bg, -1.0, -1.0)
|
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
|
||||||
.font_size(self.fonts.cyri.scale(20))
|
|
||||||
.set(self.ids.walking_speed_txt, ui_widgets);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Camera zoom lock
|
// Camera zoom lock
|
||||||
self.show.zoom_lock.update(dt);
|
self.show.zoom_lock.update(dt);
|
||||||
|
|
||||||
@ -4939,10 +4920,6 @@ impl Hud {
|
|||||||
|
|
||||||
pub fn auto_walk(&mut self, auto_walk: bool) { self.show.auto_walk = auto_walk; }
|
pub fn auto_walk(&mut self, auto_walk: bool) { self.show.auto_walk = auto_walk; }
|
||||||
|
|
||||||
pub fn walking_speed(&mut self, walking_speed: bool) {
|
|
||||||
self.show.walking_speed = walking_speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn camera_clamp(&mut self, camera_clamp: bool) { self.show.camera_clamp = camera_clamp; }
|
pub fn camera_clamp(&mut self, camera_clamp: bool) { self.show.camera_clamp = camera_clamp; }
|
||||||
|
|
||||||
/// Remind the player camera zoom is currently locked, for example if they
|
/// Remind the player camera zoom is currently locked, for example if they
|
||||||
|
@ -686,8 +686,6 @@ impl PlayState for SessionState {
|
|||||||
// Throw out distance info, it will be useful in the future
|
// Throw out distance info, it will be useful in the future
|
||||||
self.target_entity = entity_target.map(|t| t.kind.0);
|
self.target_entity = entity_target.map(|t| t.kind.0);
|
||||||
|
|
||||||
let mut stop_walk = false;
|
|
||||||
|
|
||||||
// Handle window events.
|
// Handle window events.
|
||||||
for event in events {
|
for event in events {
|
||||||
// Pass all events to the ui first.
|
// Pass all events to the ui first.
|
||||||
@ -714,7 +712,7 @@ impl PlayState for SessionState {
|
|||||||
}
|
}
|
||||||
match input {
|
match input {
|
||||||
GameInput::Primary => {
|
GameInput::Primary => {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
let mut client = self.client.borrow_mut();
|
let mut client = self.client.borrow_mut();
|
||||||
// Mine and build targets can be the same block. make building
|
// Mine and build targets can be the same block. make building
|
||||||
// take precedence.
|
// take precedence.
|
||||||
@ -733,7 +731,7 @@ impl PlayState for SessionState {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
GameInput::Secondary => {
|
GameInput::Secondary => {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
let mut client = self.client.borrow_mut();
|
let mut client = self.client.borrow_mut();
|
||||||
if let Some(build_target) = build_target.filter(|bt| {
|
if let Some(build_target) = build_target.filter(|bt| {
|
||||||
state && can_build && nearest_block_dist == Some(bt.distance)
|
state && can_build && nearest_block_dist == Some(bt.distance)
|
||||||
@ -753,7 +751,7 @@ impl PlayState for SessionState {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
GameInput::Block => {
|
GameInput::Block => {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
self.client.borrow_mut().handle_input(
|
self.client.borrow_mut().handle_input(
|
||||||
InputKind::Block,
|
InputKind::Block,
|
||||||
state,
|
state,
|
||||||
@ -762,7 +760,7 @@ impl PlayState for SessionState {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
GameInput::Roll => {
|
GameInput::Roll => {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
let mut client = self.client.borrow_mut();
|
let mut client = self.client.borrow_mut();
|
||||||
if can_build {
|
if can_build {
|
||||||
if state {
|
if state {
|
||||||
@ -787,14 +785,14 @@ impl PlayState for SessionState {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
GameInput::Respawn => {
|
GameInput::Respawn => {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
self.stop_auto_walk();
|
self.stop_auto_walk();
|
||||||
if state {
|
if state {
|
||||||
self.client.borrow_mut().respawn();
|
self.client.borrow_mut().respawn();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
GameInput::Jump => {
|
GameInput::Jump => {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
self.client.borrow_mut().handle_input(
|
self.client.borrow_mut().handle_input(
|
||||||
InputKind::Jump,
|
InputKind::Jump,
|
||||||
state,
|
state,
|
||||||
@ -857,7 +855,7 @@ impl PlayState for SessionState {
|
|||||||
self.key_state.right = state
|
self.key_state.right = state
|
||||||
},
|
},
|
||||||
GameInput::Glide => {
|
GameInput::Glide => {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
let is_trading = self.client.borrow().is_trading();
|
let is_trading = self.client.borrow().is_trading();
|
||||||
if state && !is_trading {
|
if state && !is_trading {
|
||||||
if global_state.settings.gameplay.stop_auto_walk_on_input {
|
if global_state.settings.gameplay.stop_auto_walk_on_input {
|
||||||
@ -890,7 +888,7 @@ impl PlayState for SessionState {
|
|||||||
if state {
|
if state {
|
||||||
let mut client = self.client.borrow_mut();
|
let mut client = self.client.borrow_mut();
|
||||||
if client.is_wielding().is_some_and(|b| !b) {
|
if client.is_wielding().is_some_and(|b| !b) {
|
||||||
stop_walk = true;
|
self.walking_speed = false;
|
||||||
}
|
}
|
||||||
client.toggle_wield();
|
client.toggle_wield();
|
||||||
}
|
}
|
||||||
@ -1230,20 +1228,11 @@ impl PlayState for SessionState {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
GameInput::ToggleWalk if state => {
|
GameInput::ToggleWalk if state => {
|
||||||
let hud = &mut self.hud;
|
|
||||||
global_state
|
global_state
|
||||||
.settings
|
.settings
|
||||||
.gameplay
|
.gameplay
|
||||||
.walking_speed_behavior
|
.walking_speed_behavior
|
||||||
.update(state, &mut self.walking_speed, |b| {
|
.update(state, &mut self.walking_speed, |_| {});
|
||||||
hud.walking_speed(b)
|
|
||||||
});
|
|
||||||
|
|
||||||
self.key_state.speed_mul = if self.walking_speed {
|
|
||||||
global_state.settings.gameplay.walking_speed
|
|
||||||
} else {
|
|
||||||
1.0
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
@ -1454,10 +1443,9 @@ impl PlayState for SessionState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if stop_walk && self.walking_speed {
|
if self.walking_speed {
|
||||||
self.walking_speed = false;
|
self.key_state.speed_mul = global_state.settings.gameplay.walking_speed;
|
||||||
self.hud.walking_speed(false);
|
} else {
|
||||||
|
|
||||||
self.key_state.speed_mul = 1.0;
|
self.key_state.speed_mul = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user