Add chapter checkpoint UI improvements and separate Quests toggle
- Fix checkpoint button display with expandMessageActions setting - Add body class observer to update buttons when setting toggles - Add cleanupCheckpointUI function for extension disable - Separate Quests from Inventory with independent toggle - Add horizontal scrolling to Info Box dashboard - Add divider between Inventory and Quests sections
This commit is contained in:
@@ -93,7 +93,8 @@ import {
|
||||
import {
|
||||
initChapterCheckpointUI,
|
||||
injectCheckpointButton,
|
||||
updateAllCheckpointIndicators
|
||||
updateAllCheckpointIndicators,
|
||||
cleanupCheckpointUI
|
||||
} from './src/systems/ui/checkpointUI.js';
|
||||
import { restoreCheckpointOnLoad } from './src/systems/features/chapterCheckpoint.js';
|
||||
import {
|
||||
@@ -197,6 +198,7 @@ async function addExtensionSettings() {
|
||||
// Disabling extension - remove UI elements
|
||||
clearExtensionPrompts();
|
||||
updateChatThoughts(); // Remove thought bubbles
|
||||
cleanupCheckpointUI(); // Remove checkpoint buttons and indicators
|
||||
|
||||
// Remove panel and toggle buttons
|
||||
$('#rpg-companion-panel').remove();
|
||||
@@ -204,11 +206,14 @@ async function addExtensionSettings() {
|
||||
$('#rpg-collapse-toggle').remove();
|
||||
$('#rpg-debug-toggle').remove();
|
||||
$('#rpg-debug-panel').remove();
|
||||
$('#rpg-plot-buttons').remove(); // Remove plot buttons
|
||||
} else if (extensionSettings.enabled && !wasEnabled) {
|
||||
// Enabling extension - initialize UI
|
||||
await initUI();
|
||||
loadChatData(); // Load chat data for current chat
|
||||
updateChatThoughts(); // Create thought bubbles if data exists
|
||||
injectCheckpointButton(); // Re-add checkpoint buttons
|
||||
updateAllCheckpointIndicators(); // Update button states
|
||||
}
|
||||
|
||||
// Update Memory Recollection button visibility
|
||||
@@ -332,6 +337,12 @@ async function initUI() {
|
||||
updateSectionVisibility();
|
||||
});
|
||||
|
||||
$('#rpg-toggle-quests').on('change', function() {
|
||||
extensionSettings.showQuests = $(this).prop('checked');
|
||||
saveSettings();
|
||||
updateSectionVisibility();
|
||||
});
|
||||
|
||||
$('#rpg-toggle-thoughts-in-chat').on('change', function() {
|
||||
extensionSettings.showThoughtsInChat = $(this).prop('checked');
|
||||
// console.log('[RPG Companion] Toggle showThoughtsInChat changed to:', extensionSettings.showThoughtsInChat);
|
||||
@@ -472,6 +483,7 @@ async function initUI() {
|
||||
$('#rpg-toggle-info-box').prop('checked', extensionSettings.showInfoBox);
|
||||
$('#rpg-toggle-thoughts').prop('checked', extensionSettings.showCharacterThoughts);
|
||||
$('#rpg-toggle-inventory').prop('checked', extensionSettings.showInventory);
|
||||
$('#rpg-toggle-quests').prop('checked', extensionSettings.showQuests);
|
||||
$('#rpg-toggle-thoughts-in-chat').prop('checked', extensionSettings.showThoughtsInChat);
|
||||
$('#rpg-toggle-always-show-bubble').prop('checked', extensionSettings.alwaysShowThoughtBubble);
|
||||
$('#rpg-toggle-html-prompt').prop('checked', extensionSettings.enableHtmlPrompt);
|
||||
|
||||
Reference in New Issue
Block a user