Merge pull request #94 from tomt610/feature/weather-foreground-option

feat: Add weather foreground option (experimental)
This commit is contained in:
Spicy Marinara
2026-01-11 19:33:14 +01:00
committed by GitHub
6 changed files with 31 additions and 2 deletions
+11
View File
@@ -403,6 +403,16 @@ async function initUI() {
toggleDynamicWeather(extensionSettings.enableDynamicWeather); toggleDynamicWeather(extensionSettings.enableDynamicWeather);
}); });
$('#rpg-toggle-weather-foreground').on('change', function() {
extensionSettings.weatherEffectsForeground = $(this).prop('checked');
saveSettings();
// Re-apply weather effect with new z-index
if (extensionSettings.enableDynamicWeather) {
toggleDynamicWeather(false);
toggleDynamicWeather(true);
}
});
$('#rpg-toggle-narrator').on('change', function() { $('#rpg-toggle-narrator').on('change', function() {
extensionSettings.narratorMode = $(this).prop('checked'); extensionSettings.narratorMode = $(this).prop('checked');
saveSettings(); saveSettings();
@@ -879,6 +889,7 @@ async function initUI() {
$('#rpg-toggle-spotify-music').prop('checked', extensionSettings.enableSpotifyMusic); $('#rpg-toggle-spotify-music').prop('checked', extensionSettings.enableSpotifyMusic);
$('#rpg-toggle-dynamic-weather').prop('checked', extensionSettings.enableDynamicWeather); $('#rpg-toggle-dynamic-weather').prop('checked', extensionSettings.enableDynamicWeather);
$('#rpg-toggle-weather-foreground').prop('checked', extensionSettings.weatherEffectsForeground ?? false);
$('#rpg-toggle-narrator').prop('checked', extensionSettings.narratorMode); $('#rpg-toggle-narrator').prop('checked', extensionSettings.narratorMode);
// Feature toggle visibility settings // Feature toggle visibility settings
+1
View File
@@ -35,6 +35,7 @@ export let extensionSettings = {
customSpotifyPrompt: '', // Custom Spotify prompt text (empty = use default) customSpotifyPrompt: '', // Custom Spotify prompt text (empty = use default)
enableDynamicWeather: true, // Enable dynamic weather effects based on Info Box weather field (v2: enabled by default) enableDynamicWeather: true, // Enable dynamic weather effects based on Info Box weather field (v2: enabled by default)
weatherEffectsForeground: false, // Experimental: render weather effects in foreground (on top of chat)
dismissedHolidayPromo: false, // User dismissed the holiday promotion banner dismissedHolidayPromo: false, // User dismissed the holiday promotion banner
showHtmlToggle: true, // Show Immersive HTML toggle in main panel showHtmlToggle: true, // Show Immersive HTML toggle in main panel
showDialogueColoringToggle: true, // Show Dialogue Coloring toggle in main panel (enabled by default) showDialogueColoringToggle: true, // Show Dialogue Coloring toggle in main panel (enabled by default)
+3
View File
@@ -143,6 +143,7 @@ export function updateFeatureTogglesVisibility() {
const $spotifyToggle = $('#rpg-spotify-toggle-wrapper'); const $spotifyToggle = $('#rpg-spotify-toggle-wrapper');
const $dynamicWeatherToggle = $('#rpg-dynamic-weather-toggle-wrapper'); const $dynamicWeatherToggle = $('#rpg-dynamic-weather-toggle-wrapper');
const $weatherForegroundToggle = $('#rpg-weather-foreground-toggle-wrapper');
const $narratorToggle = $('#rpg-narrator-toggle-wrapper'); const $narratorToggle = $('#rpg-narrator-toggle-wrapper');
const $autoAvatarsToggle = $('#rpg-auto-avatars-toggle-wrapper'); const $autoAvatarsToggle = $('#rpg-auto-avatars-toggle-wrapper');
@@ -154,6 +155,8 @@ export function updateFeatureTogglesVisibility() {
$spotifyToggle.toggle(extensionSettings.showSpotifyToggle); $spotifyToggle.toggle(extensionSettings.showSpotifyToggle);
$dynamicWeatherToggle.toggle(extensionSettings.showDynamicWeatherToggle); $dynamicWeatherToggle.toggle(extensionSettings.showDynamicWeatherToggle);
// Weather foreground toggle is only shown when dynamic weather toggle is visible
$weatherForegroundToggle.toggle(extensionSettings.showDynamicWeatherToggle);
$narratorToggle.toggle(extensionSettings.showNarratorMode); $narratorToggle.toggle(extensionSettings.showNarratorMode);
$autoAvatarsToggle.toggle(extensionSettings.showAutoAvatars); $autoAvatarsToggle.toggle(extensionSettings.showAutoAvatars);
+5
View File
@@ -270,6 +270,11 @@ export function updateWeatherEffect() {
} }
if (weatherContainer) { if (weatherContainer) {
// Apply foreground z-index if experimental setting is enabled
if (extensionSettings.weatherEffectsForeground) {
weatherContainer.style.zIndex = '9998';
}
document.body.appendChild(weatherContainer); document.body.appendChild(weatherContainer);
} }
} }
+3 -2
View File
@@ -9428,8 +9428,9 @@ body[data-theme="cyberpunk"] .rpg-music-widget-play {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100vw;
height: 100%; height: 100vh;
height: 100dvh; /* Dynamic viewport height for mobile browsers */
pointer-events: none; pointer-events: none;
z-index: 1; z-index: 1;
overflow: hidden; overflow: hidden;
+8
View File
@@ -125,6 +125,14 @@
<span class="rpg-toggle-text" data-i18n-key="template.mainPanel.dynamicWeatherEffects">Dynamic Weather</span> <span class="rpg-toggle-text" data-i18n-key="template.mainPanel.dynamicWeatherEffects">Dynamic Weather</span>
</label> </label>
</div> </div>
<!-- Weather Foreground Toggle (Experimental) -->
<div class="rpg-toggle-container rpg-feature-col" id="rpg-weather-foreground-toggle-wrapper">
<label class="rpg-toggle-label" title="Weather Effects in Foreground (Experimental)">
<input type="checkbox" id="rpg-toggle-weather-foreground">
<i class="fa-solid fa-layer-group"></i>
<span class="rpg-toggle-text">Weather Foreground</span>
</label>
</div>
<!-- Narrator Mode Toggle --> <!-- Narrator Mode Toggle -->
<div class="rpg-toggle-container rpg-feature-col" id="rpg-narrator-toggle-wrapper"> <div class="rpg-toggle-container rpg-feature-col" id="rpg-narrator-toggle-wrapper">
<label class="rpg-toggle-label" title="Narrator Mode"> <label class="rpg-toggle-label" title="Narrator Mode">