| | |
| | | import WebSocketClient from './websocket' |
| | | import ConfirmButton from "../page/components/ConfirmButton"; |
| | | import { FitScreen } from '@mui/icons-material'; |
| | | |
| | | import MapSearch from "./header/MapSearch"; |
| | | |
| | | let player; |
| | | let websocket; |
| | |
| | | Tool.setThemeMode(themeMode); |
| | | Http.setNotify(notify); |
| | | Http.setMapContainer(player.mapContainer); |
| | | // websocket = new WebSocketClient('/ws/map/websocket'); |
| | | websocket = new WebSocketClient('/ws/map/websocket'); |
| | | |
| | | await Http.fetchMapData(); |
| | | websocket.connect(); |
| | | websocket.onMessage = (wsMsg) => { |
| | | Tool.generateDynamicGraphic(curZone, JSON.parse(wsMsg)); |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | player.adaptScreen(); |
| | | notify.info(translate('page.map.welcome')); |
| | | }, 200) |
| | | |
| | | // websocket.connect(); |
| | | // websocket.onMessage = (data) => { |
| | | // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); |
| | | // } |
| | | |
| | | } |
| | | initialize(); |
| | | |
| | |
| | | break |
| | | case MAP_MODE.SETTINGS_MODE: |
| | | player.hideGridLines(); |
| | | player.showStarryBackground(); // 0x2f68ac |
| | | // player.showStarryBackground(); // 0x2f68ac |
| | | |
| | | player.activateMapMultiSelect((selectedSprites, restartFn) => { |
| | | setBatchSprites(selectedSprites); |
| | |
| | | boxShadow: theme.shadows[1], |
| | | }} |
| | | > |
| | | <TextField |
| | | variant="outlined" |
| | | size="small" |
| | | placeholder="搜索..." |
| | | sx={{ |
| | | width: '200px', |
| | | backgroundColor: theme.palette.background.paper, |
| | | borderRadius: 1, |
| | | }} |
| | | <MapSearch |
| | | mode={mode} |
| | | setMode={setMode} |
| | | curZone={curZone} |
| | | setSpriteSettings={setSpriteSettings} |
| | | /> |
| | | <Box sx={{ flexGrow: 1 }} /> |
| | | |