Make examine inventory controlled by item, perhaps still buggy
This commit is contained in:
@@ -19,8 +19,8 @@ import NewInt
|
||||
import Padding
|
||||
import Picture.Base
|
||||
|
||||
invSelectionItem :: Int -> LWorld -> ComposedItem -> SelectionItem ()
|
||||
invSelectionItem indent lw ci =
|
||||
invSelectionItem :: Int -> World -> ComposedItem -> SelectionItem ()
|
||||
invSelectionItem indent w ci =
|
||||
SelectionItem
|
||||
{ _siPictures = pics & ix 0 %~ (++ anyequippos ++ anyhotkey)
|
||||
, _siHeight = itInvHeight $ ci ^. _1
|
||||
@@ -31,13 +31,14 @@ invSelectionItem indent lw ci =
|
||||
, _siPayload = ()
|
||||
}
|
||||
where
|
||||
lw = w ^. cWorld . lWorld
|
||||
cr = lw ^?! creatures . ix 0
|
||||
itid = ci ^. _1 . itID . unNInt
|
||||
anyhotkey = maybe [] ((' ' :) . hotkeyToString) (lw ^? imHotkeys . unNIntMap . ix itid)
|
||||
anyequippos = maybe [] (rightPad 8 ' ' . (' ' :) . eqPosText)
|
||||
(ci ^? _1 . itLocation . ilEquipSite . _Just)
|
||||
col = itemInvColor ci
|
||||
pics = itemDisplay cr ci
|
||||
pics = itemDisplay w cr ci
|
||||
|
||||
hotkeyToString :: Hotkey -> String
|
||||
hotkeyToString x = case x of
|
||||
|
||||
Reference in New Issue
Block a user