Skip to content

Commit

Permalink
Merge branch 'release/2.20.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarmlessHarm committed Nov 20, 2023
2 parents 445095c + e9a41a2 commit 53fa58f
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 185 deletions.
4 changes: 4 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ changelog:
- title: Improvements 🦾
labels:
- "improvement"
- "Improvement"
- "enhancement"
- "Enhancement"
- title: Bugfixes 🐛
labels:
- "bugfix"
- "Bugfix"
- "bug"
- "Bug"
25 changes: 0 additions & 25 deletions ReleaseTemplate.md

This file was deleted.

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.20.0",
"version": "2.20.1",
"name": "harmless_key",
"description": "A Dungeons and Dragons Combat Tracker",
"productName": "Harmless Key",
Expand Down
179 changes: 93 additions & 86 deletions src/components/campaign/resources/CheatSheet.vue
Original file line number Diff line number Diff line change
@@ -1,105 +1,112 @@
<template>
<div>
<hk-input
v-model="query"
:dense="!compendium"
label="Search"
class="mb-2"
clearable>
<div>
<hk-input v-model="query" :dense="!compendium" label="Search" class="mb-2" clearable>
<q-icon slot="prepend" name="search" />
</hk-input>
<p class="red" v-if="query && !sheet.length">Nothing found</p>
<q-tabs
v-if="!query"
v-model="type"
<q-tabs
v-if="!query && !isMobile"
v-model="tab_type"
:dark="$store.getters.theme === 'dark'"
inline-label
outside-arrows
mobile-arrows
class="mb-2"
class="mb-2"
>
<q-tab
v-for="{ name, label } in types"
:name="name"
:label="label"
:key="name"
/>
<q-tab v-for="{ name, label } in types" :name="name" :label="label" :key="name" />
</q-tabs>

<q-list :dark="$store.getters.theme === 'dark'" class="accordion">
<q-expansion-item
v-for="{ type, name, description, caption, src, url } in sheet"
:dark="$store.getters.theme === 'dark'"
switch-toggle-side
:name="name"
:key="url"
>
<template v-slot:header>
<q-item-section>
<router-link v-if="compendium" :to="`/compendium/rules/${url}`" stop.prevent>
{{ name }}
</router-link>
<template v-else>{{ name }}</template>
<q-item-label caption class="neutral-3">{{ caption }}</q-item-label>
</q-item-section>
<q-item-section avatar class="neutral-3">
{{ types.filter(item => item.name === type)[0]?.label }}
</q-item-section>
</template>
<q-list :dark="$store.getters.theme === 'dark'" class="accordion">
<q-expansion-item
v-for="{ type, name, description, caption, src, url } in sheet"
:dark="$store.getters.theme === 'dark'"
switch-toggle-side
:name="name"
:key="url"
>
<template v-slot:header>
<q-item-section>
<router-link v-if="compendium" :to="`/compendium/rules/${url}`" stop.prevent>
{{ name }}
</router-link>
<template v-else>{{ name }}</template>
<q-item-label caption class="neutral-3">{{ caption }}</q-item-label>
</q-item-section>
<q-item-section avatar class="neutral-3">
{{ types.filter((item) => item.name === type)[0]?.label }}
</q-item-section>
</template>

<div class="accordion-body">
<hk-markdown-editor :value="description" read-only />
<span class="neutral-2">{{ src }}</span>
</div>
</q-expansion-item>
</q-list>
</div>
<div class="accordion-body">
<hk-markdown-editor :value="description" read-only />
<span class="neutral-2">{{ src }}</span>
</div>
</q-expansion-item>
</q-list>
</div>
</template>

<script>
import { rules } from "src/utils/generalConstants";
export default {
name: "CheatSheet",
props: {
compendium: {
type: Boolean,
default: false,
}
},
data() {
return {
type: "action",
query: null,
types: [
{
name: "action",
label: "Action"
},
{
name: "bonus_action",
label: "Bonus Action"
},
{
name: "reaction",
label: "Reaction"
},
{
name: "movement",
label: "Movement"
},
{
name: "environment",
label: "Environment"
},
],
cheatSheet: rules,
}
},
computed: {
sheet() {
return this.query ? this.cheatSheet.filter(({ name, description }) => name.toLowerCase().includes(this.query.toLowerCase()) || description.toLowerCase().includes(this.query.toLowerCase())) : this.cheatSheet.filter(item => item.type === this.type);
}
}
}
name: "CheatSheet",
props: {
compendium: {
type: Boolean,
default: false,
},
},
data() {
return {
tab_type: undefined,
query: null,
types: [
{
name: "action",
label: "Action",
},
{
name: "bonus_action",
label: "Bonus Action",
},
{
name: "reaction",
label: "Reaction",
},
{
name: "movement",
label: "Movement",
},
{
name: "environment",
label: "Environment",
},
],
cheatSheet: rules,
};
},
mounted() {
console.log("Mount Cheat Sheet");
},
computed: {
isMobile() {
// This only works for real mobiles, not for small desktop screens
return this.$q.platform.is.mobile;
},
sheet() {
if (this.query) {
return this.cheatSheet.filter(
({ name, description }) =>
name.toLowerCase().includes(this.query.toLowerCase()) ||
description.toLowerCase().includes(this.query.toLowerCase())
);
}
if (this.tab_type) {
return this.cheatSheet.filter((item) => item.type === this.tab_type);
}
return this.cheatSheet;
},
},
};
</script>
39 changes: 22 additions & 17 deletions src/components/compendium/Monster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<br />
</template>
<template v-if="monster.skills"
><strong>Skills</strong>
><strong>Skills </strong>
<span class="saves">
<hk-roll
v-for="(skill, index) in monster.skills"
Expand All @@ -129,12 +129,9 @@
"
>
<span class="save">
{{ skill }}
{{
skillModifier(skillList[skill].ability, skill) > 0
? `+${skillModifier(skillList[skill].ability, skill)}`
: skillModifier(skillList[skill].ability, skill)
}}{{ index+1 &lt; monster.skills.length ? "," : "" }}
{{ skill.capitalize() }}
{{ skillModifier2str(skillModifier(skillList[skill].ability, skill)) }}
{{ index+1 &lt; monster.skills.length ? "," : "" }}
</span>
</hk-roll>
<br />
Expand Down Expand Up @@ -217,11 +214,7 @@
<i aria-hidden="true" v-else class="far fa-circle"></i>
{{ skill.skill }}
</span>
<span>{{
skillModifier(skill.ability, key) > 0
? `+${skillModifier(skill.ability, key)}`
: skillModifier(skill.ability, key)
}}</span>
<span>{{ skillModifier2str(skillModifier(skill.ability, key)) }}</span>
</span>
</hk-roll>
</div>
Expand Down Expand Up @@ -260,7 +253,7 @@
<template #content>
<Spell :id="spell.key" />
</template> </hk-popover
>{{ index+1 &lt; spellsForLevel(level).length ? "," : "" }}
>{{ index + 1 &lt; spellsForLevel(level).length ? "," : "" }}
</i>
</div>
</template>
Expand Down Expand Up @@ -296,7 +289,7 @@
<template #content>
<Spell :id="spell.key" />
</template> </hk-popover
>{{ index+1 &lt; spellsForLimit(limit).length ? "," : "" }}
>{{ index + 1 &lt; spellsForLimit(limit).length ? "," : "" }}
</i>
</div>
</template>
Expand Down Expand Up @@ -362,7 +355,11 @@
{{ ability.legendary_cost > 1 ? `(Costs ${ability.legendary_cost} Actions)` : `` }}
</em></strong
>
<hk-dice-text v-if="ability.desc" :input_text="ability.desc" />
<hk-dice-text
v-if="ability.desc"
class="action-description"
:input_text="ability.desc"
/>
</p>
</template>
</div>
Expand Down Expand Up @@ -509,6 +506,12 @@ export default {
return calc_skill_mod(ability_mod, proficiency, bonus, proficient, expertise);
},
skillModifier2str(mod_value) {
if (mod_value > 0) {
return `+${mod_value}`;
}
return `${mod_value}`;
},
},
};
</script>
Expand All @@ -520,8 +523,10 @@ export default {
padding: 20px;
color: $black;
font-family: Helvetica, sans-serif, serif;
.hk-roll {
color: $black;
&::v-deep {
.hk-roll {
color: $black !important;
}
}
h2 {
Expand Down
22 changes: 22 additions & 0 deletions src/components/settings/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,28 @@ export default {
},
],
},
{
key: "legacy_campaign_layout",
name: "Campaign Layout",
icon: "fas fa-bars",
info: "Select whether or not you want to use the modern campaign layout, or if you want to switch to the old layout.",
options: [
{
value: true,
name: "Legacy",
action: "Legacy",
icon: "fas fa-columns",
color: "neutral-2",
},
{
value: undefined,
name: "DM Screen",
action: "DM Screen",
icon: "fas fa-map",
color: "neutral-2",
},
],
},
],
},
},
Expand Down
Loading

0 comments on commit 53fa58f

Please sign in to comment.