mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 10:22:36 +01:00
Update FloorPlanEditor
This commit is contained in:
parent
fed35dd1f0
commit
d9a0c81104
@ -164,25 +164,6 @@ export const FloorplanCanvasView: FC<FloorplanCanvasViewProps> = props =>
|
|||||||
</Button>
|
</Button>
|
||||||
</Column>
|
</Column>
|
||||||
</Grid>
|
</Grid>
|
||||||
{/* <Flex center className="d-md-none">
|
|
||||||
<Button onClick={ event => onClickArrowButton('up') }>
|
|
||||||
<FontAwesomeIcon icon="arrow-up" />
|
|
||||||
</Button>
|
|
||||||
</Flex>
|
|
||||||
<Flex center gap={ 1 }>
|
|
||||||
<Button className="d-md-none" onClick={ event => onClickArrowButton('left') }>
|
|
||||||
<FontAwesomeIcon icon="arrow-left" />
|
|
||||||
</Button>
|
|
||||||
<Base overflow="auto" innerRef={ elementRef } />
|
|
||||||
<Button className="d-md-none" onClick={ event => onClickArrowButton('right') }>
|
|
||||||
<FontAwesomeIcon icon="arrow-right" />
|
|
||||||
</Button>
|
|
||||||
</Flex>
|
|
||||||
<Flex center className="d-md-none">
|
|
||||||
<Button onClick={ event => onClickArrowButton('down') }>
|
|
||||||
<FontAwesomeIcon icon="arrow-down" />
|
|
||||||
</Button>
|
|
||||||
</Flex> */}
|
|
||||||
{ children }
|
{ children }
|
||||||
</Column>
|
</Column>
|
||||||
);
|
);
|
@ -1,5 +1,5 @@
|
|||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { FC, useCallback, useState } from 'react';
|
import { FC, useState } from 'react';
|
||||||
import ReactSlider from 'react-slider';
|
import ReactSlider from 'react-slider';
|
||||||
import { LocalizeText } from '../../../api';
|
import { LocalizeText } from '../../../api';
|
||||||
import { Column, Flex, LayoutGridItem, Text } from '../../../common';
|
import { Column, Flex, LayoutGridItem, Text } from '../../../common';
|
||||||
@ -19,17 +19,18 @@ export const FloorplanOptionsView: FC<{}> = props =>
|
|||||||
const [ floorAction, setFloorAction ] = useState(FloorAction.SET);
|
const [ floorAction, setFloorAction ] = useState(FloorAction.SET);
|
||||||
const [ floorHeight, setFloorHeight ] = useState(0);
|
const [ floorHeight, setFloorHeight ] = useState(0);
|
||||||
|
|
||||||
const selectAction = useCallback((action: number) =>
|
const selectAction = (action: number) =>
|
||||||
{
|
{
|
||||||
setFloorAction(action);
|
setFloorAction(action);
|
||||||
FloorplanEditor.instance.actionSettings.currentAction = action;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const changeDoorDirection = useCallback(() =>
|
FloorplanEditor.instance.actionSettings.currentAction = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
const changeDoorDirection = () =>
|
||||||
{
|
{
|
||||||
setVisualizationSettings(prevValue =>
|
setVisualizationSettings(prevValue =>
|
||||||
{
|
{
|
||||||
const newValue = Object.assign({}, prevValue);
|
const newValue = { ...prevValue };
|
||||||
|
|
||||||
if(newValue.entryPointDir < 7)
|
if(newValue.entryPointDir < 7)
|
||||||
{
|
{
|
||||||
@ -42,9 +43,9 @@ export const FloorplanOptionsView: FC<{}> = props =>
|
|||||||
|
|
||||||
return newValue;
|
return newValue;
|
||||||
});
|
});
|
||||||
}, [ setVisualizationSettings ]);
|
}
|
||||||
|
|
||||||
const onFloorHeightChange = useCallback((value: number) =>
|
const onFloorHeightChange = (value: number) =>
|
||||||
{
|
{
|
||||||
if(isNaN(value) || (value <= 0)) value = 0;
|
if(isNaN(value) || (value <= 0)) value = 0;
|
||||||
|
|
||||||
@ -53,31 +54,33 @@ export const FloorplanOptionsView: FC<{}> = props =>
|
|||||||
setFloorHeight(value);
|
setFloorHeight(value);
|
||||||
|
|
||||||
FloorplanEditor.instance.actionSettings.currentHeight = value.toString(36);
|
FloorplanEditor.instance.actionSettings.currentHeight = value.toString(36);
|
||||||
}, []);
|
}
|
||||||
|
|
||||||
const onFloorThicknessChange = useCallback((value: number) =>
|
const onFloorThicknessChange = (value: number) =>
|
||||||
{
|
{
|
||||||
setVisualizationSettings(prevValue =>
|
setVisualizationSettings(prevValue =>
|
||||||
{
|
{
|
||||||
const newValue = Object.assign({}, prevValue);
|
const newValue = { ...prevValue };
|
||||||
|
|
||||||
newValue.thicknessFloor = value;
|
newValue.thicknessFloor = value;
|
||||||
|
|
||||||
return newValue;
|
return newValue;
|
||||||
});
|
});
|
||||||
}, [setVisualizationSettings]);
|
}
|
||||||
|
|
||||||
const onWallThicknessChange = useCallback((value: number) =>
|
const onWallThicknessChange = (value: number) =>
|
||||||
{
|
{
|
||||||
setVisualizationSettings(prevValue =>
|
setVisualizationSettings(prevValue =>
|
||||||
{
|
{
|
||||||
const newValue = Object.assign({}, prevValue);
|
const newValue = { ...prevValue };
|
||||||
|
|
||||||
newValue.thicknessWall = value;
|
newValue.thicknessWall = value;
|
||||||
|
|
||||||
return newValue;
|
return newValue;
|
||||||
});
|
});
|
||||||
}, [setVisualizationSettings]);
|
}
|
||||||
|
|
||||||
const onWallHeightChange = useCallback((value: number) =>
|
const onWallHeightChange = (value: number) =>
|
||||||
{
|
{
|
||||||
if(isNaN(value) || (value <= 0)) value = MIN_WALL_HEIGHT;
|
if(isNaN(value) || (value <= 0)) value = MIN_WALL_HEIGHT;
|
||||||
|
|
||||||
@ -85,15 +88,15 @@ export const FloorplanOptionsView: FC<{}> = props =>
|
|||||||
|
|
||||||
setVisualizationSettings(prevValue =>
|
setVisualizationSettings(prevValue =>
|
||||||
{
|
{
|
||||||
const newValue = Object.assign({}, prevValue);
|
const newValue = { ...prevValue };
|
||||||
|
|
||||||
newValue.wallHeight = value;
|
newValue.wallHeight = value;
|
||||||
|
|
||||||
return newValue;
|
return newValue;
|
||||||
});
|
});
|
||||||
}, [ setVisualizationSettings ]);
|
}
|
||||||
|
|
||||||
function increaseWallHeight(): void
|
const increaseWallHeight = () =>
|
||||||
{
|
{
|
||||||
let height = (visualizationSettings.wallHeight + 1);
|
let height = (visualizationSettings.wallHeight + 1);
|
||||||
|
|
||||||
@ -102,7 +105,7 @@ export const FloorplanOptionsView: FC<{}> = props =>
|
|||||||
onWallHeightChange(height);
|
onWallHeightChange(height);
|
||||||
}
|
}
|
||||||
|
|
||||||
function decreaseWallHeight(): void
|
const decreaseWallHeight = () =>
|
||||||
{
|
{
|
||||||
let height = (visualizationSettings.wallHeight - 1);
|
let height = (visualizationSettings.wallHeight - 1);
|
||||||
|
|
@ -3,6 +3,7 @@
|
|||||||
@import './camera/CameraWidgetView';
|
@import './camera/CameraWidgetView';
|
||||||
@import './catalog/CatalogView';
|
@import './catalog/CatalogView';
|
||||||
@import './chat-history/ChatHistoryView';
|
@import './chat-history/ChatHistoryView';
|
||||||
|
@import './floorplan-editor/FloorplanEditorView';
|
||||||
@import './groups/GroupView';
|
@import './groups/GroupView';
|
||||||
@import './guide-tool/GuideToolView';
|
@import './guide-tool/GuideToolView';
|
||||||
@import './help/HelpView';
|
@import './help/HelpView';
|
||||||
|
@ -4,7 +4,6 @@ import { AddEventLinkTracker, GetCommunication, RemoveLinkEventTracker } from '.
|
|||||||
import { Base, TransitionAnimation, TransitionAnimationTypes } from '../../common';
|
import { Base, TransitionAnimation, TransitionAnimationTypes } from '../../common';
|
||||||
import { UseRoomSessionManagerEvent } from '../../hooks';
|
import { UseRoomSessionManagerEvent } from '../../hooks';
|
||||||
import { CampaignView } from '../../views/campaign/CampaignView';
|
import { CampaignView } from '../../views/campaign/CampaignView';
|
||||||
import { FloorplanEditorView } from '../../views/floorplan-editor/FloorplanEditorView';
|
|
||||||
import { FriendsView } from '../../views/friends/FriendsView';
|
import { FriendsView } from '../../views/friends/FriendsView';
|
||||||
import { HcCenterView } from '../../views/hc-center/HcCenterView';
|
import { HcCenterView } from '../../views/hc-center/HcCenterView';
|
||||||
import { HotelView } from '../../views/hotel-view/HotelView';
|
import { HotelView } from '../../views/hotel-view/HotelView';
|
||||||
@ -14,6 +13,7 @@ import { AvatarEditorView } from '../avatar-editor/AvatarEditorView';
|
|||||||
import { CameraWidgetView } from '../camera/CameraWidgetView';
|
import { CameraWidgetView } from '../camera/CameraWidgetView';
|
||||||
import { CatalogView } from '../catalog/CatalogView';
|
import { CatalogView } from '../catalog/CatalogView';
|
||||||
import { ChatHistoryView } from '../chat-history/ChatHistoryView';
|
import { ChatHistoryView } from '../chat-history/ChatHistoryView';
|
||||||
|
import { FloorplanEditorView } from '../floorplan-editor/FloorplanEditorView';
|
||||||
import { GroupsView } from '../groups/GroupsView';
|
import { GroupsView } from '../groups/GroupsView';
|
||||||
import { GuideToolView } from '../guide-tool/GuideToolView';
|
import { GuideToolView } from '../guide-tool/GuideToolView';
|
||||||
import { HelpView } from '../help/HelpView';
|
import { HelpView } from '../help/HelpView';
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
@import "./friends/FriendsView";
|
@import "./friends/FriendsView";
|
||||||
@import "./hotel-view/HotelView";
|
@import "./hotel-view/HotelView";
|
||||||
@import "./notification-center/NotificationCenterView";
|
@import "./notification-center/NotificationCenterView";
|
||||||
@import "./floorplan-editor/FloorplanEditorView";
|
|
||||||
@import "./nitropedia/NitropediaView";
|
@import "./nitropedia/NitropediaView";
|
||||||
@import "./hc-center/HcCenterView.scss";
|
@import "./hc-center/HcCenterView.scss";
|
||||||
@import './campaign/CampaignView';
|
@import './campaign/CampaignView';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user