|  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | 'map.edit': 'Edit Map', | 
|---|
|  |  |  | 'map.edit': 'Edit Model', | 
|---|
|  |  |  | 'map.edit.close': 'Exit Edit', | 
|---|
|  |  |  | '': '', | 
|---|
|  |  |  | '': '', | 
|---|
|  |  |  | '': '', | 
|---|
|  |  |  | '': '', | 
|---|
|  |  |  | '': '', | 
|---|
|  |  |  | '': '', | 
|---|
|  |  |  | '': '', | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | width: window.innerWidth, | 
|---|
|  |  |  | height: window.innerHeight, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | const [app, setApp] = React.useState(null) | 
|---|
|  |  |  | const [mapContainer, setMapContainer] = React.useState(null) | 
|---|
|  |  |  | const [app, setApp] = React.useState(null); | 
|---|
|  |  |  | const [mapContainer, setMapContainer] = React.useState(null); | 
|---|
|  |  |  | const [mapEditModel, setMapEditModel] = React.useState(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | React.useEffect(() => { | 
|---|
|  |  |  | const player = new Player(mapRef.current, styles.dark); | 
|---|
|  |  |  | 
|---|
|  |  |  | const height = contentRef.current.offsetHeight; | 
|---|
|  |  |  | app.renderer.resize(width, height); | 
|---|
|  |  |  | }, [app, mapContainer, windowSize]) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const editHandle = () => { | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | React.useEffect(() => { | 
|---|
|  |  |  | if (!mapContainer) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log(mapEditModel); | 
|---|
|  |  |  | }, [mapEditModel]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onDrop = (sprite, x, y) => { | 
|---|
|  |  |  | const { mapX, mapY } = Utils.getRealPosition(x, y, mapContainer); | 
|---|
|  |  |  | 
|---|
|  |  |  | <Col span={8} style={{}}></Col> | 
|---|
|  |  |  | <Col span={16} style={{ backgroundColor: '#3C40C6', }}> | 
|---|
|  |  |  | <Flex className={styles.flex} gap={'large'} justify={'flex-end'} align={'center'}> | 
|---|
|  |  |  | <Button onClick={editHandle} size={'large'}><FormattedMessage id='map.edit' defaultMessage='编辑地图' /></Button> | 
|---|
|  |  |  | <Button onClick={() => setMapEditModel(!mapEditModel)} size={'large'}> | 
|---|
|  |  |  | {!mapEditModel | 
|---|
|  |  |  | ? <FormattedMessage id='map.edit' defaultMessage='编辑地图' /> | 
|---|
|  |  |  | : <span style={{ color: 'red', fontWeight: 'bold' }}><FormattedMessage id='map.edit.close' defaultMessage='退出编辑' /></span> | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </Button> | 
|---|
|  |  |  | </Flex> | 
|---|
|  |  |  | </Col> | 
|---|
|  |  |  | </Row> | 
|---|
|  |  |  | 
|---|
|  |  |  | </FloatButton.Group> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <FloatButton.Group | 
|---|
|  |  |  | hidden={!mapEditModel} | 
|---|
|  |  |  | trigger="hover" | 
|---|
|  |  |  | style={{ | 
|---|
|  |  |  | right: 35, | 
|---|