merge: integrate upstream RPG attributes customization system
Merged commits from upstream/main (d870731): - Add customizable RPG attributes (STR/DEX/etc) with add/remove/rename - Fix character stats editing (0% display bug, missing Stats line creation) - Add mobile font-size overrides for better readability - Fix together mode rendering order (render panels before cleaning DOM) - Fix temperature unit toggle (C/F) and thermometer thresholds - Add buildAttributesString() for custom attribute names in AI prompts Upstream Features: - trackerConfig.rpgAttributes array replaces showRPGAttributes boolean - Per-attribute enable/disable, custom names, reordering - Tracker editor UI for managing attributes - Custom attribute names appear in AI prompts and dice rolls - Backward compatible migration from old boolean toggle Merge Conflict Resolution: - src/systems/integration/sillytavern.js: * Kept both: upstream's "render before DOM cleaning" + our refreshDashboard() * Result: render panels → refresh dashboard → update DOM - style.css: * Kept both: our Widget Integration CSS + upstream's Mobile Font Overrides * Our Recent Events width fix (width: 100%) preserved Related upstream commits: -d870731: Add customizable RPG attributes and fix character stats editing -f20710f: Make RPG attributes customizable and editable -883212b: Add comprehensive mobile font-size overrides -718696e: Fix multiple UI and functionality issues No functional changes to v2 dashboard yet - integration in next commit.
This commit is contained in:
@@ -381,6 +381,14 @@ function migrateToTrackerConfig() {
|
||||
userStats: {
|
||||
customStats: [],
|
||||
showRPGAttributes: true,
|
||||
rpgAttributes: [
|
||||
{ id: 'str', name: 'STR', enabled: true },
|
||||
{ id: 'dex', name: 'DEX', enabled: true },
|
||||
{ id: 'con', name: 'CON', enabled: true },
|
||||
{ id: 'int', name: 'INT', enabled: true },
|
||||
{ id: 'wis', name: 'WIS', enabled: true },
|
||||
{ id: 'cha', name: 'CHA', enabled: true }
|
||||
],
|
||||
statusSection: {
|
||||
enabled: true,
|
||||
showMoodEmoji: true,
|
||||
@@ -438,6 +446,47 @@ function migrateToTrackerConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
// Migrate old showRPGAttributes boolean to rpgAttributes array
|
||||
if (extensionSettings.trackerConfig.userStats.showRPGAttributes !== undefined) {
|
||||
const shouldShow = extensionSettings.trackerConfig.userStats.showRPGAttributes;
|
||||
extensionSettings.trackerConfig.userStats.rpgAttributes = [
|
||||
{ id: 'str', name: 'STR', enabled: shouldShow },
|
||||
{ id: 'dex', name: 'DEX', enabled: shouldShow },
|
||||
{ id: 'con', name: 'CON', enabled: shouldShow },
|
||||
{ id: 'int', name: 'INT', enabled: shouldShow },
|
||||
{ id: 'wis', name: 'WIS', enabled: shouldShow },
|
||||
{ id: 'cha', name: 'CHA', enabled: shouldShow }
|
||||
];
|
||||
delete extensionSettings.trackerConfig.userStats.showRPGAttributes;
|
||||
console.log('[RPG Companion] Migrated showRPGAttributes to rpgAttributes array');
|
||||
}
|
||||
|
||||
// Ensure rpgAttributes exists even if no migration was needed
|
||||
if (!extensionSettings.trackerConfig.userStats.rpgAttributes) {
|
||||
extensionSettings.trackerConfig.userStats.rpgAttributes = [
|
||||
{ id: 'str', name: 'STR', enabled: true },
|
||||
{ id: 'dex', name: 'DEX', enabled: true },
|
||||
{ id: 'con', name: 'CON', enabled: true },
|
||||
{ id: 'int', name: 'INT', enabled: true },
|
||||
{ id: 'wis', name: 'WIS', enabled: true },
|
||||
{ id: 'cha', name: 'CHA', enabled: true }
|
||||
];
|
||||
}
|
||||
|
||||
// Ensure showRPGAttributes exists (defaults to true)
|
||||
if (extensionSettings.trackerConfig.userStats.showRPGAttributes === undefined) {
|
||||
extensionSettings.trackerConfig.userStats.showRPGAttributes = true;
|
||||
}
|
||||
|
||||
// Ensure all rpgAttributes have corresponding values in classicStats
|
||||
if (extensionSettings.classicStats) {
|
||||
for (const attr of extensionSettings.trackerConfig.userStats.rpgAttributes) {
|
||||
if (extensionSettings.classicStats[attr.id] === undefined) {
|
||||
extensionSettings.classicStats[attr.id] = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Migrate old presentCharacters structure to new format
|
||||
if (extensionSettings.trackerConfig.presentCharacters) {
|
||||
const pc = extensionSettings.trackerConfig.presentCharacters;
|
||||
|
||||
Reference in New Issue
Block a user