mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Allow disabling zoom towards cursor
This commit is contained in:
@@ -511,7 +511,11 @@ export class Camera extends BasicSerializableObject {
|
||||
this.clampZoomLevel();
|
||||
this.desiredZoom = null;
|
||||
|
||||
const mousePosition = this.root.app.mousePosition;
|
||||
let mousePosition = this.root.app.mousePosition;
|
||||
if (!this.root.app.settings.getAllSettings().zoomToCursor) {
|
||||
mousePosition = new Vector(this.root.gameWidth / 2, this.root.gameHeight / 2);
|
||||
}
|
||||
|
||||
if (mousePosition) {
|
||||
const worldPos = this.root.camera.screenToWorld(mousePosition);
|
||||
const worldDelta = worldPos.sub(this.center);
|
||||
|
||||
@@ -7,7 +7,7 @@ export class HUDBetaOverlay extends BaseHUDPart {
|
||||
parent,
|
||||
"ingame_HUD_BetaOverlay",
|
||||
[],
|
||||
"<h2>UNSTABLE BETA VERSION</h2><span>Steam Release: 9th October 2020!</span>"
|
||||
"<h2>UNSTABLE BETA VERSION</h2><span>Unfinalized & potential buggy content!</span>"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -258,6 +258,7 @@ export const allApplicationSettings = [
|
||||
|
||||
new BoolSetting("enableMousePan", enumCategories.advanced, (app, value) => {}),
|
||||
new BoolSetting("alwaysMultiplace", enumCategories.advanced, (app, value) => {}),
|
||||
new BoolSetting("zoomToCursor", enumCategories.advanced, (app, value) => {}),
|
||||
new BoolSetting("clearCursorOnDeleteWhilePlacing", enumCategories.advanced, (app, value) => {}),
|
||||
new BoolSetting("enableTunnelSmartplace", enumCategories.advanced, (app, value) => {}),
|
||||
new BoolSetting("vignette", enumCategories.userInterface, (app, value) => {}),
|
||||
@@ -322,6 +323,7 @@ class SettingsStorage {
|
||||
this.disableTileGrid = false;
|
||||
this.lowQualityTextures = false;
|
||||
this.simplifiedBelts = false;
|
||||
this.zoomToCursor = true;
|
||||
|
||||
/**
|
||||
* @type {Object.<string, number>}
|
||||
@@ -532,7 +534,7 @@ export class ApplicationSettings extends ReadWriteProxy {
|
||||
}
|
||||
|
||||
getCurrentVersion() {
|
||||
return 28;
|
||||
return 29;
|
||||
}
|
||||
|
||||
/** @param {{settings: SettingsStorage, version: number}} data */
|
||||
@@ -665,6 +667,11 @@ export class ApplicationSettings extends ReadWriteProxy {
|
||||
data.version = 28;
|
||||
}
|
||||
|
||||
if (data.version < 29) {
|
||||
data.settings.zoomToCursor = true;
|
||||
data.version = 29;
|
||||
}
|
||||
|
||||
return ExplainedResult.good();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user