Remove _plGenUpdate field, instead allow Placements to take World arg

This commit is contained in:
2022-06-02 20:00:03 +01:00
parent 7c4a853d70
commit 024f72da20
13 changed files with 54 additions and 53 deletions
+2 -2
View File
@@ -149,8 +149,8 @@ spanLSLightI ls h a b = ps0j (PutLS $ ls & lsParam . lsPos .~ V3 x y h)
V2 x y = 0.5 *.* (a +.+ b)
spanLS :: LightSource -> Point2 -> Point2 -> Placement
spanLS ls a b = Placement (PS (V2 x y) 0) (PutLS ls) Nothing Nothing
$ const $ Just $ sps0 $ PutShape $ thinHighBar h a b
spanLS ls a b = Placement (PS (V2 x y) 0) (PutLS ls) Nothing
$ const $ const $ Just $ sps0 $ PutShape $ thinHighBar h a b
where
V3 _ _ h = _lsPos (_lsParam ls) + 5
V2 x y = 0.5 *.* (a +.+ b)
+3 -6
View File
@@ -35,7 +35,9 @@ putTerminal' col mcf = ps0PushPS (PutButton termButton)
$ const Nothing
putTerminal :: (GenParams -> World -> TerminalParams) -> Placement
putTerminal f = plGenUpdate ?~ g $ ps0PushPS (PutButton termButton)
putTerminal f = ps0PushPSw PutNothing $ \w _ -> Just $
--plGenUpdate ?~ g $ ps0PushPS (PutButton $ termButton & btTerminalParams .~ f (_genParams w))
ps0PushPS (PutButton $ termButton & btTerminalParams .~ f (_genParams w))
$ \pl -> Just $ pt0 (PutMachine terminalColor (reverse $ square 10) defaultMachine
{ _mcDraw = noPic . terminalShape terminalColor
, _mcHP = 100
@@ -44,11 +46,6 @@ putTerminal f = plGenUpdate ?~ g $ ps0PushPS (PutButton termButton)
. makeExplosionAt (_mcPos mc)
})
$ const Nothing
where
g gp pl = (gp,
pl & plType . putButton . btTerminalParams .~ f gp
& plGenUpdate .~ Nothing
)
termButton :: Button
termButton = Button
{ _btPict = const mempty