diff --git a/src/Dodge/Default.hs b/src/Dodge/Default.hs index 1b4bed8aa..773ce392b 100644 --- a/src/Dodge/Default.hs +++ b/src/Dodge/Default.hs @@ -21,10 +21,7 @@ import Dodge.Data import Dodge.SoundLogic import Geometry import Picture -import ShapePicture -import Shape -import Control.Lens import qualified Data.Text as T import qualified Data.Map.Strict as M diff --git a/src/Dodge/LevelGen/Switch.hs b/src/Dodge/LevelGen/Switch.hs index bbb457f98..e407aaca8 100644 --- a/src/Dodge/LevelGen/Switch.hs +++ b/src/Dodge/LevelGen/Switch.hs @@ -12,8 +12,6 @@ import ShapePicture import Shape import Geometry -import qualified IntMapHelp as IM -import Control.Lens makeButton :: Color -> WorldEffect -- ^ Effect when pressed @@ -24,8 +22,6 @@ makeButton col eff = defaultButton , _btText = "Button" , _btState = BtOff } - where - btpos b w' = _btPos $ _buttons w' IM.! _btID b drawSwitchWire :: Color -> Color -> Button -> SPic @@ -51,8 +47,6 @@ makeSwitchSPic dswitch effOn effOff = defaultButton , _btText = "SWITCH/" , _btState = BtOff } - where - bpos b w = _btPos $ _buttons w IM.! _btID b makeSwitch :: Color diff --git a/src/Dodge/Placement/Instance/Button.hs b/src/Dodge/Placement/Instance/Button.hs index 127474e6c..b4463d52f 100644 --- a/src/Dodge/Placement/Instance/Button.hs +++ b/src/Dodge/Placement/Instance/Button.hs @@ -4,11 +4,9 @@ import Dodge.LightSource import Color import Geometry import Dodge.LevelGen.Data ---import Dodge.Default import Dodge.LevelGen.Switch import Dodge.Placement.Instance.LightSource import Dodge.PlacementSpot -import ShapePicture import Data.Maybe import Control.Lens @@ -30,7 +28,6 @@ triggerSwitchSPicLight sdraw ps = psPtCont ps (PutTrigger False) where thels = lsColPosRad (V3 0.5 0 0) (V3 0 0 78) 75 trigid tp = fromJust $ _plMID tp - eff lsid tid b c = (triggers . ix tid .~ b) oneff lsid tid = WorldEffects [SetLSCol (V3 0 0.5 0) lsid, SetTrigger True tid] offeff lsid tid = WorldEffects [SetLSCol (V3 0.5 0 0) lsid, SetTrigger False tid] diff --git a/src/Dodge/WorldEffect.hs b/src/Dodge/WorldEffect.hs index a6739bedb..6a20e2821 100644 --- a/src/Dodge/WorldEffect.hs +++ b/src/Dodge/WorldEffect.hs @@ -10,3 +10,4 @@ doWorldEffect we = case we of SetTrigger bool tid -> triggers . ix tid .~ bool SetLSCol col lsid -> lightSources . ix lsid . lsParam . lsCol .~ col AccessTerminal mtmid -> accessTerminal mtmid + WorldEffects wes -> \w -> foldr doWorldEffect w wes