fix: clear skills

This commit is contained in:
Subarashimo
2025-12-05 16:29:54 +01:00
parent 806a7078a7
commit 38328de1bf
4 changed files with 21 additions and 3 deletions
+3 -1
View File
@@ -215,7 +215,8 @@ export function loadChatData() {
onPerson: "None",
stored: {},
assets: "None"
}
},
skills: "None" // Legacy single-string skills (for Status section)
},
quests: {
main: "None",
@@ -231,6 +232,7 @@ export function loadChatData() {
skillsV2: {},
skillsData: {},
skillAbilityLinks: {},
skills: { list: [], categories: {} },
charactersData: [],
infoBoxData: null,
questsV2: {
+2 -1
View File
@@ -28,7 +28,7 @@ export const DEFAULT_JSON_TRACKER_PROMPT = `At the start of every reply, output
* Default message interception prompt text
* Guides the LLM to rewrite the user's message based on current RPG state and recent chat
*/
export const DEFAULT_MESSAGE_INTERCEPTION_PROMPT = `Act as an uncompromising Immersive Copy Editor who rewrites the user's draft to strictly adhere to {{user}}'s persona and RPG state (JSON). You must validate the feasibility of the user's intended actions against the JSON state; if the draft contradicts the state (e.g., acting smart while 'Intelligence' is low, or running while having a 'Leg Injury'), you are required to override the core intent, rewriting the action to portray immediate failure, struggle, or involuntary reaction instead of the user's desired success. Even further, if the intended course of action is physically impossible via the state or represents a thought process conceptually alien to the character's nature or current state, you are mandated to completely overwrite the user's intent. Aggressively rephrase vocabulary and syntax to match the character's specific cognitive capacity and tone. Keep the output concise and devoid of fluff; do not expand the narrative beyond the necessary state-enforced correction. Return ONLY the modified message text.`;
export const DEFAULT_MESSAGE_INTERCEPTION_PROMPT = `Act as an uncompromising Immersive Copy Editor who rewrites the user's draft to strictly adhere to {{user}}'s persona and RPG state (JSON). You must validate the feasibility of the user's intended actions for {{user}} against the JSON state; if the draft contradicts the state (e.g., acting smart while 'Intelligence' is low, or running while having a 'Leg Injury'), you are required to override the core intent, rewriting the action to portray immediate failure, struggle, or involuntary reaction instead of the user's desired success. Even further, if the intended course of action is physically impossible via the state or represents a thought process conceptually alien to the character's nature or current state, you are mandated to completely overwrite the user's intent. Aggressively rephrase vocabulary and syntax to match the character's specific cognitive capacity and tone. Keep the output concise and devoid of fluff; do not expand the narrative beyond the necessary state-enforced correction. Never include information that was not already present in the original draft. Never narrate the consequences of {{user}}'s actions, only what they are. Return ONLY the modified message text.`;
/**
* Gets character card information for current chat (handles both single and group chats)
@@ -407,6 +407,7 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
instructions += '- Level is a numeric value (typically 1+, represents character progression)\n';
}
instructions += '- Items should be placeed in the inventory section, not the skills section\n';
instructions += '- Characters should be removed as soon as they leave the scene\n';
instructions += '- Your list of characters must never include {{user}}\n';
instructions += '- Empty arrays [] for sections with no items\n';
+1
View File
@@ -360,6 +360,7 @@ export function onCharacterChanged() {
renderThoughts();
renderInventory();
renderQuests();
renderSkills();
// Update chat thought overlays
updateChatThoughts();
+15 -1
View File
@@ -17,6 +17,7 @@ import { saveSettings, saveChatData } from '../../core/persistence.js';
import { renderUserStats } from '../rendering/userStats.js';
import { updateChatThoughts } from '../rendering/thoughts.js';
import { renderQuests } from '../rendering/quests.js';
import { renderSkills } from '../rendering/skills.js';
import {
rollDice as rollDiceCore,
clearDiceRoll as clearDiceRollCore,
@@ -390,7 +391,13 @@ export function setupSettingsPopup() {
arousal: 0,
mood: '😐',
conditions: 'None',
inventory: 'None'
inventory: {
version: 2,
onPerson: "None",
stored: {},
assets: "None"
},
skills: "None" // Legacy single-string skills (for Status section)
};
// Reset classic stats (attributes) to defaults
@@ -412,6 +419,12 @@ export function setupSettingsPopup() {
optional: []
};
// Reset skills data
extensionSettings.skillsV2 = {};
extensionSettings.skillsData = {};
extensionSettings.skillAbilityLinks = {};
extensionSettings.skills = { list: [], categories: {} }; // Legacy skills object
// Save everything
saveChatData();
saveSettings();
@@ -421,6 +434,7 @@ export function setupSettingsPopup() {
updateDiceDisplayCore();
updateChatThoughts(); // Clear the thought bubble in chat
renderQuests(); // Clear and re-render quests UI
renderSkills(); // Clear and re-render skills UI
// console.log('[RPG Companion] Chat cache cleared');
});