Assorted changes, cleanup menu selection text
This commit is contained in:
+19
-15
@@ -11,6 +11,7 @@ import Dodge.Data
|
||||
import Dodge.PreloadData
|
||||
import Dodge.Save
|
||||
import Dodge.Config.Update
|
||||
import Padding
|
||||
--import SDL.Internal.Numbered
|
||||
--import Preload.Update
|
||||
import Dodge.SoundLogic
|
||||
@@ -33,18 +34,20 @@ pauseMenu :: ScreenLayer
|
||||
pauseMenu = slTitleOptionsEff "PAUSED" pauseMenuOptions (return . unpause)
|
||||
pauseMenuOptions :: [MenuOption]
|
||||
pauseMenuOptions =
|
||||
[ Toggle ScancodeN (return . Just . startNewGame) (const "NEW LEVEL")
|
||||
, Toggle ScancodeR (return . Just . loadSaveSlot LevelStartSlot) (const "RESTART")
|
||||
, Toggle ScancodeS (pushScreen $ seedStartMenu "START FROM SEED") (const "START FROM SEED")
|
||||
, Toggle ScancodeO (pushScreen optionMenu ) (const "OPTIONS")
|
||||
, Toggle ScancodeC (pushScreen displayControls) (const "CONTROLS")
|
||||
[ Toggle ScancodeN (return . Just . startNewGame) (opText "NEW LEVEL")
|
||||
, Toggle ScancodeR (return . Just . loadSaveSlot LevelStartSlot) (opText "RESTART")
|
||||
, Toggle ScancodeS (pushScreen $ seedStartMenu "START FROM SEED") (opText "START FROM SEED")
|
||||
, Toggle ScancodeO (pushScreen optionMenu ) (opText "OPTIONS")
|
||||
, Toggle ScancodeC (pushScreen displayControls) (opText "CONTROLS")
|
||||
, InvisibleToggle ScancodeEscape (return . const Nothing)
|
||||
]
|
||||
where
|
||||
opText = const . Left
|
||||
seedStartMenu :: String -> ScreenLayer
|
||||
seedStartMenu str = slTitleOptionsEff str seedStartOptions popScreen
|
||||
seedStartOptions :: [MenuOption]
|
||||
seedStartOptions =
|
||||
[ Toggle ScancodeP trySeedFromClipboard (const "PASTE NUMBER FROM CLIPBOARD")
|
||||
[ Toggle ScancodeP trySeedFromClipboard (const $ Left "PASTE NUMBER FROM CLIPBOARD")
|
||||
-- , Toggle ScancodeI (return . Just . loadSaveSlot LevelStartSlot) (const "INSERT NUMBER")
|
||||
]
|
||||
|
||||
@@ -64,10 +67,10 @@ optionMenu = slTitleOptionsEff "OPTIONS" optionsOptions popScreen
|
||||
|
||||
optionsOptions :: [MenuOption]
|
||||
optionsOptions =
|
||||
[ makeSubmenuOption ScancodeV soundMenu "VOLUME"
|
||||
, makeSubmenuOption ScancodeG graphicsMenu "GRAPHICS"
|
||||
, makeSubmenuOption ScancodeP gameplayMenu "GAMEPLAY"
|
||||
, makeSubmenuOption ScancodeD debugMenu "DEBUG OPTIONS"
|
||||
[ makeSubmenuOption ScancodeV soundMenu $ Left "VOLUME"
|
||||
, makeSubmenuOption ScancodeG graphicsMenu $ Left "GRAPHICS"
|
||||
, makeSubmenuOption ScancodeP gameplayMenu $ Left "GAMEPLAY"
|
||||
, makeSubmenuOption ScancodeD debugMenu $ Left "DEBUG OPTIONS"
|
||||
]
|
||||
debugMenu :: ScreenLayer
|
||||
debugMenu = slTitleOptions
|
||||
@@ -83,10 +86,11 @@ debugMenuOptions =
|
||||
, makeEnumOption ScancodeB debug_view_clip_bounds "SHOW ROOM CLIP" return
|
||||
, doption ScancodeP debug_pathing "SHOW PATHING" _debug_pathing
|
||||
, doption ScancodeS debug_show_sound "SHOW VISUAL SOUNDS" _debug_show_sound
|
||||
, doption ScancodeM debug_mouse_position "SHOW MOUSE POSITION" _debug_mouse_position
|
||||
]
|
||||
where
|
||||
doption scode l t rec
|
||||
= Toggle scode (return . Just . (config . l %~ not)) (\w -> t ++ ":" ++ show (rec $ _config w))
|
||||
= Toggle scode (return . Just . (config . l %~ not)) (\w -> Right (t ,show (rec $ _config w)))
|
||||
gameplayMenu :: ScreenLayer
|
||||
gameplayMenu = slTitleOptions
|
||||
"OPTIONS:GAMEPLAY"
|
||||
@@ -104,9 +108,9 @@ soundMenu = slTitleOptions
|
||||
|
||||
soundMenuOptions :: [MenuOption]
|
||||
soundMenuOptions =
|
||||
[ theoption ScancodeY volume_master ScancodeU "MASTER VOLUME:" _volume_master
|
||||
, theoption ScancodeH volume_sound ScancodeJ "EFFECTS VOLUME:" _volume_sound
|
||||
, theoption ScancodeN volume_music ScancodeM "MUSIC VOLUME:" _volume_music
|
||||
[ theoption ScancodeY volume_master ScancodeU "MASTER VOLUME" _volume_master
|
||||
, theoption ScancodeH volume_sound ScancodeJ "EFFECTS VOLUME" _volume_sound
|
||||
, theoption ScancodeN volume_music ScancodeM "MUSIC VOLUME" _volume_music
|
||||
]
|
||||
where
|
||||
theoption scod1 stype scod2 str voltype = Toggle2
|
||||
@@ -114,7 +118,7 @@ soundMenuOptions =
|
||||
(change dec stype)
|
||||
scod2
|
||||
(change inc stype)
|
||||
(\w -> str ++ show (round $ 10 * voltype (_config w)::Int))
|
||||
(\w -> Right (str , leftPad 2 '.' $ show (round $ 10 * voltype (_config w)::Int)))
|
||||
change g vt = return . Just . (config . vt %~ g) . sw
|
||||
dec x = max 0 (x - 0.1)
|
||||
inc x = min 1 (x + 0.1)
|
||||
|
||||
Reference in New Issue
Block a user