Respect showInventory toggle in prompt generation
This commit is contained in:
@@ -241,15 +241,17 @@ export function generateTrackerInstructions(includeHtmlPrompt = true, includeCon
|
||||
instructions += `Skills: [${skillFieldsText || 'Skill1, Skill2, etc.'}]\n`;
|
||||
}
|
||||
|
||||
// Add inventory format based on feature flag
|
||||
if (FEATURE_FLAGS.useNewInventory) {
|
||||
instructions += 'On Person: [Items currently carried/worn, or "None"]\n';
|
||||
instructions += 'Stored - [Location Name]: [Items stored at this location]\n';
|
||||
instructions += '(Add multiple "Stored - [Location]:" lines as needed for different storage locations)\n';
|
||||
instructions += 'Assets: [Vehicles, property, major possessions, or "None"]\n';
|
||||
} else {
|
||||
// Legacy v1 format
|
||||
instructions += 'Inventory: [Clothing/Armor, Inventory Items (list of important items, or "None")]\\n';
|
||||
// Add inventory format based on feature flag - only if showInventory is enabled
|
||||
if (extensionSettings.showInventory) {
|
||||
if (FEATURE_FLAGS.useNewInventory) {
|
||||
instructions += 'On Person: [Items currently carried/worn, or "None"]\n';
|
||||
instructions += 'Stored - [Location Name]: [Items stored at this location]\n';
|
||||
instructions += '(Add multiple "Stored - [Location]:" lines as needed for different storage locations)\n';
|
||||
instructions += 'Assets: [Vehicles, property, major possessions, or "None"]\n';
|
||||
} else {
|
||||
// Legacy v1 format
|
||||
instructions += 'Inventory: [Clothing/Armor, Inventory Items (list of important items, or "None")]\\n';
|
||||
}
|
||||
}
|
||||
|
||||
// Add quests section
|
||||
|
||||
@@ -73,6 +73,7 @@ export function commitTrackerData() {
|
||||
/**
|
||||
* Event handler for when the user sends a message.
|
||||
* Sets the flag to indicate this is NOT a swipe.
|
||||
* In separate mode with auto-update disabled, commits the displayed tracker data.
|
||||
*/
|
||||
export function onMessageSent() {
|
||||
if (!extensionSettings.enabled) return;
|
||||
@@ -80,6 +81,21 @@ export function onMessageSent() {
|
||||
// User sent a new message - NOT a swipe
|
||||
setLastActionWasSwipe(false);
|
||||
// console.log('[RPG Companion] 🟢 EVENT: onMessageSent - lastActionWasSwipe =', lastActionWasSwipe);
|
||||
|
||||
// In separate mode with auto-update disabled, commit displayed tracker when user sends a message
|
||||
if (extensionSettings.generationMode === 'separate' && !extensionSettings.autoUpdate) {
|
||||
// Commit whatever is currently displayed in lastGeneratedData
|
||||
if (lastGeneratedData.userStats || lastGeneratedData.infoBox || lastGeneratedData.characterThoughts) {
|
||||
committedTrackerData.userStats = lastGeneratedData.userStats;
|
||||
committedTrackerData.infoBox = lastGeneratedData.infoBox;
|
||||
committedTrackerData.characterThoughts = lastGeneratedData.characterThoughts;
|
||||
|
||||
// Save to chat metadata
|
||||
saveChatData();
|
||||
|
||||
// console.log('[RPG Companion] 💾 Committed displayed tracker on user message (auto-update disabled)');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1116,7 +1116,8 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
gap: 0.25em;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.rpg-info-content::-webkit-scrollbar {
|
||||
@@ -1449,7 +1450,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
gap: 0;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
min-height: 0;
|
||||
overflow: visible;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -1521,9 +1522,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
overflow-y: auto;
|
||||
max-height: 100%;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.rpg-notebook-lines::-webkit-scrollbar {
|
||||
@@ -1906,13 +1905,36 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.rpg-character-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: clamp(3px, 0.5vh, 5px);
|
||||
overflow: hidden; /* Prevent content from overflowing */
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--rpg-border) transparent;
|
||||
}
|
||||
|
||||
.rpg-character-info::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.rpg-character-info::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.rpg-character-info::-webkit-scrollbar-thumb {
|
||||
background: var(--rpg-border);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.rpg-character-info::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--rpg-highlight);
|
||||
}
|
||||
|
||||
/* Character header with emoji and name */
|
||||
|
||||
Reference in New Issue
Block a user