Cleanup
This commit is contained in:
@@ -11,29 +11,23 @@ import Dodge.Render.List
|
||||
import Dodge.ScreenPos
|
||||
import Picture
|
||||
|
||||
drawMenuScreen :: Config -> Maybe Int -> ScreenLayer -> Picture
|
||||
drawMenuScreen cf mi = \case
|
||||
OptionScreen{_scTitle = s, _scSelectionList = l} -> drawOptions cf s mi l
|
||||
InputScreen inputstr -> drawInputMenu cf ('>' : inputstr)
|
||||
drawMenuScreen :: Maybe Int -> ScreenLayer -> Config -> Picture
|
||||
drawMenuScreen mi = \case
|
||||
OptionScreen{_scTitle = s, _scSelectionList = l} -> drawOptions s mi l
|
||||
InputScreen inputstr -> drawInputMenu ('>' : inputstr)
|
||||
|
||||
drawInputMenu :: Config -> String -> Picture
|
||||
drawInputMenu cf s = darkenBackground cf <> drawTitle cf s
|
||||
drawInputMenu :: String -> Config -> Picture
|
||||
drawInputMenu s cf = darkenBackground cf <> drawTitle cf s
|
||||
|
||||
drawOptions :: Config -> String -> Maybe Int -> [SelectionItem a] -> Picture
|
||||
drawOptions cf title msel sl =
|
||||
drawOptions :: String -> Maybe Int -> [SelectionItem a] -> Config -> Picture
|
||||
drawOptions title msel sl cf =
|
||||
darkenBackground cf
|
||||
<> drawTitle cf title
|
||||
<> drawSelectionList menuLDP cf sl
|
||||
<> translateScreenPos
|
||||
cf
|
||||
(menuLDP ^. ldpPos)
|
||||
( drawCursorAt
|
||||
msel
|
||||
sl
|
||||
menuLDP
|
||||
50
|
||||
(BoundaryCursor [North, South])
|
||||
)
|
||||
(drawCursorAt msel sl menuLDP 50 (BoundaryCursor [North, South]))
|
||||
|
||||
darkenBackground :: Config -> Picture
|
||||
darkenBackground = color (withAlpha 0.5 black) . polygon . reverse . screenBox
|
||||
|
||||
Reference in New Issue
Block a user