feat(grfn/xanthous): Add a help panel

Change-Id: I581a37df0a20fa54878da4446007dbe677e057da
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5444
Autosubmit: grfn <grfn@gws.fyi>
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Griffin Smith 2022-04-10 12:06:10 -04:00 committed by clbot
parent 79aceaec17
commit 3c294fbabd
6 changed files with 100 additions and 7 deletions

View file

@ -1,7 +1,10 @@
{-# LANGUAGE TemplateHaskell #-}
--------------------------------------------------------------------------------
module Xanthous.Command
( Command(..)
( -- * Commands
Command(..)
, commandIsHidden
-- * Keybindings
, Keybinding(..)
, keybindings
, commands
@ -29,6 +32,7 @@ import Xanthous.Util.QuickCheck (GenericArbitrary(..))
data Command
= Quit
| Help
| Move !Direction
| StartAutoMove !Direction
| PreviousMessage
@ -58,6 +62,16 @@ data Command
via WithOptions '[ SumEnc UntaggedVal ]
Command
-- | Should the command be hidden from the help menu?
--
-- Note that this is true for both debug commands and movement commands, as the
-- latter is documented non-automatically
commandIsHidden :: Command -> Bool
commandIsHidden (Move _) = True
commandIsHidden (StartAutoMove _) = True
commandIsHidden ToggleRevealAll = True
commandIsHidden _ = False
--------------------------------------------------------------------------------
data Keybinding = Keybinding !Key ![Modifier]