Add settings panel with strip reopen button and AV disabled notification
CI / ci (push) Successful in 46s

Features:
- Added ScryingPoolSettings application with reopen/close strip buttons
- Registered settings menu in module settings (GM only)
- Added template for settings panel with styled buttons
- Added translations for settings UI
- Added info notification when AV is not available

Files:
- src/ui/gm/ScryingPoolSettings.js: New settings application
- templates/settings.hbs: Settings panel template
- lang/en.json: Added translations
- module.js: Registered settings menu and AV notification

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-05-25 15:57:58 +02:00
parent 3c8ebaf82a
commit 6bbde5c1cf
4 changed files with 151 additions and 2 deletions
+21
View File
@@ -35,6 +35,12 @@ import { ConfirmationBar } from './src/ui/gm/ConfirmationBar.js';
import { PlayerPrivacyPanelMenu, initPlayerPrivacyPanelMenu } from './src/ui/player/PlayerPrivacyPanelMenu.js';
import { initGMPlayerPrivacySelector } from './src/ui/gm/GMPlayerPrivacySelector.js';
import { ScryingPoolCameraViews, initScryingPoolCameraViews } from './src/ui/shared/ScryingPoolCameraViews.js';
import { ScryingPoolSettings } from './src/ui/gm/ScryingPoolSettings.js';
// Factory function to create ScryingPoolSettings with roleRenderer dependency
function initScryingPoolSettings(roleRendererRef) {
return () => new ScryingPoolSettings(roleRendererRef);
}
import { SOCKET_EVENTS } from './src/contracts/socket-message.js';
// Module-level references — constructed in init hook, used across hooks
@@ -262,6 +268,10 @@ Hooks.once("ready", () => {
} else if (outcome === 'unsupported') {
adapter.webrtc = null;
console.log('[ScryingPool] WebRTC not available - AV features disabled');
// Show info message to GM about AV being disabled
if (game.user?.isGM) {
ui.notifications?.info(game.i18n.localize('SCRYING_POOL.Notifications.AVDisabled'));
}
} else {
// Legacy: track-disable or css-fallback (deprecated)
adapter.webrtc = FoundryAdapter.buildWebRTCSurface(game.webrtc);
@@ -403,6 +413,17 @@ Hooks.once("ready", () => {
type: PlayerPrivacyPanelMenu,
restricted: false,
});
// Story 5.3: Register ScryingPoolSettings in module settings
// Provides button to reopen the strip
game.settings.registerMenu('scrying-pool', 'stripSettings', {
name: 'SCRYING_POOL.Settings.Title',
label: 'SCRYING_POOL.Settings.Title',
hint: 'SCRYING_POOL.Settings.Hint',
icon: 'fa-solid fa-cog',
type: initScryingPoolSettings(roleRenderer),
restricted: true, // GM only
});
} catch (err) {
console.error('[ScryingPool] Module initialization failed:', err);
throw err; // Re-throw to prevent module from loading in broken state