allow player creation callbacks to be impure
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user