added rookie flag to player creation confirmation
This commit is contained in:
parent
fefa217df1
commit
4315b40732
|
@ -23,11 +23,11 @@ module Mtlstats.Control.CreatePlayer (createPlayerC) where
|
||||||
|
|
||||||
import Control.Monad (join)
|
import Control.Monad (join)
|
||||||
import Control.Monad.Trans.State (gets, modify)
|
import Control.Monad.Trans.State (gets, modify)
|
||||||
import Data.Maybe (fromJust)
|
|
||||||
import Lens.Micro ((^.), (.~), (?~), (%~), to)
|
import Lens.Micro ((^.), (.~), (?~), (%~), to)
|
||||||
import qualified UI.NCurses as C
|
import qualified UI.NCurses as C
|
||||||
|
|
||||||
import Mtlstats.Actions
|
import Mtlstats.Actions
|
||||||
|
import Mtlstats.Format
|
||||||
import Mtlstats.Handlers
|
import Mtlstats.Handlers
|
||||||
import Mtlstats.Prompt
|
import Mtlstats.Prompt
|
||||||
import Mtlstats.Types
|
import Mtlstats.Types
|
||||||
|
@ -64,10 +64,16 @@ confirmCreatePlayerC :: Controller
|
||||||
confirmCreatePlayerC = Controller
|
confirmCreatePlayerC = Controller
|
||||||
{ drawController = \s -> do
|
{ drawController = \s -> do
|
||||||
let cps = s^.progMode.createPlayerStateL
|
let cps = s^.progMode.createPlayerStateL
|
||||||
C.drawString $ " Player number: " ++ show (fromJust $ cps^.cpsNumber) ++ "\n"
|
C.drawString $ unlines
|
||||||
C.drawString $ " Player name: " ++ cps^.cpsName ++ "\n"
|
$ labelTable
|
||||||
C.drawString $ "Player position: " ++ cps^.cpsPosition ++ "\n\n"
|
[ ( "Player number", maybe "?" show $ cps^.cpsNumber )
|
||||||
C.drawString "Create player: are you sure? (Y/N)"
|
, ( "Player name", cps^.cpsName )
|
||||||
|
, ( "Player position", cps^.cpsPosition )
|
||||||
|
, ( "Rookie", maybe "?" show $ cps^.cpsRookieFlag )
|
||||||
|
]
|
||||||
|
++ [ ""
|
||||||
|
, "Create player: are you sure? (Y/N)"
|
||||||
|
]
|
||||||
return C.CursorInvisible
|
return C.CursorInvisible
|
||||||
, handleController = \e -> do
|
, handleController = \e -> do
|
||||||
case ynHandler e of
|
case ynHandler e of
|
||||||
|
|
Loading…
Reference in New Issue
Block a user