mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Added layersupport to waypoints!!
It will now save what layer its made on!
This commit is contained in:
parent
25135056f7
commit
9665213174
@ -18,6 +18,7 @@ import { T } from "../../../translations";
|
||||
import { BaseItem } from "../../base_item";
|
||||
import { enumMouseButton } from "../../camera";
|
||||
import { KEYMAPPINGS } from "../../key_action_mapper";
|
||||
import { layers } from "../../root";
|
||||
import { ShapeDefinition } from "../../shape_definition";
|
||||
import { BaseHUDPart } from "../base_hud_part";
|
||||
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
||||
@ -26,7 +27,8 @@ import { enumNotificationType } from "./notifications";
|
||||
/** @typedef {{
|
||||
* label: string | null,
|
||||
* center: { x: number, y: number },
|
||||
* zoomLevel: number
|
||||
* zoomLevel: number,
|
||||
* layer: Layer,
|
||||
* }} Waypoint */
|
||||
|
||||
/**
|
||||
@ -98,6 +100,7 @@ export class HUDWaypoints extends BaseHUDPart {
|
||||
label: null,
|
||||
center: { x: 0, y: 0 },
|
||||
zoomLevel: 3,
|
||||
layer: layers[0],
|
||||
},
|
||||
];
|
||||
|
||||
@ -228,6 +231,7 @@ export class HUDWaypoints extends BaseHUDPart {
|
||||
* @param {Waypoint} waypoint
|
||||
*/
|
||||
moveToWaypoint(waypoint) {
|
||||
this.root.currentLayer = waypoint.layer;
|
||||
this.root.camera.setDesiredCenter(new Vector(waypoint.center.x, waypoint.center.y));
|
||||
this.root.camera.setDesiredZoom(waypoint.zoomLevel);
|
||||
}
|
||||
@ -326,6 +330,7 @@ export class HUDWaypoints extends BaseHUDPart {
|
||||
label,
|
||||
center: { x: position.x, y: position.y },
|
||||
zoomLevel: this.root.camera.zoomLevel,
|
||||
layer: this.root.currentLayer,
|
||||
});
|
||||
|
||||
this.sortWaypoints();
|
||||
|
Loading…
Reference in New Issue
Block a user