limit number of player shortcuts displayed

This commit is contained in:
Jonathan Lamothe 2019-09-19 06:34:03 -04:00
parent f7e6ac9437
commit e3388c45c7
2 changed files with 6 additions and 1 deletions

View File

@ -24,3 +24,7 @@ module Mtlstats.Config where
-- | The name of the team whose stats we're tracking
myTeam :: String
myTeam = "MONTREAL"
-- | The maximum number of function keys
maxFunKeys :: Int
maxFunKeys = 9

View File

@ -50,6 +50,7 @@ import Text.Read (readMaybe)
import qualified UI.NCurses as C
import Mtlstats.Actions
import Mtlstats.Config
import Mtlstats.Format
import Mtlstats.Types
import Mtlstats.Util
@ -159,7 +160,7 @@ selectPlayerPrompt pStr callback = Prompt
C.drawString sStr
(row, col) <- C.cursorPosition
C.drawString "\n\nPlayer select:\n"
let sel = zip [1..] $ playerSearch sStr $ s^.database.dbPlayers
let sel = zip [1..maxFunKeys] $ playerSearch sStr $ s^.database.dbPlayers
mapM_
(\(n, (_, p)) -> C.drawString $
"F" ++ show n ++ ") " ++ p^.pName ++ " (" ++ show (p^.pNumber) ++ ")\n")