Remove explicit scancode from menu items
This commit is contained in:
+17
-10
@@ -78,16 +78,17 @@ subInvSelectionList = SelectionList
|
||||
|
||||
inventorySelectionList :: World -> [SelectionItem]
|
||||
inventorySelectionList w = map (invSelectionItem cr) (IM.toList inv)
|
||||
++ [SelectionItem displayFreeSlots 1 False white 0]
|
||||
++ [SelectionItem displayFreeSlots 1 False (length thetext) white 0]
|
||||
++ map (closeObjectToSelectionItem nfreeslots) (w ^. cWorld . lWorld . closeObjects)
|
||||
where
|
||||
cr = you w
|
||||
inv = _crInv cr
|
||||
nfreeslots = crNumFreeSlots cr
|
||||
displayFreeSlots = case nfreeslots of
|
||||
0 -> [color invDimColor . text $ " INVENTORY FULL"]
|
||||
1 -> [color invDimColor . text $ " +1 FREE SLOT"]
|
||||
x -> [color invDimColor . text $ " +" ++ show x ++ " FREE SLOTS"]
|
||||
thetext = case nfreeslots of
|
||||
0 -> " INVENTORY FULL"
|
||||
1 -> " +1 FREE SLOT"
|
||||
x -> " +" ++ show x ++ " FREE SLOTS"
|
||||
displayFreeSlots = [color invDimColor $ text thetext]
|
||||
|
||||
inventoryCursorPos :: SubInventory -> World -> Maybe Int
|
||||
inventoryCursorPos subinv w = case subinv of
|
||||
@@ -316,11 +317,14 @@ combineListSelection w = subInvSelectionList & slItems .~ combineListSelectionIt
|
||||
|
||||
combineListSelectionItems :: World -> [SelectionItem]
|
||||
combineListSelectionItems w = case combineListSelectionItems' w of
|
||||
[] -> [SelectionItem [text "NO POSSIBLE COMBINATIONS"] 1 False white 0]
|
||||
[] -> [SelectionItem [text thetext] 1 False (length thetext) white 0]
|
||||
xs -> xs
|
||||
where
|
||||
thetext = "NO POSSIBLE COMBINATIONS"
|
||||
|
||||
|
||||
combineListSelectionItems' :: World -> [SelectionItem]
|
||||
combineListSelectionItems' w = map (picsToSelectable . itemText . snd) $ combineItemListYou w
|
||||
combineListSelectionItems' w = map (picsToSelectable 15 . itemText . snd) $ combineItemListYou w
|
||||
|
||||
ammoTweakSelectionItems :: Maybe Item -> [SelectionItem]
|
||||
ammoTweakSelectionItems = textSelItems . ammoTweakStrings
|
||||
@@ -349,6 +353,7 @@ closeObjectToSelectionItem n e = SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
, _siWidth = 15
|
||||
, _siColor = col
|
||||
, _siOffX = 2
|
||||
}
|
||||
@@ -447,23 +452,25 @@ mapWall cfig thehud wl =
|
||||
mainListCursor :: Color -> Int -> Configuration -> Picture
|
||||
mainListCursor c = openCursorAt 120 c 5 0
|
||||
|
||||
picsToSelectable :: [Picture] -> SelectionItem
|
||||
picsToSelectable pics = SelectionItem
|
||||
picsToSelectable :: Int -> [Picture] -> SelectionItem
|
||||
picsToSelectable wdth pics = SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
, _siWidth = wdth
|
||||
, _siColor = white
|
||||
, _siOffX = 0
|
||||
}
|
||||
|
||||
textSelItems :: [String] -> [SelectionItem]
|
||||
textSelItems = map (picsToSelectable . (:[]) . text)
|
||||
textSelItems = map (picsToSelectable 15 . (:[]) . text)
|
||||
|
||||
invSelectionItem :: Creature -> (Int,Item) -> SelectionItem
|
||||
invSelectionItem cr (i,it) = SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
, _siWidth = 15
|
||||
, _siColor = col
|
||||
, _siOffX = 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user