Move button data
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Button where
|
||||
import Dodge.Data.WorldEffect
|
||||
import Control.Lens
|
||||
import Geometry.Data
|
||||
import Sound.Data
|
||||
import Color
|
||||
|
||||
data ButtonDraw = DefaultDrawButton Color
|
||||
| DefaultDrawSwitch Color Color
|
||||
| DrawNoButton
|
||||
data ButtonEvent = ButtonDoNothing
|
||||
| ButtonPress
|
||||
{_bpState :: ButtonState
|
||||
,_bpEvent :: ButtonEvent
|
||||
,_bpSound :: SoundID
|
||||
,_bpEff :: WorldEffect
|
||||
}
|
||||
-- | ButtonSwitch
|
||||
-- {_bonState :: ButtonState
|
||||
-- ,_bonEvent :: ButtonEvent
|
||||
-- ,_bonSound :: SoundID
|
||||
-- ,_bonEff :: WorldEffect
|
||||
-- ,_boffState :: ButtonState
|
||||
-- ,_boffEvent :: ButtonEvent
|
||||
-- ,_boffSound :: SoundID
|
||||
-- ,_boffEff :: WorldEffect
|
||||
-- }
|
||||
| ButtonSimpleSwith
|
||||
{_bonEff :: WorldEffect
|
||||
,_boffEff :: WorldEffect
|
||||
}
|
||||
| ButtonAccessTerminal
|
||||
|
||||
data Button = Button
|
||||
{ _btPict :: ButtonDraw --Button -> SPic
|
||||
, _btPos :: Point2
|
||||
, _btRot :: Float
|
||||
, _btEvent :: ButtonEvent --Button -> World -> World
|
||||
, _btID :: Int
|
||||
, _btText :: String
|
||||
, _btState :: ButtonState
|
||||
, _btTermMID :: Maybe Int
|
||||
, _btName :: String
|
||||
, _btColor :: Color
|
||||
}
|
||||
data ButtonState = BtOn | BtOff | BtNoLabel
|
||||
deriving (Eq, Show)
|
||||
makeLenses ''Button
|
||||
Reference in New Issue
Block a user