Cleanup
This commit is contained in:
@@ -4,7 +4,9 @@ module Dodge.Menu (
|
||||
splashMenu,
|
||||
) where
|
||||
|
||||
import qualified Data.Aeson.Encode.Pretty as AEP
|
||||
import Control.Monad
|
||||
import Data.ByteString.Lazy.Char8 (unpack)
|
||||
--import SDL
|
||||
|
||||
import Data.Maybe
|
||||
@@ -41,6 +43,7 @@ splashMenuOptions =
|
||||
, Toggle (pushScreen $ seedStartMenu "START FROM SEED") (opText "NEW WITH SPECIFIC SEED")
|
||||
, Toggle (pushScreen optionMenu) (opText "OPTIONS")
|
||||
, Toggle (pushScreen displayControls) (opText "VIEW CONTROLS")
|
||||
, Toggle (pushScreen displayConfig) (opText "VIEW CONFIG")
|
||||
, Toggle id (displaywhenseed "VIEW LAST SEED")
|
||||
, Toggle hardQuit (opText "QUIT")
|
||||
]
|
||||
@@ -200,6 +203,13 @@ gameOverMenu u =
|
||||
unpause :: Universe -> Universe
|
||||
unpause w = resumeSound $ w & uvScreenLayers .~ []
|
||||
|
||||
-- note that this won't update after it is first loaded
|
||||
displayConfig :: Universe -> ScreenLayer
|
||||
displayConfig u = titleOptionsNoWrite "CONFIG" (map (Toggle id . const . MODString) $ listConfig u) u
|
||||
|
||||
listConfig :: Universe -> [String]
|
||||
listConfig u = lines $ unpack $ AEP.encodePretty' (AEP.Config (AEP.Spaces 2) compare AEP.Generic False) $ u ^. uvConfig
|
||||
|
||||
displayControls :: Universe -> ScreenLayer
|
||||
--displayControls = const $ ColumnsScreen "CONTROLS" listControls
|
||||
displayControls = titleOptionsNoWrite "CONTROLS" $ map (Toggle id . const . uncurry MODStringOption) listControls
|
||||
|
||||
Reference in New Issue
Block a user