Improve mouse menu controls, tweak charmap

This commit is contained in:
2022-12-21 11:33:11 +00:00
parent 860d63df45
commit 03c945d189
12 changed files with 68 additions and 50 deletions
+14 -15
View File
@@ -1,7 +1,6 @@
{- The menu picture. -}
module Dodge.Render.MenuScreen (
menuScreen,
menuScreen',
drawMenuScreen,
) where
--import LensHelp
@@ -15,8 +14,8 @@ import Dodge.Data.Universe
import Padding
import Picture
menuScreen' :: Configuration -> ScreenLayer -> Picture
menuScreen' cfig screen = case screen of
drawMenuScreen :: Configuration -> ScreenLayer -> Picture
drawMenuScreen cfig screen = case screen of
OptionScreen{_scTitle = titf, _scSelectionList = selpos} ->
drawOptions cfig titf selpos "Use keys to navigate the menu"
-- (WaitScreen sf _) -> drawOptions w (sf w) [] 0 ""
@@ -24,12 +23,12 @@ menuScreen' cfig screen = case screen of
-- (DisplayScreen sd) -> sd w
(ColumnsScreen titf pairs) -> drawTwoColumnsScreen cfig titf pairs
menuScreen :: Configuration -> ScreenLayer -> Picture
menuScreen cfig screen = case screen of
OptionScreen{_scTitle = titf, _scSelectionList = selpos} ->
drawOptions cfig titf selpos "Use keys to navigate the menu"
(InputScreen inputstr help) -> drawInputMenu cfig ('>' : T.unpack inputstr) help
(ColumnsScreen titf pairs) -> drawTwoColumnsScreen cfig titf pairs
--menuScreen :: Configuration -> ScreenLayer -> Picture
--menuScreen cfig screen = case screen of
-- OptionScreen{_scTitle = titf, _scSelectionList = selpos} ->
-- drawOptions cfig titf selpos "Use keys to navigate the menu"
-- (InputScreen inputstr help) -> drawInputMenu cfig ('>' : T.unpack inputstr) help
-- (ColumnsScreen titf pairs) -> drawTwoColumnsScreen cfig titf pairs
--displayStringList :: World -> [String] -> Picture
--displayStringList w ss = pictures
@@ -72,8 +71,8 @@ drawInputMenu ::
Picture
drawInputMenu cfig title footer =
pictures
[ --darkenBackground cfig
drawTitle cfig title
[ darkenBackground cfig
, drawTitle cfig title
, drawFooterText cfig red footer
]
@@ -88,14 +87,14 @@ drawOptions ::
Picture
drawOptions cfig title sl footer =
pictures
[ --darkenBackground cfig
drawTitle cfig title
[ darkenBackground cfig
, drawTitle cfig title
, drawFooterText cfig red footer
, drawSelectionList cfig sl
]
darkenBackground :: Configuration -> Picture
darkenBackground = color (withAlpha 0.5 black) . polygon . reverse . screenBox
darkenBackground cfig = winScale cfig . color (withAlpha 0.5 black) . polygon . reverse . screenBox $ cfig
drawTitle :: Configuration -> String -> Picture
drawTitle cfig = winScale cfig . translate (30 - hw) (hh-50) . scale 0.4 0.4 . text