Partially working change to selected items
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user