Skip to content

Commit

Permalink
Merge branch 'release/2.22.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakeyzer committed Feb 18, 2024
2 parents 04b2f25 + 401e3cd commit facab27
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 73 deletions.
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.21.0",
"version": "2.22.0",
"name": "harmless_key",
"description": "A Dungeons and Dragons Combat Tracker",
"productName": "Harmless Key",
Expand Down
4 changes: 4 additions & 0 deletions src/components/compendium/Monster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@
</template>
</div>
</div>

<div v-if="monster.environment?.length" class="mt-3">
<strong>Environment:</strong> {{ monster.environment.join(", ").capitalizeEach() }}
</div>
<q-resize-observer @resize="setSize" />
</div>
<hk-loader v-else name="monster" />
Expand Down
15 changes: 10 additions & 5 deletions src/components/encounters/Entities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,16 @@ export default {
},
},
visibleColumns() {
return this.width > 600
? ["challenge_rating", "name", "type", "environment", "actions"]
: this.width > 450
? ["challenge_rating", "name", "type", "actions"]
: ["challenge_rating", "name", "actions"];
switch (true) {
case this.width > 600:
return ["challenge_rating", "name", "type", "environment", "actions"];
case this.width > 450:
return ["challenge_rating", "name", "type", "actions"];
case this.width > 400:
return ["challenge_rating", "name", "actions"];
default:
return ["name", "actions"];
}
},
addable() {
let count = 0;
Expand Down
14 changes: 8 additions & 6 deletions src/components/encounters/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,14 @@ export default {
async setDifficulty() {
this.encDifficulty = await this.difficulty(this.encounter.entities);
//Store the new xp value for the encounter
this.set_xp({
campaignId: this.campaignId,
encounterId: this.encounterId,
type: "calculated",
value: this.encDifficulty["totalXp"],
});
if (!this.demo) {
this.set_xp({
campaignId: this.campaignId,
encounterId: this.encounterId,
type: "calculated",
value: this.encDifficulty["totalXp"],
});
}
},
async get_entity_data() {
const entities = {};
Expand Down
11 changes: 11 additions & 0 deletions src/components/npcs/BasicInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@
v-model="npc.alignment"
:options="monster_alignment"
/>

<!-- ENVIRONMENT -->
<hk-select
class="mb-4"
label="Environment"
v-model="npc.environment"
use-chips
multiple
clearable
:options="monster_environments"
/>

<!-- SPEED -->
<div class="row q-col-gutter-sm">
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/monster.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const monsterMixin = {
"Undead",
],
monster_alignment: [
"Any",
"Any alignment",
"Unaligned",
"Lawful good",
"Neutral good",
Expand Down
6 changes: 4 additions & 2 deletions src/views/Compendium/Conditions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
filled square
debounce="300"
clearable
placeholder="Search">
placeholder="Search"
@keyup.enter="filter()"
@clear="filter()">
<q-icon slot="append" name="search" />
<button slot="after" class="btn" @click="filter()">Filter</button>
<button slot="after" class="btn" @click="filter()">Search</button>
</q-input>

<q-table
Expand Down
57 changes: 29 additions & 28 deletions src/views/Compendium/Items.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,51 +39,49 @@

<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
>
:auto-width="col.name !== 'name'"
>
{{ col.label }}
</q-th>
<q-th auto-width />
</q-tr>
</template>

<!-- Body -->
<template v-slot:body="props">
<q-tr :props="props">
<q-td auto-width>
<a @click="props.expand = !props.expand">
<i aria-hidden="true" class="fas" :class="props.expand ? 'fa-chevron-up' : 'fa-chevron-down'" />
</a>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
:auto-width="col.name !== 'name'"
>
<div class="truncate-cell">
<div class="truncate">
<router-link v-if="col.name === 'name'" :to="`${$route.path}/${props.row.url}`">
{{ col.value }}
</router-link>
<span
v-else-if="col.name === 'rarity'"
:class="{
'white': col.value == 'common',
'green': col.value == 'uncommon',
'blue': col.value == 'rare',
'purple': col.value == 'very rare',
'orange': col.value == 'legendary',
'red-light': col.value == 'artifact',
}"
>
{{ col.value }}
</span>
<template v-else>{{ col.value }}</template>
</div>
</div>
<router-link v-if="col.name === 'name'" :to="`${$route.path}/${props.row.url}`">
{{ col.value }}
</router-link>
<span
v-else-if="col.name === 'rarity'"
:class="{
'white': col.value == 'common',
'green': col.value == 'uncommon',
'blue': col.value == 'rare',
'purple': col.value == 'very rare',
'orange': col.value == 'legendary',
'red-light': col.value == 'artifact',
}"
>
{{ col.value }}
</span>
<template v-else>{{ col.value }}</template>
</q-td>
<q-td auto-width>
<a @click="props.expand = !props.expand" class="neutral-2">
<i aria-hidden="true" class="fas" :class="props.expand ? 'fa-chevron-up' : 'fa-chevron-down'" />
</a>
</q-td>
</q-tr>
<q-tr v-if="props.expand" :props="props">
Expand Down Expand Up @@ -125,13 +123,16 @@
field: "name",
sortable: true,
align: "left",
classes: "truncate-cell",
format: val => val.capitalizeEach()
},
{
name: "attunement",
label: "Attunement",
field: "requires_attunement",
align: "left",
headerStyle: "min-width: 125px;",
classes: "truncate-cell",
sortable: true
},
{
Expand Down
62 changes: 34 additions & 28 deletions src/views/UserContent/Spells/Spells.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,40 +48,45 @@
:filter="search"
wrap-cells
>
<template v-slot:body-cell="props">
<q-td v-if="props.col.name !== 'actions'">
<div class="truncate-cell">
<div class="truncate">
<template v-slot:body="props">
<q-tr :props="props">
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
:auto-width="col.name !== 'name'"
>
<template v-if="col.name !== 'actions'">
<router-link
v-if="props.col.name === 'name'"
v-if="col.name === 'name'"
:to="`${$route.path}/${props.key}`"
>
{{ props.value }}
{{ col.value }}
</router-link>
<template v-else>
{{ props.value }}
{{ col.value }}
</template>
</template>
<div v-else class="d-flex justify-content-end">
<router-link class="btn btn-sm bg-neutral-5" :to="`${$route.path}/${props.key}`">
<i aria-hidden="true" class="fas fa-pencil" />
<q-tooltip anchor="top middle" self="center middle">Edit</q-tooltip>
</router-link>
<ExportUserContent
class="btn-sm bg-neutral-5 mx-2"
content-type="spell"
:content-id="props.key"
/>
<button
class="btn btn-sm bg-neutral-5"
@click="confirmDelete($event, props.key, props.row)"
>
<i aria-hidden="true" class="fas fa-trash-alt" />
<q-tooltip anchor="top middle" self="center middle">Delete</q-tooltip>
</button>
</div>
</div>
</q-td>
<q-td v-else class="text-right d-flex justify-content-between">
<router-link class="btn btn-sm bg-neutral-5" :to="`${$route.path}/${props.key}`">
<i aria-hidden="true" class="fas fa-pencil" />
<q-tooltip anchor="top middle" self="center middle">Edit</q-tooltip>
</router-link>
<ExportUserContent
class="btn-sm bg-neutral-5 mx-2"
content-type="spell"
:content-id="props.key"
/>
<button
class="btn btn-sm bg-neutral-5"
@click="confirmDelete($event, props.key, props.row)"
>
<i aria-hidden="true" class="fas fa-trash-alt" />
<q-tooltip anchor="top middle" self="center middle">Delete</q-tooltip>
</button>
</q-td>
</q-td>
</q-tr>
</template>
<div slot="no-data" />
<hk-loader slot="loading" name="spells" />
Expand Down Expand Up @@ -149,6 +154,7 @@ export default {
field: "name",
sortable: true,
align: "left",
classes: "truncate-cell",
format: (val) => val.capitalizeEach(),
},
{
Expand All @@ -165,6 +171,7 @@ export default {
field: "level",
sortable: true,
align: "left",
headerStyle: "min-width: 80px;",
format: (val) => this.spellLevel(val),
},
{
Expand All @@ -179,7 +186,6 @@ export default {
...mapGetters(["tier", "overencumbered"]),
...mapGetters("spells", ["spells"]),
spellIds() {
console.log(this.spells.map((spell) => spell.key));
return this.spells.map((spell) => spell.key);
},
},
Expand Down

0 comments on commit facab27

Please sign in to comment.