Make examine inventory controlled by item, perhaps still buggy
This commit is contained in:
@@ -440,7 +440,6 @@ updateInitialPressInGame uv sc = case sc of
|
||||
ScancodeM -> toggleMap uv
|
||||
-- ScancodeR -> over (uvWorld . cWorld . lWorld . creatures . ix 0) crReloadToggle uv
|
||||
ScancodeT -> over uvWorld testEvent uv
|
||||
ScancodeX -> uv & uvWorld %~ toggleTweakInv
|
||||
ScancodeC -> toggleCombineInv uv
|
||||
-- the following should be put in a more sensible place
|
||||
ScancodeSlash -> uv & uvWorld %~ updateEnterRegex
|
||||
@@ -470,8 +469,7 @@ doRegexInput inp i sss msel filts
|
||||
)
|
||||
where
|
||||
endregex a b =
|
||||
--( sss & ix i . ssItems .~ mempty
|
||||
( sss -- & ix i . ssItems .~ mempty
|
||||
( sss
|
||||
, msel & ssSetCursor (ssLookupDown a b) sss
|
||||
, Nothing
|
||||
)
|
||||
@@ -596,15 +594,6 @@ toggleMap u = case u ^. uvWorld . hud . hudElement of
|
||||
}
|
||||
_ -> u & uvWorld . hud . hudElement .~ DisplayCarte
|
||||
|
||||
toggleTweakInv :: World -> World
|
||||
toggleTweakInv w = case w ^? hud . hudElement . subInventory of
|
||||
Just ExamineInventory{} ->
|
||||
w
|
||||
& thepointer .~ NoSubInventory --MouseInvNothing
|
||||
_ -> w & thepointer .~ ExamineInventory -- mi
|
||||
where
|
||||
thepointer = hud . hudElement . subInventory
|
||||
|
||||
tryCombine :: (Int, Int) -> World -> World
|
||||
tryCombine (i, j) w = fromMaybe w $ do
|
||||
sss <- w ^? hud . hudElement . subInventory . ciSections
|
||||
|
||||
@@ -27,10 +27,6 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
|
||||
-- functions that modify the inventory should be centralised so that
|
||||
-- this lock can be sensibly applied, perhaps
|
||||
| w ^?! cWorld . lWorld . creatures . ix 0 . crInvLock -> w
|
||||
-- | rbDown -> case (yourScrollAttachment w, _rbOptions w) of
|
||||
-- (_,EquipOptions{}) -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
|
||||
-- (Nothing, _) -> w
|
||||
-- (Just (invid,hs), _) -> doHeldScroll invid hs y w
|
||||
| bdown ButtonRight -> case _rbOptions w of
|
||||
EquipOptions{} -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
|
||||
NoRightButtonOptions -> selectedItemScroll yi w
|
||||
@@ -38,12 +34,9 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
|
||||
| invKeyDown -> changeSwapSel yi w
|
||||
| otherwise -> scrollAugInvSel yi w
|
||||
DisplayInventory{_subInventory = ExamineInventory}
|
||||
| invKeyDown -> scrollAugInvSel yi w
|
||||
| otherwise -> w
|
||||
-- | invKeyDown && rbDown -> w & moveTweakSel yi
|
||||
-- | invKeyDown -> scrollAugInvSel yi w
|
||||
-- | rbDown -> w & changeTweakParam mi yi
|
||||
-- | otherwise -> w & moveTweakSel yi
|
||||
-- | invKeyDown
|
||||
-> scrollAugInvSel yi w
|
||||
-- | otherwise -> w
|
||||
DisplayInventory{_subInventory = CombineInventory{}} -> w & moveCombineSel yi
|
||||
DisplayInventory{_subInventory = DisplayTerminal tmid} -> terminalWheelEvent yi tmid w
|
||||
_ -> w
|
||||
|
||||
Reference in New Issue
Block a user