diff --git a/index.js b/index.js index 037592d..f91172b 100644 --- a/index.js +++ b/index.js @@ -105,6 +105,9 @@ import { setupDesktopTabs, removeDesktopTabs } from './src/systems/ui/desktop.js'; +import { + updateDebugUIVisibility +} from './src/systems/ui/debug.js'; // Feature modules import { setupPlotButtons, sendPlotProgression } from './src/systems/features/plotProgression.js'; @@ -190,6 +193,13 @@ function addExtensionSettings() { updateChatThoughts(); // This will re-create the thought bubble if data exists } }); + + // Set up the debug mode toggle + $('#rpg-debug-mode').prop('checked', extensionSettings.debugMode).on('change', function() { + extensionSettings.debugMode = $(this).prop('checked'); + saveSettings(); + updateDebugUIVisibility(); + }); } /** @@ -455,6 +465,9 @@ async function initUI() { setupContentEditableScrolling(); setupRefreshButtonDrag(); initInventoryEventListeners(); + + // Initialize debug UI if debug mode is enabled + updateDebugUIVisibility(); } diff --git a/settings.html b/settings.html index a6d40ea..069a9fe 100644 --- a/settings.html +++ b/settings.html @@ -11,6 +11,12 @@ Toggle to enable/disable the RPG Companion extension. Configure additional settings within the panel itself. + + Enable debug logging visible in UI. Useful for troubleshooting parsing issues on mobile devices. Shows a red bug button to view parser logs. +