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:
@@ -15,6 +15,7 @@
|
||||
const DEFAULT_INVENTORY_V2 = {
|
||||
version: 2,
|
||||
onPerson: "None",
|
||||
clothing: "None",
|
||||
stored: {},
|
||||
assets: "None"
|
||||
};
|
||||
@@ -29,6 +30,17 @@ const DEFAULT_INVENTORY_V2 = {
|
||||
export function migrateInventory(inventory) {
|
||||
// Case 1: Already v2 format (has version property and is an object)
|
||||
if (inventory && typeof inventory === 'object' && inventory.version === 2) {
|
||||
// Check if clothing field exists (v2.1 upgrade)
|
||||
if (!inventory.hasOwnProperty('clothing')) {
|
||||
// console.log('[RPG Companion Migration] Upgrading v2 inventory to v2.1 (adding clothing field)');
|
||||
inventory.clothing = "None";
|
||||
return {
|
||||
inventory: inventory,
|
||||
migrated: true,
|
||||
source: 'v2-upgrade'
|
||||
};
|
||||
}
|
||||
|
||||
// console.log('[RPG Companion Migration] Inventory already v2, no migration needed');
|
||||
return {
|
||||
inventory: inventory,
|
||||
@@ -66,6 +78,7 @@ export function migrateInventory(inventory) {
|
||||
inventory: {
|
||||
version: 2,
|
||||
onPerson: inventory,
|
||||
clothing: "None",
|
||||
stored: {},
|
||||
assets: "None"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user