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({ - 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 } } })