Readd space action on buttons
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
|
||||
module Dodge.Inventory.SelectionList (
|
||||
invSelectionItem,
|
||||
invSelectionItem',
|
||||
closeItemToSelectionItem,
|
||||
closeButtonToSelectionItem,
|
||||
) where
|
||||
|
||||
import NewInt
|
||||
import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.SelectionList
|
||||
import Dodge.Data.World
|
||||
@@ -16,12 +14,10 @@ import Dodge.Item.Display
|
||||
import Dodge.Item.Grammar
|
||||
import Dodge.Item.InventoryColor
|
||||
import LensHelp
|
||||
import NewInt
|
||||
import Padding
|
||||
import Picture.Base
|
||||
|
||||
invSelectionItem' :: Creature -> Int -> ComposedItem -> SelectionItem ()
|
||||
invSelectionItem' = invSelectionItem 0
|
||||
|
||||
invSelectionItem :: Int -> Creature -> Int -> ComposedItem -> SelectionItem ()
|
||||
invSelectionItem indent cr i ci =
|
||||
SelectionItem
|
||||
@@ -57,30 +53,31 @@ closeItemToSelectionItem :: World -> NewInt FloorInt -> Maybe (SelectionItem ())
|
||||
closeItemToSelectionItem w (NInt i) = do
|
||||
e <- w ^? cWorld . lWorld . floorItems . unNIntMap . ix i
|
||||
let (pics, col) = closeItemToTextPictures e
|
||||
return SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
, _siColor = col
|
||||
, _siOffX = 0
|
||||
, _siPayload = ()
|
||||
}
|
||||
return
|
||||
SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
, _siColor = col
|
||||
, _siOffX = 0
|
||||
, _siPayload = ()
|
||||
}
|
||||
|
||||
closeButtonToSelectionItem :: World -> Int -> Maybe (SelectionItem ())
|
||||
closeButtonToSelectionItem w i = do
|
||||
bt <- w ^? cWorld . lWorld . buttons . ix i
|
||||
return SelectionItem
|
||||
{ _siPictures = [_btText bt]
|
||||
, _siHeight = 1
|
||||
, _siIsSelectable = True
|
||||
, _siColor = yellow
|
||||
, _siOffX = 0
|
||||
, _siPayload = ()
|
||||
}
|
||||
return
|
||||
SelectionItem
|
||||
{ _siPictures = [_btText bt]
|
||||
, _siHeight = 1
|
||||
, _siIsSelectable = True
|
||||
, _siColor = yellow
|
||||
, _siOffX = 0
|
||||
, _siPayload = ()
|
||||
}
|
||||
|
||||
closeItemToTextPictures :: FloorItem -> ([String], Color)
|
||||
closeItemToTextPictures flit =
|
||||
let it = _flIt flit
|
||||
in (basicItemDisplay it, itemInvColor . pciToCI $ basePCI it)
|
||||
|
||||
|
||||
closeItemToTextPictures flit =
|
||||
(basicItemDisplay it, itemInvColor . pciToCI $ basePCI it)
|
||||
where
|
||||
it = _flIt flit
|
||||
|
||||
Reference in New Issue
Block a user