Skip to content

Commit

Permalink
fix: property lines are now set to '-' if not conditioned and zero le…
Browse files Browse the repository at this point in the history
…ngth
  • Loading branch information
valentine195 committed Dec 16, 2021
1 parent 18307be commit cf82529
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import {
addIcon,
MarkdownPostProcessorContext,
MarkdownView,
Notice,
Plugin,
TFile
} from "obsidian";
import domtoimage from "dom-to-image";

import type DiceRollerPlugin from "../../obsidian-dice-roller/src/main";

import { BESTIARY_BY_NAME } from "./data/srd-bestiary";
import StatBlockRenderer from "./view/statblock";
Expand All @@ -30,7 +27,6 @@ import { sort } from "fast-sort";
import type { Plugins } from "../../obsidian-overload";
import type {
HomebrewCreature,
SRDMonster
} from "../../obsidian-initiative-tracker/@types";
declare module "obsidian" {
interface App {
Expand Down
13 changes: 9 additions & 4 deletions src/view/ui/PropertyLine.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@
console.error(e);
}
}
if (!item.conditioned && !property.length) {
property = "-";
}
</script>

<div class="line">
<span class="property-name">{display}</span>
<DiceHolder {property} />
</div>
{#if !item.conditioned || (item.conditioned && property.length)}
<div class="line">
<span class="property-name">{display}</span>
<DiceHolder {property} />
</div>
{/if}

<style>
.line {
Expand Down

0 comments on commit cf82529

Please sign in to comment.