Make item display universal

This commit is contained in:
2022-06-19 12:56:30 +01:00
parent df1f3ad6b0
commit 541a04f1bc
22 changed files with 349 additions and 358 deletions
+4 -3
View File
@@ -3,6 +3,7 @@ module Dodge.Render.HUD
( hudDrawings
) where
import Dodge.Data
import Dodge.Item.Display
import Dodge.Combine
import Dodge.Clock
import Dodge.Base
@@ -281,7 +282,7 @@ invDimColor :: Color
invDimColor = greyN 0.7
closeObjectToTextPictures :: Int -> Either FloorItem Button -> [Picture]
closeObjectToTextPictures nfreeslots e = case e of
Left flit -> let it = _flIt flit in map (applycolor it . textindent) $ _itInvDisplay it it
Left flit -> let it = _flIt flit in map (applycolor it . textindent) $ itemDisplay it
Right bt -> [color yellow $ textindent $ _btText bt]
where
textindent = text . (replicate clObjIntIn ' '++)
@@ -369,9 +370,9 @@ mainListCursor c = openCursorAt 120 c 5 0
itemText :: Item -> [Picture]
{-# INLINE itemText #-}
itemText it = f $ case _itCurseStatus it of
UndroppableIdentified -> map (color yellow . text) (_itInvDisplay it it)
UndroppableIdentified -> map (color yellow . text) (itemDisplay it)
-- <> color (withAlpha 0.9 thecolor) (polygon (rectNSEW 110 (-65) 885 (-90)))
_ -> map (color thecolor . text) (_itInvDisplay it it)
_ -> map (color thecolor . text) (itemDisplay it)
where
thecolor = _itInvColor it
f = take (itSlotsTaken it) . (++ replicate 10 (color (_itInvColor it) $ text "*"))