Cleanup and reorganise

This commit is contained in:
2021-10-31 19:46:32 +00:00
parent 41e64d14c3
commit 08fa84c1fd
53 changed files with 1352 additions and 1407 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
module Dodge.Config.Load
(
loadDodgeConfig
( loadDodgeConfig
) where
import Dodge.Config.Data
+6 -6
View File
@@ -2,7 +2,10 @@
IO actions that apply config side effects and save configuration settings to disk.
-}
module Dodge.Config.Update
where
( saveConfig
, setVolThen
, applyWorldConfig
) where
--import Dodge.Data.SoundOrigin
import Dodge.Config.Data
import Sound
@@ -19,7 +22,6 @@ saveConfig cfig f x = do
putStrLn "Saving config to data/dodge.config.json"
encodeFile "data/dodge.config.json" cfig
f x
{- |
Apply the volume settings from the world configuration to the running game.
-}
@@ -28,12 +30,10 @@ setVol cfig = do
setSoundVolume ( _volume_master cfig * _volume_sound cfig)
setMusicVolume ( _volume_master cfig * _volume_music cfig)
setVol' :: Configuration -> (a -> IO a) -> a -> IO a
setVol' cfig f a = do
setVolThen :: Configuration -> (a -> IO a) -> a -> IO a
setVolThen cfig f a = do
setVol cfig
f a
{- |
Apply /all/ of the values in the world configuration to the running game.
-}