This commit is contained in:
2025-08-26 18:51:14 +01:00
parent b87c3380b8
commit 1ebdbdd8ae
34 changed files with 210 additions and 246 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import Data.Aeson
import Dodge.Data.Config
import System.Directory
loadDodgeConfig :: IO Configuration
loadDodgeConfig :: IO Config
loadDodgeConfig = do
fExists <- doesFileExist "data/dodge.config.json"
if fExists
+3 -3
View File
@@ -17,7 +17,7 @@ import Sound
{- |
Write the current world configuration to disk as a json file.
-}
saveConfig :: Configuration -> (a -> IO a) -> a -> IO a
saveConfig :: Config -> (a -> IO a) -> a -> IO a
saveConfig cfig f x = do
-- putStrLn "Saving config to data/dodge.config.json"
BS.writeFile "data/dodge.config.json" $
@@ -27,7 +27,7 @@ saveConfig cfig f x = do
{- |
Apply the volume settings from the world configuration to the running game.
-}
setVol :: Configuration -> IO ()
setVol :: Config -> IO ()
setVol cfig = do
setSoundVolume (_volume_master cfig * _volume_sound cfig)
setMusicVolume (_volume_master cfig * _volume_music cfig)
@@ -36,7 +36,7 @@ setVol cfig = do
Apply /all/ of the values in the world configuration to the running game.
-}
applyWorldConfig ::
Configuration ->
Config ->
PreloadData ->
IO PreloadData
applyWorldConfig cfig pdata = do