Simplify lasers
This commit is contained in:
@@ -3,20 +3,20 @@ module Dodge.Render.MenuScreen (
|
||||
drawMenuScreen,
|
||||
) where
|
||||
|
||||
import Dodge.ListDisplayParams
|
||||
import Dodge.ScreenPos
|
||||
import Dodge.Data.CardinalPoint
|
||||
import Control.Lens
|
||||
import Dodge.Render.List
|
||||
import Dodge.Base.Window
|
||||
import Dodge.Data.CardinalPoint
|
||||
import Dodge.Data.SelectionList
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.ListDisplayParams
|
||||
import Dodge.Render.List
|
||||
import Dodge.ScreenPos
|
||||
import Picture
|
||||
|
||||
drawMenuScreen :: Configuration -> Maybe Int -> ScreenLayer -> Picture
|
||||
drawMenuScreen cfig spos screen = case screen of
|
||||
OptionScreen{_scTitle = titf, _scSelectionList = slist} ->
|
||||
drawOptions optionListDisplayParams cfig titf spos slist
|
||||
drawOptions cfig titf spos slist
|
||||
InputScreen inputstr help -> drawInputMenu cfig ('>' : inputstr) help
|
||||
|
||||
drawInputMenu ::
|
||||
@@ -33,25 +33,21 @@ drawInputMenu cfig title footer =
|
||||
, drawFooterText cfig red footer
|
||||
]
|
||||
|
||||
drawOptions ::
|
||||
ListDisplayParams ->
|
||||
Configuration ->
|
||||
-- | Title
|
||||
String ->
|
||||
Maybe Int ->
|
||||
[SelectionItem a] ->
|
||||
Picture
|
||||
drawOptions ldps cfig title msel sl =
|
||||
drawOptions :: Configuration -> String -> Maybe Int -> [SelectionItem a] -> Picture
|
||||
drawOptions cfig title msel sl =
|
||||
darkenBackground cfig
|
||||
<> drawTitle cfig title
|
||||
<> drawSelectionList ldps cfig sl
|
||||
<> translateScreenPos cfig (ldps ^. ldpPos) (drawCursorAt
|
||||
<> drawSelectionList menuDisplayParams cfig sl
|
||||
<> translateScreenPos
|
||||
cfig
|
||||
(menuDisplayParams ^. ldpPos)
|
||||
( drawCursorAt
|
||||
msel
|
||||
sl
|
||||
ldps
|
||||
menuDisplayParams
|
||||
50
|
||||
(BoundaryCursor [North, South])
|
||||
)
|
||||
)
|
||||
|
||||
darkenBackground :: Configuration -> Picture
|
||||
darkenBackground = color (withAlpha 0.5 black) . polygon . reverse . screenBox
|
||||
|
||||
Reference in New Issue
Block a user