From 8117f7da2ea6d70ca56acf1ae51feacb2e94f70a Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 11 Feb 2021 20:58:34 +1100 Subject: [PATCH 1/7] Added v1.8.0 preview release notes --- src/docs/releaseNotes/v1.8.0.md | 57 +++++++++++++++++++++++++++++++++ src/routes/ReleaseNotes.js | 8 ++++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/docs/releaseNotes/v1.8.0.md diff --git a/src/docs/releaseNotes/v1.8.0.md b/src/docs/releaseNotes/v1.8.0.md new file mode 100644 index 0000000..f7c6c2d --- /dev/null +++ b/src/docs/releaseNotes/v1.8.0.md @@ -0,0 +1,57 @@ +## Major Changes + +### Hex Grid Support + +It's been a little while but hex grids are finally here. +When you import a map you can now select the Hex Vertical and Hex Horizontal Grid Types. Hex Vertical orients the hex grid with the pointy end up while Hex Horizontal orients with the point end to the right. + +To Support hex grids a few things have changed. + +- The measurement options which used to be in the ruler tools settings are now under a map's settings below the grid type. +- Square and hex grid types now offer different measurement options. +- Measurements are now presented in increments of your grid scale. +- A new grid renderer was added that is optimized for larger grid sizes. +- All grid snapping now supports hex grids. +- Tokens can now snap to the center of grid cells. +- Tokens now rotate in 15° increments. + +### Database Import/Export + +This release brings the first step of being able to import and export your data in Owlbear Rodeo. + +With the new Import/Export button in the Settings screen you can make a full backup of your data and import that data on any other computer / browser. + +This also works from PC to mobile so if you wish you can do your prep on a PC transfer that data over to play on mobile. + +In the future we plan to add the ability to be more selective with what you import/export but for now this is a good first step. + +### Coloured Pointers + +Players can now choose the colour of their pointer thanks to a new pointer renderer which allows pointers to dynamically blend into the background. + +### Fog Snapping Overhaul + +This release adds a few changes to the way snapping works with fog to make the tool easier to use. + +- When using the rectangle or polygon fog tool guidelines are now shown to indicate where your grid snapping point is. +- Fog snapping is now aware of other fog shapes and will allow you to match the width or height of shapes close by. +- A new edge snapping algorithm works with cut fog shapes and will also prioritise the vertices of your fog to allow for easier aligning of nearby shapes. +- A new visual for edge snapping allows you to preview where your snapping will appear. +- While editing fog now has a transparent white border that helps indicate where the borders of your fog shapes are. +- The diagonal pattern of hidden fog shapes is now blended more with the background to create greater contrast between visible shapes while also allowing you to better see your maps. + +### New Text Only Mode for Notes + +Notes can now be set to a text only mode that removes the background and allows you to change the colour of the text. + +A GM can toggle this setting by clicking on a note once it is on the map and clicking the Text Mode button. + +## Minor Changes + +- Token label sizes is now dynamic and will shrink to fit more text +- The initial loading of maps and tokens has been optimised to be quicker and a few bugs have been fixed that prevented loading of large databases. To accomplish this a database conversion was necessary so the first time you load v1.8.0 you may experience a longer load time but after this conversion load time should be improved. +- Drawing and fog tools now use a more optimised storage format. This means that there should be bugs with syncing this data. It does now mean that undo history for fog editing and drawing is now only available until you refresh your page. +- A new Grid Snapping Sensitivity option was added to the Settings screen that allows you to edit how much grid snapping occurs. 0 = no snapping and 1 = full grid snapping. +- Notes are now shown above drawings to prevent the case where you can't move your note because a drawing was on top of it. +- Fixed a crash caused by pressing the delete key when in the map editor. +- Fixed a regression that caused an unsupported browser message to appear on browsers that were previously supported. diff --git a/src/routes/ReleaseNotes.js b/src/routes/ReleaseNotes.js index baf2e92..08f72a5 100644 --- a/src/routes/ReleaseNotes.js +++ b/src/routes/ReleaseNotes.js @@ -24,6 +24,7 @@ const v160 = raw("../docs/releaseNotes/v1.6.0.md"); const v161 = raw("../docs/releaseNotes/v1.6.1.md"); const v162 = raw("../docs/releaseNotes/v1.6.2.md"); const v170 = raw("../docs/releaseNotes/v1.7.0.md"); +const v180 = raw("../docs/releaseNotes/v1.8.0.md"); function ReleaseNotes() { const location = useLocation(); @@ -48,8 +49,13 @@ function ReleaseNotes() { Release Notes +
+ + + +
- +
From 57e64e132beb9a3d019371e256f3f021ebb7bcaf Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 11 Feb 2021 23:01:32 +1100 Subject: [PATCH 2/7] Changed db import to use importInto --- src/modals/ImportExportModal.js | 1 - src/workers/DatabaseWorker.js | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modals/ImportExportModal.js b/src/modals/ImportExportModal.js index d518254..98723bf 100644 --- a/src/modals/ImportExportModal.js +++ b/src/modals/ImportExportModal.js @@ -35,7 +35,6 @@ function ImportDatabaseModal({ isOpen, onRequestClose }) { async function handleImportDatabase(file) { setIsLoading(true); backgroundTaskRunningRef.current = true; - await database.delete(); await worker.importData(file, Comlink.proxy(handleDBProgress)); setIsLoading(false); backgroundTaskRunningRef.current = false; diff --git a/src/workers/DatabaseWorker.js b/src/workers/DatabaseWorker.js index 3e7bbf2..d30a526 100644 --- a/src/workers/DatabaseWorker.js +++ b/src/workers/DatabaseWorker.js @@ -1,5 +1,5 @@ import * as Comlink from "comlink"; -import { importDB, exportDB } from "dexie-export-import"; +import { importInto, exportDB } from "dexie-export-import"; import { encode } from "@msgpack/msgpack"; import { getDatabase } from "../database"; @@ -59,7 +59,8 @@ let service = { */ async importData(data, progressCallback) { try { - await importDB(data, { progressCallback }); + let db = getDatabase({}); + await importInto(db, data, { progressCallback, overwriteValues: true }); } catch {} }, }; From 002a52674b805a86474e55d42ce2167515e0b218 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 11 Feb 2021 23:09:00 +1100 Subject: [PATCH 3/7] Clear map actions when map changes --- src/network/NetworkedMapAndTokens.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/network/NetworkedMapAndTokens.js b/src/network/NetworkedMapAndTokens.js index a75c945..2238d7b 100644 --- a/src/network/NetworkedMapAndTokens.js +++ b/src/network/NetworkedMapAndTokens.js @@ -336,11 +336,14 @@ function NetworkedMapAndTokens({ session }) { updateActionIndex(1, "fogDrawActionIndex", "fogDrawActions", "fogShapes"); } + // If map changes clear map actions + const previousMapIdRef = useRef(); useEffect(() => { - if (!currentMapState) { + if (currentMap && currentMap.id !== previousMapIdRef.current) { setMapActions(defaultMapActions); + previousMapIdRef.current = currentMap.id; } - }, [currentMapState]); + }, [currentMap]); function handleNoteChange(note) { setCurrentMapState((prevMapState) => ({ From 9370365ab49e15d3310a2ed584614072198e26ab Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 12 Feb 2021 00:38:36 +1100 Subject: [PATCH 4/7] Fix warnings --- src/components/map/MapFog.js | 1 - src/contexts/GridContext.js | 2 +- src/helpers/konva.js | 1 + src/modals/EditMapModal.js | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/map/MapFog.js b/src/components/map/MapFog.js index bec840d..51a64cc 100644 --- a/src/components/map/MapFog.js +++ b/src/components/map/MapFog.js @@ -27,7 +27,6 @@ import { getRelativePointerPosition, } from "../../helpers/konva"; -import useDebounce from "../../hooks/useDebounce"; import useSetting from "../../hooks/useSetting"; function MapFog({ diff --git a/src/contexts/GridContext.js b/src/contexts/GridContext.js index d8e9ca9..6598000 100644 --- a/src/contexts/GridContext.js +++ b/src/contexts/GridContext.js @@ -1,4 +1,4 @@ -import React, { useContext, useCallback } from "react"; +import React, { useContext } from "react"; import Vector2 from "../helpers/Vector2"; import Size from "../helpers/Size"; diff --git a/src/helpers/konva.js b/src/helpers/konva.js index 7ad3883..e391a64 100644 --- a/src/helpers/konva.js +++ b/src/helpers/konva.js @@ -1,5 +1,6 @@ import React, { useState, useEffect, useRef } from "react"; import { Line, Group, Path, Circle } from "react-konva"; +// eslint-disable-next-line no-unused-vars import Konva from "konva"; import Color from "color"; import Vector2 from "./Vector2"; diff --git a/src/modals/EditMapModal.js b/src/modals/EditMapModal.js index 37399f0..c590102 100644 --- a/src/modals/EditMapModal.js +++ b/src/modals/EditMapModal.js @@ -45,7 +45,7 @@ function EditMapModal({ isOpen, onDone, mapId }) { setMap(); setMapState(); } - }, [isOpen, mapId, getMapFromDB, mapStates]); + }, [isOpen, mapId, getMapFromDB, mapStates, getMap]); function handleClose() { setMapSettingChanges({}); From 9b0bf9c00559ed2be0158b4eb4943fa597c0aa5f Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 12 Feb 2021 00:40:30 +1100 Subject: [PATCH 5/7] Update ImportExportModal.js --- src/modals/ImportExportModal.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/modals/ImportExportModal.js b/src/modals/ImportExportModal.js index 98723bf..dde8a54 100644 --- a/src/modals/ImportExportModal.js +++ b/src/modals/ImportExportModal.js @@ -7,14 +7,11 @@ import Modal from "../components/Modal"; import LoadingOverlay from "../components/LoadingOverlay"; import LoadingBar from "../components/LoadingBar"; -import { useDatabase } from "../contexts/DatabaseContext"; - import DatabaseWorker from "worker-loader!../workers/DatabaseWorker"; // eslint-disable-line import/no-webpack-loader-syntax const worker = Comlink.wrap(new DatabaseWorker()); function ImportDatabaseModal({ isOpen, onRequestClose }) { - const { database } = useDatabase(); const [isLoading, setIsLoading] = useState(false); const backgroundTaskRunningRef = useRef(false); From a81cacb5fdf4bcbd84dabf102d60c5a34bb173af Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 12 Feb 2021 00:40:42 +1100 Subject: [PATCH 6/7] Add known issues to 1.8.0 release notes --- src/docs/releaseNotes/v1.8.0.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/docs/releaseNotes/v1.8.0.md b/src/docs/releaseNotes/v1.8.0.md index f7c6c2d..21f880f 100644 --- a/src/docs/releaseNotes/v1.8.0.md +++ b/src/docs/releaseNotes/v1.8.0.md @@ -55,3 +55,8 @@ A GM can toggle this setting by clicking on a note once it is on the map and cli - Notes are now shown above drawings to prevent the case where you can't move your note because a drawing was on top of it. - Fixed a crash caused by pressing the delete key when in the map editor. - Fixed a regression that caused an unsupported browser message to appear on browsers that were previously supported. + +## Known Issues + +- Databases with maps over 10MB in size will fail to import. +- The triangle shape tool is offset with hex grids. From b557d001691a6f48d8375d7d26e8b606dc33922e Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 12 Feb 2021 08:54:02 +1100 Subject: [PATCH 7/7] Update v1.8.0.md --- src/docs/releaseNotes/v1.8.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/releaseNotes/v1.8.0.md b/src/docs/releaseNotes/v1.8.0.md index 21f880f..0a9a9fd 100644 --- a/src/docs/releaseNotes/v1.8.0.md +++ b/src/docs/releaseNotes/v1.8.0.md @@ -50,7 +50,7 @@ A GM can toggle this setting by clicking on a note once it is on the map and cli - Token label sizes is now dynamic and will shrink to fit more text - The initial loading of maps and tokens has been optimised to be quicker and a few bugs have been fixed that prevented loading of large databases. To accomplish this a database conversion was necessary so the first time you load v1.8.0 you may experience a longer load time but after this conversion load time should be improved. -- Drawing and fog tools now use a more optimised storage format. This means that there should be bugs with syncing this data. It does now mean that undo history for fog editing and drawing is now only available until you refresh your page. +- Drawing and fog tools now use a more optimised storage format. This means that there should be less bugs with syncing this data. It does now mean that undo history for fog editing and drawing is now only available until you refresh your page. - A new Grid Snapping Sensitivity option was added to the Settings screen that allows you to edit how much grid snapping occurs. 0 = no snapping and 1 = full grid snapping. - Notes are now shown above drawings to prevent the case where you can't move your note because a drawing was on top of it. - Fixed a crash caused by pressing the delete key when in the map editor.