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