Cleanup and reorganise
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
module Dodge.Config.Load
|
||||
(
|
||||
loadDodgeConfig
|
||||
( loadDodgeConfig
|
||||
) where
|
||||
import Dodge.Config.Data
|
||||
|
||||
|
||||
@@ -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.
|
||||
-}
|
||||
|
||||
Reference in New Issue
Block a user