nuke all follow up (#1952)
This commit is contained in:
@ -428,17 +428,15 @@ export class KclManager {
|
|||||||
return this?.engineCommandManager?.defaultPlanes
|
return this?.engineCommandManager?.defaultPlanes
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlaneId(axis: 'xy' | 'xz' | 'yz'): string {
|
|
||||||
return this.defaultPlanes[axis]
|
|
||||||
}
|
|
||||||
|
|
||||||
showPlanes() {
|
showPlanes() {
|
||||||
|
if (!this.defaultPlanes) return
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, false)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, false)
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, false)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, false)
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, false)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
hidePlanes() {
|
hidePlanes() {
|
||||||
|
if (!this.defaultPlanes) return
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, true)
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
|
||||||
|
@ -843,11 +843,7 @@ export class EngineCommandManager {
|
|||||||
outSequence = 1
|
outSequence = 1
|
||||||
inSequence = 1
|
inSequence = 1
|
||||||
engineConnection?: EngineConnection
|
engineConnection?: EngineConnection
|
||||||
defaultPlanes: { xy: string; yz: string; xz: string } = {
|
defaultPlanes: { xy: string; yz: string; xz: string } | null = null
|
||||||
xy: '',
|
|
||||||
yz: '',
|
|
||||||
xz: '',
|
|
||||||
}
|
|
||||||
_commandLogs: CommandLog[] = []
|
_commandLogs: CommandLog[] = []
|
||||||
_commandLogCallBack: (command: CommandLog[]) => void = () => {}
|
_commandLogCallBack: (command: CommandLog[]) => void = () => {}
|
||||||
// Folks should realize that wait for ready does not get called _everytime_
|
// Folks should realize that wait for ready does not get called _everytime_
|
||||||
@ -1245,6 +1241,7 @@ export class EngineCommandManager {
|
|||||||
startNewSession() {
|
startNewSession() {
|
||||||
this.lastArtifactMap = this.artifactMap
|
this.lastArtifactMap = this.artifactMap
|
||||||
this.artifactMap = {}
|
this.artifactMap = {}
|
||||||
|
this.initPlanes()
|
||||||
}
|
}
|
||||||
subscribeTo<T extends ModelTypes>({
|
subscribeTo<T extends ModelTypes>({
|
||||||
event,
|
event,
|
||||||
@ -1296,6 +1293,7 @@ export class EngineCommandManager {
|
|||||||
type: 'scene_clear_all',
|
type: 'scene_clear_all',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
this.defaultPlanes = null
|
||||||
this.engineConnection?.send(deleteCmd)
|
this.engineConnection?.send(deleteCmd)
|
||||||
}
|
}
|
||||||
addCommandLog(message: CommandLog) {
|
addCommandLog(message: CommandLog) {
|
||||||
@ -1603,6 +1601,7 @@ export class EngineCommandManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private async initPlanes() {
|
private async initPlanes() {
|
||||||
|
if (this.planesInitialized()) return
|
||||||
const [xy, yz, xz] = [
|
const [xy, yz, xz] = [
|
||||||
await this.createPlane({
|
await this.createPlane({
|
||||||
x_axis: { x: 1, y: 0, z: 0 },
|
x_axis: { x: 1, y: 0, z: 0 },
|
||||||
@ -1626,20 +1625,14 @@ export class EngineCommandManager {
|
|||||||
event: 'select_with_point',
|
event: 'select_with_point',
|
||||||
callback: ({ data }) => {
|
callback: ({ data }) => {
|
||||||
if (!data?.entity_id) return
|
if (!data?.entity_id) return
|
||||||
if (
|
if (![xy, yz, xz].includes(data.entity_id)) return
|
||||||
![
|
|
||||||
this.defaultPlanes.xy,
|
|
||||||
this.defaultPlanes.yz,
|
|
||||||
this.defaultPlanes.xz,
|
|
||||||
].includes(data.entity_id)
|
|
||||||
)
|
|
||||||
return
|
|
||||||
this.onPlaneSelectCallback(data.entity_id)
|
this.onPlaneSelectCallback(data.entity_id)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
planesInitialized(): boolean {
|
planesInitialized(): boolean {
|
||||||
return (
|
return (
|
||||||
|
!!this.defaultPlanes &&
|
||||||
this.defaultPlanes.xy !== '' &&
|
this.defaultPlanes.xy !== '' &&
|
||||||
this.defaultPlanes.yz !== '' &&
|
this.defaultPlanes.yz !== '' &&
|
||||||
this.defaultPlanes.xz !== ''
|
this.defaultPlanes.xz !== ''
|
||||||
|
Reference in New Issue
Block a user