| | |
| | | useTheme, |
| | | Fab, |
| | | } from '@mui/material'; |
| | | import { MAP_MODE, MAP_DEFAULT_ROTATION } from "./constants"; |
| | | import { MAP_MODE, MAP_DEFAULT_ROTATION, setMapPreferences } from "./constants"; |
| | | import Player from './player'; |
| | | import * as Tool from './tool'; |
| | | import { NotificationProvider, useNotification } from './Notification'; |
| | |
| | | }); |
| | | |
| | | const handleResize = () => { |
| | | if (!contentRef) { return; } |
| | | if (!contentRef.current || !player) { |
| | | return; |
| | | } |
| | | const width = contentRef.current.offsetWidth; |
| | | const height = contentRef.current.offsetHeight; |
| | | player.resize(width, height); |
| | |
| | | Tool.setThemeMode(themeMode); |
| | | Http.setNotify(notify); |
| | | Http.setMapContainer(player.mapContainer); |
| | | await Http.fetchMapPreferences(curZone, setMapPreferences); |
| | | websocket = new WebSocketClient('/ws/map/websocket'); |
| | | |
| | | await Http.fetchMapData(curZone, setRcsStatus, setCurSprite); |
| | |
| | | }, [sidebarOpen]); |
| | | |
| | | useEffect(() => { |
| | | if (!player) { |
| | | return; |
| | | } |
| | | player.setTheme(themeMode); |
| | | Tool.setThemeMode(themeMode); |
| | | }, [themeMode]) |