Expands cheat menu
This commit is contained in:
parent
0344f87da8
commit
71f5c2ac9f
10 changed files with 66 additions and 10 deletions
|
|
@ -7,6 +7,9 @@ pub enum CheatMenuResult {
|
|||
Cancel,
|
||||
Ascend,
|
||||
Descend,
|
||||
Heal,
|
||||
MagicMap,
|
||||
GodMode,
|
||||
}
|
||||
|
||||
pub fn show_cheat_menu(_gs: &mut State, ctx: &mut Rltk) -> CheatMenuResult {
|
||||
|
|
@ -20,8 +23,8 @@ pub fn show_cheat_menu(_gs: &mut State, ctx: &mut Rltk) -> CheatMenuResult {
|
|||
);
|
||||
let x = 1 + x_offset;
|
||||
let mut y = 3 + y_offset;
|
||||
let count = 2;
|
||||
let width = 18;
|
||||
let count = 5;
|
||||
let width = 19;
|
||||
|
||||
ctx.draw_box(x, y, width, (count + 1) as i32, RGB::named(rltk::RED), RGB::named(rltk::BLACK));
|
||||
y += 1;
|
||||
|
|
@ -32,12 +35,28 @@ pub fn show_cheat_menu(_gs: &mut State, ctx: &mut Rltk) -> CheatMenuResult {
|
|||
// Desc
|
||||
ctx.set(x_offset + 2, y, RGB::named(rltk::YELLOW), RGB::named(rltk::BLACK), rltk::to_cp437('d'));
|
||||
ctx.print(x_offset + 4, y, "DESCEND A FLOOR");
|
||||
y += 1;
|
||||
// Heal
|
||||
ctx.set(x_offset + 2, y, RGB::named(rltk::YELLOW), RGB::named(rltk::BLACK), rltk::to_cp437('h'));
|
||||
ctx.print(x_offset + 4, y, "HEAL TO FULL");
|
||||
y += 1;
|
||||
// Reveal map
|
||||
ctx.set(x_offset + 2, y, RGB::named(rltk::YELLOW), RGB::named(rltk::BLACK), rltk::to_cp437('m'));
|
||||
ctx.print(x_offset + 4, y, "MAGIC MAP REVEAL");
|
||||
y += 1;
|
||||
// Godmode
|
||||
ctx.set(x_offset + 2, y, RGB::named(rltk::YELLOW), RGB::named(rltk::BLACK), rltk::to_cp437('g'));
|
||||
ctx.print(x_offset + 4, y, "GOD MODE");
|
||||
y += 1;
|
||||
// Match keys
|
||||
match ctx.key {
|
||||
None => CheatMenuResult::NoResponse,
|
||||
Some(key) => match key {
|
||||
VirtualKeyCode::A => CheatMenuResult::Ascend,
|
||||
VirtualKeyCode::D => CheatMenuResult::Descend,
|
||||
VirtualKeyCode::H => CheatMenuResult::Heal,
|
||||
VirtualKeyCode::M => CheatMenuResult::MagicMap,
|
||||
VirtualKeyCode::G => CheatMenuResult::GodMode,
|
||||
VirtualKeyCode::Escape => CheatMenuResult::Cancel,
|
||||
_ => CheatMenuResult::NoResponse,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue