2020-05-22 13:47:11 +10:00
|
|
|
import React, { useState, useContext, useEffect } from "react";
|
2020-07-20 19:14:46 +10:00
|
|
|
import { Group } from "react-konva";
|
2020-03-19 17:33:57 +11:00
|
|
|
|
2020-04-18 23:31:40 +10:00
|
|
|
import MapControls from "./MapControls";
|
2020-04-27 17:29:46 +10:00
|
|
|
import MapInteraction from "./MapInteraction";
|
2020-04-18 18:11:21 +10:00
|
|
|
import MapToken from "./MapToken";
|
|
|
|
|
import MapDrawing from "./MapDrawing";
|
2020-04-28 22:05:47 +10:00
|
|
|
import MapFog from "./MapFog";
|
2020-05-31 16:25:05 +10:00
|
|
|
import MapGrid from "./MapGrid";
|
2020-06-26 12:23:06 +10:00
|
|
|
import MapMeasure from "./MapMeasure";
|
2020-06-28 13:37:04 +10:00
|
|
|
import MapLoadingOverlay from "./MapLoadingOverlay";
|
2020-07-28 17:59:26 +10:00
|
|
|
import NetworkedMapPointer from "../../network/NetworkedMapPointer";
|
2020-03-20 13:33:12 +11:00
|
|
|
|
2020-05-19 16:21:01 +10:00
|
|
|
import TokenDataContext from "../../contexts/TokenDataContext";
|
2020-08-07 17:15:16 +10:00
|
|
|
import SettingsContext from "../../contexts/SettingsContext";
|
2020-04-27 17:29:46 +10:00
|
|
|
|
2020-05-21 16:46:50 +10:00
|
|
|
import TokenMenu from "../token/TokenMenu";
|
2020-05-21 22:57:44 +10:00
|
|
|
import TokenDragOverlay from "../token/TokenDragOverlay";
|
2020-04-19 13:33:31 +10:00
|
|
|
|
2020-06-25 08:47:53 +10:00
|
|
|
import { drawActionsToShapes } from "../../helpers/drawing";
|
2020-03-20 13:33:12 +11:00
|
|
|
|
2020-03-20 18:06:24 +11:00
|
|
|
function Map({
|
2020-04-23 11:54:29 +10:00
|
|
|
map,
|
2020-04-23 17:23:34 +10:00
|
|
|
mapState,
|
2020-04-24 18:39:11 +10:00
|
|
|
onMapTokenStateChange,
|
|
|
|
|
onMapTokenStateRemove,
|
2020-04-13 00:24:03 +10:00
|
|
|
onMapChange,
|
2020-04-23 21:54:58 +10:00
|
|
|
onMapStateChange,
|
2020-04-19 15:15:48 +10:00
|
|
|
onMapDraw,
|
2020-04-30 09:29:16 +10:00
|
|
|
onMapDrawUndo,
|
|
|
|
|
onMapDrawRedo,
|
2020-04-28 22:05:47 +10:00
|
|
|
onFogDraw,
|
2020-04-30 09:29:16 +10:00
|
|
|
onFogDrawUndo,
|
|
|
|
|
onFogDrawRedo,
|
2020-04-29 21:12:57 +10:00
|
|
|
allowMapDrawing,
|
|
|
|
|
allowFogDrawing,
|
2020-07-17 15:57:52 +10:00
|
|
|
allowMapChange,
|
2020-04-30 15:12:34 +10:00
|
|
|
disabledTokens,
|
2020-07-28 17:59:26 +10:00
|
|
|
session,
|
2020-03-20 18:06:24 +11:00
|
|
|
}) {
|
2020-05-22 20:43:07 +10:00
|
|
|
const { tokensById } = useContext(TokenDataContext);
|
2020-03-20 11:05:40 +11:00
|
|
|
|
2020-05-21 16:46:50 +10:00
|
|
|
const gridX = map && map.gridX;
|
|
|
|
|
const gridY = map && map.gridY;
|
2020-05-22 17:56:03 +10:00
|
|
|
const gridSizeNormalized = {
|
|
|
|
|
x: gridX ? 1 / gridX : 0,
|
|
|
|
|
y: gridY ? 1 / gridY : 0,
|
|
|
|
|
};
|
2020-05-21 16:46:50 +10:00
|
|
|
const tokenSizePercent = gridSizeNormalized.x;
|
2020-03-20 21:46:52 +11:00
|
|
|
|
2020-04-27 17:29:46 +10:00
|
|
|
const [selectedToolId, setSelectedToolId] = useState("pan");
|
2020-08-07 17:15:16 +10:00
|
|
|
const { settings, setSettings } = useContext(SettingsContext);
|
2020-04-29 20:55:52 +10:00
|
|
|
|
2020-04-27 17:29:46 +10:00
|
|
|
function handleToolSettingChange(tool, change) {
|
2020-08-07 17:15:16 +10:00
|
|
|
setSettings((prevSettings) => ({
|
2020-04-27 17:29:46 +10:00
|
|
|
...prevSettings,
|
|
|
|
|
[tool]: {
|
|
|
|
|
...prevSettings[tool],
|
|
|
|
|
...change,
|
|
|
|
|
},
|
|
|
|
|
}));
|
|
|
|
|
}
|
2020-04-19 00:24:06 +10:00
|
|
|
|
2020-04-29 20:55:52 +10:00
|
|
|
function handleToolAction(action) {
|
|
|
|
|
if (action === "eraseAll") {
|
|
|
|
|
onMapDraw({
|
|
|
|
|
type: "remove",
|
|
|
|
|
shapeIds: mapShapes.map((s) => s.id),
|
|
|
|
|
timestamp: Date.now(),
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-04-30 09:29:16 +10:00
|
|
|
if (action === "mapUndo") {
|
|
|
|
|
onMapDrawUndo();
|
|
|
|
|
}
|
|
|
|
|
if (action === "mapRedo") {
|
|
|
|
|
onMapDrawRedo();
|
|
|
|
|
}
|
|
|
|
|
if (action === "fogUndo") {
|
|
|
|
|
onFogDrawUndo();
|
|
|
|
|
}
|
|
|
|
|
if (action === "fogRedo") {
|
|
|
|
|
onFogDrawRedo();
|
|
|
|
|
}
|
2020-04-29 20:55:52 +10:00
|
|
|
}
|
|
|
|
|
|
2020-04-28 22:05:47 +10:00
|
|
|
const [mapShapes, setMapShapes] = useState([]);
|
2020-05-22 17:22:32 +10:00
|
|
|
|
2020-04-28 22:05:47 +10:00
|
|
|
function handleMapShapeAdd(shape) {
|
2020-04-30 09:29:16 +10:00
|
|
|
onMapDraw({ type: "add", shapes: [shape] });
|
2020-04-19 13:33:31 +10:00
|
|
|
}
|
|
|
|
|
|
2020-05-31 12:12:16 +10:00
|
|
|
function handleMapShapesRemove(shapeIds) {
|
|
|
|
|
onMapDraw({ type: "remove", shapeIds });
|
2020-04-20 11:56:56 +10:00
|
|
|
}
|
|
|
|
|
|
2020-04-28 22:05:47 +10:00
|
|
|
const [fogShapes, setFogShapes] = useState([]);
|
2020-04-19 13:33:31 +10:00
|
|
|
|
2020-04-28 22:05:47 +10:00
|
|
|
function handleFogShapeAdd(shape) {
|
2020-04-30 09:29:16 +10:00
|
|
|
onFogDraw({ type: "add", shapes: [shape] });
|
2020-04-28 22:05:47 +10:00
|
|
|
}
|
|
|
|
|
|
2020-06-09 12:45:52 +10:00
|
|
|
function handleFogShapeSubtract(shape) {
|
|
|
|
|
onFogDraw({ type: "subtract", shapes: [shape] });
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-31 12:12:16 +10:00
|
|
|
function handleFogShapesRemove(shapeIds) {
|
|
|
|
|
onFogDraw({ type: "remove", shapeIds });
|
2020-04-19 13:33:31 +10:00
|
|
|
}
|
|
|
|
|
|
2020-05-31 12:12:16 +10:00
|
|
|
function handleFogShapesEdit(shapes) {
|
|
|
|
|
onFogDraw({ type: "edit", shapes });
|
2020-04-29 20:40:34 +10:00
|
|
|
}
|
|
|
|
|
|
2020-04-19 15:15:48 +10:00
|
|
|
// Replay the draw actions and convert them to shapes for the map drawing
|
2020-04-19 13:33:31 +10:00
|
|
|
useEffect(() => {
|
2020-04-23 17:23:34 +10:00
|
|
|
if (!mapState) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-04-28 22:05:47 +10:00
|
|
|
setMapShapes(
|
2020-06-25 08:47:53 +10:00
|
|
|
drawActionsToShapes(mapState.mapDrawActions, mapState.mapDrawActionIndex)
|
2020-04-28 22:05:47 +10:00
|
|
|
);
|
|
|
|
|
setFogShapes(
|
2020-06-25 08:47:53 +10:00
|
|
|
drawActionsToShapes(mapState.fogDrawActions, mapState.fogDrawActionIndex)
|
2020-04-28 22:05:47 +10:00
|
|
|
);
|
2020-04-23 17:23:34 +10:00
|
|
|
}, [mapState]);
|
2020-04-19 13:33:31 +10:00
|
|
|
|
2020-04-27 17:29:46 +10:00
|
|
|
const disabledControls = [];
|
2020-04-29 21:12:57 +10:00
|
|
|
if (!allowMapDrawing) {
|
2020-06-21 11:01:03 +10:00
|
|
|
disabledControls.push("drawing");
|
2020-04-29 21:32:23 +10:00
|
|
|
}
|
2020-04-23 11:54:29 +10:00
|
|
|
if (!map) {
|
2020-04-27 17:29:46 +10:00
|
|
|
disabledControls.push("pan");
|
2020-06-26 12:23:06 +10:00
|
|
|
disabledControls.push("measure");
|
2020-07-28 17:59:26 +10:00
|
|
|
disabledControls.push("pointer");
|
2020-04-19 13:33:31 +10:00
|
|
|
}
|
2020-04-29 21:12:57 +10:00
|
|
|
if (!allowFogDrawing) {
|
|
|
|
|
disabledControls.push("fog");
|
|
|
|
|
}
|
2020-07-17 15:57:52 +10:00
|
|
|
if (!allowMapChange) {
|
|
|
|
|
disabledControls.push("map");
|
|
|
|
|
}
|
2020-04-30 09:29:16 +10:00
|
|
|
|
2020-06-21 11:01:03 +10:00
|
|
|
const disabledSettings = { fog: [], drawing: [] };
|
|
|
|
|
if (mapShapes.length === 0) {
|
|
|
|
|
disabledSettings.drawing.push("erase");
|
|
|
|
|
}
|
2020-04-30 09:29:16 +10:00
|
|
|
if (!mapState || mapState.mapDrawActionIndex < 0) {
|
2020-06-21 11:01:03 +10:00
|
|
|
disabledSettings.drawing.push("undo");
|
2020-04-30 09:29:16 +10:00
|
|
|
}
|
2020-04-27 17:29:46 +10:00
|
|
|
if (
|
|
|
|
|
!mapState ||
|
2020-04-28 22:05:47 +10:00
|
|
|
mapState.mapDrawActionIndex === mapState.mapDrawActions.length - 1
|
2020-04-27 17:29:46 +10:00
|
|
|
) {
|
2020-06-21 11:01:03 +10:00
|
|
|
disabledSettings.drawing.push("redo");
|
2020-04-30 09:29:16 +10:00
|
|
|
}
|
2020-05-31 13:56:33 +10:00
|
|
|
if (!mapState || mapState.fogDrawActionIndex < 0) {
|
2020-04-30 09:29:16 +10:00
|
|
|
disabledSettings.fog.push("undo");
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
!mapState ||
|
|
|
|
|
mapState.fogDrawActionIndex === mapState.fogDrawActions.length - 1
|
|
|
|
|
) {
|
|
|
|
|
disabledSettings.fog.push("redo");
|
2020-04-19 13:34:07 +10:00
|
|
|
}
|
2020-04-09 18:20:10 +10:00
|
|
|
|
2020-04-27 17:29:46 +10:00
|
|
|
const mapControls = (
|
|
|
|
|
<MapControls
|
|
|
|
|
onMapChange={onMapChange}
|
|
|
|
|
onMapStateChange={onMapStateChange}
|
|
|
|
|
currentMap={map}
|
2020-05-19 16:33:23 +10:00
|
|
|
currentMapState={mapState}
|
2020-04-27 17:29:46 +10:00
|
|
|
onSelectedToolChange={setSelectedToolId}
|
|
|
|
|
selectedToolId={selectedToolId}
|
2020-08-07 17:15:16 +10:00
|
|
|
toolSettings={settings}
|
2020-04-27 17:29:46 +10:00
|
|
|
onToolSettingChange={handleToolSettingChange}
|
2020-04-29 20:55:52 +10:00
|
|
|
onToolAction={handleToolAction}
|
2020-04-27 17:29:46 +10:00
|
|
|
disabledControls={disabledControls}
|
2020-04-30 09:29:16 +10:00
|
|
|
disabledSettings={disabledSettings}
|
2020-04-27 17:29:46 +10:00
|
|
|
/>
|
|
|
|
|
);
|
2020-05-21 16:46:50 +10:00
|
|
|
|
|
|
|
|
const [isTokenMenuOpen, setIsTokenMenuOpen] = useState(false);
|
|
|
|
|
const [tokenMenuOptions, setTokenMenuOptions] = useState({});
|
2020-05-22 20:43:07 +10:00
|
|
|
const [draggingTokenOptions, setDraggingTokenOptions] = useState();
|
2020-05-21 16:46:50 +10:00
|
|
|
function handleTokenMenuOpen(tokenStateId, tokenImage) {
|
|
|
|
|
setTokenMenuOptions({ tokenStateId, tokenImage });
|
|
|
|
|
setIsTokenMenuOpen(true);
|
|
|
|
|
}
|
2020-04-19 13:33:31 +10:00
|
|
|
|
2020-08-27 19:09:16 +10:00
|
|
|
function getMapTokenCategoryWeight(category) {
|
|
|
|
|
switch (category) {
|
|
|
|
|
case "character":
|
|
|
|
|
return 0;
|
|
|
|
|
case "vehicle":
|
|
|
|
|
return 1;
|
|
|
|
|
case "prop":
|
|
|
|
|
return 2;
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-24 13:32:49 +10:00
|
|
|
// Sort so vehicles render below other tokens
|
2020-08-27 17:56:59 +10:00
|
|
|
function sortMapTokenStates(a, b, draggingTokenOptions) {
|
2020-05-24 13:32:49 +10:00
|
|
|
const tokenA = tokensById[a.tokenId];
|
|
|
|
|
const tokenB = tokensById[b.tokenId];
|
|
|
|
|
if (tokenA && tokenB) {
|
2020-08-27 19:09:16 +10:00
|
|
|
// If categories are different sort in order "prop", "vehicle", "character"
|
|
|
|
|
if (tokenB.category !== tokenA.category) {
|
|
|
|
|
const aWeight = getMapTokenCategoryWeight(tokenA.category);
|
|
|
|
|
const bWeight = getMapTokenCategoryWeight(tokenB.category);
|
|
|
|
|
return bWeight - aWeight;
|
2020-08-27 17:56:59 +10:00
|
|
|
} else if (
|
|
|
|
|
draggingTokenOptions &&
|
|
|
|
|
draggingTokenOptions.tokenState.id === a.id
|
|
|
|
|
) {
|
|
|
|
|
// If dragging token a move above
|
|
|
|
|
return 1;
|
|
|
|
|
} else if (
|
|
|
|
|
draggingTokenOptions &&
|
|
|
|
|
draggingTokenOptions.tokenState.id === b.id
|
|
|
|
|
) {
|
|
|
|
|
// If dragging token b move above
|
|
|
|
|
return -1;
|
|
|
|
|
} else {
|
|
|
|
|
// Else sort so last modified is on top
|
|
|
|
|
return a.lastModified - b.lastModified;
|
|
|
|
|
}
|
2020-05-24 13:32:49 +10:00
|
|
|
} else if (tokenA) {
|
|
|
|
|
return 1;
|
|
|
|
|
} else if (tokenB) {
|
|
|
|
|
return -1;
|
|
|
|
|
} else {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-04-27 17:29:46 +10:00
|
|
|
|
2020-07-20 19:14:46 +10:00
|
|
|
const mapTokens = mapState && (
|
|
|
|
|
<Group>
|
|
|
|
|
{Object.values(mapState.tokens)
|
2020-08-27 17:56:59 +10:00
|
|
|
.sort((a, b) => sortMapTokenStates(a, b, draggingTokenOptions))
|
2020-07-20 19:14:46 +10:00
|
|
|
.map((tokenState) => (
|
|
|
|
|
<MapToken
|
|
|
|
|
key={tokenState.id}
|
|
|
|
|
token={tokensById[tokenState.tokenId]}
|
|
|
|
|
tokenState={tokenState}
|
|
|
|
|
tokenSizePercent={tokenSizePercent}
|
|
|
|
|
onTokenStateChange={onMapTokenStateChange}
|
|
|
|
|
onTokenMenuOpen={handleTokenMenuOpen}
|
|
|
|
|
onTokenDragStart={(e) =>
|
|
|
|
|
setDraggingTokenOptions({
|
|
|
|
|
dragging: true,
|
|
|
|
|
tokenState,
|
|
|
|
|
tokenGroup: e.target,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
onTokenDragEnd={() =>
|
|
|
|
|
setDraggingTokenOptions({
|
|
|
|
|
...draggingTokenOptions,
|
|
|
|
|
dragging: false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
draggable={
|
2020-08-27 17:30:17 +10:00
|
|
|
selectedToolId === "pan" &&
|
|
|
|
|
!(tokenState.id in disabledTokens) &&
|
|
|
|
|
!tokenState.locked
|
2020-07-20 19:14:46 +10:00
|
|
|
}
|
|
|
|
|
mapState={mapState}
|
2020-07-31 14:50:01 +10:00
|
|
|
fadeOnHover={selectedToolId === "drawing"}
|
2020-08-07 12:55:16 +10:00
|
|
|
map={map}
|
2020-07-20 19:14:46 +10:00
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</Group>
|
|
|
|
|
);
|
2020-03-20 17:56:34 +11:00
|
|
|
|
2020-05-22 13:46:52 +10:00
|
|
|
const tokenMenu = (
|
2020-05-21 16:46:50 +10:00
|
|
|
<TokenMenu
|
|
|
|
|
isOpen={isTokenMenuOpen}
|
|
|
|
|
onRequestClose={() => setIsTokenMenuOpen(false)}
|
2020-05-22 22:17:30 +10:00
|
|
|
onTokenStateChange={onMapTokenStateChange}
|
2020-05-22 13:46:52 +10:00
|
|
|
tokenState={mapState && mapState.tokens[tokenMenuOptions.tokenStateId]}
|
2020-05-21 16:46:50 +10:00
|
|
|
tokenImage={tokenMenuOptions.tokenImage}
|
2020-08-27 17:30:17 +10:00
|
|
|
map={map}
|
2020-05-21 16:46:50 +10:00
|
|
|
/>
|
2020-04-13 00:24:03 +10:00
|
|
|
);
|
|
|
|
|
|
2020-05-22 20:43:07 +10:00
|
|
|
const tokenDragOverlay = draggingTokenOptions && (
|
2020-05-21 22:57:44 +10:00
|
|
|
<TokenDragOverlay
|
2020-05-22 20:43:07 +10:00
|
|
|
onTokenStateRemove={(state) => {
|
|
|
|
|
onMapTokenStateRemove(state);
|
|
|
|
|
setDraggingTokenOptions(null);
|
2020-04-13 00:24:03 +10:00
|
|
|
}}
|
2020-05-22 20:43:07 +10:00
|
|
|
onTokenStateChange={onMapTokenStateChange}
|
|
|
|
|
tokenState={draggingTokenOptions && draggingTokenOptions.tokenState}
|
2020-07-20 19:05:19 +10:00
|
|
|
tokenGroup={draggingTokenOptions && draggingTokenOptions.tokenGroup}
|
|
|
|
|
dragging={draggingTokenOptions && draggingTokenOptions.dragging}
|
2020-05-22 20:43:07 +10:00
|
|
|
token={tokensById[draggingTokenOptions.tokenState.tokenId]}
|
|
|
|
|
mapState={mapState}
|
2020-05-21 22:57:44 +10:00
|
|
|
/>
|
2020-04-13 00:24:03 +10:00
|
|
|
);
|
|
|
|
|
|
2020-04-24 16:18:48 +10:00
|
|
|
const mapDrawing = (
|
|
|
|
|
<MapDrawing
|
2020-08-07 12:28:50 +10:00
|
|
|
map={map}
|
2020-04-28 22:05:47 +10:00
|
|
|
shapes={mapShapes}
|
|
|
|
|
onShapeAdd={handleMapShapeAdd}
|
2020-05-31 12:12:16 +10:00
|
|
|
onShapesRemove={handleMapShapesRemove}
|
2020-08-04 14:51:31 +10:00
|
|
|
active={selectedToolId === "drawing"}
|
|
|
|
|
toolId="drawing"
|
2020-08-07 17:15:16 +10:00
|
|
|
toolSettings={settings.drawing}
|
2020-04-28 22:05:47 +10:00
|
|
|
gridSize={gridSizeNormalized}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const mapFog = (
|
|
|
|
|
<MapFog
|
2020-08-07 12:28:50 +10:00
|
|
|
map={map}
|
2020-04-28 22:05:47 +10:00
|
|
|
shapes={fogShapes}
|
|
|
|
|
onShapeAdd={handleFogShapeAdd}
|
2020-06-09 12:45:52 +10:00
|
|
|
onShapeSubtract={handleFogShapeSubtract}
|
2020-05-31 12:12:16 +10:00
|
|
|
onShapesRemove={handleFogShapesRemove}
|
|
|
|
|
onShapesEdit={handleFogShapesEdit}
|
2020-08-04 14:51:31 +10:00
|
|
|
active={selectedToolId === "fog"}
|
|
|
|
|
toolId="fog"
|
2020-08-07 17:15:16 +10:00
|
|
|
toolSettings={settings.fog}
|
2020-04-24 16:18:48 +10:00
|
|
|
gridSize={gridSizeNormalized}
|
2020-08-07 17:15:16 +10:00
|
|
|
transparent={allowFogDrawing && !settings.fog.preview}
|
2020-04-24 16:18:48 +10:00
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
2020-05-31 16:25:05 +10:00
|
|
|
const mapGrid = map && map.showGrid && (
|
|
|
|
|
<MapGrid map={map} gridSize={gridSizeNormalized} />
|
|
|
|
|
);
|
|
|
|
|
|
2020-06-26 12:23:06 +10:00
|
|
|
const mapMeasure = (
|
|
|
|
|
<MapMeasure
|
2020-08-07 12:28:50 +10:00
|
|
|
map={map}
|
2020-06-26 12:23:06 +10:00
|
|
|
active={selectedToolId === "measure"}
|
|
|
|
|
gridSize={gridSizeNormalized}
|
2020-08-07 17:15:16 +10:00
|
|
|
selectedToolSettings={settings[selectedToolId]}
|
2020-06-26 12:23:06 +10:00
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
2020-07-28 17:59:26 +10:00
|
|
|
const mapPointer = (
|
|
|
|
|
<NetworkedMapPointer
|
|
|
|
|
active={selectedToolId === "pointer"}
|
|
|
|
|
gridSize={gridSizeNormalized}
|
|
|
|
|
session={session}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
2020-03-19 17:33:57 +11:00
|
|
|
return (
|
2020-05-21 16:46:50 +10:00
|
|
|
<MapInteraction
|
|
|
|
|
map={map}
|
|
|
|
|
controls={
|
|
|
|
|
<>
|
|
|
|
|
{mapControls}
|
|
|
|
|
{tokenMenu}
|
2020-05-21 22:57:44 +10:00
|
|
|
{tokenDragOverlay}
|
2020-06-28 13:37:04 +10:00
|
|
|
<MapLoadingOverlay />
|
2020-05-21 16:46:50 +10:00
|
|
|
</>
|
|
|
|
|
}
|
2020-05-22 13:47:11 +10:00
|
|
|
selectedToolId={selectedToolId}
|
2020-06-22 09:22:20 +10:00
|
|
|
onSelectedToolChange={setSelectedToolId}
|
2020-06-26 12:32:51 +10:00
|
|
|
disabledControls={disabledControls}
|
2020-05-21 16:46:50 +10:00
|
|
|
>
|
2020-05-31 16:25:05 +10:00
|
|
|
{mapGrid}
|
2020-05-22 13:47:11 +10:00
|
|
|
{mapDrawing}
|
2020-05-21 16:46:50 +10:00
|
|
|
{mapTokens}
|
2020-05-22 17:22:32 +10:00
|
|
|
{mapFog}
|
2020-07-28 17:59:26 +10:00
|
|
|
{mapPointer}
|
2020-06-26 12:23:06 +10:00
|
|
|
{mapMeasure}
|
2020-05-21 16:46:50 +10:00
|
|
|
</MapInteraction>
|
2020-03-19 17:33:57 +11:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Map;
|