Skip to content

Commit

Permalink
fix: added image type to statblock layout creator
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Jan 4, 2022
1 parent fef806f commit 0d6b5ad
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/settings/add.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { nanoid } from "src/data/constants";
import { ImageItem, nanoid } from "src/data/constants";
import type {
StatblockItemType,
GroupItem,
Expand All @@ -24,6 +24,7 @@ function blockGenerator(type: "traits"): TraitsItem;
function blockGenerator(type: "spells"): SpellsItem;
function blockGenerator(type: "subheading"): SubHeadingItem;
function blockGenerator(type: "table"): TableItem;
function blockGenerator(type: "image"): ImageItem;
function blockGenerator(type: StatblockItemType): StatblockItem;
function blockGenerator(type: string): StatblockItem {
switch (type) {
Expand Down Expand Up @@ -78,6 +79,13 @@ function blockGenerator(type: string): StatblockItem {
properties: []
};
}
case "image": {
return {
type: "image",
id: nanoid(),
properties: []
};
}
case "table": {
return {
type: "table",
Expand All @@ -92,6 +100,7 @@ function blockGenerator(type: string): StatblockItem {
const types: Array<[StatblockItemType, string]> = [
["group", "Group"],
["heading", "Heading"],
["image", "Image"],
["inline", "Inline Group"],
["property", "Property Line"],
["saves", "Saves"],
Expand Down

0 comments on commit 0d6b5ad

Please sign in to comment.