Work on more complicated terminals
This commit is contained in:
@@ -92,6 +92,13 @@ handlePressedMouseButton :: MouseButton -> Universe -> Maybe Universe
|
||||
handlePressedMouseButton but w = case (_hudElement (_hud $ _uvWorld w), but) of
|
||||
(DisplayCarte,_) -> Just $ w & uvWorld . clickMousePos .~ _mousePos (_uvWorld w)
|
||||
(_,ButtonMiddle) -> Just $ w & uvWorld . clickMousePos .~ _mousePos (_uvWorld w)
|
||||
( DisplayInventory (DisplayTerminal tp _) , ButtonLeft)
|
||||
-> Just $ fromMaybe w
|
||||
$ do -- ugly
|
||||
i <- _termSel tp
|
||||
f <- _termOptions tp !? i
|
||||
return $ w & uvWorld %~ snd f
|
||||
& uvWorld . hud . hudElement .~ DisplayInventory NoSubInventory
|
||||
( DisplayInventory (CombineInventory mi) , ButtonLeft)
|
||||
-> Just $ fromMaybe (w & uvWorld . hud . hudElement .~ DisplayInventory NoSubInventory)
|
||||
$ do -- ugly
|
||||
@@ -140,6 +147,9 @@ 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 _) -> w
|
||||
& hud . hudElement . subInventory . termParams . termSel . _Just
|
||||
%~ ((`mod` length (_termOptions tp)) . subtract yi)
|
||||
_ -> w
|
||||
where
|
||||
numcombs = length $ combineItemListYou w
|
||||
|
||||
Reference in New Issue
Block a user