v3.5.0: Weather effects improvements and dice roll fixes

- Refactor weather effects toggles to radio buttons in settings
  - Replace weatherEffectsForeground with weatherBackground/weatherForeground
  - Add Background/Foreground position options as radio toggles
  - Remove weather foreground toggle from main panel
- Fix dice roll to work independently of RPG attributes
  - Dice rolls now sent regardless of attribute settings
  - Adjust prompt wording based on whether attributes are enabled
- Improve History Persistence UI styling
  - Update input/select CSS to match tracker editor
  - Fix alignment issues
- Add theme-based radio button styling
  - Radio buttons now use theme colors instead of default blue
  - Support for all themes (default, sci-fi, fantasy, cyberpunk, custom)
- Update weather effects z-index logic for both modes
- Bump version to v3.5.0
This commit is contained in:
Spicy_Marinara
2026-01-11 20:05:35 +01:00
parent 46e6de0eba
commit c614f7b8dc
9 changed files with 225 additions and 43 deletions
+44 -11
View File
@@ -403,16 +403,6 @@ async function initUI() {
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() {
extensionSettings.narratorMode = $(this).prop('checked');
saveSettings();
@@ -603,6 +593,34 @@ async function initUI() {
}
saveSettings();
updateFeatureTogglesVisibility();
updateWeatherSubOptionsVisibility();
});
// Weather sub-options (background and foreground) - radio buttons
$('#rpg-toggle-weather-background').on('change', function() {
if ($(this).prop('checked')) {
extensionSettings.weatherBackground = true;
extensionSettings.weatherForeground = false;
saveSettings();
// Re-apply weather effect
if (extensionSettings.enableDynamicWeather) {
toggleDynamicWeather(false);
toggleDynamicWeather(true);
}
}
});
$('#rpg-toggle-weather-foreground').on('change', function() {
if ($(this).prop('checked')) {
extensionSettings.weatherBackground = false;
extensionSettings.weatherForeground = true;
saveSettings();
// Re-apply weather effect
if (extensionSettings.enableDynamicWeather) {
toggleDynamicWeather(false);
toggleDynamicWeather(true);
}
}
});
$('#rpg-toggle-show-narrator-mode').on('change', function() {
@@ -889,7 +907,6 @@ async function initUI() {
$('#rpg-toggle-spotify-music').prop('checked', extensionSettings.enableSpotifyMusic);
$('#rpg-toggle-dynamic-weather').prop('checked', extensionSettings.enableDynamicWeather);
$('#rpg-toggle-weather-foreground').prop('checked', extensionSettings.weatherEffectsForeground ?? false);
$('#rpg-toggle-narrator').prop('checked', extensionSettings.narratorMode);
// Feature toggle visibility settings
@@ -899,6 +916,8 @@ async function initUI() {
$('#rpg-toggle-show-cyoa-toggle').prop('checked', extensionSettings.showCYOAToggle ?? true);
$('#rpg-toggle-show-spotify-toggle').prop('checked', extensionSettings.showSpotifyToggle ?? true);
$('#rpg-toggle-show-dynamic-weather-toggle').prop('checked', extensionSettings.showDynamicWeatherToggle ?? true);
$('#rpg-toggle-weather-background').prop('checked', extensionSettings.weatherBackground ?? true);
$('#rpg-toggle-weather-foreground').prop('checked', extensionSettings.weatherForeground ?? false);
$('#rpg-toggle-show-narrator-mode').prop('checked', extensionSettings.showNarratorMode ?? true);
$('#rpg-toggle-show-auto-avatars').prop('checked', extensionSettings.showAutoAvatars ?? true);
@@ -1196,3 +1215,17 @@ jQuery(async () => {
);
}
});
/**
* Updates the visibility of weather sub-options in settings based on dynamic weather toggle
*/
function updateWeatherSubOptionsVisibility() {
const $weatherSubOptions = $('#rpg-weather-suboptions');
const isDynamicWeatherEnabled = extensionSettings.showDynamicWeatherToggle ?? true;
if (isDynamicWeatherEnabled) {
$weatherSubOptions.show();
} else {
$weatherSubOptions.hide();
}
}