Continue mouse refactor, add explicit release event/timer

This commit is contained in:
2024-11-19 12:00:31 +00:00
parent 5b709cd7ba
commit e31f6dfd4b
10 changed files with 97 additions and 75 deletions
+8 -8
View File
@@ -24,16 +24,16 @@ data HUDElement
}
| DisplayCarte
data MouseInventorySelection
= MouseInvSelect
{_misSelStart :: (Int, Int), _misMaybeEnd :: Maybe (Int, Int)}
| MouseInvDrag
| MouseInvNothing
--data MouseInventorySelection
-- = MouseInvSelect
-- {_misSelStart :: (Int, Int), _misMaybeEnd :: Maybe (Int, Int)}
-- | MouseInvDrag
-- | MouseInvNothing
data SubInventory
= NoSubInventory
{ _nsSelected :: MouseInventorySelection
}
-- { _nsSelected :: MouseInventorySelection
-- }
| ExamineInventory
| CombineInventory
{ _ciSections :: IntMap (SelectionSection CombinableItem)
@@ -54,4 +54,4 @@ data HUD = HUD
makeLenses ''HUD
makeLenses ''HUDElement
makeLenses ''SubInventory
makeLenses ''MouseInventorySelection
--makeLenses ''MouseInventorySelection
+2 -1
View File
@@ -23,7 +23,7 @@ data MouseContext
| MouseMenuClick {_mcoMenuClick :: Int}
| MouseMenuCursor
| OverInvDrag
| OverInvDragSelect { _mcoSelStart :: (Int,Int), _mcoSelEnd :: (Int,Int) }
| OverInvDragSelect { _mcoSelStart :: (Int,Int), _mcoSelEnd :: Maybe (Int,Int) }
| OverInvSelect { _mcoInvSelect :: (Int,Int)}
| OverInvFilt { _mcoInvFilt :: (Int,Int)}
| OverCombSelect { _mcoCombSelect :: (Int,Int)}
@@ -40,6 +40,7 @@ data Input = Input
, _mouseMoving :: Bool
, _pressedKeys :: M.Map Scancode PressType
, _mouseButtons :: M.Map MouseButton Int -- counts number of frames held down
, _mouseButtonsReleased :: M.Map MouseButton Int -- counts number of frames released
, _scrollAmount :: Int
, _smoothScrollAmount :: Int
, _clickPos :: M.Map MouseButton Point2 -- updates on initial mouse button press