Better func. naming
This commit is contained in:
parent
13cb46658f
commit
3c9b92ccbd
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Image v-for="tile in zoneEditorStore.zone?.zoneEventTiles" v-bind="getEventTileImageProps(tile)" />
|
||||
<Image v-for="tile in zoneEditorStore.zone?.zoneEventTiles" v-bind="getImageProps(tile)" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -17,11 +17,12 @@ const props = defineProps<{
|
||||
tilemap: Phaser.Tilemaps.Tilemap
|
||||
}>()
|
||||
|
||||
function getEventTileImageProps(tile: ZoneEventTile) {
|
||||
function getImageProps(tile: ZoneEventTile) {
|
||||
return {
|
||||
x: tileToWorldX(props.tilemap, tile.positionX, tile.positionY),
|
||||
y: tileToWorldY(props.tilemap, tile.positionX, tile.positionY),
|
||||
texture: tile.type
|
||||
texture: tile.type,
|
||||
depth: 999
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<SelectedZoneObject v-if="selectedZoneObject" :zoneObject="selectedZoneObject" @move="moveZoneObject" @rotate="rotateZoneObject" @delete="deleteZoneObject" />
|
||||
<Image v-for="object in zoneEditorStore.zone?.zoneObjects" v-bind="getObjectImageProps(object)" @pointerup="() => (selectedZoneObject = object)" />
|
||||
<Image v-for="object in zoneEditorStore.zone?.zoneObjects" v-bind="getImageProps(object)" @pointerup="() => (selectedZoneObject = object)" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -21,17 +21,17 @@ const props = defineProps<{
|
||||
tilemap: Phaser.Tilemaps.Tilemap
|
||||
}>()
|
||||
|
||||
function getObjectImageProps(object: ZoneObject) {
|
||||
function getImageProps(zoneObject: ZoneObject) {
|
||||
return {
|
||||
alpha: object.id === movingZoneObject.value?.id ? 0.5 : 1,
|
||||
depth: calculateIsometricDepth(object.positionX, object.positionY, object.object.frameWidth, object.object.frameHeight),
|
||||
tint: selectedZoneObject.value?.id === object.id ? 0x00ff00 : 0xffffff,
|
||||
x: tileToWorldX(props.tilemap, object.positionX, object.positionY),
|
||||
y: tileToWorldY(props.tilemap, object.positionX, object.positionY),
|
||||
flipX: object.isRotated,
|
||||
texture: object.object.id,
|
||||
originY: Number(object.object.originX),
|
||||
originX: Number(object.object.originY)
|
||||
alpha: zoneObject.id === movingZoneObject.value?.id ? 0.5 : 1,
|
||||
depth: calculateIsometricDepth(zoneObject.positionX, zoneObject.positionY, zoneObject.object.frameWidth, zoneObject.object.frameHeight),
|
||||
tint: selectedZoneObject.value?.id === zoneObject.id ? 0x00ff00 : 0xffffff,
|
||||
x: tileToWorldX(props.tilemap, zoneObject.positionX, zoneObject.positionY),
|
||||
y: tileToWorldY(props.tilemap, zoneObject.positionX, zoneObject.positionY),
|
||||
flipX: zoneObject.isRotated,
|
||||
texture: zoneObject.object.id,
|
||||
originY: Number(zoneObject.object.originX),
|
||||
originX: Number(zoneObject.object.originY)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Image v-for="object in zoneStore.zone?.zoneObjects" v-bind="getObjectImageProps(object)" />
|
||||
<Image v-for="object in zoneStore.zone?.zoneObjects" v-bind="getImageProps(object)" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -14,7 +14,7 @@ const props = defineProps<{
|
||||
tilemap: Phaser.Tilemaps.Tilemap
|
||||
}>()
|
||||
|
||||
const getObjectImageProps = (object: ZoneObject) => {
|
||||
const getImageProps = (object: ZoneObject) => {
|
||||
return {
|
||||
depth: calculateIsometricDepth(object.positionX, object.positionY, object.object.frameWidth, object.object.frameHeight),
|
||||
x: tileToWorldX(props.tilemap as any, object.positionX, object.positionY),
|
||||
|
Loading…
x
Reference in New Issue
Block a user