| | |
| | | draft.addChild(label); |
| | | }; |
| | | |
| | | export const updateAreaSpriteName = (sprite, newName) => { |
| | | if (!sprite || sprite?.data?.type !== DEVICE_TYPE.AREA) { |
| | | return; |
| | | } |
| | | sprite.data.name = newName; |
| | | const label = sprite.children?.find((child) => child instanceof PIXI.Text); |
| | | if (label) { |
| | | label.text = newName ?? ''; |
| | | } |
| | | }; |
| | | |
| | | export const loadAreas = (curZone, setCurSprite) => { |
| | | if (!mapContainer) return; |
| | | clearAreas(); |
| | |
| | | stage.on('pointerup', handleUp); |
| | | return true; |
| | | }; |
| | | |
| | | export const cancelAreaDrawing = () => { |
| | | if (areaDrawingCleanup) { |
| | | areaDrawingCleanup(); |
| | | } |
| | | }; |