Refactor close objects hud display

This commit is contained in:
2024-11-24 16:12:35 +00:00
parent e6c2b659fd
commit 81fcfea1be
11 changed files with 205 additions and 220 deletions
+9 -9
View File
@@ -1,9 +1,9 @@
{-# LANGUAGE LambdaCase #-}
--{-# LANGUAGE LambdaCase #-}
module Dodge.Inventory.SelectionList (
invSelectionItem,
invSelectionItem',
closeObjectToSelectionItem,
closeItemToSelectionItem,
) where
import Dodge.Data.ComposedItem
@@ -51,8 +51,8 @@ hotkeyToString x = case x of
Hotkey9 -> "[9]"
Hotkey0 -> "[0]"
closeObjectToSelectionItem :: Either FloorItem Button -> SelectionItem ()
closeObjectToSelectionItem e =
closeItemToSelectionItem :: FloorItem -> SelectionItem ()
closeItemToSelectionItem e =
SelectionItem
{ _siPictures = pics
, _siHeight = length pics
@@ -63,11 +63,11 @@ closeObjectToSelectionItem e =
, _siPayload = ()
}
where
(pics, col) = closeObjectToTextPictures e
(pics, col) = closeItemToTextPictures e
closeObjectToTextPictures :: Either FloorItem Button -> ([String], Color)
closeObjectToTextPictures = \case
Left flit ->
closeItemToTextPictures :: FloorItem -> ([String], Color)
closeItemToTextPictures flit =
let it = _flIt flit
in (basicItemDisplay it, itemInvColor . pciToCI $ basePCI it)
Right bt -> ([_btText bt], yellow)
-- Right bt -> ([_btText bt], yellow)