From a61e05592d97f97b5cb85845f2e2c04d110a536e Mon Sep 17 00:00:00 2001
From: Andrei <amborn02@gmail.com>
Date: Wed, 22 Jan 2025 17:50:08 -0600
Subject: [PATCH] Removed weather effects booleans, now to disable weather
 effects, setting the value to 0 is the way

---
 src/application/types.ts            |  6 +-----
 src/components/game/map/Effects.vue |  6 ++----
 src/stores/gameStore.ts             | 12 ++++++------
 3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/application/types.ts b/src/application/types.ts
index 071b32c..deefce5 100644
--- a/src/application/types.ts
+++ b/src/application/types.ts
@@ -242,15 +242,11 @@ export type Chat = {
 
 export type WorldSettings = {
   date: Date
-  isRainEnabled: boolean
-  isFogEnabled: boolean
-  fogDensity: number
+  weatherState: WeatherState
 }
 
 export type WeatherState = {
-  isRainEnabled: boolean
   rainPercentage: number
-  isFogEnabled: boolean
   fogDensity: number
 }
 
diff --git a/src/components/game/map/Effects.vue b/src/components/game/map/Effects.vue
index 9181640..955bb64 100644
--- a/src/components/game/map/Effects.vue
+++ b/src/components/game/map/Effects.vue
@@ -35,9 +35,7 @@ const effects = {
 
 // Weather state
 const weatherState = ref<WeatherState>({
-  isRainEnabled: false,
   rainPercentage: 0,
-  isFogEnabled: false,
   fogDensity: 0
 })
 
@@ -123,8 +121,8 @@ const updateScene = () => {
       ? mapEffects
       : {
           light: timeBasedLight,
-          rain: weatherState.value.isRainEnabled ? weatherState.value.rainPercentage : 0,
-          fog: weatherState.value.isFogEnabled ? weatherState.value.fogDensity * 100 : 0
+          rain: weatherState.value.rainPercentage,
+          fog: weatherState.value.fogDensity * 100
         }
   applyEffects(finalEffects)
 }
diff --git a/src/stores/gameStore.ts b/src/stores/gameStore.ts
index 842dadb..fbe9149 100644
--- a/src/stores/gameStore.ts
+++ b/src/stores/gameStore.ts
@@ -15,9 +15,10 @@ export const useGameStore = defineStore('game', {
       character: null as Character | null,
       world: {
         date: new Date(),
-        isRainEnabled: false,
-        isFogEnabled: false,
-        fogDensity: 0
+        weatherState: {
+          rainPercentage: 0,
+          fogDensity: 0
+        }
       } as WorldSettings,
       game: {
         isLoading: false,
@@ -119,9 +120,8 @@ export const useGameStore = defineStore('game', {
       this.uiSettings.isGmPanelOpen = false
 
       this.world.date = new Date()
-      this.world.isRainEnabled = false
-      this.world.isFogEnabled = false
-      this.world.fogDensity = 0
+      this.world.weatherState.rainPercentage = 0
+      this.world.weatherState.fogDensity = 0
     }
   }
 })