| | |
| | | Tool.setMapContainer(player.mapContainer); |
| | | Tool.setThemeMode(themeMode); |
| | | Http.setNotify(notify); |
| | | Http.setMapContainer(player.mapContainer); |
| | | // websocket = new WebSocketClient('/ws/map/websocket'); |
| | | |
| | | await Http.fetchMapData(0); |
| | | await Http.fetchMapData(); |
| | | |
| | | setTimeout(() => { |
| | | player.adaptScreen(); |
| | | notify.info('Welcome to Rcs'); |
| | | }, 200) |
| | | |
| | | // websocket.connect(); |
| | | // websocket.onMessage = (data) => { |
| | | // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); |
| | |
| | | }; |
| | | handleResize(); |
| | | window.addEventListener('resize', handleResize); |
| | | |
| | | notify.info('Welcome to Rcs'); |
| | | |
| | | return () => { |
| | | if (websocket) { |
| | |
| | | restartFn(); |
| | | }); |
| | | }); |
| | | |
| | | mapContainer.children.forEach(child => { |
| | | Tool.beMovable(child); |
| | | }) |
| | | break |
| | | case MapMode.SETTINGS_MODE: |
| | | player.hideGridLines(); |
| | |
| | | {mode === MapMode.MOVABLE_MODE && ( |
| | | <> |
| | | <Button |
| | | variant="outlined" |
| | | sx={{ mr: 2 }} |
| | | onClick={() => { |
| | | Tool.clearMapData(); |
| | | }} |
| | | > |
| | | {translate('page.map.action.clear')} |
| | | </Button> |
| | | <ConfirmButton |
| | | label="page.map.action.save" |
| | | variant="contained" |
| | | sx={{ mr: 2 }} |
| | | onConfirm={() => { |
| | | Http.saveMapData(curZone); |
| | | }} |
| | | /> |
| | | <Button |
| | | variant="contained" |
| | | color="primary" |
| | | sx={{ mr: 1 }} |
| | |
| | | |
| | | {mode === MapMode.SETTINGS_MODE && ( |
| | | <> |
| | | <Button |
| | | variant="outlined" |
| | | sx={{ mr: 2 }} |
| | | onClick={() => { |
| | | Tool.clearMapData(); |
| | | }} |
| | | > |
| | | {translate('page.map.action.clear')} |
| | | </Button> |
| | | <ConfirmButton |
| | | label="page.map.action.save" |
| | | variant="contained" |
| | | onConfirm={() => { |
| | | Http.saveMapData(curZone, mapContainer); |
| | | Http.saveMapData(curZone); |
| | | }} |
| | | /> |
| | | </> |