Remove recursive WdWd
This commit is contained in:
@@ -25,8 +25,8 @@ data SoundFilter
|
|||||||
data WdWd
|
data WdWd
|
||||||
= NoWorldEffect
|
= NoWorldEffect
|
||||||
| SetTrigger Bool Int
|
| SetTrigger Bool Int
|
||||||
| WorldEffects [WdWd] -- probably best to avoid recursive types if possible...
|
|
||||||
| SetLSCol Point3 Int
|
| SetLSCol Point3 Int
|
||||||
|
| SetTriggerAndSetLSCol Bool Int Point3 Int
|
||||||
| AccessTerminal Int
|
| AccessTerminal Int
|
||||||
| UnlockInv
|
| UnlockInv
|
||||||
| SoundStart SoundOrigin Point2 SoundID (Maybe Int)
|
| SoundStart SoundOrigin Point2 SoundID (Maybe Int)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ putLitButOnPosExtTrig' col thePS cnt =
|
|||||||
\plmnt ->
|
\plmnt ->
|
||||||
jps0'
|
jps0'
|
||||||
( PutButton
|
( PutButton
|
||||||
(makeButton col (WorldEffects [changeLight (fromJust $ _plMID plmnt), oneff (trigid tp)]))
|
(makeButton col (buteff (trigid tp) (fromJust $ _plMID plmnt)))
|
||||||
{ _btPos = V2 0 (-1)
|
{ _btPos = V2 0 (-1)
|
||||||
, _btRot = pi
|
, _btRot = pi
|
||||||
}
|
}
|
||||||
@@ -119,8 +119,7 @@ putLitButOnPosExtTrig' col thePS cnt =
|
|||||||
<&> plSpot
|
<&> plSpot
|
||||||
.~ _plSpot plmnt
|
.~ _plSpot plmnt
|
||||||
where
|
where
|
||||||
|
buteff i j = SetTriggerAndSetLSCol True i (V3 0 0.5 0) j
|
||||||
shp = fmap (fmap $ colorSH col) aShape
|
shp = fmap (fmap $ colorSH col) aShape
|
||||||
trigid tp = fromJust $ _plMID tp
|
trigid tp = fromJust $ _plMID tp
|
||||||
oneff = SetTrigger True
|
|
||||||
changeLight = SetLSCol (V3 0 0.5 0)
|
|
||||||
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
|
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ doWdWd = \case
|
|||||||
NoWorldEffect -> id
|
NoWorldEffect -> id
|
||||||
SetTrigger bool tid -> cWorld . lWorld . triggers . ix tid .~ bool
|
SetTrigger bool tid -> cWorld . lWorld . triggers . ix tid .~ bool
|
||||||
SetLSCol col lsid -> cWorld . lWorld . lightSources . ix lsid . lsParam . lsCol .~ col
|
SetLSCol col lsid -> cWorld . lWorld . lightSources . ix lsid . lsParam . lsCol .~ col
|
||||||
|
SetTriggerAndSetLSCol bool tid col lsid -> (cWorld . lWorld . lightSources . ix lsid . lsParam . lsCol .~ col)
|
||||||
|
. (cWorld . lWorld . triggers . ix tid .~ bool)
|
||||||
AccessTerminal mtmid -> accessTerminal mtmid
|
AccessTerminal mtmid -> accessTerminal mtmid
|
||||||
WorldEffects wes -> \w -> foldr doWdWd w wes
|
|
||||||
UnlockInv -> unlockInv
|
UnlockInv -> unlockInv
|
||||||
MakeStartCloudAt p -> makeCloudAt CryoReleaseCloud 400 p
|
MakeStartCloudAt p -> makeCloudAt CryoReleaseCloud 400 p
|
||||||
TorqueCr x cid -> torqueCr x cid
|
TorqueCr x cid -> torqueCr x cid
|
||||||
|
|||||||
Reference in New Issue
Block a user