Skip to content

Commit a9668e7

Browse files
authored
feat(app): add stat block template system
* feat: use eslint as formatter * feat: add stats endpoints * feat: add stat views * feat: implement stats into player * chore: tests * feat: implement stats in npcs * fix: counts and visibility * feat: update import/export for stats * feat: show stat usage * fix: test * fix: unnecessary import * chore: add changeset for stat block system
1 parent b8f6cca commit a9668e7

61 files changed

Lines changed: 5112 additions & 714 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/stat-block-system.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@dm-hero/app": minor
3+
---
4+
5+
Add stat block template system for NPCs and Players
6+
7+
- Stat template CRUD with presets (D&D 5e, Pathfinder 2e, DSA 5, Splittermond)
8+
- Entity stats (assign, edit, change, remove) with all field types
9+
- Character sheet PDF upload/view/download
10+
- Export/Import support for stat templates and entity stats
11+
- Reference data editor with usage tracking and imported badge
12+
- Character sheets excluded from document counts

.prettierrc

Lines changed: 0 additions & 11 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,23 @@
3434
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
3535
},
3636
"[json]": {
37-
"editor.defaultFormatter": "esbenp.prettier-vscode"
37+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
3838
},
3939
"[jsonc]": {
40-
"editor.defaultFormatter": "esbenp.prettier-vscode"
40+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
4141
},
4242
"[markdown]": {
43-
"editor.defaultFormatter": "esbenp.prettier-vscode"
43+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
4444
},
4545

46+
// Disable Prettier entirely
47+
"prettier.enable": false,
48+
4649
// Vuetify auto-import
4750
"volar.autoCompleteRefs": true,
4851

4952
// TypeScript
5053
"typescript.tsdk": "node_modules/typescript/lib",
51-
"typescript.enablePromptUseWorkspaceTsdk": true
54+
"typescript.enablePromptUseWorkspaceTsdk": true,
55+
"editor.fontFamily": "'Dank Mono', monospace"
5256
}

packages/app/app/app.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const localeCookie = useCookie<'en' | 'de'>('locale', {
9696
maxAge: 60 * 60 * 24 * 365, // 1 year
9797
})
9898
99-
// Sync Vuetify locale with i18n locale
99+
// Sync Vuetify locale with i18n locale fox
100100
watch(
101101
locale,
102102
(newLocale) => {
@@ -123,7 +123,8 @@ if (import.meta.client) {
123123
(newId) => {
124124
if (newId) {
125125
notesStore.fetchNotes(Number(newId))
126-
} else {
126+
}
127+
else {
127128
notesStore.clearNotes()
128129
}
129130
},
@@ -174,8 +175,8 @@ onMounted(() => {
174175
const handleKeydown = (e: KeyboardEvent) => {
175176
// Check if user is typing in an input field
176177
const target = e.target as HTMLElement
177-
const isTyping =
178-
target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable
178+
const isTyping
179+
= target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable
179180
180181
// "/" öffnet Suche (nur wenn NICHT in Eingabefeld)
181182
if (e.key === '/' && !showSearch.value && !isTyping) {
@@ -223,12 +224,13 @@ watch(searchQuery, async (query) => {
223224
},
224225
})
225226
226-
searchResults.value = results.map((r) => ({
227+
searchResults.value = results.map(r => ({
227228
...r,
228229
path: getEntityPath(r.type, r.id, r.name),
229230
linkedEntities: r.linkedEntities || [],
230231
}))
231-
} catch (error) {
232+
}
233+
catch (error) {
232234
console.error('Search failed:', error)
233235
searchResults.value = []
234236
}

packages/app/app/components/campaigns/CampaignImportDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ async function onFileSelected(filesOrFile: File[] | File | null) {
663663
entityCounts,
664664
sessionCount: manifest.sessions?.length || 0,
665665
mapCount: manifest.maps?.length || 0,
666-
hasCalendar: !!manifest.calendar,
666+
hasCalendar: !!(manifest.calendar && manifest.calendar.months && manifest.calendar.months.length > 0),
667667
warnings: warnings.length > 0 ? warnings : undefined,
668668
}
669669

packages/app/app/components/factions/FactionViewDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ watch(
325325
$fetch<typeof players.value>(`/api/entities/${newFactionId}/related/players`).catch(
326326
() => [],
327327
),
328-
$fetch<Document[]>(`/api/entities/${newFactionId}/documents`).catch(() => []),
328+
$fetch<Document[]>(`/api/entities/${newFactionId}/documents`, { query: { exclude_type: 'character_sheet' } }).catch(() => []),
329329
$fetch<Image[]>(`/api/entity-images/${newFactionId}`).catch(() => []),
330330
])
331331

0 commit comments

Comments
 (0)