Add looping sound, add sound to terminals

This commit is contained in:
2022-03-16 09:23:17 +00:00
parent 5623747b01
commit 5aeb04ba05
24 changed files with 156 additions and 133 deletions
+5 -7
View File
@@ -88,17 +88,15 @@ handleResizeEvent sev u = return . Just $ u
divRes = resFactorNum $ u ^. config . resolution_factor
handlePressedMouseButton :: MouseButton -> Universe -> Maybe Universe
handlePressedMouseButton but w
| but == ButtonMiddle || _hudElement (_hud $ _uvWorld w) == DisplayCarte
= Just $ w & uvWorld . clickMousePos .~ _mousePos (_uvWorld w)
| but == ButtonLeft = case _hudElement (_hud $ _uvWorld w) of
DisplayInventory (CombineInventory mi)
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 (CombineInventory mi) , ButtonLeft)
-> Just $ fromMaybe (w & uvWorld . hud . hudElement .~ DisplayInventory NoSubInventory)
$ do -- ugly
i <- mi
return $ over uvWorld (doCombine i) w
_ -> Just w
| otherwise = Just w
_ -> Just w
-- note "sort" on the inventory indices; otherwise
-- lower items may be shifted up and items below these removed instead