Fix issue with tooltip location
This commit is contained in:
parent
a5d3adadeb
commit
8824faff24
10
src/gui.rs
10
src/gui.rs
@ -2,8 +2,8 @@ use ::rltk::{Point, Rltk, VirtualKeyCode, RGB};
|
|||||||
use ::specs::prelude::*;
|
use ::specs::prelude::*;
|
||||||
|
|
||||||
use crate::components::{
|
use crate::components::{
|
||||||
Attribute, Attributes, Consumable, HungerClock, HungerState, InBackpack, Name, Player, Pools,
|
Attribute, Attributes, Consumable, HungerClock, HungerState, InBackpack, Name, Pools, Position,
|
||||||
Position, Viewshed,
|
Viewshed,
|
||||||
};
|
};
|
||||||
use crate::game_log::GameLog;
|
use crate::game_log::GameLog;
|
||||||
use crate::rex_assets::RexAssets;
|
use crate::rex_assets::RexAssets;
|
||||||
@ -240,9 +240,9 @@ fn draw_tooltips(ecs: &World, ctx: &mut Rltk) {
|
|||||||
let pools = ecs.read_storage::<Pools>();
|
let pools = ecs.read_storage::<Pools>();
|
||||||
let entities = ecs.entities();
|
let entities = ecs.entities();
|
||||||
let mouse_pos = ctx.mouse_pos();
|
let mouse_pos = ctx.mouse_pos();
|
||||||
let mut mouse_map_pos = mouse_pos.clone();
|
let mut mouse_map_pos = mouse_pos;
|
||||||
mouse_map_pos.0 += min_x - 1;
|
mouse_map_pos.0 += min_x;
|
||||||
mouse_map_pos.1 += min_y - 1;
|
mouse_map_pos.1 += min_y;
|
||||||
|
|
||||||
if mouse_map_pos.0 >= map.width - 1
|
if mouse_map_pos.0 >= map.width - 1
|
||||||
|| mouse_map_pos.1 >= map.height - 1
|
|| mouse_map_pos.1 >= map.height - 1
|
||||||
|
Loading…
Reference in New Issue
Block a user