Skip to content

Commit

Permalink
Merge branch 'release/0.15.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruptein committed Apr 14, 2019
2 parents 978c40e + 6ca8e55 commit 64bae5c
Show file tree
Hide file tree
Showing 59 changed files with 1,941 additions and 2,432 deletions.
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,56 @@ All notable changes to this project will be documented in this file.

## Unreleased

## [0.15.0] - 2019-04-14

### Added

- Keybinding to toggle UI (ctrl+u).
- Keybinding to copy selection to clipboard (ctrl+c).
- Keybinding to paste clipboard to board (ctrl+v).
- Labeling system.
- You can add labels to shapes.
- You can filter the gameboard on these labels.

### Changed

- Asset preview now disappears when starting a drag asset action.
- A mouse down in general will now trigger layer or tool selection.
- In the past a 'click' was required, now any 'mousedown' will trigger.
- Zoom scale has been modified.
- Select tool can now also select shapes not owned by the player.
- The selection info box is shown with all info visible for the user.
- The tokens cannot be dragged or resized.
- Groupselect will only select your own tokens.
- Some minor style changes to the edit asset dialog
- Shape names can now be hidden from other users.
- Default vision mode changed to triangle mode. Legacy vision mode (bvh) can still be selected in the DM options.

### Fixed

- Bug causing rulers to stick on DM screen.
- Bug causing rulers to not appear on other screens.
- Drag and drop asset on firefox redirecting to random urls.
- Some eventlisteners not being removed properly.
- This caused zoom behaviour to mess up when leaving and joining a room multiple times.
- Bug causing players not being able to add or update initiative effects.
- Bug causing shown initiative effect to be one lower than it actually is on location load.
- Move layer to/from DM layer having broken results for players untill a refresh of the page.
- Bug causing some windows (e.g. initiatives) to no longer appear.
- Vision bugs at different zoom levels caused by the world boundary being too large.
- Reduced boundary location from 1e10 to 1e8.
- Bug causing the vision recalculation not happening in a lot of cases.

### Removed

- Some old css files.

### [0.14.2] - 2019-01-29

### Fixed

- Registered users had to logout and login again before being able to perform actions.
- [tech] Javascript files being wrongly served as plaintext in some obscure cases.

## [0.14.1] - 2019-01-28

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.6-slim

MAINTAINER Schemen <me@schemen.me>
MAINTAINER Kruptein <info@darragh.dev>

EXPOSE 8000

Expand Down
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.14.2",
"version": "0.15.0",
"description": "A companion tool for when you travel into the planes.",
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
116 changes: 116 additions & 0 deletions client/src/core/components/accordion.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<template>
<div class="accordion">
<div id="header" @click.prevent="toggleDisplay">
<input type="checkbox" @click.stop="toggleCategory" ref="overall">
<strong>{{title}}</strong>
<template v-if="showArrow">
<span class="down-Arrow" v-show="showArrow && !active">&#9660;</span>
<span class="up-Arrow" v-show="showArrow && active">&#9650;</span>
</template>
</div>
<div v-show="active" id="body">
<div v-for="item in items" :key="item[0]" class="item" @click="toggleSelection(item[0])">
<input type="checkbox" :checked="selected.includes(item[0])" @click.prevent> {{ item[1] }}
</div>
</div>
</div>
</template>

<script lang="ts">
import Vue from "vue";
import Component from "vue-class-component";
import { Prop } from "vue-property-decorator";
import { gameStore } from '../../game/store';
@Component
export default class Accordion extends Vue {
@Prop(String) title!: string;
@Prop({ default: true, type: Boolean }) showArrow!: boolean;
@Prop({ default: () => []}) items!: [string, string][];
@Prop({ default: () => []}) initialValues!: string[];
selected: string[] = [];
active = false;
mounted() {
this.selected = this.initialValues;
this.updateCategory();
}
toggleDisplay(event: MouseEvent) {
this.active = !this.active;
}
toggleCategory() {
const overall = this.$refs.overall as HTMLInputElement;
if (overall.checked) this.selected = this.items.map((i) => i[0]);
else this.selected = [];
this.$emit("selectionupdate", {title: this.title, selection: this.selected});
}
updateCategory() {
const overall = this.$refs.overall as HTMLInputElement;
if (this.selected.length === 0) {
overall.checked = false;
overall.indeterminate = false;
} else if(this.selected.length === this.items.length) {
overall.checked = true;
overall.indeterminate = false;
} else {
overall.checked = false;
overall.indeterminate = true;
}
}
toggleSelection(item: string) {
const found = this.selected.indexOf(item);
if (found === -1) this.selected.push(item);
else this.selected.splice(found, 1);
this.updateCategory();
this.$emit("selectionupdate", {title: this.title, selection: this.selected});
}
}
</script>

<style scoped>
.accordion {
border: solid 2px #ff7052;
user-select: none !important;
-webkit-user-drag: none !important;
}
#header {
background-color: #ff7052;
cursor: pointer;
padding: 0.5em;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
*[type="checkbox"] {
width: min-content;
margin-right: 10px;
}
#body {
padding: 0.3em;
display: flex;
flex-direction: column;
/* background-color: red; */
}
.item {
padding: 0.2em;
display: flex;
align-items: center;
}
.item:hover {
background-color: #ff7052;
cursor: pointer;
}
</style>
38 changes: 21 additions & 17 deletions client/src/core/components/colorpicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
// This due to the canvas elements requiring rgba strings for their colours and thus avoiding extra conversion steps

<template>
<div class="outer" @click.self="open">
<div
class="current-color"
@click.self="open"
:style="transparent ? 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)' : 'background-color:' + color"
></div>
<div class="mask" v-show="display" @click.self="closePicker"></div>
<chrome-picker
:value="color"
@input="updateColor"
:style="{position: 'fixed', left:left + 'px', top:top + 'px', 'z-index': 9999}"
tabindex="-1"
v-show="display"
ref="chromePicker"
/>
</div>
<div class="outer" @click.self="open">
<div
class="current-color"
@click.self="open"
:style="transparent ? 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)' : 'background-color:' + color"
></div>
<div class="mask" v-show="display" @click.self="closePicker"></div>
<chrome-picker
:value="color"
@input="updateColor"
:style="{position: 'fixed', left:left + 'px', top:top + 'px', 'z-index': 9999}"
tabindex="-1"
v-show="display"
ref="chromePicker"
/>
</div>
</template>

<script lang="ts">
Expand All @@ -37,6 +37,7 @@ import { Prop } from "vue-property-decorator";
})
export default class ColorPicker extends Vue {
@Prop(String) color!: string;
@Prop(Boolean) disabled!: boolean;
display = false;
left = 0;
Expand All @@ -49,7 +50,7 @@ export default class ColorPicker extends Vue {
}
open() {
if (this.display) return; // click on the picker itself
if (this.display || this.disabled) return; // click on the picker itself
this.setPosition();
this.display = true;
this.$nextTick(() => this.$children[0].$el.focus());
Expand Down Expand Up @@ -82,6 +83,9 @@ export default class ColorPicker extends Vue {
border: solid 1px black;
border-radius: 3px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
.current-color {
width: 13px;
Expand Down
32 changes: 30 additions & 2 deletions client/src/game/api/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { createLayer } from "@/game/layers/utils";
import { gameManager } from "@/game/manager";
import { gameStore } from "@/game/store";
import { router } from "@/router";
import { zoomDisplay } from "../utils";

socket.on("connect", () => {
console.log("Connected");
Expand Down Expand Up @@ -43,7 +44,8 @@ socket.on("Client.Options.Set", (options: ServerClient) => {
gameStore.setRulerColour({ colour: options.ruler_colour, sync: false });
gameStore.setPanX(options.pan_x);
gameStore.setPanY(options.pan_y);
gameStore.setZoomFactor(options.zoom_factor);
gameStore.setZoomDisplay(zoomDisplay(options.zoom_factor));
// gameStore.setZoomDisplay(0.5);
if (options.active_layer) layerManager.selectLayer(options.active_layer, false);
if (layerManager.getGridLayer() !== undefined) layerManager.getGridLayer()!.invalidate();
});
Expand Down Expand Up @@ -122,7 +124,7 @@ socket.on("Shape.Layer.Change", (data: { uuid: string; layer: string }) => {
if (shape === undefined) return;
shape.moveLayer(data.layer, false);
});
socket.on("Shape.Update", (data: { shape: ServerShape; redraw: boolean; move: boolean }) => {
socket.on("Shape.Update", (data: { shape: ServerShape; redraw: boolean; move: boolean, temporary: boolean }) => {
gameManager.updateShape(data);
});
socket.on("Temp.Clear", (shapes: ServerShape[]) => {
Expand All @@ -139,3 +141,29 @@ socket.on("Temp.Clear", (shapes: ServerShape[]) => {
layerManager.getLayer(shape.layer)!.removeShape(realShape, false);
});
});
socket.on("Labels.Set", (labels: Label[]) => {
for (const label of labels) gameStore.addLabel(label);
});
socket.on("Label.Visibility.Set", (data: { user: string; uuid: string; visible: boolean }) => {
gameStore.setLabelVisibility(data);
});
socket.on("Label.Add", (data: Label) => {
gameStore.addLabel(data);
});
socket.on("Label.Delete", (data: { user: string; uuid: string }) => {
gameStore.deleteLabel(data);
});
socket.on("Labels.Filter.Add", (uuid: string) => {
gameStore.labelFilters.push(uuid);
layerManager.invalidate();
})
socket.on("Labels.Filter.Remove", (uuid: string) => {
const idx = gameStore.labelFilters.indexOf(uuid);
if (idx >= 0) {
gameStore.labelFilters.splice(idx, 1);
layerManager.invalidate();
}
})
socket.on("Labels.Filters.Set", (filters: string[]) => {
gameStore.setLabelFilters(filters);
})
2 changes: 2 additions & 0 deletions client/src/game/comm/types/shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ export interface ServerShape {
draw_operator: string;
trackers: Tracker[];
auras: ServerAura[];
labels: Label[];
owners: string[];
fill_colour: string;
stroke_colour: string;
name: string;
name_visible: boolean;
annotation: string;
is_token: boolean;
options?: string;
Expand Down
Loading

0 comments on commit 64bae5c

Please sign in to comment.