mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Q-ing when on an ore- or shape-patch will show the miner silhouette
This commit is contained in:
parent
1756740947
commit
8ec83144ad
@ -11,6 +11,7 @@ import { KEYMAPPINGS } from "../../key_action_mapper";
|
|||||||
import { defaultBuildingVariant, MetaBuilding } from "../../meta_building";
|
import { defaultBuildingVariant, MetaBuilding } from "../../meta_building";
|
||||||
import { BaseHUDPart } from "../base_hud_part";
|
import { BaseHUDPart } from "../base_hud_part";
|
||||||
import { SOUNDS } from "../../../platform/sound";
|
import { SOUNDS } from "../../../platform/sound";
|
||||||
|
import { MetaMinerBuilding } from "../../buildings/miner";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains all logic for the building placer - this doesn't include the rendering
|
* Contains all logic for the building placer - this doesn't include the rendering
|
||||||
@ -244,10 +245,15 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
|
|||||||
|
|
||||||
const worldPos = this.root.camera.screenToWorld(mousePosition);
|
const worldPos = this.root.camera.screenToWorld(mousePosition);
|
||||||
const tile = worldPos.toTileSpace();
|
const tile = worldPos.toTileSpace();
|
||||||
const contents = this.root.map.getTileContent(tile);
|
|
||||||
|
|
||||||
|
const contents = this.root.map.getTileContent(tile);
|
||||||
if (!contents) {
|
if (!contents) {
|
||||||
|
const tileBelow = this.root.map.getLowerLayerContentXY(tile.x, tile.y);
|
||||||
|
if (tileBelow) {
|
||||||
|
this.currentMetaBuilding.set(gMetaBuildingRegistry.findByClass(MetaMinerBuilding));
|
||||||
|
} else {
|
||||||
this.currentMetaBuilding.set(null);
|
this.currentMetaBuilding.set(null);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user