Refactor sound
This commit is contained in:
@@ -3,6 +3,7 @@ module Dodge.LevelGen.Switch
|
||||
import Dodge.Data
|
||||
import Dodge.Data.SoundOrigin
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Dodge.Picture.Layer
|
||||
import Picture
|
||||
import Geometry
|
||||
@@ -19,7 +20,7 @@ makeButton c eff = Button
|
||||
, _btPos = V2 0 0
|
||||
, _btRot = 0
|
||||
, _btEvent = \b w -> eff . over buttons (IM.adjust turnOn (_btID b))
|
||||
. soundFromGeneral (LeverSound 0) (btpos b) 1 Nothing $ w
|
||||
. soundFromGeneral (LeverSound 0) (btpos b) click1S Nothing $ w
|
||||
, _btID = 0
|
||||
, _btText = "Button"
|
||||
--, _btText = "Button"
|
||||
@@ -45,7 +46,7 @@ makeSwitch c effOn effOff = Button
|
||||
, _btState = BtOff
|
||||
}
|
||||
where
|
||||
flipSwitch b w = switchEffect b . soundFromGeneral (LeverSound 0) (bpos b) 1 Nothing $ w
|
||||
flipSwitch b w = switchEffect b . soundFromGeneral (LeverSound 0) (bpos b) click1S Nothing $ w
|
||||
bpos b w = _btPos $ _buttons w IM.! _btID b
|
||||
switchEffect b = case _btState b of
|
||||
BtOff -> effOn . over buttons (IM.adjust turnOn (_btID b))
|
||||
|
||||
Reference in New Issue
Block a user