Distinguish between selected item and root-selected item
This commit is contained in:
@@ -46,7 +46,7 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
|
||||
_ -> w
|
||||
where
|
||||
rbscrollmax = fromMaybe 1 $ do
|
||||
invid <- you w ^? crManipulation . manObject . inInventory . ispItem
|
||||
invid <- you w ^? crManipulation . manObject . inInventory . imSelectedItem
|
||||
esite <- you w ^? crInv . ix invid . itUse . equipEffect . eeSite
|
||||
return $ length $ equipSiteToPositions esite
|
||||
y = fromIntegral yi
|
||||
@@ -111,15 +111,15 @@ scrollRBOption dy ymax
|
||||
| otherwise = id
|
||||
|
||||
moveTweakSel :: Int -> World -> World
|
||||
moveTweakSel i w = case yourItem w ^? _Just . itTweaks . tweakParams of
|
||||
moveTweakSel i w = case yourSelectedItem w ^? _Just . itTweaks . tweakParams of
|
||||
Just l -> moveSubSel i (length l) w
|
||||
_ -> w
|
||||
|
||||
changeTweakParam :: Maybe Int -> Int -> World -> World
|
||||
changeTweakParam mi i w = fromMaybe w $ do
|
||||
curpos <- you w ^? crManipulation . manObject . inInventory . ispItem
|
||||
curpos <- you w ^? crManipulation . manObject . inInventory . imSelectedItem
|
||||
paramid <- mi
|
||||
params <- yourItem w ^? _Just . itTweaks . tweakParams . ix paramid
|
||||
params <- yourSelectedItem w ^? _Just . itTweaks . tweakParams . ix paramid
|
||||
let x = (_tweakVal params + i) `mod` _tweakMax params
|
||||
return $
|
||||
w & cWorld . lWorld . creatures . ix 0 . crInv . ix curpos
|
||||
|
||||
Reference in New Issue
Block a user