Add character notes and more debugging for mailserver (help me !!!)
This commit is contained in:
parent
32439b41f6
commit
a30f394ef7
BIN
db.sqlite-shm
BIN
db.sqlite-shm
Binary file not shown.
BIN
db.sqlite-wal
BIN
db.sqlite-wal
Binary file not shown.
|
|
@ -71,10 +71,11 @@ const data = ref<Character>({
|
||||||
},
|
},
|
||||||
abilities: {},
|
abilities: {},
|
||||||
modifiers: {},
|
modifiers: {},
|
||||||
|
notes: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const peopleOpen = ref(false), trainingOpen = ref(false), modifierOpen = ref(false), abilityOpen = ref(false), trainingTab = ref(0);
|
const peopleOpen = ref(false), trainingOpen = ref(false), notesOpen = ref(false), abilityOpen = ref(false), trainingTab = ref(0);
|
||||||
const raceOptions = computed(() => data.value.progress.race.index !== undefined ? characterConfig.peoples[data.value.progress.race.index!].options : undefined);
|
const raceOptions = computed(() => data.value.progress.race.index !== undefined ? characterConfig.peoples[data.value.progress.race.index!].options : undefined);
|
||||||
const selectedRaceOptions = computed(() => raceOptions !== undefined ? data.value.progress.race.progress!.map(e => raceOptions.value![e[0]][e[1]]) : undefined);
|
const selectedRaceOptions = computed(() => raceOptions !== undefined ? data.value.progress.race.progress!.map(e => raceOptions.value![e[0]][e[1]]) : undefined);
|
||||||
const trainingPoints = computed(() => raceOptions.value ? data.value.progress.race.progress?.reduce((p, v) => p + (raceOptions.value![v[0]][v[1]].training ?? 0), 0) : 0);
|
const trainingPoints = computed(() => raceOptions.value ? data.value.progress.race.progress?.reduce((p, v) => p + (raceOptions.value![v[0]][v[1]].training ?? 0), 0) : 0);
|
||||||
|
|
@ -244,7 +245,7 @@ useShortcuts({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1 flex-col min-w-[800px] w-[75vw] max-w-[1200px]">
|
<div class="flex flex-1 flex-col min-w-[800px] w-[75vw] max-w-[1200px]">
|
||||||
<Collapsible class="border-b border-light-30 dark:border-dark-30 p-1" v-model="peopleOpen" @update:model-value="() => { trainingOpen = false; modifierOpen = false; abilityOpen = false; }">
|
<Collapsible class="border-b border-light-30 dark:border-dark-30 p-1" v-model="peopleOpen" @update:model-value="() => { trainingOpen = false; abilityOpen = false; notesOpen = false; }">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="font-bold text-xl">Peuple</span>
|
<span class="font-bold text-xl">Peuple</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -267,7 +268,7 @@ useShortcuts({
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
<Collapsible class="border-b border-light-30 dark:border-dark-30 p-1" v-model="trainingOpen" :disabled="data.progress.race.index === undefined" @update:model-value="() => { peopleOpen = false; modifierOpen = false; abilityOpen = false; }">
|
<Collapsible class="border-b border-light-30 dark:border-dark-30 p-1" v-model="trainingOpen" :disabled="data.progress.race.index === undefined" @update:model-value="() => { peopleOpen = false; abilityOpen = false; notesOpen = false; }">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="font-bold text-xl">Entrainement</span>
|
<span class="font-bold text-xl">Entrainement</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -298,7 +299,7 @@ useShortcuts({
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
<Collapsible class="border-b border-light-30 dark:border-dark-30 p-1" v-model="abilityOpen" :disabled="data.progress.race.index === undefined" @update:model-value="() => { trainingOpen = false; modifierOpen = false; peopleOpen = false; }">
|
<Collapsible class="border-b border-light-30 dark:border-dark-30 p-1" v-model="abilityOpen" :disabled="data.progress.race.index === undefined" @update:model-value="() => { trainingOpen = false;peopleOpen = false; notesOpen = false; }">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="font-bold text-xl">Compétences</span>
|
<span class="font-bold text-xl">Compétences</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -323,6 +324,14 @@ useShortcuts({
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
|
<Collapsible class="border-b border-light-30 dark:border-dark-30 p-1" v-model="notesOpen" @update:model-value="() => { trainingOpen = false; peopleOpen = false; abilityOpen = false; }">
|
||||||
|
<template #label>
|
||||||
|
<span class="font-bold text-xl">Notes libres</span>
|
||||||
|
</template>
|
||||||
|
<template #default>
|
||||||
|
<Editor class="min-h-[400px] border border-light-30 dark:border-dark-30" v-model="data.progress.notes" />
|
||||||
|
</template>
|
||||||
|
</Collapsible>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -125,6 +125,10 @@ const { data: character, status, error } = await useAsyncData(() => useRequestFe
|
||||||
<span class="text-lg font-semibold">Aptitudes</span>
|
<span class="text-lg font-semibold">Aptitudes</span>
|
||||||
<MarkdownRenderer :content="character.features.misc.map(e => `> ${e}`).join('\n\n')" />
|
<MarkdownRenderer :content="character.features.misc.map(e => `> ${e}`).join('\n\n')" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-lg font-semibold border-b border-light-30 dark:border-dark-30">Notes</span>
|
||||||
|
<MarkdownRenderer :content="character.notes" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { and, eq } from 'drizzle-orm';
|
import { and, eq } from 'drizzle-orm';
|
||||||
import useDatabase from '~/composables/useDatabase';
|
import useDatabase from '~/composables/useDatabase';
|
||||||
import { characterTable } from '~/db/schema';
|
import { characterTable } from '~/db/schema';
|
||||||
import type { Character, CharacterConfig, CompiledCharacter, DoubleIndex, Feature, MainStat, TrainingLevel, TrainingOption } from '~/types/character';
|
import type { Ability, Character, CharacterConfig, CompiledCharacter, DoubleIndex, Feature, MainStat, TrainingLevel, TrainingOption } from '~/types/character';
|
||||||
import characterData from '#shared/character-config.json';
|
import characterData from '#shared/character-config.json';
|
||||||
import { users } from '~/drizzle/schema';
|
import { users } from '~/drizzle/schema';
|
||||||
|
|
||||||
|
|
@ -191,13 +191,14 @@ function compileCharacter(character: Character & { username?: string }): Compile
|
||||||
},
|
},
|
||||||
initiative: 0,
|
initiative: 0,
|
||||||
aspect: "",
|
aspect: "",
|
||||||
|
notes: character.progress.notes,
|
||||||
};
|
};
|
||||||
|
|
||||||
features.forEach(e => e[1].forEach((_e, i) => applyTrainingOption(e[0], _e, compiled, i === e[1].length - 1)));
|
features.forEach(e => e[1].forEach((_e, i) => applyTrainingOption(e[0], _e, compiled, i === e[1].length - 1)));
|
||||||
specialFeatures(compiled, character.progress.training);
|
specialFeatures(compiled, character.progress.training);
|
||||||
|
|
||||||
Object.entries(character.progress.abilities).forEach(e => compiled.abilities[e[0]] += e[1][0]);
|
Object.entries(character.progress.abilities).forEach(e => compiled.abilities[e[0] as Ability]! += e[1][0]);
|
||||||
|
|
||||||
return compiled;
|
return compiled;
|
||||||
}
|
}
|
||||||
function applyTrainingOption(stat: MainStat, option: TrainingOption, character: CompiledCharacter, last: boolean)
|
function applyTrainingOption(stat: MainStat, option: TrainingOption, character: CompiledCharacter, last: boolean)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ interface MailPayload
|
||||||
data: Record<string, any>
|
data: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(config);
|
||||||
|
|
||||||
const transport = nodemailer.createTransport({
|
const transport = nodemailer.createTransport({
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
pool: true,
|
pool: true,
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ export type Progression = {
|
||||||
spells?: string[]; //Spell ID
|
spells?: string[]; //Spell ID
|
||||||
modifiers: Partial<Record<MainStat, number>>;
|
modifiers: Partial<Record<MainStat, number>>;
|
||||||
aspect?: string;
|
aspect?: string;
|
||||||
|
notes: string;
|
||||||
};
|
};
|
||||||
export type Character = {
|
export type Character = {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -148,4 +149,6 @@ export type CompiledCharacter = {
|
||||||
abilities: Partial<Record<Ability, number>>;
|
abilities: Partial<Record<Ability, number>>;
|
||||||
level: number;
|
level: number;
|
||||||
features: Record<Category, string[]>; //Currently: List of training option as text. TODO: Update to a more complex structure later
|
features: Record<Category, string[]>; //Currently: List of training option as text. TODO: Update to a more complex structure later
|
||||||
|
|
||||||
|
notes: string;
|
||||||
};
|
};
|
||||||
Loading…
Reference in New Issue