precursor to cleaning up/modularising inventory display, instead of needing to iterate through every item held to find unique copies, we can just check if the button pressed corresponds to any entity's Key {} index
17 lines
482 B
Rust
17 lines
482 B
Rust
use notan::prelude::*;
|
|
use notan::draw::{ Draw, Font };
|
|
use specs::prelude::*;
|
|
use super::TILESIZE;
|
|
use crate::Fonts;
|
|
|
|
pub fn draw_inventory(ecs: &World, draw: &mut Draw, font: &Fonts, x: i32, y: i32) {
|
|
let inv = super::get_player_inventory(ecs);
|
|
let offsets = crate::camera::get_offset();
|
|
super::print_options(
|
|
draw,
|
|
font,
|
|
&inv,
|
|
((x as f32) + (offsets.x as f32)) * TILESIZE,
|
|
((y as f32) + (offsets.y as f32)) * TILESIZE
|
|
);
|
|
}
|