fixes cheatmenu, reimpl particle ticker

This commit is contained in:
Llywelwyn 2023-09-24 23:56:29 +01:00
parent 0d4c0c9558
commit 7f9ba34afa
5 changed files with 27 additions and 57 deletions

View file

@ -46,7 +46,7 @@ pub fn show_cheat_menu(_gs: &mut State, ctx: &mut App) -> CheatMenuResult {
pub fn draw_cheat_menu(
draw: &mut notan::draw::Draw,
atlas: &HashMap<String, Texture>,
_atlas: &HashMap<String, Texture>,
font: &notan::draw::Font
) {
let offsets = crate::camera::get_offset();
@ -59,40 +59,7 @@ pub fn draw_cheat_menu(
m - MAGIC MAP REVEAL
g - GOD MODE"#;
draw.text(&font, DEBUG_MENU)
.position(1.0 + (offsets.x as f32) * TILESIZE, 1.0 + (offsets.y as f32) * TILESIZE)
.color(Color::RED);
/*let (x_offset, y_offset) = (1, 10);
ctx.print_color(
1 + x_offset,
1 + y_offset,
RGB::named(RED),
RGB::named(BLACK),
"DEBUG MENU! [aA-zZ][Esc.]"
);
let x = 1 + x_offset;
let mut y = 3 + y_offset;
let count = 5;
let width = 19;
ctx.draw_box(x, y, width, (count + 1) as i32, RGB::named(RED), RGB::named(BLACK));
y += 1;
// Asc
ctx.set(x_offset + 2, y, RGB::named(YELLOW), RGB::named(BLACK), to_cp437('a'));
ctx.print(x_offset + 4, y, "ASCEND A FLOOR");
y += 1;
// Desc
ctx.set(x_offset + 2, y, RGB::named(YELLOW), RGB::named(BLACK), to_cp437('d'));
ctx.print(x_offset + 4, y, "DESCEND A FLOOR");
y += 1;
// Heal
ctx.set(x_offset + 2, y, RGB::named(YELLOW), RGB::named(BLACK), to_cp437('h'));
ctx.print(x_offset + 4, y, "HEAL TO FULL");
y += 1;
// Reveal map
ctx.set(x_offset + 2, y, RGB::named(YELLOW), RGB::named(BLACK), to_cp437('m'));
ctx.print(x_offset + 4, y, "MAGIC MAP REVEAL");
y += 1;
// Godmode
ctx.set(x_offset + 2, y, RGB::named(YELLOW), RGB::named(BLACK), to_cp437('g'));
ctx.print(x_offset + 4, y, "GOD MODE");*/
.position(3.0 + (offsets.x as f32) * TILESIZE, 3.0 + (offsets.y as f32) * TILESIZE)
.color(Color::RED)
.size(TILESIZE);
}

View file

@ -1,6 +1,9 @@
use super::{ State, RunState, tooltip::draw_tooltips, camera::get_offset, VIEWPORT_H, VIEWPORT_W };
use bracket_lib::prelude::*;
use notan::prelude::*;
use notan::draw::{ Draw, DrawImages };
use std::collections::HashMap;
use crate::consts::TILESIZE;
#[derive(PartialEq, Copy, Clone)]
pub enum FarlookResult {
@ -57,3 +60,10 @@ pub fn show_farlook(gs: &mut State, ctx: &mut App) -> FarlookResult {
return FarlookResult::NoResponse { x: ppos.x + offsets.x, y: ppos.x + offsets.y };
}
}
pub fn draw_farlook(x: i32, y: i32, draw: &mut Draw, atlas: &HashMap<String, Texture>) {
draw.image(atlas.get("ui_select_c1").unwrap()).position(
(x as f32) * TILESIZE,
(y as f32) * TILESIZE
);
}