Move universe IO effects outside of world

This commit is contained in:
2022-07-23 12:53:20 +01:00
parent 2892bb25f0
commit 12fad676f2
12 changed files with 41 additions and 44 deletions
+3 -3
View File
@@ -134,13 +134,13 @@ soundMenuOptions =
scod2
(change inc stype)
(\w -> Right (str , leftPad 2 '.' $ show (round $ 10 * voltype (_uvConfig w)::Int)))
change g vt = return . Just . (uvConfig . vt %~ g) . sw
change g vt uv = sw uv >> return (Just $ uv & uvConfig . vt %~ g)
dec x = max 0 (x - 0.1)
inc x = min 1 (x + 0.1)
sw w = w & uvWorld . sideEffects %~ setVolThen (_uvConfig w)
sw w = setVol (_uvConfig w)
writeConfig :: Universe -> Universe
writeConfig w = w & uvWorld . sideEffects %~ saveConfig (_uvConfig w)
writeConfig w = w & uvIOEffects %~ saveConfig (_uvConfig w)
graphicsMenu :: ScreenLayer
graphicsMenu = slTitleOptions "OPTIONS:GRAPHICS" graphicsMenuOptions