| | |
| | | gap: 2 |
| | | }} |
| | | > |
| | | {mode !== MAP_MODE.AREA_MODE && ( |
| | | {mode === MAP_MODE.OBSERVER_MODE && ( |
| | | <> |
| | | <AreaFab |
| | | curZone={curZone} |
| | |
| | | import * as TWEEDLE from 'tweedle.js'; |
| | | import * as Tool from './tool'; |
| | | import star from '/img/map/star.png'; |
| | | import { MAP_MIRROR } from './constants'; |
| | | import { DEVICE_TYPE, MAP_MIRROR } from './constants'; |
| | | |
| | | export default class Player { |
| | | |
| | |
| | | |
| | | // sprite show style which be selected |
| | | this.mapContainer.children.forEach(child => { |
| | | if (child?.data?.type === DEVICE_TYPE.AREA) { |
| | | return; |
| | | } |
| | | if (Tool.isSpriteInSelectionBox(child, this.selectionBox)) { |
| | | this.selectedSprites.push(child); |
| | | Tool.markSprite(child); |
| | |
| | | |
| | | const draft = new PIXI.Graphics(); |
| | | draft.name = id ? `area_${id}` : 'area_' + generateID(); |
| | | draft.zIndex = DEVICE_Z_INDEX.AREA; |
| | | draft.lineStyle(2 / Math.abs(mapContainer.scale.x || 1), AREA_BORDER_COLOR, 0.9); |
| | | draft.zIndex = 0; |
| | | if (setCurSprite) { |
| | | draft.lineStyle(2 / Math.abs(mapContainer.scale.x || 1), AREA_BORDER_COLOR, 0.9); |
| | | draft.zIndex = DEVICE_Z_INDEX.AREA; |
| | | } |
| | | draft.beginFill(areaColor, 0.18); |
| | | draft.drawRect( |
| | | Math.min(from.x, to.x), |
| | |
| | | |
| | | export const hideAreas = (curZone, setShowAreas) => { |
| | | clearAreas(); |
| | | if (setShowAreas) { |
| | | setShowAreas(false); |
| | | } |
| | | setShowAreas(false); |
| | | }; |