v2.1: Add dynamic weather effects, clothing inventory, and bug fixes
Features: - Add dynamic weather effects system (snow, rain, mist, sunshine, storm, wind, blizzard) - Add separate Clothing tab in inventory system - Weather effects auto-update based on Info Box weather field - Combined effects for storm (rain+lightning) and blizzard (snow+wind) Improvements: - Settings migration system for automatic feature enablement - Weather effects positioned behind chat interface (z-index: 1) - Dynamic weather enabled by default for new users Bug Fixes: - Fix tab visibility issues (disabled tabs now properly hide) - Fix theme-aware borders (remove hardcoded blue colors) - Fix double scrollbar in Edit Trackers window - Fix scroll position jumping when editing Present Characters - Fix dynamic weather toggle hiding issue Technical: - Update inventory schema to v2.1 with clothing field - Add automatic migration for existing v2 inventories - Update parsers and prompts to handle clothing separately - Add translations (EN/ZH-TW) for new features
This commit is contained in:
@@ -70,6 +70,7 @@ import { renderInventory } from './src/systems/rendering/inventory.js';
|
||||
import { renderQuests } from './src/systems/rendering/quests.js';
|
||||
import { renderMusicPlayer } from './src/systems/rendering/musicPlayer.js';
|
||||
import { toggleSnowflakes, initSnowflakes } from './src/systems/ui/snowflakes.js';
|
||||
import { toggleDynamicWeather, initWeatherEffects, updateWeatherEffect } from './src/systems/ui/weatherEffects.js';
|
||||
|
||||
// Interaction modules
|
||||
import { initInventoryEventListeners } from './src/systems/interaction/inventoryActions.js';
|
||||
@@ -397,6 +398,12 @@ async function initUI() {
|
||||
toggleSnowflakes(extensionSettings.enableSnowflakes);
|
||||
});
|
||||
|
||||
$('#rpg-toggle-dynamic-weather').on('change', function() {
|
||||
extensionSettings.enableDynamicWeather = $(this).prop('checked');
|
||||
saveSettings();
|
||||
toggleDynamicWeather(extensionSettings.enableDynamicWeather);
|
||||
});
|
||||
|
||||
$('#rpg-dismiss-promo').on('click', function() {
|
||||
extensionSettings.dismissedHolidayPromo = true;
|
||||
saveSettings();
|
||||
@@ -561,6 +568,24 @@ async function initUI() {
|
||||
updateFeatureTogglesVisibility();
|
||||
});
|
||||
|
||||
$('#rpg-toggle-show-dynamic-weather-toggle').on('change', function() {
|
||||
extensionSettings.showDynamicWeatherToggle = $(this).prop('checked');
|
||||
// Also disable the feature when hiding the toggle
|
||||
if (!extensionSettings.showDynamicWeatherToggle) {
|
||||
extensionSettings.enableDynamicWeather = false;
|
||||
$('#rpg-toggle-dynamic-weather').prop('checked', false);
|
||||
toggleDynamicWeather(false);
|
||||
}
|
||||
saveSettings();
|
||||
updateFeatureTogglesVisibility();
|
||||
});
|
||||
|
||||
$('#rpg-toggle-show-snowflakes-toggle').on('change', function() {
|
||||
extensionSettings.showSnowflakesToggle = $(this).prop('checked');
|
||||
saveSettings();
|
||||
updateFeatureTogglesVisibility();
|
||||
});
|
||||
|
||||
// Auto avatar generation settings
|
||||
$('#rpg-toggle-auto-avatars').on('change', function() {
|
||||
extensionSettings.autoGenerateAvatars = $(this).prop('checked');
|
||||
@@ -757,11 +782,14 @@ async function initUI() {
|
||||
$('#rpg-toggle-html-prompt').prop('checked', extensionSettings.enableHtmlPrompt);
|
||||
$('#rpg-toggle-spotify-music').prop('checked', extensionSettings.enableSpotifyMusic);
|
||||
$('#rpg-toggle-snowflakes').prop('checked', extensionSettings.enableSnowflakes);
|
||||
$('#rpg-toggle-dynamic-weather').prop('checked', extensionSettings.enableDynamicWeather);
|
||||
|
||||
// Feature toggle visibility settings
|
||||
$('#rpg-toggle-show-html-toggle').prop('checked', extensionSettings.showHtmlToggle ?? true);
|
||||
$('#rpg-toggle-show-spotify-toggle').prop('checked', extensionSettings.showSpotifyToggle ?? true);
|
||||
$('#rpg-toggle-show-snowflakes-toggle').prop('checked', extensionSettings.showSnowflakesToggle ?? true);
|
||||
$('#rpg-toggle-show-dynamic-weather-toggle').prop('checked', extensionSettings.showDynamicWeatherToggle ?? true);
|
||||
$('#rpg-toggle-show-snowflakes-toggle').prop('checked', extensionSettings.showSnowflakesToggle ?? true);
|
||||
|
||||
// Hide holiday promo if previously dismissed
|
||||
if (extensionSettings.dismissedHolidayPromo) {
|
||||
@@ -825,6 +853,7 @@ async function initUI() {
|
||||
toggleAnimations();
|
||||
updateFeatureTogglesVisibility();
|
||||
togglePlotButtons(); // Initialize plot buttons and encounter button visibility
|
||||
initWeatherEffects(); // Initialize dynamic weather effects
|
||||
|
||||
// Setup mobile toggle button
|
||||
setupMobileToggle();
|
||||
@@ -865,6 +894,12 @@ async function initUI() {
|
||||
|
||||
// Initialize Lorebook Limiter
|
||||
initLorebookLimiter();
|
||||
|
||||
// Expose weather effect functions globally for cross-module access
|
||||
if (!window.RPGCompanion) {
|
||||
window.RPGCompanion = {};
|
||||
}
|
||||
window.RPGCompanion.updateWeatherEffect = updateWeatherEffect;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user