mirror of
https://github.com/tobspr-games/shapez.io.git
synced 2026-01-21 03:50:47 -08:00
Fixes for the pipette
This commit is contained in:
parent
76b619e4e7
commit
ba52edf7a4
3 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue