Fixes for the pipette

This commit is contained in:
tobspr 2020-06-21 21:59:35 +02:00
parent 76b619e4e7
commit ba52edf7a4
3 changed files with 10 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bbac64f40b2bac1187c87efc97ac718c6e57349d304939c70d99a090e822b6dc
size 235135
oid sha256:ebde52e75e54d2f4add0cf498c85f059082a0745212a23c4de7328a7d78b00a5
size 238170

View File

@ -60,6 +60,11 @@ export class HUDBlueprintPlacer extends BaseHUDPart {
* Starts the pipette function
*/
startPipette() {
// Disable in overview
if (this.root.camera.getIsMapOverlayActive()) {
return;
}
const mousePosition = this.root.app.mousePosition;
if (!mousePosition) {
// Not on screen
@ -69,7 +74,9 @@ export class HUDBlueprintPlacer extends BaseHUDPart {
const worldPos = this.root.camera.screenToWorld(mousePosition);
const tile = worldPos.toTileSpace();
const contents = this.root.map.getTileContent(tile);
if (contents) {
// Make sure we selected something, and also make sure it's not a special entity
if (contents && !contents.components.Unremovable) {
const blueprint = PipetteBlueprint.fromEntity(contents);
// Notice: Order here matters, since pipetteExecuted clears the blueprint