From 567cd1ba9e89b4c8193817ae11ec5050a54310ec Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 21 三月 2024 10:31:16 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/player.js | 17 ++++++-----------
zy-asrs-flow/src/pages/map/index.jsx | 4 ++--
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index 0abed28..35bd1ec 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/zy-asrs-flow/src/pages/map/index.jsx
@@ -156,7 +156,7 @@
player.showGridlines();
player.hideStarryBackground();
- player.activateMapEvent(Utils.MapEvent.SELECTION_BOX);
+ player.activateMapEvent(Utils.MapEvent.SELECTION_BOX, model);
Utils.removeSelectedEffect();
setSpriteBySettings(null);
@@ -172,7 +172,7 @@
player.showGridlines();
player.showStarryBackground();
- player.activateMapEvent(null);
+ player.activateMapEvent(Utils.MapEvent.SELECTION_BOX, model);
setDeviceVisible(false);
setDrawerVisible(false);
diff --git a/zy-asrs-flow/src/pages/map/player.js b/zy-asrs-flow/src/pages/map/player.js
index fe71ddf..7b6bbcf 100644
--- a/zy-asrs-flow/src/pages/map/player.js
+++ b/zy-asrs-flow/src/pages/map/player.js
@@ -25,7 +25,7 @@
this.getStartedTicker();
}
- activateMapEvent = (leftEvent, rightEvent) => {
+ activateMapEvent = (eventType, mapModel) => {
if (this.mapEvent) {
this.mapContainer.parent.off('mousedown');
this.mapEvent = null;
@@ -36,17 +36,11 @@
}
}
this.mapEvent = (event) => {
- if (leftEvent && event.button === 0) {
- switch (leftEvent) {
+ if (eventType && event.button === 0) {
+ switch (eventType) {
case Utils.MapEvent.SELECTION_BOX:
- this.mapSelect(event);
+ this.mapSelect(event, mapModel);
break
- default:
- break
- }
- }
- if (rightEvent && event.button === 2) {
- switch (rightEvent) {
default:
break
}
@@ -55,7 +49,7 @@
this.mapContainer.parent.on('mousedown', this.mapEvent)
}
- mapSelect = (event) => {
+ mapSelect = (event, mapModel) => {
let isSelecting = false;
if (!this.selectionBox) {
this.selectionBox = new PIXI.Graphics();
@@ -108,6 +102,7 @@
isSelecting = false;
this.selectionBox.clear();
+ console.log(mapModel);
// sprites batch move
Utils.spriteListBeMovable(this.selectedSprites, this.scale, () => {
this.activateMapEvent(Utils.MapEvent.SELECTION_BOX);
--
Gitblit v1.9.1