static keys - items in inventory will save their assigned key
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
This commit is contained in:
parent
a7b4f621fb
commit
d11971126c
19 changed files with 445 additions and 122 deletions
|
|
@ -4,14 +4,14 @@ use specs::prelude::*;
|
|||
use super::TILESIZE;
|
||||
use crate::Fonts;
|
||||
|
||||
pub fn draw_inventory(ecs: &World, draw: &mut Draw, font: &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,
|
||||
(offsets.x as f32) * TILESIZE,
|
||||
(offsets.y as f32) * TILESIZE
|
||||
((x as f32) + (offsets.x as f32)) * TILESIZE,
|
||||
((y as f32) + (offsets.y as f32)) * TILESIZE
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue