forked from noxious/server
Fix for object depths and proper depths for rotated objects
This commit is contained in:
parent
632f2c9770
commit
661abd030f
@ -14,10 +14,7 @@ export class BaseMapObject extends BaseEntity {
|
||||
tags: string[] = []
|
||||
|
||||
@Property({ type: 'json' })
|
||||
depthOffsets = [0]
|
||||
|
||||
@Property({ type: 'json' })
|
||||
pivotPoints: { x: number; y: number }[] = []
|
||||
depthOffsets: number[] = [0]
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2 })
|
||||
originX = 0
|
||||
@ -67,15 +64,10 @@ export class BaseMapObject extends BaseEntity {
|
||||
return this.tags
|
||||
}
|
||||
|
||||
setDepthOffsets(offsets: any) {
|
||||
setDepthOffsets(offsets: number[]) {
|
||||
this.depthOffsets = offsets
|
||||
}
|
||||
|
||||
setPivotPoints(pivotPoints: { x: number; y: number }[]) {
|
||||
this.pivotPoints = pivotPoints
|
||||
return this
|
||||
}
|
||||
|
||||
getDepthOffsets() {
|
||||
return this.depthOffsets;
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ type Payload = {
|
||||
name: string
|
||||
tags: string[]
|
||||
depthOffsets: number[]
|
||||
pivotPoints: { x: number; y: number }[]
|
||||
originX: number
|
||||
originY: number
|
||||
frameRate: number
|
||||
@ -33,7 +32,6 @@ export default class MapObjectUpdateEvent extends BaseEvent {
|
||||
if (data.name !== undefined) mapObject.name = data.name
|
||||
if (data.tags !== undefined) mapObject.tags = data.tags
|
||||
if (data.depthOffsets !== undefined) mapObject.depthOffsets = data.depthOffsets
|
||||
if (data.pivotPoints !== undefined) mapObject.pivotPoints = data.pivotPoints
|
||||
if (data.originX !== undefined) mapObject.originX = data.originX
|
||||
if (data.originY !== undefined) mapObject.originY = data.originY
|
||||
if (data.frameRate !== undefined) mapObject.frameRate = data.frameRate
|
||||
|
Loading…
x
Reference in New Issue
Block a user