even more stylistic changes
I hope to God I'm done with these now.
This commit is contained in:
parent
251dc90cea
commit
886cf0b243
|
@ -26,14 +26,13 @@ import Brick.Main (App (..), halt, showFirstCursor)
|
||||||
import Brick.Types (BrickEvent (VtyEvent), Widget)
|
import Brick.Types (BrickEvent (VtyEvent), Widget)
|
||||||
import Brick.Util (on)
|
import Brick.Util (on)
|
||||||
import Brick.Widgets.Core (fill)
|
import Brick.Widgets.Core (fill)
|
||||||
|
import Control.Monad.State.Class (gets)
|
||||||
import Graphics.Vty.Attributes.Color (blue, white)
|
import Graphics.Vty.Attributes.Color (blue, white)
|
||||||
import Graphics.Vty.Input.Events
|
import Graphics.Vty.Input.Events
|
||||||
( Event (EvKey)
|
( Event (EvKey)
|
||||||
, Modifier (MCtrl)
|
, Modifier (MCtrl)
|
||||||
, Key (KChar)
|
, Key (KChar)
|
||||||
)
|
)
|
||||||
import Lens.Micro (to)
|
|
||||||
import Lens.Micro.Mtl (use)
|
|
||||||
|
|
||||||
import Mtlstats.Control
|
import Mtlstats.Control
|
||||||
import Mtlstats.Types
|
import Mtlstats.Types
|
||||||
|
@ -57,7 +56,7 @@ draw s =
|
||||||
handler :: Handler ()
|
handler :: Handler ()
|
||||||
handler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
|
handler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
|
||||||
handler e = do
|
handler e = do
|
||||||
c <- use (to dispatch)
|
c <- gets dispatch
|
||||||
handleController c e
|
handleController c e
|
||||||
|
|
||||||
myAttrMap :: AttrMap
|
myAttrMap :: AttrMap
|
||||||
|
|
|
@ -24,6 +24,7 @@ module Mtlstats.Control.CreateGoalie (createGoalieC) where
|
||||||
import Brick.Widgets.Core (str)
|
import Brick.Widgets.Core (str)
|
||||||
import Control.Monad.State.Class (gets, modify)
|
import Control.Monad.State.Class (gets, modify)
|
||||||
import Lens.Micro ((^.), (.~), (?~), (%~), to)
|
import Lens.Micro ((^.), (.~), (?~), (%~), to)
|
||||||
|
import Lens.Micro.Mtl ((.=))
|
||||||
|
|
||||||
import Mtlstats.Actions
|
import Mtlstats.Actions
|
||||||
import Mtlstats.Format
|
import Mtlstats.Format
|
||||||
|
@ -63,7 +64,7 @@ getActiveFlagC :: Controller
|
||||||
getActiveFlagC = Controller
|
getActiveFlagC = Controller
|
||||||
{ drawController = const $ str "Is this goalie active? (Y/N)"
|
{ drawController = const $ str "Is this goalie active? (Y/N)"
|
||||||
, handleController = \e ->
|
, handleController = \e ->
|
||||||
modify $ progMode.createGoalieStateL.cgsActiveFlag .~ ynHandler e
|
progMode.createGoalieStateL.cgsActiveFlag .= ynHandler e
|
||||||
}
|
}
|
||||||
|
|
||||||
confirmCreateGoalieC :: Controller
|
confirmCreateGoalieC :: Controller
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Mtlstats.Control.CreatePlayer (createPlayerC) where
|
||||||
import Brick.Widgets.Core (str)
|
import Brick.Widgets.Core (str)
|
||||||
import Control.Monad.State.Class (gets, modify)
|
import Control.Monad.State.Class (gets, modify)
|
||||||
import Lens.Micro ((^.), (.~), (?~), (%~), to)
|
import Lens.Micro ((^.), (.~), (?~), (%~), to)
|
||||||
import Lens.Micro.Mtl ((.=))
|
import Lens.Micro.Mtl ((.=), use)
|
||||||
|
|
||||||
import Mtlstats.Actions
|
import Mtlstats.Actions
|
||||||
import Mtlstats.Format
|
import Mtlstats.Format
|
||||||
|
@ -85,7 +85,7 @@ confirmCreatePlayerC = Controller
|
||||||
, "Create player: are you sure? (Y/N)"
|
, "Create player: are you sure? (Y/N)"
|
||||||
]
|
]
|
||||||
, handleController = \e -> do
|
, handleController = \e -> do
|
||||||
cps <- gets (^.progMode.createPlayerStateL)
|
cps <- use $ progMode.createPlayerStateL
|
||||||
let
|
let
|
||||||
success = cps^.cpsSuccessCallback
|
success = cps^.cpsSuccessCallback
|
||||||
failure = cps^.cpsFailureCallback
|
failure = cps^.cpsFailureCallback
|
||||||
|
|
Loading…
Reference in New Issue
Block a user