allow player creation callbacks to be impure

This commit is contained in:
Jonathan Lamothe
2019-09-19 04:01:28 -04:00
parent 8277f8bac7
commit 11a66cfd33
3 changed files with 12 additions and 12 deletions

View File

@@ -34,6 +34,7 @@ module Mtlstats.Actions
, addPlayer
) where
import Control.Monad.Trans.State (modify)
import Data.Maybe (fromMaybe)
import Data.Time.Calendar (fromGregorianValid)
import Lens.Micro (over, (^.), (&), (.~), (?~), (%~), (+~))
@@ -117,7 +118,7 @@ validateGameDate s = fromMaybe s $ do
-- | Starts player creation mode
createPlayer :: ProgState -> ProgState
createPlayer = let
cb = progMode .~ MainMenu
cb = modify $ progMode .~ MainMenu
cps
= newCreatePlayerState
& cpsSuccessCallback .~ cb