1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-11 01:01:53 +00:00

*Fixed Formatting*🛠

This commit is contained in:
Christopher-Robin 2020-10-10 01:13:43 +11:00
parent 704867dcd0
commit 55f218b81f
No known key found for this signature in database
GPG Key ID: 39A83BF9D91CC108

View File

@ -249,10 +249,9 @@ export class HUDMassSelector extends BaseHUDPart {
if ( if (
this.root.keyMapper.getBinding(KEYMAPPINGS.massSelect.massSelectSelectMultiLayer) this.root.keyMapper.getBinding(KEYMAPPINGS.massSelect.massSelectSelectMultiLayer)
.pressed .pressed
){ ) {
entities = this.root.map.getLayersContentsMultipleXY(x, y); entities = this.root.map.getLayersContentsMultipleXY(x, y);
} } else {
else{
entities = [this.root.map.getLayerContentXY(x, y, this.root.currentLayer)]; entities = [this.root.map.getLayerContentXY(x, y, this.root.currentLayer)];
} }
@ -274,7 +273,6 @@ export class HUDMassSelector extends BaseHUDPart {
* @param {DrawParameters} parameters * @param {DrawParameters} parameters
*/ */
draw(parameters) { draw(parameters) {
if (this.currentSelectionStartWorld) { if (this.currentSelectionStartWorld) {
const worldStart = this.currentSelectionStartWorld; const worldStart = this.currentSelectionStartWorld;
const worldEnd = this.root.camera.screenToWorld(this.currentSelectionEnd); const worldEnd = this.root.camera.screenToWorld(this.currentSelectionEnd);
@ -310,9 +308,9 @@ export class HUDMassSelector extends BaseHUDPart {
for (let x = realTileStart.x; x <= realTileEnd.x; ++x) { for (let x = realTileStart.x; x <= realTileEnd.x; ++x) {
for (let y = realTileStart.y; y <= realTileEnd.y; ++y) { for (let y = realTileStart.y; y <= realTileEnd.y; ++y) {
let entities = []; let entities = [];
if (isMultiLayerPressed){ if (isMultiLayerPressed) {
entities = this.root.map.getLayersContentsMultipleXY(x, y); entities = this.root.map.getLayersContentsMultipleXY(x, y);
}else { } else {
entities = [this.root.map.getLayerContentXY(x, y, this.root.currentLayer)]; entities = [this.root.map.getLayerContentXY(x, y, this.root.currentLayer)];
} }
@ -335,16 +333,16 @@ export class HUDMassSelector extends BaseHUDPart {
//EXTREMELY SLOW. There must be a better way. (Possibly use a Array)wa //EXTREMELY SLOW. There must be a better way. (Possibly use a Array)wa
this.selectedUids.forEach(uid => { this.selectedUids.forEach(uid => {
const entity = this.root.entityMgr.findByUid(uid); const entity = this.root.entityMgr.findByUid(uid);
this.RenderSelectonPreviewTile(parameters, entity); this.RenderSelectonPreviewTile(parameters, entity);
}); });
} }
/** /**
* *
* @param {DrawParameters} parameters * @param {DrawParameters} parameters
* @param {Entity} entity * @param {Entity} entity
*/ */
RenderSelectonPreviewTile(parameters, entity){ RenderSelectonPreviewTile(parameters, entity) {
const staticComp = entity.components.StaticMapEntity; const staticComp = entity.components.StaticMapEntity;
parameters.context.beginPath(); parameters.context.beginPath();