Simplify button drawing

This commit is contained in:
2025-06-25 15:40:12 +01:00
parent bf0bc22720
commit 6e9d4918a1
9 changed files with 40 additions and 46 deletions
+6 -6
View File
@@ -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