Flatten HUDElement

This commit is contained in:
2025-08-26 16:46:02 +01:00
parent 596880f76a
commit 9034c409e1
24 changed files with 255 additions and 270 deletions
+5 -5
View File
@@ -15,13 +15,13 @@ textInputFocus ::
Applicative f =>
World ->
Maybe ((String -> f String) -> World -> f World)
textInputFocus w = case w ^? hud . hudElement . subInventory of
textInputFocus w = case w ^? hud . subInventory of
Just NoSubInventory{} -> case he ^? diSelection . _Just . _1 of
Just (-1) -> Just $ hud . hudElement . diInvFilter . _Just
Just 2 -> Just $ hud . hudElement . diCloseFilter . _Just
Just (-1) -> Just $ hud . diInvFilter . _Just
Just 2 -> Just $ hud . diCloseFilter . _Just
_ -> Nothing
Just CombineInventory{} -> case he ^? subInventory . ciSelection . _Just . _1 of
Just (-1) -> Just $ hud . hudElement . subInventory . ciFilter . _Just
Just (-1) -> Just $ hud . subInventory . ciFilter . _Just
_ -> Nothing
Just DisplayTerminal{_termID = tmid} -> do
-- connectionstatus <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus
@@ -29,4 +29,4 @@ textInputFocus w = case w ^? hud . hudElement . subInventory of
return $ cWorld . lWorld . terminals . ix tmid . tmStatus . tiText
_ -> Nothing
where
he = w ^. hud . hudElement
he = w ^. hud