Start simplifying buttons

This commit is contained in:
2025-06-25 15:16:11 +01:00
parent ab1b939e3d
commit bf0bc22720
8 changed files with 16 additions and 11 deletions
+11 -1
View File
@@ -221,7 +221,7 @@ closeButtonToSelectionItem w i = do
bt <- w ^? cWorld . lWorld . buttons . ix i
return
SelectionItem
{ _siPictures = [_btText bt]
{ _siPictures = [btText bt]
, _siHeight = 1
, _siWidth = 15
, _siIsSelectable = True
@@ -230,6 +230,16 @@ closeButtonToSelectionItem w i = do
, _siPayload = ()
}
btText :: Button -> String
btText bt = case _btEvent bt of
ButtonDoNothing -> "UNPRESSABLE BUTTON"
ButtonPress {} -> "BUTTON"
ButtonSimpleSwith {} -> case _btState bt of
BtOn -> "SWITCH\\"
BtOff -> "SWITCH/"
BtInactive -> "INACTIVE SWITCH"
ButtonAccessTerminal -> "TERMINAL"
closeItemToTextPictures :: FloorItem -> ([String], Color)
closeItemToTextPictures flit = (basicItemDisplay it, itemInvColor $ baseCI it)
where