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:
parent
79aceaec17
commit
3c294fbabd
6 changed files with 100 additions and 7 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue