From c4ffccd2536be747500e6ac7800200284dc7220f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 14 十月 2024 10:19:02 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/MapPage.jsx |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx
index 2d5e439..9d35888 100644
--- a/zy-acs-flow/src/map/MapPage.jsx
+++ b/zy-acs-flow/src/map/MapPage.jsx
@@ -136,7 +136,7 @@
                 player.hideStarryBackground();
 
                 player.activateMapMultiSelect((selectedSprites, restartFn) => {
-                    console.log(selectedSprites);
+                    setBatchSprites(selectedSprites);
                 });
 
                 break
@@ -159,7 +159,7 @@
                 player.showStarryBackground(); // 0x2f68ac
 
                 player.activateMapMultiSelect((selectedSprites, restartFn) => {
-                    console.log(selectedSprites);
+                    setBatchSprites(selectedSprites);
                 });
 
                 mapContainer.children.forEach(child => {
@@ -205,6 +205,19 @@
         }
     }, [spriteSettings, mapContainer])
     const prevSpriteSettings = prevSpriteSettingsRef.current;
+
+    // watch batchSprites
+    React.useEffect(() => {
+        if (!mapContainer) {
+            return;
+        }
+        if (batchSprites?.length > 0) {
+            setBatchSelectionVisible(true)
+        } else {
+            player.clearSelectedSprites();
+            setBatchSelectionVisible(false)
+        }
+    }, [batchSprites])
 
     const actions = [
         { icon: <FileCopyIcon />, name: '澶嶅埗' },
@@ -430,6 +443,7 @@
                 onCancel={() => {
                     setBatchSelectionVisible(false);
                 }}
+                width={570}
             />
 
         </Box>

--
Gitblit v1.9.1