add 'saveKeys' boolean to GameType.game_type, which should tell us to assign the new userKeys record to the InputState (which is implemented), and should also tell us to convert the keys to a string and save it to controls.config
This commit is contained in:
@@ -286,6 +286,16 @@ struct
|
||||
| OPTIONS options => drawOptions (shellState, options)
|
||||
end
|
||||
|
||||
fun saveKeys game =
|
||||
let val () = InputState.setControls (#userKeys game)
|
||||
in ()
|
||||
end
|
||||
|
||||
fun runEffects game =
|
||||
let val () = if #saveKeys game then saveKeys game else ()
|
||||
in ()
|
||||
end
|
||||
|
||||
fun helpLoop (shellState as {window, ...}: t, game) =
|
||||
case Glfw.windowShouldClose window of
|
||||
false =>
|
||||
@@ -298,6 +308,7 @@ struct
|
||||
val game = GameUpdate.update (game, input, time)
|
||||
|
||||
val shellState = drawMode (shellState, game)
|
||||
val () = runEffects game
|
||||
|
||||
val _ = Glfw.swapBuffers window
|
||||
val _ = Glfw.pollEvents ()
|
||||
|
||||
Reference in New Issue
Block a user