This commit is contained in:
2025-09-19 20:39:17 +01:00
parent d4f2cdd3fd
commit b837e6a798
9 changed files with 268 additions and 345 deletions
+9 -15
View File
@@ -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