v0.5.0: tapping on heap sprites now overrides the tile location of that tap
This commit is contained in:
parent
2b314bf1a9
commit
2611125adf
|
@ -21,6 +21,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
|
@ -61,6 +62,13 @@ public class CellSelector extends TouchArea {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Heap heap : Dungeon.level.heaps.values()){
|
||||||
|
if (heap.sprite != null && heap.sprite.overlapsPoint( p.x, p.y)){
|
||||||
|
select( heap.pos );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
select( ((DungeonTilemap)target).screenToTile(
|
select( ((DungeonTilemap)target).screenToTile(
|
||||||
(int)touch.current.x,
|
(int)touch.current.x,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user