Make examine inventory controlled by item, perhaps still buggy

This commit is contained in:
2025-01-01 21:14:38 +00:00
parent 86aba6d115
commit 5b978d9f1c
25 changed files with 523 additions and 502 deletions
+1 -12
View File
@@ -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