Partially working change to selected items

This commit is contained in:
2023-02-07 12:07:13 +00:00
parent 5f7d662454
commit c354949ca9
27 changed files with 386 additions and 288 deletions
+2 -1
View File
@@ -105,11 +105,12 @@ moveTweakSel i w = case yourItem w ^? _Just . itTweaks . tweakParams of
changeTweakParam :: Maybe Int -> Int -> World -> World
changeTweakParam mi i w = fromMaybe w $ do
curpos <- you w ^? crInvSel . isel . ispItem
paramid <- mi
params <- yourItem w ^? _Just . itTweaks . tweakParams . ix paramid
let x = (_tweakVal params + i) `mod` _tweakMax params
return $
w & cWorld . lWorld . creatures . ix 0 . crInv . ix (crSel (you w))
w & cWorld . lWorld . creatures . ix 0 . crInv . ix curpos
%~ ( (itTweaks . tweakParams . ix paramid . tweakVal .~ x)
. doTweak (_tweakType params) x
)