Make buttons without labels inactive
This commit is contained in:
@@ -4,6 +4,7 @@ import Dodge.Data
|
||||
import Dodge.Base
|
||||
import Dodge.CreatureActions
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.Inventory
|
||||
|
||||
import Geometry
|
||||
|
||||
@@ -170,15 +171,6 @@ mouseActionsWorld keys w
|
||||
---theItem = _crInv (you w) IM.! _crInvSel (you w)
|
||||
rotation = angleBetween (_mousePos w) (_lbClickMousePos w)
|
||||
|
||||
-- for now, left are floor items, right are buttons
|
||||
closestActiveObject :: World -> Maybe (Either FloorItem Button)
|
||||
closestActiveObject w = listToMaybe $ sortBy (compare `on` dist ypos . pos) $ actObjs
|
||||
where ypos = _crPos $ you w
|
||||
actObjs = filter (\obj -> dist ypos (pos obj) < 40 && hasLOS ypos (pos obj) w)
|
||||
$ map Left (IM.elems $ _floorItems w) ++ map Right (IM.elems $ _buttons w)
|
||||
pos (Right x) = _btPos x
|
||||
pos (Left x) = _flItPos x
|
||||
|
||||
spaceAction :: World -> World
|
||||
spaceAction w = case closestActiveObject w of
|
||||
Just (Left flit) -> pickUpItem' flit w
|
||||
|
||||
Reference in New Issue
Block a user