This commit is contained in:
2024-11-18 11:02:12 +00:00
parent 3c5e5b92b1
commit 69fe28afe7
3 changed files with 12 additions and 84 deletions
-51
View File
@@ -60,9 +60,7 @@ updateUseInputInGame u = updateFunctionKeys $ case u ^. uvWorld . hud . hudEleme
& uvWorld %~ setInvPosFromSS
_ -> M.foldlWithKey' updateKeyInGame u pkeys
where
-- w = u ^. uvWorld
pkeys = u ^. uvWorld . input . pressedKeys
-- lbinitialpress = u ^? uvWorld . input . mouseButtons . ix ButtonLeft == Just 0
dodisplayregexinput x di = fromMaybe di $ do
sss <- di ^? diSections
msel <- di ^? diSelection
@@ -152,55 +150,6 @@ updateFunctionKey uv sc InitialPress = case sc of
_ -> uv
updateFunctionKey uv _ _ = uv
updateCombineInvClick ::
IM.IntMap (SelectionSection CombinableItem) ->
World ->
World
updateCombineInvClick sss w = case w ^. input . mouseContext of
OverCombSelect x ->
w & hud . hudElement . subInventory . ciSelection ?~ x
& worldEventFlags . at CombineInventoryChange ?~ ()
OverCombFilter ->
w & hud . hudElement . subInventory . ciFilter .~ Nothing
& worldEventFlags . at CombineInventoryChange ?~ ()
OverCombCombine (i, j) ->
(worldEventFlags . at InventoryChange ?~ ()) . maybeExitCombine $
tryCombine (i, j) w
& worldEventFlags . at CombineInventoryChange ?~ ()
OverCombEscape ->
w
& worldEventFlags . at InventoryChange ?~ ()
& hud . hudElement . subInventory .~ NoSubInventory MouseInvNothing
OverInvFilt (i, j) -> fromMaybe w $ do
guard $ i == 0
str <-
fmap (take 5) $
w
^? hud . hudElement . diSections . ix i . ssItems . ix j . siPictures . ix 0
return . (worldEventFlags . at CombineInventoryChange ?~ ()) $
case w ^? hud . hudElement . subInventory . ciFilter . _Just of
Just (_ : xs)
| str == xs ->
w
& hud . hudElement . subInventory . ciFilter .~ Nothing
_ -> w & hud . hudElement . subInventory . ciFilter ?~ ("<" ++ str)
x ->
error $
"while combining this mouse context should not be possible: "
++ show x
-- x@(Just (i,_))
-- | x /= msel -> w & hud . hudElement . subInventory . ciSelection .~ x
-- & worldEventFlags . at CombineInventoryChange ?~ ()
-- | i == -1 -> w & hud . hudElement . subInventory . ciFilter .~ Nothing
-- & worldEventFlags . at CombineInventoryChange ?~ ()
-- _ | (w ^? hud . hudElement . subInventory . ciSelection . _Just . _1) == Just (-1)
-- -> w & hud . hudElement . subInventory . ciFilter .~ Nothing
-- & worldEventFlags . at CombineInventoryChange ?~ ()
-- _ -> (worldEventFlags . at InventoryChange ?~ ()) . maybeExitCombine $
-- tryCombine sss msel w
-- & worldEventFlags . at CombineInventoryChange ?~ ()
updatePressedButtonsCarte :: World -> World
updatePressedButtonsCarte w = updatePressedButtonsCarte' (_mouseButtons (_input w)) w