Move combine list over to SelectionSections -- more todo
This commit is contained in:
@@ -30,8 +30,8 @@ updateUsingInput w = case w ^. hud . hudElement of
|
||||
pressedMBEffects :: SubInventory -> M.Map MouseButton Bool -> World -> World
|
||||
pressedMBEffects subinv pkeys w = case subinv of
|
||||
NoSubInventory -> pressedMBEffectsNoInventory pkeys w
|
||||
CombineInventory SelectionIntMap{_smSelPos = mi}
|
||||
| lbinitialpress -> maybeexitcombine (maybe id doCombine mi w)
|
||||
CombineInventory _ _ sss
|
||||
| lbinitialpress -> tryCombine sss w -- maybeexitcombine (maybe id doCombine mi w)
|
||||
DisplayTerminal tmid
|
||||
| lbinitialpress && inTermFocus w ->
|
||||
doTerminalEffectLB (w ^?! cWorld . lWorld . terminals . ix tmid) w
|
||||
@@ -40,11 +40,14 @@ pressedMBEffects subinv pkeys w = case subinv of
|
||||
_ -> w
|
||||
where
|
||||
lbinitialpress = pkeys ^? ix ButtonLeft == Just False
|
||||
maybeexitcombine w'
|
||||
| ButtonRight `M.member` _mouseButtons (_input w) =
|
||||
(hud . hudElement . subInventory . subInvMap %~ setShownIntMap) $
|
||||
(hud . hudElement . subInventory . subInvMap . smItems .~ combineList w') w'
|
||||
| otherwise = w' & hud . hudElement . subInventory .~ NoSubInventory
|
||||
-- maybeexitcombine w'
|
||||
-- | ButtonRight `M.member` _mouseButtons (_input w) =
|
||||
-- (hud . hudElement . subInventory . subInvMap %~ setShownIntMap) $
|
||||
-- (hud . hudElement . subInventory . subInvMap . smItems .~ combineList w') w'
|
||||
-- | otherwise = w' & hud . hudElement . subInventory .~ NoSubInventory
|
||||
|
||||
tryCombine :: SelectionSections CombinableItem -> World -> World
|
||||
tryCombine sss w = w
|
||||
|
||||
pressedMBEffectsNoInventory :: M.Map MouseButton Bool -> World -> World
|
||||
pressedMBEffectsNoInventory pkeys w
|
||||
@@ -64,9 +67,10 @@ pressedMBEffectsNoInventory pkeys w
|
||||
-- note "sort" on the inventory indices; otherwise
|
||||
-- lower items may be shifted up and items below these removed instead
|
||||
doCombine :: Int -> World -> World
|
||||
doCombine i w = case w ^? hud . hudElement . subInventory . subInvMap . smShownItems . ix i . siPayload of
|
||||
Nothing -> w
|
||||
Just (CombinableItem is it _) -> createAndSelectItem it $ foldr (rmInvItem 0) w (sort is)
|
||||
doCombine i w = undefined
|
||||
-- case w ^? hud . hudElement . subInventory . subInvMap . smShownItems . ix i . siPayload of
|
||||
-- Nothing -> w
|
||||
-- Just (CombinableItem is it _) -> createAndSelectItem it $ foldr (rmInvItem 0) w (sort is)
|
||||
|
||||
updatePressedButtonsCarte :: M.Map MouseButton Bool -> World -> World
|
||||
updatePressedButtonsCarte pkeys w
|
||||
|
||||
Reference in New Issue
Block a user