Cleanup
This commit is contained in:
@@ -13,14 +13,14 @@ import Dodge.Render.List
|
||||
import Dodge.ScreenPos
|
||||
import Picture
|
||||
|
||||
drawMenuScreen :: Configuration -> Maybe Int -> ScreenLayer -> Picture
|
||||
drawMenuScreen :: Config -> Maybe Int -> ScreenLayer -> Picture
|
||||
drawMenuScreen cfig spos screen = case screen of
|
||||
OptionScreen{_scTitle = titf, _scSelectionList = slist} ->
|
||||
drawOptions cfig titf spos slist
|
||||
InputScreen inputstr help -> drawInputMenu cfig ('>' : inputstr) help
|
||||
|
||||
drawInputMenu ::
|
||||
Configuration ->
|
||||
Config ->
|
||||
-- | Title
|
||||
String ->
|
||||
-- | Help Text
|
||||
@@ -33,7 +33,7 @@ drawInputMenu cfig title footer =
|
||||
, drawFooterText cfig red footer
|
||||
]
|
||||
|
||||
drawOptions :: Configuration -> String -> Maybe Int -> [SelectionItem a] -> Picture
|
||||
drawOptions :: Config -> String -> Maybe Int -> [SelectionItem a] -> Picture
|
||||
drawOptions cfig title msel sl =
|
||||
darkenBackground cfig
|
||||
<> drawTitle cfig title
|
||||
@@ -49,10 +49,10 @@ drawOptions cfig title msel sl =
|
||||
(BoundaryCursor [North, South])
|
||||
)
|
||||
|
||||
darkenBackground :: Configuration -> Picture
|
||||
darkenBackground :: Config -> Picture
|
||||
darkenBackground = color (withAlpha 0.5 black) . polygon . reverse . screenBox
|
||||
|
||||
drawTitle :: Configuration -> String -> Picture
|
||||
drawTitle :: Config -> String -> Picture
|
||||
drawTitle cfig = translate (- hw) (hh -80) . scale 0.4 0.4 . text
|
||||
where
|
||||
hh = halfHeight cfig
|
||||
@@ -69,7 +69,7 @@ placeString ::
|
||||
Picture
|
||||
placeString x y sc = color white . translate x y . scale sc sc . text
|
||||
|
||||
drawFooterText :: Configuration -> Color -> String -> Picture
|
||||
drawFooterText :: Config -> Color -> String -> Picture
|
||||
drawFooterText cfig col = color col . placeString (- hw + 30) (- hh + 10) 0.1
|
||||
where
|
||||
hh = halfHeight cfig
|
||||
|
||||
Reference in New Issue
Block a user