Move button data

This commit is contained in:
2022-07-21 18:22:08 +01:00
parent aabd8a2cb8
commit b58444f931
16 changed files with 185 additions and 89 deletions
+2 -13
View File
@@ -62,16 +62,6 @@ defaultMachine = Machine
, _mcMounts = mempty
, _mcCloseSound = Nothing
}
defaultDrawButton :: Color -> Button -> SPic
defaultDrawButton col bt =
( translateSHz 15 . colorSH col $ upperPrismPoly 5 buttonGeometry
, mempty
)
where
buttonGeometry
| _btState bt == BtOff = reverse $ rectNSWE 10 (-1) (-width) width
| otherwise = reverse $ rectNSWE 2 (-1) (-width) width
width = 8
defaultTerminal :: Terminal
defaultTerminal = Terminal
{ _tmID = 0
@@ -100,11 +90,10 @@ defaultTerminalInput = TerminalInput
defaultButton :: Button
defaultButton = Button
{ _btPict = defaultDrawButton (dark red)
{ _btPict = DefaultDrawButton (dark red)
, _btPos = V2 0 0
, _btRot = 0
, _btEvent = \b w -> set (buttons . ix (_btID b) . btState) BtNoLabel
. soundStart (LeverSound 0) (_btPos b) click1S Nothing $ w
, _btEvent = ButtonPress BtNoLabel ButtonDoNothing click1S NoWorldEffect
, _btID = 0
, _btText = "Button"
, _btState = BtOff