Merge branch 'preview/v1.8.0' into release/v1.8.0

This commit is contained in:
Mitchell McCaffrey 2021-02-13 15:48:23 +11:00
commit 70eb049b4a
7 changed files with 77 additions and 6 deletions

View File

@ -27,7 +27,6 @@ import {
getRelativePointerPosition,
} from "../../helpers/konva";
import useDebounce from "../../hooks/useDebounce";
import useSetting from "../../hooks/useSetting";
function MapFog({

View File

@ -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";

View File

@ -0,0 +1,62 @@
## 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 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.
- 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.

View File

@ -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";

View File

@ -45,7 +45,7 @@ function EditMapModal({ isOpen, onDone, mapId }) {
setMap();
setMapState();
}
}, [isOpen, mapId, getMapFromDB, mapStates]);
}, [isOpen, mapId, getMapFromDB, mapStates, getMap]);
function handleClose() {
setMapSettingChanges({});

View File

@ -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) => ({

View File

@ -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() {
<Text mb={2} variant="heading" as="h1" sx={{ fontSize: 5 }}>
Release Notes
</Text>
<div id="v180">
<Accordion heading="v1.8.0 (Preview)" defaultOpen>
<Markdown source={v180} />
</Accordion>
</div>
<div id="v170">
<Accordion heading="v1.7.0" defaultOpen>
<Accordion heading="v1.7.0" defaultOpen={location.hash === "#v170"}>
<Markdown source={v170} />
</Accordion>
</div>