Flatten values in creature manipulation data types

This commit is contained in:
2024-09-24 21:50:21 +01:00
parent fe00af0e73
commit 25cec10313
24 changed files with 69 additions and 86 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
_ -> w
where
rbscrollmax = fromMaybe 1 $ do
invid <- you w ^? crManipulation . manObject . inInventory . imSelectedItem
invid <- you w ^? crManipulation . manObject . imSelectedItem
esite <- you w ^? crInv . ix invid . itUse . equipEffect . eeSite
return $ length $ equipSiteToPositions esite
y = fromIntegral yi
@@ -117,7 +117,7 @@ moveTweakSel i w = case yourSelectedItem w ^? _Just . itTweaks . tweakParams of
changeTweakParam :: Maybe Int -> Int -> World -> World
changeTweakParam mi i w = fromMaybe w $ do
curpos <- you w ^? crManipulation . manObject . inInventory . imSelectedItem
curpos <- you w ^? crManipulation . manObject . imSelectedItem
paramid <- mi
params <- yourSelectedItem w ^? _Just . itTweaks . tweakParams . ix paramid
let x = (_tweakVal params + i) `mod` _tweakMax params