Cleanup
This commit is contained in:
+7
-7
@@ -150,7 +150,7 @@ wheelEvent y w = case _hudElement $ _hud w of
|
||||
| otherwise -> w & moveTweakSel yi
|
||||
DisplayInventory (CombineInventory _) -> w
|
||||
& hud . hudElement . subInventory . combineInvSel . _Just %~ ((`mod` numcombs) . subtract yi)
|
||||
DisplayInventory (DisplayTerminal tp _)
|
||||
DisplayInventory DisplayTerminal{}
|
||||
| rbDown -> w
|
||||
& hud . hudElement . subInventory . termParams %~ updatetermsubsel
|
||||
| otherwise -> w
|
||||
@@ -160,20 +160,20 @@ wheelEvent y w = case _hudElement $ _hud w of
|
||||
updatetermsel tp = case _termSel tp of
|
||||
Nothing -> tp & termSel ?~ (0,0)
|
||||
& termInput . _Just %~ replacewith tp 0
|
||||
Just (i,_) -> let newi = ((`mod` length (_termCommands tp)) . subtract yi) i
|
||||
Just (i,_) -> let newi = ((`mod` length (_termScrollCommands tp)) . subtract yi) i
|
||||
in tp & termSel . _Just .~ (newi,0)
|
||||
& termInput . _Just %~ replacewith tp newi
|
||||
updatetermsubsel tp = case _termSel tp of
|
||||
Nothing -> tp
|
||||
Just (i,j) -> let newj = (j - yi) `mod` (1 + length (_tcArguments (_termCommands tp !! i) w))
|
||||
Just (i,j) -> let newj = (j - yi) `mod` (1 + length (_tcArguments (_termScrollCommands tp !! i) w))
|
||||
in tp & termSel . _Just .~ (i,newj)
|
||||
& termInput . _Just %~ replacewith' tp i newj w
|
||||
replacewith tp newi _ = T.pack (_tcString (_termCommands tp !! newi))
|
||||
replacewith' tp i j w _ = T.pack $ _tcString tc ++ " " ++ arg-- ++ ((_tcArguments tp) w !! j)
|
||||
replacewith tp newi _ = T.pack (_tcString (_termScrollCommands tp !! newi))
|
||||
replacewith' tp i j w' _ = T.pack $ _tcString tc ++ " " ++ arg-- ++ ((_tcArguments tp) w !! j)
|
||||
where
|
||||
arg :: String
|
||||
arg = (("":(_tcArguments tc w) )!! j)
|
||||
tc = _termCommands tp !! i
|
||||
arg = ("": _tcArguments tc w' )!! j
|
||||
tc = _termScrollCommands tp !! i
|
||||
numcombs = length $ combineItemListYou w
|
||||
yi = round $ signum y
|
||||
numLocs = (fst . IM.findMax $ _seenLocations w) + 1
|
||||
|
||||
Reference in New Issue
Block a user