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

@@ -436,19 +436,47 @@
"back": "Back",
"newCharacter": "New character",
"basicInfo": "Basic information",
"name": "Name",
"namePlaceholder": "Enter a name",
"name": "First name",
"namePlaceholder": "Enter a first name",
"lastName": "Last name",
"lastNamePlaceholder": "Example: Smith",
"nickname": "Nickname",
"nicknamePlaceholder": "Nickname or alias",
"role": "Role",
"title": "Title",
"titlePlaceholder": "Example: King, Captain, Doctor...",
"gender": "Gender",
"genderPlaceholder": "Character's gender",
"age": "Age",
"agePlaceholder": "Character's age",
"historySection": "Background",
"biography": "Biography",
"biographyPlaceholder": "Character biography.",
"history": "History",
"historyPlaceholder": "Character history...",
"roleFull": "Role",
"roleFull": "Role in the story",
"roleFullPlaceholder": "Role of the character in the story",
"advancedMode": "Advanced mode",
"showAdvanced": "Show",
"hideAdvanced": "Hide",
"identitySection": "Extended identity",
"species": "Species",
"speciesPlaceholder": "Human, Elf, Vampire...",
"nationality": "Nationality",
"nationalityPlaceholder": "Country or region of origin",
"status": "Status",
"residence": "Residence",
"residencePlaceholder": "Current place of residence",
"voiceSection": "Character voice",
"speechPattern": "Speech pattern",
"speechPatternPlaceholder": "How does this character speak? Accent, speech quirks...",
"catchphrase": "Catchphrase",
"catchphrasePlaceholder": "A signature phrase of the character",
"authorSection": "Author notes",
"notes": "Notes",
"notesPlaceholder": "Personal notes about this character...",
"colorLabel": "Color",
"colorPlaceholder": "Color associated with the character",
"fetchAttributesError": "Error fetching attributes.",
"deleteTitle": "Delete character",
"deleteMessage": "Are you sure you want to delete {name}? This action cannot be undone."

View File

@@ -436,19 +436,47 @@
"back": "Retour",
"newCharacter": "Nouveau personnage",
"basicInfo": "Informations de base",
"name": "Nom",
"namePlaceholder": "Entrer un nom",
"name": "Prénom",
"namePlaceholder": "Entrer un prénom",
"lastName": "Nom de famille",
"lastNamePlaceholder": "Exemple : Smith",
"nickname": "Surnom",
"nicknamePlaceholder": "Surnom ou alias du personnage",
"role": "Rôle",
"title": "Titre",
"historySection": "Parcourt",
"titlePlaceholder": "Exemple : Roi, Capitaine, Docteur...",
"gender": "Genre",
"genderPlaceholder": "Genre du personnage",
"age": "Âge",
"agePlaceholder": "Âge du personnage",
"historySection": "Parcours",
"biography": "Biographie",
"biographyPlaceholder": "La biographie du personnage.",
"history": "Histoire",
"historyPlaceholder": "Histoire du personnage...",
"roleFull": "Rôle",
"roleFull": "Rôle dans l'histoire",
"roleFullPlaceholder": "Rôle du personnage dans l'histoire",
"advancedMode": "Mode avancé",
"showAdvanced": "Afficher",
"hideAdvanced": "Masquer",
"identitySection": "Identité étendue",
"species": "Espèce",
"speciesPlaceholder": "Humain, Elfe, Vampire...",
"nationality": "Nationalité",
"nationalityPlaceholder": "Pays ou région d'origine",
"status": "Statut",
"residence": "Résidence",
"residencePlaceholder": "Lieu de résidence actuel",
"voiceSection": "Voix du personnage",
"speechPattern": "Pattern de parole",
"speechPatternPlaceholder": "Comment parle ce personnage ? Accent, tics de langage...",
"catchphrase": "Phrase fétiche",
"catchphrasePlaceholder": "Une phrase signature du personnage",
"authorSection": "Notes de l'auteur",
"notes": "Notes",
"notesPlaceholder": "Notes personnelles sur ce personnage...",
"colorLabel": "Couleur",
"colorPlaceholder": "Couleur associée au personnage",
"fetchAttributesError": "Erreur lors de la récupération des attributs.",
"deleteTitle": "Supprimer le personnage",
"deleteMessage": "Êtes-vous sûr de vouloir supprimer {name} ? Cette action est irréversible."

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,
];