Cancel terminal display if destroyed while displaying

This commit is contained in:
2025-08-19 18:01:23 +01:00
parent b07280e50c
commit 5ccbfa1f91
10 changed files with 135 additions and 149 deletions
+6 -6
View File
@@ -31,14 +31,14 @@ import Picture.Base
invSelectionItem :: World -> Int -> LocationDT OItem -> SelectionItem ()
invSelectionItem w indent loc =
SelectionItem
SelItem
{ _siPictures = itemDisplay w cr ci
, _siHeight = itInvHeight $ ci ^. _1
, _siWidth = 15
, _siIsSelectable = True
, _siColor = itemInvColor ci
, _siOffX = indent
, _siPayload = ()
, _siPayload = Nothing
}
where
ci = (a,b)
@@ -207,28 +207,28 @@ closeItemToSelectionItem w (NInt i) = do
e <- w ^? cWorld . lWorld . floorItems . unNIntMap . ix i
let (pics, col) = closeItemToTextPictures e
return
SelectionItem
SelItem
{ _siPictures = pics
, _siHeight = length pics
, _siWidth = 15
, _siIsSelectable = True
, _siColor = col
, _siOffX = 0
, _siPayload = ()
, _siPayload = Nothing
}
closeButtonToSelectionItem :: World -> Int -> Maybe (SelectionItem ())
closeButtonToSelectionItem w i = do
bt <- w ^? cWorld . lWorld . buttons . ix i
return
SelectionItem
SelItem
{ _siPictures = [btText bt]
, _siHeight = 1
, _siWidth = 15
, _siIsSelectable = True
, _siColor = yellow
, _siOffX = 0
, _siPayload = ()
, _siPayload = Nothing
}
btText :: Button -> String