Add basic hex functionality and clean up hooks and Vector2 class

This commit is contained in:
Mitchell McCaffrey
2021-02-04 15:06:34 +11:00
parent 924b3e2481
commit de84e77e58
61 changed files with 835 additions and 573 deletions

View File

@@ -16,6 +16,12 @@ const qualitySettings = [
{ value: "original", label: "Original" },
];
const gridTypeSettings = [
{ value: "square", label: "Square" },
{ value: "hexVertical", label: "Hex Vertical" },
{ value: "hexHorizontal", label: "Hex Horizontal" },
];
function MapSettings({
map,
mapState,
@@ -141,13 +147,15 @@ function MapSettings({
<Box mb={1} sx={{ width: "50%" }}>
<Label mb={1}>Grid Type</Label>
<Select
defaultValue={{ value: "square", label: "Square" }}
isDisabled={mapEmpty || map.type === "default"}
options={[
{ value: "square", label: "Square" },
{ value: "hex", label: "Hex (Coming Soon)" },
]}
isOptionDisabled={(option) => option.value === "hex"}
options={gridTypeSettings}
value={
!mapEmpty &&
gridTypeSettings.find((s) => s.value === map.grid.type)
}
onChange={(option) =>
onSettingsChange("grid", { ...map.grid, type: option.value })
}
isSearchable={false}
/>
</Box>