Skip to content

Commit

Permalink
Merge branch 'hotfix/0.19.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruptein committed Mar 22, 2020
2 parents 6ec0453 + de82a7c commit d9fe958
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 47 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ All notable changes to this project will be documented in this file.

## Unreleased

## [0.19.2] - 2020-03-22

### Added

- Favicon

### Changed

- Only show snap points visually for the DM
- This could otherwise expose hidden things to players.

### Fixed

- Use grid toggle not working properly
- Show badge toggle not always synchronizing
- Moving shape to a different layer no longer leaves the old selection box around

## [0.19.1] - 2020-03-22

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Some key features are:
**Offline support**: This tool can be used in a completely offline set-up for when you play D&D in a dark dungeon.

**Simple layers**: Organize your scenes in layers for easier management.\
**Infinite canvas**: When a limited workspace is still nog enough!\
**Infinite canvas**: When a limited workspace is still not enough!\
**Dynamic lighting**: Increase your immersion by working with light and shadows.\
**Player vision**: Limit vision to what your token(s) can see. Is your companion in a different room, no light for you!\
**Initiative tracker**: Simple initiative tracker
Expand Down Expand Up @@ -47,5 +47,7 @@ If you simply have feedback, or found a bug, go to the issues tab above. First s

If you want to contribute to the actual codebase, you can read more about how to setup a development environment in the CONTRIBUTING document.

If you want to contribute some gold pieces, feel free to checkout my [pateron](https://patreon.com/planarally)

![Example view of a player with a light source](https://github.com/Kruptein/PlanarAlly/blob/dev/extra/player_light_example.png?raw=true)
_Credits to Gogots for the background map used [source](https://gogots.deviantart.com/art/City-of-Moarkaliff-702295905)_
2 changes: 1 addition & 1 deletion client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "planarally-client",
"version": "0.19.0-rc.1",
"version": "0.19.2",
"description": "A companion tool for when you travel into the planes.",
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
38 changes: 22 additions & 16 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>PlanarAlly - The companion tool for your planar travels.</title>
<script
defer
src="/static/extern/js/fontawesome-5.6.3.js"
integrity="sha384-EIHISlAOj4zgYieurP0SdoiBYfGJKkgWedPHH4jCzpCXLmzVsw1ouK59MuUtP4a1"
></script>
<link rel="stylesheet" type="text/css" href="/static/extern/css/directory.css" />
<link rel="shortcut icon" type="image/png" href="/static/favicon.png" />
</head>

<head>
<meta charset="utf-8">
<title>PlanarAlly - The companion tool for your planar travels.</title>
<script defer src="/static/extern/js/fontawesome-5.6.3.js" integrity="sha384-EIHISlAOj4zgYieurP0SdoiBYfGJKkgWedPHH4jCzpCXLmzVsw1ouK59MuUtP4a1"></script>
<link rel="stylesheet" type="text/css" href="/static/extern/css/directory.css">
</head>

<body>
<noscript>
<strong>We're sorry but PlanarAlly doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>

</html>
<body>
<noscript>
<strong>
We're sorry but PlanarAlly doesn't work properly without JavaScript enabled. Please enable it to
continue.
</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
48 changes: 25 additions & 23 deletions client/src/game/layers/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,37 @@ export class GridLayer extends Layer {
invalidate(): void {
this.valid = false;
}
show(): void {
if (gameStore.useGrid) this.canvas.style.removeProperty("display");
}
draw(_doClear?: boolean): void {
if (!this.valid) {
this.drawGrid();
}
}
drawGrid(): void {
const activeFowFloorName = layerManager.floor?.name;
if (gameStore.useGrid) {
const activeFowFloorName = layerManager.floor?.name;

if (this.floor === activeFowFloorName && this.canvas.style.display === "none")
this.canvas.style.removeProperty("display");
else if (this.floor !== activeFowFloorName && this.canvas.style.display !== "none")
this.canvas.style.display = "none";
if (this.floor === activeFowFloorName && this.canvas.style.display === "none")
this.canvas.style.removeProperty("display");
else if (this.floor !== activeFowFloorName && this.canvas.style.display !== "none")
this.canvas.style.display = "none";

const ctx = this.ctx;
this.clear();
ctx.beginPath();
const ctx = this.ctx;
this.clear();
ctx.beginPath();

const gs = gameStore.gridSize;
const gs = gameStore.gridSize;

for (let i = 0; i < this.width; i += gs * gameStore.zoomFactor) {
ctx.moveTo(i + (gameStore.panX % gs) * gameStore.zoomFactor, 0);
ctx.lineTo(i + (gameStore.panX % gs) * gameStore.zoomFactor, this.height);
ctx.moveTo(0, i + (gameStore.panY % gs) * gameStore.zoomFactor);
ctx.lineTo(this.width, i + (gameStore.panY % gs) * gameStore.zoomFactor);
}
for (let i = 0; i < this.width; i += gs * gameStore.zoomFactor) {
ctx.moveTo(i + (gameStore.panX % gs) * gameStore.zoomFactor, 0);
ctx.lineTo(i + (gameStore.panX % gs) * gameStore.zoomFactor, this.height);
ctx.moveTo(0, i + (gameStore.panY % gs) * gameStore.zoomFactor);
ctx.lineTo(this.width, i + (gameStore.panY % gs) * gameStore.zoomFactor);
}

ctx.strokeStyle = gameStore.gridColour;
ctx.lineWidth = 1;
ctx.stroke();
this.valid = true;
ctx.strokeStyle = gameStore.gridColour;
ctx.lineWidth = 1;
ctx.stroke();
}
this.valid = true;
}
}
}
5 changes: 3 additions & 2 deletions client/src/game/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class GameStore extends VuexModule implements GameState {
setGridColour(data: { colour: string; sync: boolean }): void {
this.gridColour = data.colour;
for (const floor of layerManager.floors) {
layerManager.getGridLayer(floor.name)!.drawGrid();
layerManager.getGridLayer(floor.name)!.invalidate();
}
if (data.sync) socket.emit("Client.Options.Set", { gridColour: data.colour });
}
Expand Down Expand Up @@ -348,6 +348,7 @@ class GameStore extends VuexModule implements GameState {
const gridLayer = layerManager.getGridLayer(floor.name)!;
if (data.useGrid) gridLayer.canvas.style.display = "block";
else gridLayer.canvas.style.display = "none";
gridLayer.invalidate();
}
// eslint-disable-next-line @typescript-eslint/camelcase
if (data.sync) socket.emit("Location.Options.Set", { use_grid: data.useGrid });
Expand All @@ -360,7 +361,7 @@ class GameStore extends VuexModule implements GameState {
this.gridSize = data.gridSize;
for (const floor of layerManager.floors) {
const gridLayer = layerManager.getGridLayer(floor.name);
if (gridLayer !== undefined) gridLayer.drawGrid();
if (gridLayer !== undefined) gridLayer.invalidate();
}
if (data.sync) socket.emit("Gridsize.Set", data.gridSize);
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/game/ui/selection/edit_dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export default class EditDialog extends Vue {
shape.showBadge = !shape.showBadge;
socket.emit("Shape.Update", {
shape: shape.asDict(),
redraw: groupMembers.length === i - 1,
redraw: groupMembers.length === i + 1,
temporary: false,
});
}
Expand Down
1 change: 1 addition & 0 deletions client/src/game/ui/selection/shapecontext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export default class ShapeContext extends Vue {
setLayer(newLayer: string): void {
const layer = this.getActiveLayer()!;
layer.selection.forEach(shape => shape.moveLayer(newLayer, true));
layer.clearSelection();
this.close();
}
setLocation(newLocation: string): void {
Expand Down
2 changes: 1 addition & 1 deletion client/src/game/ui/tools/draw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ export default class DrawTool extends Tool {
this.brushHelper = new Circle(new GlobalPoint(-1000, -1000), this.brushSize / 2, this.fillColour);
this.setupBrush();
layer.addShape(this.brushHelper, SyncMode.NO_SYNC, InvalidationMode.NORMAL, false); // during mode change the shape is already added
this.showLayerPoints();
if (gameStore.IS_DM) this.showLayerPoints();
}
onDeselect(targetLayer?: string): void {
this.activeTool = false;
Expand Down
2 changes: 1 addition & 1 deletion server/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.0-rc.1
0.19.2
Binary file added server/static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d9fe958

Please sign in to comment.