Expand character model with additional attributes and advanced customization options

- Added fields such as `nickname`, `age`, `gender`, `species`, `nationality`, `status`, and others to enhance character customization.
- Modified localization files to include new field labels and placeholders.
- Updated `CharacterComponent` and `CharacterDetail` components with UI elements for the newly added attributes.
- Introduced "Advanced Mode" toggle to manage visibility of extended customization options.
- Refactored database models and repository methods (`addNewCharacter`, `updateCharacter`, and `fetchCharacters`) to handle the extended schema.
- Improved data encryption and decryption workflows for secure storage of added attributes.
- Enhanced user experience by reorganizing character customization layouts.
This commit is contained in:
natreex
2026-01-23 20:49:57 -05:00
parent 57bf0c6ec3
commit 0fbd3743e7
11 changed files with 806 additions and 211 deletions

View File

@@ -7,6 +7,16 @@ import {
faShieldAlt,
faUsers,
faWrench,
faRoute,
faUserSecret,
faGhost,
faHeartBroken,
faHandHoldingHeart,
faBolt,
faQuoteLeft,
faFingerprint,
faBox,
faPeopleGroup,
} from '@fortawesome/free-solid-svg-icons';
import {SelectBoxProps} from "@/shared/interface";
@@ -31,100 +41,10 @@ export const characterCategories: SelectBoxProps[] = [
},
];
export const characterTitle: SelectBoxProps[] = [
{value: 'none', label: 'Aucun'},
{value: 'king', label: 'Roi'},
{value: 'queen', label: 'Reine'},
{value: 'emperor', label: 'Empereur'},
{value: 'empress', label: 'Impératrice'},
{value: 'prince', label: 'Prince'},
{value: 'princess', label: 'Princesse'},
{value: 'duke', label: 'Duc'},
{value: 'duchess', label: 'Duchesse'},
{value: 'count', label: 'Comte'},
{value: 'countess', label: 'Comtesse'},
{value: 'baron', label: 'Baron'},
{value: 'baroness', label: 'Baronne'},
{value: 'lord', label: 'Seigneur'},
{value: 'lady', label: 'Dame'},
{value: 'knight', label: 'Chevalier'},
{value: 'squire', label: 'Écuyer'},
{value: 'warrior', label: 'Guerrier'},
{value: 'general', label: 'Général'},
{value: 'commander', label: 'Commandant'},
{value: 'captain', label: 'Capitaine'},
{value: 'soldier', label: 'Soldat'},
{value: 'mercenary', label: 'Mercenaire'},
{value: 'assassin', label: 'Assassin'},
{value: 'thief', label: 'Voleur'},
{value: 'spy', label: 'Espion'},
{value: 'archmage', label: 'Archimage'},
{value: 'sorcerer', label: 'Sorcier'},
{value: 'witch', label: 'Sorcière'},
{value: 'warlock', label: 'Mage Noir'},
{value: 'druid', label: 'Druide'},
{value: 'priest', label: 'Prêtre'},
{value: 'prophet', label: 'Prophète'},
{value: 'oracle', label: 'Oracle'},
{value: 'seer', label: 'Voyant'},
{value: 'scholar', label: 'Érudit'},
{value: 'alchemist', label: 'Alchimiste'},
{value: 'healer', label: 'Guérisseur'},
{value: 'bard', label: 'Barde'},
{value: 'hermit', label: 'Ermite'},
{value: 'noble', label: 'Noble'},
{value: 'peasant', label: 'Paysan'},
{value: 'merchant', label: 'Marchand'},
{value: 'sailor', label: 'Marin'},
{value: 'pirate', label: 'Pirate'},
{value: 'slave', label: 'Esclave'},
{value: 'gladiator', label: 'Gladiateur'},
{value: 'champion', label: 'Champion'},
{value: 'outlaw', label: 'Hors-la-loi'},
{value: 'hunter', label: 'Chasseur'},
{value: 'beastmaster', label: 'Maître des Bêtes'},
{value: 'ranger', label: 'Rôdeur'},
{value: 'warden', label: 'Gardien'},
{value: 'sentinel', label: 'Sentinelle'},
{value: 'herald', label: 'Héraut'},
{value: 'messenger', label: 'Messager'},
{value: 'pilgrim', label: 'Pèlerin'},
{value: 'nomad', label: 'Nomade'},
{value: 'chieftain', label: 'Chef de Clan'},
{value: 'high-priest', label: 'Grand Prêtre'},
{value: 'inquisitor', label: 'Inquisiteur'},
{value: 'judge', label: 'Juge'},
{value: 'executioner', label: 'Bourreau'},
{value: 'warden', label: 'Gardien de Prison'},
{value: 'monk', label: 'Moine'},
{value: 'abbot', label: 'Abbé'},
{value: 'nun', label: 'Nonne'},
{value: 'diplomat', label: 'Diplomate'},
{value: 'ambassador', label: 'Ambassadeur'},
{value: 'scientist', label: 'Scientifique'},
{value: 'engineer', label: 'Ingénieur'},
{value: 'inventor', label: 'Inventeur'},
{value: 'architect', label: 'Architecte'},
{value: 'scribe', label: 'Scribe'},
{value: 'chronicler', label: 'Chroniqueur'},
{value: 'storyteller', label: 'Conteur'},
{value: 'actor', label: 'Acteur'},
{value: 'musician', label: 'Musicien'},
{value: 'artist', label: 'Artiste'},
{value: 'sculptor', label: 'Sculpteur'},
{value: 'orator', label: 'Orateur'},
{value: 'revolutionary', label: 'Révolutionnaire'},
{value: 'resistance-fighter', label: 'Résistant'},
{value: 'freedom-fighter', label: 'Combattant de la Liberté'},
{value: 'cult-leader', label: 'Chef de Secte'},
{value: 'warlock-lord', label: 'Seigneur Noir'},
{value: 'dark-prophet', label: 'Prophète du Chaos'},
{value: 'warlord', label: 'Seigneur de Guerre'},
{value: 'grandmaster', label: 'Grand Maître'},
{value: 'tactician', label: 'Tacticien'},
{value: 'archduke', label: 'Archiduc'},
{value: 'high-king', label: 'Haut Roi'},
{value: 'divine-champion', label: 'Champion Divin'},
export const characterStatus: SelectBoxProps[] = [
{value: 'alive', label: 'Vivant'},
{value: 'dead', label: 'Décédé'},
{value: 'unknown', label: 'Inconnu'},
];
export interface Relation {
@@ -147,6 +67,12 @@ export interface CharacterProps {
id: string | null;
name: string;
lastName: string;
nickname: string;
age: string;
gender: string;
species: string;
nationality: string;
status: 'alive' | 'dead' | 'unknown';
category: CharacterCategory;
title: string;
image: string;
@@ -158,9 +84,24 @@ export interface CharacterProps {
strengths: Attribute[];
goals: Attribute[];
motivations: Attribute[];
arc: Attribute[];
secrets: Attribute[];
fears: Attribute[];
flaws: Attribute[];
beliefs: Attribute[];
conflicts: Attribute[];
quotes: Attribute[];
distinguishingMarks: Attribute[];
items: Attribute[];
affiliations: Attribute[];
role: string;
biography?: string;
history?: string;
speechPattern?: string;
catchphrase?: string;
residence?: string;
notes?: string;
color?: string;
}
export interface CharacterListResponse {
@@ -175,7 +116,8 @@ export interface CharacterElement {
icon: any; // Replace `any` with an appropriate type if you have a specific icon type.
}
export const characterElementCategory: CharacterElement[] = [
// Attributs de base (toujours visibles)
export const basicCharacterElements: CharacterElement[] = [
{
title: 'Descriptions physiques',
section: 'physical',
@@ -188,6 +130,58 @@ export const characterElementCategory: CharacterElement[] = [
placeholder: 'Nouvelle Description Psychologique',
icon: faBrain,
},
];
// Attributs avancés (visibles en mode avancé)
export const advancedCharacterElements: CharacterElement[] = [
{
title: 'Signes distinctifs',
section: 'distinguishingMarks',
placeholder: 'Nouveau signe distinctif',
icon: faFingerprint,
},
{
title: 'Arc du personnage',
section: 'arc',
placeholder: 'Nouvelle étape de l\'arc',
icon: faRoute,
},
{
title: 'Secrets',
section: 'secrets',
placeholder: 'Nouveau secret',
icon: faUserSecret,
},
{
title: 'Peurs',
section: 'fears',
placeholder: 'Nouvelle peur',
icon: faGhost,
},
{
title: 'Défauts',
section: 'flaws',
placeholder: 'Nouveau défaut',
icon: faHeartBroken,
},
{
title: 'Croyances',
section: 'beliefs',
placeholder: 'Nouvelle croyance',
icon: faHandHoldingHeart,
},
{
title: 'Conflits internes',
section: 'conflicts',
placeholder: 'Nouveau conflit',
icon: faBolt,
},
{
title: 'Citations',
section: 'quotes',
placeholder: 'Nouvelle citation',
icon: faQuoteLeft,
},
{
title: 'Relations',
section: 'relations',
@@ -224,4 +218,22 @@ export const characterElementCategory: CharacterElement[] = [
placeholder: 'Nouvelle Motivation',
icon: faFire,
},
{
title: 'Objets importants',
section: 'items',
placeholder: 'Nouvel objet',
icon: faBox,
},
{
title: 'Affiliations',
section: 'affiliations',
placeholder: 'Nouvelle affiliation',
icon: faPeopleGroup,
},
];
// Pour rétro-compatibilité, on garde characterElementCategory qui combine les deux
export const characterElementCategory: CharacterElement[] = [
...basicCharacterElements,
...advancedCharacterElements,
];