Simplify button drawing
This commit is contained in:
@@ -11,15 +11,15 @@ import Dodge.Placement.Instance.LightSource
|
||||
import Dodge.PlacementSpot
|
||||
import Geometry
|
||||
|
||||
triggerSwitchSPic :: ButtonDraw -> PlacementSpot -> Placement
|
||||
triggerSwitchSPic sdraw ps = psPtCont ps (PutTrigger False) $
|
||||
triggerSwitchSPic :: Color -> Color -> PlacementSpot -> Placement
|
||||
triggerSwitchSPic c1 c2 ps = psPtCont ps (PutTrigger False) $
|
||||
\tp ->
|
||||
Just $
|
||||
pContID
|
||||
ps
|
||||
( PutButton
|
||||
( makeSwitchSPic
|
||||
sdraw
|
||||
c1 c2
|
||||
(SetTrigger True $ trigid tp)
|
||||
(SetTrigger False $ trigid tp)
|
||||
)
|
||||
@@ -28,15 +28,15 @@ triggerSwitchSPic sdraw ps = psPtCont ps (PutTrigger False) $
|
||||
where
|
||||
trigid tp = fromJust $ _plMID tp
|
||||
|
||||
triggerSwitchSPicLight :: ButtonDraw -> PlacementSpot -> Placement
|
||||
triggerSwitchSPicLight sdraw ps = psPtCont ps (PutTrigger False) $
|
||||
triggerSwitchSPicLight :: Color -> Color -> PlacementSpot -> Placement
|
||||
triggerSwitchSPicLight c1 c2 ps = psPtCont ps (PutTrigger False) $
|
||||
\tp -> Just $
|
||||
pContID atFstLnkOut (PutLS thels) $
|
||||
\lsid ->
|
||||
Just $
|
||||
pContID
|
||||
ps
|
||||
(PutButton (makeSwitchSPic sdraw (oneff lsid $ trigid tp) (offeff lsid $ trigid tp)))
|
||||
(PutButton (makeSwitchSPic c1 c2 (oneff lsid $ trigid tp) (offeff lsid $ trigid tp)))
|
||||
(const Nothing)
|
||||
where
|
||||
thels = lsColPosRad (V3 0.5 0 0) (V3 0 0 78) 75
|
||||
|
||||
Reference in New Issue
Block a user