x to farlook, now playable with 0 mouse input
This commit is contained in:
parent
81a48d5a6e
commit
7da00ed2b1
5 changed files with 82 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ use super::{
|
|||
gui::obfuscate_name_ecs,
|
||||
gui::renderable_colour_ecs,
|
||||
gui::item_colour_ecs,
|
||||
camera::get_screen_bounds,
|
||||
raws::Reaction,
|
||||
Attributes,
|
||||
BlocksTile,
|
||||
|
|
@ -672,6 +673,12 @@ pub fn player_input(gs: &mut State, ctx: &mut Rltk) -> RunState {
|
|||
VirtualKeyCode::Escape => {
|
||||
return RunState::SaveGame;
|
||||
}
|
||||
VirtualKeyCode::X => {
|
||||
let (min_x, _max_x, min_y, _max_y, x_offset, y_offset) = get_screen_bounds(&gs.ecs, ctx);
|
||||
let ppos = gs.ecs.fetch::<Point>();
|
||||
let (x, y) = (ppos.x + x_offset - min_x, ppos.y + y_offset - min_y);
|
||||
return RunState::Farlook { x, y };
|
||||
}
|
||||
_ => {
|
||||
return RunState::AwaitingInput;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue