| | |
| | | }).start(); |
| | | } |
| | | |
| | | export const showLockPath = (nodes, curFloor, setCurSPrite) => { |
| | | const pathLineName = 'lockPath-' + curFloor; |
| | | export const showLockPath = (lockPath, curFloor, setCurSPrite) => { |
| | | const pathLineName = 'lockPath'; |
| | | let pathLine = mapContainer.getChildByName(pathLineName); |
| | | if (pathLine) { |
| | | mapContainer.removeChild(pathLine); |
| | | } |
| | | |
| | | pathLine = new PIXI.Graphics(); |
| | | pathLine.name = pathLineName; |
| | | pathLine.lineStyle(3 * (1 / mapContainer.scale.x), 0xff0000, 0.8); |
| | | pathLine.zIndex = SENSOR_ZINDEX.TRAVEL_PATH; |
| | | let firstNode = true; |
| | | for (let i = 0; i < lockPath.length; i++) { |
| | | const item = lockPath[i] |
| | | if(item.lev != curFloor) {continue} |
| | | const nodes = item.path; |
| | | |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | const node = nodes[i]; |
| | | if (node.z !== curFloor) { continue } |
| | | const shelf = querySprite(SENSOR_TYPE.SHELF, node.x + '-' + node.y); |
| | | if (!shelf) { continue } |
| | | |
| | | let position = shelf.position; |
| | | let x = position.x; |
| | | let y = position.y; |
| | | if (firstNode) { |
| | | pathLine.moveTo(x, y); |
| | | firstNode = false; |
| | | } else { |
| | | pathLine.lineTo(x, y); |
| | | pathLine = new PIXI.Graphics(); |
| | | pathLine.name = pathLineName; |
| | | pathLine.lineStyle(3 * (1 / mapContainer.scale.x), 0xff0000, 0.8); |
| | | pathLine.zIndex = SENSOR_ZINDEX.TRAVEL_PATH; |
| | | let firstNode = true; |
| | | |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | const node = nodes[i]; |
| | | const shelf = querySprite(SENSOR_TYPE.SHELF, node.x + '-' + node.y); |
| | | if (!shelf) { continue } |
| | | |
| | | let position = shelf.position; |
| | | let x = position.x; |
| | | let y = position.y; |
| | | if (firstNode) { |
| | | pathLine.moveTo(x, y); |
| | | firstNode = false; |
| | | } else { |
| | | pathLine.lineTo(x, y); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | mapContainer.addChild(pathLine); |
| | | } |
| | | |
| | | mapContainer.addChild(pathLine); |
| | | } |
| | | |
| | | export const showConveyorSta = (conveyorSta, curFloor, setCurSPrite) => { |