feat(inventory): wire up v2 system to main panel with full interactivity

- Add inventory section to template.html between Thoughts and bottom controls
- Wire up renderInventory() to all event handlers (message received, character changed, swipes)
- Initialize inventory container reference and event listeners in index.js
- Add showInventory toggle checkbox to settings with visibility control
- Update layout.js to handle inventory section and divider visibility
- Add renderInventory parameter to updateRPGData for separate mode support
- Update state.js and config.js with inventory container and showInventory setting

Inventory is now fully integrated as a visible, interactive panel section that persists across all user interactions.
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-17 15:36:15 +11:00
parent 60e4a6c2cc
commit 1f948cd5d8
7 changed files with 64 additions and 10 deletions
+5 -1
View File
@@ -28,6 +28,7 @@ import { updateRPGData } from '../generation/apiClient.js';
import { renderUserStats } from '../rendering/userStats.js';
import { renderInfoBox } from '../rendering/infoBox.js';
import { renderThoughts, updateChatThoughts } from '../rendering/thoughts.js';
import { renderInventory } from '../rendering/inventory.js';
// Utils
import { getSafeThumbnailUrl } from '../../utils/avatars.js';
@@ -162,6 +163,7 @@ export async function onMessageReceived(data) {
renderUserStats();
renderInfoBox();
renderThoughts();
renderInventory();
// Save to chat metadata
saveChatData();
@@ -169,7 +171,7 @@ export async function onMessageReceived(data) {
} else if (extensionSettings.generationMode === 'separate' && extensionSettings.autoUpdate) {
// In separate mode with auto-update, trigger update after message
setTimeout(async () => {
await updateRPGData(renderUserStats, renderInfoBox, renderThoughts);
await updateRPGData(renderUserStats, renderInfoBox, renderThoughts, renderInventory);
}, 500);
}
@@ -210,6 +212,7 @@ export function onCharacterChanged() {
renderUserStats();
renderInfoBox();
renderThoughts();
renderInventory();
// Update chat thought overlays
updateChatThoughts();
@@ -280,6 +283,7 @@ export function onMessageSwiped(messageIndex) {
renderUserStats();
renderInfoBox();
renderThoughts();
renderInventory();
// Update chat thought overlays
updateChatThoughts();