Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -10,8 +10,8 @@ doButtonEvent be = case be of
|
||||
ButtonDoNothing -> const id
|
||||
ButtonPress newstate newevent thesound f -> \b ->
|
||||
doWdWd f
|
||||
. set (cWorld . buttons . ix (_btID b) . btState) newstate
|
||||
. set (cWorld . buttons . ix (_btID b) . btEvent) newevent
|
||||
. set (cWorld . lWorld . buttons . ix (_btID b) . btState) newstate
|
||||
. set (cWorld . lWorld . buttons . ix (_btID b) . btEvent) newevent
|
||||
. soundStart (LeverSound 0) (_btPos b) thesound Nothing
|
||||
--ButtonSwitch onstate onevent onsound oneff offstate offevent offsound offeff -> undefined
|
||||
ButtonSimpleSwith oneff offeff -> flipSwitch oneff offeff
|
||||
@@ -21,10 +21,10 @@ flipSwitch :: WdWd -> WdWd -> Button -> World -> World
|
||||
flipSwitch oneff offeff bt
|
||||
| _btState bt == BtOff =
|
||||
doWdWd oneff . dosound
|
||||
. over (cWorld . buttons . ix (_btID bt)) turnon
|
||||
. over (cWorld . lWorld . buttons . ix (_btID bt)) turnon
|
||||
| otherwise =
|
||||
doWdWd offeff . dosound
|
||||
. over (cWorld . buttons . ix (_btID bt)) turnoff
|
||||
. over (cWorld . lWorld . buttons . ix (_btID bt)) turnoff
|
||||
where
|
||||
turnon = (btState .~ BtOn) . (btText .~ "SWITCH\\")
|
||||
turnoff = (btState .~ BtOff) . (btText .~ "SWITCH/")
|
||||
|
||||
Reference in New Issue
Block a user