mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 10:59:23 +00:00
Fixed issues and regained compatibility with other PR's
This commit is contained in:
parent
bca7440f14
commit
2442d6d655
@ -19,7 +19,8 @@ export class MetaBlockBuilding extends MetaBuilding {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getIsRemovable(root) {
|
getIsRemovable(root) {
|
||||||
return root.gameMode.getIsEditor();
|
const settings = root.hud.parts.puzzleEditorSettings;
|
||||||
|
return settings ? !settings.getIsTestMode() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -23,7 +23,8 @@ export class MetaConstantProducerBuilding extends MetaBuilding {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getIsRemovable(root) {
|
getIsRemovable(root) {
|
||||||
return root.gameMode.getIsEditor();
|
const settings = root.hud.parts.puzzleEditorSettings;
|
||||||
|
return settings ? !settings.getIsTestMode() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -23,7 +23,8 @@ export class MetaGoalAcceptorBuilding extends MetaBuilding {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getIsRemovable(root) {
|
getIsRemovable(root) {
|
||||||
return root.gameMode.getIsEditor();
|
const settings = root.hud.parts.puzzleEditorSettings;
|
||||||
|
return settings ? !settings.getIsTestMode() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -123,7 +123,8 @@ export class HUDBaseToolbar extends BaseHUDPart {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//lock icon for puzzle editor
|
//lock icon for puzzle editor
|
||||||
if (this.root.gameMode.getIsEditor()) {
|
const settings = this.root.hud.parts.puzzleEditorSettings;
|
||||||
|
if (settings && !settings.getIsTestMode()) {
|
||||||
itemContainer.classList.toggle("editor", true);
|
itemContainer.classList.toggle("editor", true);
|
||||||
if (!this.inRequiredBuildings(metaBuilding)) {
|
if (!this.inRequiredBuildings(metaBuilding)) {
|
||||||
const puzzleLock = makeDiv(itemContainer, null, ["puzzle-lock"]);
|
const puzzleLock = makeDiv(itemContainer, null, ["puzzle-lock"]);
|
||||||
@ -260,7 +261,8 @@ export class HUDBaseToolbar extends BaseHUDPart {
|
|||||||
|
|
||||||
const handle = this.buildingHandles[metaBuilding.getId()];
|
const handle = this.buildingHandles[metaBuilding.getId()];
|
||||||
if (handle.puzzleLocked) {
|
if (handle.puzzleLocked) {
|
||||||
if (this.root.gameMode.getIsEditor()) {
|
const settings = this.root.hud.parts.puzzleEditorSettings;
|
||||||
|
if (settings && !settings.getIsTestMode()) {
|
||||||
handle.puzzleLocked = false;
|
handle.puzzleLocked = false;
|
||||||
handle.element.classList.toggle("unlocked", false);
|
handle.element.classList.toggle("unlocked", false);
|
||||||
this.root.soundProxy.playUiClick();
|
this.root.soundProxy.playUiClick();
|
||||||
|
|||||||
@ -116,7 +116,7 @@ export class HUDPuzzleEditorSettings extends BaseHUDPart {
|
|||||||
this.root.entityMgr.destroyEntity(entity);
|
this.root.entityMgr.destroyEntity(entity);
|
||||||
}
|
}
|
||||||
this.root.entityMgr.processDestroyList();
|
this.root.entityMgr.processDestroyList();
|
||||||
} else if (this.storedSolution.length) {
|
} else if (this.storedSolution.length > 0) {
|
||||||
this.root.logic.performBulkOperation(() => {
|
this.root.logic.performBulkOperation(() => {
|
||||||
this.root.logic.performImmutableOperation(() => {
|
this.root.logic.performImmutableOperation(() => {
|
||||||
for (const entity of this.root.entityMgr.getAllWithComponent(StaticMapEntityComponent)) {
|
for (const entity of this.root.entityMgr.getAllWithComponent(StaticMapEntityComponent)) {
|
||||||
@ -275,4 +275,8 @@ export class HUDPuzzleEditorSettings extends BaseHUDPart {
|
|||||||
this.element.querySelector(".zoneWidth > .value").textContent = String(mode.zoneWidth);
|
this.element.querySelector(".zoneWidth > .value").textContent = String(mode.zoneWidth);
|
||||||
this.element.querySelector(".zoneHeight > .value").textContent = String(mode.zoneHeight);
|
this.element.querySelector(".zoneHeight > .value").textContent = String(mode.zoneHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getIsTestMode() {
|
||||||
|
return this.testMode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,8 +68,6 @@ export class PuzzleEditGameMode extends PuzzleGameMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getIsEditor() {
|
getIsEditor() {
|
||||||
/** @type {HUDPuzzleEditorSettings} */
|
return true;
|
||||||
const editSettings = this.root.hud.parts.puzzleEditorSettings;
|
|
||||||
return !editSettings.testMode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -582,7 +582,8 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.root.gameMode.getIsEditor()) {
|
const settings = this.root.hud.parts.puzzleEditorSettings;
|
||||||
|
if (settings && !settings.getIsTestMode()) {
|
||||||
// while playing in editor, assign the item
|
// while playing in editor, assign the item
|
||||||
goalComp.item = item;
|
goalComp.item = item;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user