Forbid item selection outside central box
This commit is contained in:
parent
5df5369372
commit
8a98bf3c21
1 changed files with 7 additions and 6 deletions
|
|
@ -1485,12 +1485,13 @@ namespace gmtk
|
|||
|
||||
if (!view_transition_)
|
||||
{
|
||||
map_.world.apply<item const>([&](ecs::handle entity, item const & i)
|
||||
{
|
||||
auto box = geom::expand(geom::box<float, 2>::singleton(position(map_.world, i)), scale(map_.world, i) / 9.f);
|
||||
if (geom::contains(box, mouse_world_))
|
||||
selected_item_ = entity;
|
||||
});
|
||||
if (geom::contains(geom::shrink(view_box_[0], (view_box_[0].length() - view_box_[1].length()) / 2.f), mouse_world_[0]))
|
||||
map_.world.apply<item const>([&](ecs::handle entity, item const & i)
|
||||
{
|
||||
auto box = geom::expand(geom::box<float, 2>::singleton(position(map_.world, i)), scale(map_.world, i) / 9.f);
|
||||
if (geom::contains(box, mouse_world_))
|
||||
selected_item_ = entity;
|
||||
});
|
||||
|
||||
if (selected_item_ && item_killing_spree_)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue