Cleanup
This commit is contained in:
+1
-1
@@ -404,7 +404,7 @@ data Button = Button
|
|||||||
, _btID :: Int
|
, _btID :: Int
|
||||||
, _btText :: String
|
, _btText :: String
|
||||||
, _btState :: ButtonState
|
, _btState :: ButtonState
|
||||||
, _btTerminalParams :: World -> TerminalParams
|
-- , _btTerminalParams :: World -> TerminalParams
|
||||||
, _btTerminal :: Maybe Int
|
, _btTerminal :: Maybe Int
|
||||||
, _btName :: String
|
, _btName :: String
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -253,7 +253,6 @@ defaultButton = Button
|
|||||||
, _btID = 0
|
, _btID = 0
|
||||||
, _btText = "Button"
|
, _btText = "Button"
|
||||||
, _btState = BtOff
|
, _btState = BtOff
|
||||||
, _btTerminalParams = const NoTerminalParams
|
|
||||||
, _btTerminal = Nothing
|
, _btTerminal = Nothing
|
||||||
, _btName = ""
|
, _btName = ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ makeButton col eff = defaultButton
|
|||||||
. soundFromGeneral (LeverSound 0) (btpos b) click1S Nothing $ w
|
. soundFromGeneral (LeverSound 0) (btpos b) click1S Nothing $ w
|
||||||
, _btText = "Button"
|
, _btText = "Button"
|
||||||
, _btState = BtOff
|
, _btState = BtOff
|
||||||
, _btTerminalParams = const NoTerminalParams
|
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
turnOn bt = bt {_btState = BtNoLabel, _btEvent = const id}
|
turnOn bt = bt {_btState = BtNoLabel, _btEvent = const id}
|
||||||
@@ -63,7 +62,6 @@ makeSwitchSPic dswitch effOn effOff = defaultButton
|
|||||||
, _btEvent = flipSwitch
|
, _btEvent = flipSwitch
|
||||||
, _btText = "SWITCH/"
|
, _btText = "SWITCH/"
|
||||||
, _btState = BtOff
|
, _btState = BtOff
|
||||||
, _btTerminalParams = const NoTerminalParams
|
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
flipSwitch b w = switchEffect b . soundFromGeneral (LeverSound 0) (bpos b) click1S Nothing $ w
|
flipSwitch b w = switchEffect b . soundFromGeneral (LeverSound 0) (bpos b) click1S Nothing $ w
|
||||||
@@ -95,7 +93,6 @@ makeSwitch col1 col2 effOn effOff = defaultButton
|
|||||||
, _btEvent = flipSwitch
|
, _btEvent = flipSwitch
|
||||||
, _btText = "SWITCH/"
|
, _btText = "SWITCH/"
|
||||||
, _btState = BtOff
|
, _btState = BtOff
|
||||||
, _btTerminalParams = const NoTerminalParams
|
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
flipSwitch b w = switchEffect b . soundFromGeneral (LeverSound 0) (bpos b) click1S Nothing $ w
|
flipSwitch b w = switchEffect b . soundFromGeneral (LeverSound 0) (bpos b) click1S Nothing $ w
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module Dodge.Placement.Instance.Analyser
|
|||||||
--import Dodge.PlacementSpot
|
--import Dodge.PlacementSpot
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Base.You
|
import Dodge.Base.You
|
||||||
import Dodge.Default
|
--import Dodge.Default
|
||||||
import Dodge.Terminal
|
import Dodge.Terminal
|
||||||
--import Dodge.Tree
|
--import Dodge.Tree
|
||||||
--import Dodge.RoomLink
|
--import Dodge.RoomLink
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ putTerminal''
|
|||||||
-> Placement
|
-> Placement
|
||||||
putTerminal'' mc f mcf = ps0PushPSw (PutTerminal theterminal) $ \_ tmpl -> Just $
|
putTerminal'' mc f mcf = ps0PushPSw (PutTerminal theterminal) $ \_ tmpl -> Just $
|
||||||
ps0PushPS (PutButton $ termButton & btTerminal .~ _plMID tmpl)
|
ps0PushPS (PutButton $ termButton & btTerminal .~ _plMID tmpl)
|
||||||
$ \pl -> Just $ pt0 (PutMachine (reverse $ square 10)
|
$ \pl -> Just $ pt0 (PutMachine (reverse $ square 10)
|
||||||
(mc & mcUpdate .~ machineAddSound fridgeHumS (mcf (fromJust $ _plMID pl))
|
(mc & mcUpdate .~ machineAddSound fridgeHumS (mcf (fromJust $ _plMID pl))
|
||||||
& mcDeath %~ (\fd mc' -> (buttons . at (fromJust (_plMID pl)) .~ Nothing) . fd mc')
|
& mcDeath %~ (\fd mc' -> (buttons . at (fromJust (_plMID pl)) .~ Nothing) . fd mc')
|
||||||
)
|
)
|
||||||
@@ -51,18 +51,25 @@ putTerminal' col = putTerminal'' (defaultMachine & mcColor .~ col)
|
|||||||
}
|
}
|
||||||
|
|
||||||
putTerminal :: Color -> (World -> TerminalParams) -> Placement
|
putTerminal :: Color -> (World -> TerminalParams) -> Placement
|
||||||
putTerminal col f = ps0PushPSw (PutTerminal theterminal) $ \_ tmpl -> Just $
|
putTerminal col f = putTerminal'' (mc & mcColor .~ col) f (\_ -> basicMachineUpdate $ const id)
|
||||||
ps0PushPS (PutButton $ termButton & btTerminal .~ _plMID tmpl)
|
|
||||||
$ \pl -> Just $ pt0 (PutMachine (reverse $ square 10) (defaultMachine & mcColor .~ col)
|
|
||||||
{ _mcDraw = noPic . terminalShape
|
|
||||||
, _mcHP = 100
|
|
||||||
, _mcUpdate = basicMachineUpdate $ machineAddSound fridgeHumS (const id)
|
|
||||||
, _mcDeath = \mc -> (buttons . at (fromJust (_plMID pl)) .~ Nothing)
|
|
||||||
. makeExplosionAt (_mcPos mc)
|
|
||||||
})
|
|
||||||
$ const Nothing
|
|
||||||
where
|
where
|
||||||
theterminal = defaultTerminal & tmProgram .~ const f
|
mc = defaultMachine
|
||||||
|
{ _mcDraw = noPic . terminalShape
|
||||||
|
, _mcHP = 100
|
||||||
|
, _mcDeath = makeExplosionAt . _mcPos
|
||||||
|
}
|
||||||
|
-- ps0PushPSw (PutTerminal theterminal) $ \_ tmpl -> Just $
|
||||||
|
-- ps0PushPS (PutButton $ termButton & btTerminal .~ _plMID tmpl)
|
||||||
|
-- $ \pl -> Just $ pt0 (PutMachine (reverse $ square 10) (defaultMachine & mcColor .~ col)
|
||||||
|
-- { _mcDraw = noPic . terminalShape
|
||||||
|
-- , _mcHP = 100
|
||||||
|
-- , _mcUpdate = basicMachineUpdate $ machineAddSound fridgeHumS (const id)
|
||||||
|
-- , _mcDeath = \mc -> (buttons . at (fromJust (_plMID pl)) .~ Nothing)
|
||||||
|
-- . makeExplosionAt (_mcPos mc)
|
||||||
|
-- })
|
||||||
|
-- $ const Nothing
|
||||||
|
-- where
|
||||||
|
-- theterminal = defaultTerminal & tmProgram .~ const f
|
||||||
|
|
||||||
termButton :: Button
|
termButton :: Button
|
||||||
termButton = Button
|
termButton = Button
|
||||||
@@ -73,7 +80,6 @@ termButton = Button
|
|||||||
, _btID = 0
|
, _btID = 0
|
||||||
, _btText = "TERMINAL"
|
, _btText = "TERMINAL"
|
||||||
, _btState = BtOff
|
, _btState = BtOff
|
||||||
, _btTerminalParams = const $ TerminalParams [] [] 10 "TERMINAL" Nothing Nothing [] []
|
|
||||||
, _btTerminal = Nothing
|
, _btTerminal = Nothing
|
||||||
, _btName = ""
|
, _btName = ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ addWarningTerminal outplid = (rmName .++~ "warningTerm-")
|
|||||||
(atFstLnkOutShiftBy (\(p,a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
|
(atFstLnkOutShiftBy (\(p,a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
|
||||||
(Just . set plSpot (rprShift moveToSideFirstOutLink) . putTerminal terminalColor . termMessages)
|
(Just . set plSpot (rprShift moveToSideFirstOutLink) . putTerminal terminalColor . termMessages)
|
||||||
termMessages trid _ = defaultTermParams & addInputLine
|
termMessages trid _ = defaultTermParams & addInputLine
|
||||||
[unlockCommand trid,quitCommand]
|
[unlockCommand trid,quitCommand]
|
||||||
[helpCommand,infoCommand theinfo,commandsCommand]
|
[helpCommand,infoCommand theinfo,commandsCommand]
|
||||||
unlockCommand trid = singleCommand "OPEN" ["YES","Y"] "OPEN THE CONNECTED DOOR." (toggledoor trid)
|
unlockCommand trid = singleCommand "OPEN" ["YES","Y"] "OPEN THE CONNECTED DOOR." (toggledoor trid)
|
||||||
toggledoor trid w' = w' & triggers . ix (fromJust $ _plMID trid) .~ const True
|
toggledoor trid w' = w' & triggers . ix (fromJust $ _plMID trid) .~ const True
|
||||||
theinfo = "DOOR CONTROLABLE WITH THE \"OPEN\" COMMAND. THIS TERMINAL CANNOT CLOSE THE DOOR."
|
theinfo = "DOOR CONTROLABLE WITH THE \"OPEN\" COMMAND. THIS TERMINAL CANNOT CLOSE THE DOOR."
|
||||||
|
|||||||
Reference in New Issue
Block a user