Continue reload refactor

This commit is contained in:
2022-06-21 14:07:17 +01:00
parent 14a7189b44
commit 53c8be0679
33 changed files with 106 additions and 115 deletions
+4 -4
View File
@@ -119,7 +119,7 @@ doCombine i w = case combineItemListYou w !? i of
$ foldr (rmInvItem yid) w (sort is)
where
yid = _yourID w
selectinv (Just i', w') = w' & creatures . ix yid . crInvSel .~ i'
selectinv (Just i', w') = w' & creatures . ix yid . crInvSel .~ InvSel i' NoInvSelAction
selectinv (Nothing, w') = w'
@@ -141,7 +141,7 @@ wheelEvent y w = case _hudElement $ _hud w of
| rbDown -> case (yourItem w ^? _Just . itUse . heldScroll,_rbOptions w) of
(_,EquipOptions{}) -> scrollRBOption y w
(Nothing,_) -> closeObjScrollDir y w
(Just f,_) -> w & creatures . ix 0 . crInv . ix (_crInvSel $ you w) %~ f y (you w)
(Just f,_) -> w & creatures . ix 0 . crInv . ix (crSel $ you w) %~ f y (you w)
| lbDown -> w & cameraZoom +~ y
| invKeyDown -> stopSoundFrom (CrReloadSound 0) $ changeSwapInvSel yi w
| otherwise -> stopSoundFrom (CrReloadSound 0) $ changeAugInvSel yi w
@@ -218,12 +218,12 @@ scrollRBOption y w
moveTweakSel :: Int -> World -> World
moveTweakSel i w = case yourItem w ^? _Just . itTweaks . tweakParams of
Just l -> w & creatures . ix (_yourID w) . crInv . ix (_crInvSel (you w))
Just l -> w & creatures . ix (_yourID w) . crInv . ix (crSel (you w))
. itTweaks . tweakSel %~ (`mod` length l) . subtract i
_ -> w
changeTweakParam :: Int -> World -> World
changeTweakParam i w = w
& creatures . ix (_yourID w) . crInv . ix (_crInvSel (you w)) %~
& creatures . ix (_yourID w) . crInv . ix (crSel (you w)) %~
( (itTweaks . tweakParams . ix paramid . curTweak .~ x)
. _doTweak params x)
where