This commit is contained in:
2022-06-06 00:36:18 +01:00
parent b0173c3778
commit 384a16851b
6 changed files with 23 additions and 21 deletions
+1 -1
View File
@@ -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
} }
-1
View File
@@ -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 = ""
} }
-3
View File
@@ -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
+1 -1
View File
@@ -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
+17 -11
View File
@@ -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) where
$ \pl -> Just $ pt0 (PutMachine (reverse $ square 10) (defaultMachine & mcColor .~ col) mc = defaultMachine
{ _mcDraw = noPic . terminalShape { _mcDraw = noPic . terminalShape
, _mcHP = 100 , _mcHP = 100
, _mcUpdate = basicMachineUpdate $ machineAddSound fridgeHumS (const id) , _mcDeath = makeExplosionAt . _mcPos
, _mcDeath = \mc -> (buttons . at (fromJust (_plMID pl)) .~ Nothing) }
. makeExplosionAt (_mcPos mc) -- ps0PushPSw (PutTerminal theterminal) $ \_ tmpl -> Just $
}) -- ps0PushPS (PutButton $ termButton & btTerminal .~ _plMID tmpl)
$ const Nothing -- $ \pl -> Just $ pt0 (PutMachine (reverse $ square 10) (defaultMachine & mcColor .~ col)
where -- { _mcDraw = noPic . terminalShape
theterminal = defaultTerminal & tmProgram .~ const f -- , _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 = ""
} }