Simplify button drawing
This commit is contained in:
+13
-19
@@ -13,11 +13,11 @@ import Dodge.Data.WorldEffect
|
||||
import Geometry.Data
|
||||
import Sound.Data
|
||||
|
||||
data ButtonDraw
|
||||
= DefaultDrawButton Color
|
||||
| DefaultDrawSwitch Color Color
|
||||
| DrawNoButton
|
||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
--data ButtonDraw
|
||||
-- = DefaultDrawButton Color
|
||||
-- | DefaultDrawSwitch Color Color
|
||||
-- | DrawNoButton
|
||||
-- --deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data ButtonEvent
|
||||
= ButtonDoNothing
|
||||
@@ -26,28 +26,22 @@ data ButtonEvent
|
||||
, _bpEvent :: ButtonEvent
|
||||
, _bpSound :: SoundID
|
||||
, _bpEff :: WdWd
|
||||
, _bpColor :: Color
|
||||
}
|
||||
| -- | ButtonSwitch
|
||||
-- {_bonState :: ButtonState
|
||||
-- ,_bonEvent :: ButtonEvent
|
||||
-- ,_bonSound :: SoundID
|
||||
-- ,_bonEff :: WorldEffect
|
||||
-- ,_boffState :: ButtonState
|
||||
-- ,_boffEvent :: ButtonEvent
|
||||
-- ,_boffSound :: SoundID
|
||||
-- ,_boffEff :: WorldEffect
|
||||
-- }
|
||||
ButtonSimpleSwith
|
||||
| ButtonSimpleSwith
|
||||
{ _bonEff :: WdWd
|
||||
, _boffEff :: WdWd
|
||||
, _bssColor1 :: Color
|
||||
, _bssColor2 :: Color
|
||||
}
|
||||
| ButtonAccessTerminal
|
||||
--deriving (Eq, Show, Read) --, Generic)
|
||||
--h--deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data Button = Button
|
||||
{ _btPict :: ButtonDraw --Button -> SPic
|
||||
, _btPos :: Point2
|
||||
{
|
||||
-- _btPict :: ButtonDraw --Button -> SPic
|
||||
_btPos :: Point2
|
||||
, _btRot :: Float
|
||||
, _btEvent :: ButtonEvent --Button -> World -> World
|
||||
, _btID :: Int
|
||||
@@ -65,7 +59,7 @@ data ButtonState = BtOn | BtOff | BtInactive
|
||||
|
||||
makeLenses ''Button
|
||||
makeLenses ''ButtonEvent
|
||||
deriveJSON defaultOptions ''ButtonDraw
|
||||
--deriveJSON defaultOptions ''ButtonDraw
|
||||
deriveJSON defaultOptions ''ButtonState
|
||||
deriveJSON defaultOptions ''ButtonEvent
|
||||
deriveJSON defaultOptions ''Button
|
||||
|
||||
Reference in New Issue
Block a user