Simplify the main loop, events only perform functional update
This commit is contained in:
@@ -16,6 +16,12 @@ listPicturesAt tx ty cfig = listPicturesAtOff tx ty cfig 0
|
||||
listPicturesAtOff :: Float -> Float -> Configuration -> Int -> [Picture] -> Picture
|
||||
listPicturesAtOff tx ty cfig i = mconcat . zipWith (listTextPictureAt tx ty cfig) [i ..]
|
||||
|
||||
stackPicturesAt :: Float -> Float -> Configuration -> [Picture] -> Picture
|
||||
stackPicturesAt tx ty cfig = stackPicturesAtOff tx ty cfig 0
|
||||
|
||||
stackPicturesAtOff :: Float -> Float -> Configuration -> Int -> [Picture] -> Picture
|
||||
stackPicturesAtOff tx ty cfig i = mconcat . zipWith (listTextPictureAt tx ty cfig) [i, i-1 ..]
|
||||
|
||||
-- displays a cursor that should match up to list text pictures
|
||||
-- the width of a character appears to be 9(?!)
|
||||
-- this is probably because it is 8 pixels plus one for the border
|
||||
|
||||
@@ -26,17 +26,28 @@ fixedCoordPictures u =
|
||||
cfig = _uvConfig u
|
||||
|
||||
drawConcurrentMessage :: Universe -> Picture
|
||||
drawConcurrentMessage u = case u ^? uvSideEffects . _head of
|
||||
--Just (BlockingConcEffect str) -> fillWidthText cfig str
|
||||
Just (RunningSideEffect str) ->
|
||||
listPicturesAt
|
||||
(halfWidth cfig)
|
||||
(_windowY cfig - 50)
|
||||
cfig
|
||||
[centerText str]
|
||||
_ -> mempty
|
||||
drawConcurrentMessage u =
|
||||
stackPicturesAt
|
||||
(halfWidth cfig)
|
||||
(_windowY cfig - 50)
|
||||
cfig
|
||||
(map (centerText . f) $ u ^.. uvSideEffects . each)
|
||||
where
|
||||
cfig = _uvConfig u
|
||||
f (RunningSideEffect ce) = ce ++ " IN PROGRESS"
|
||||
f x = _ceString x ++ " QUEUED"
|
||||
|
||||
-- = case u ^? uvSideEffects . _head of
|
||||
-- --Just (BlockingConcEffect str) -> fillWidthText cfig str
|
||||
-- Just (RunningSideEffect str) ->
|
||||
-- stackPicturesAt
|
||||
-- (halfWidth cfig)
|
||||
-- (_windowY cfig - 50)
|
||||
-- cfig
|
||||
-- [centerText str]
|
||||
-- _ -> mempty
|
||||
-- where
|
||||
-- cfig = _uvConfig u
|
||||
|
||||
customMouseCursor :: Configuration -> World -> Picture
|
||||
customMouseCursor cfig w =
|
||||
|
||||
Reference in New Issue
Block a user