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:
2025-02-21 18:32:48 +00:00
parent e1fb4004dd
commit e6b0a5f37f
6 changed files with 24 additions and 13 deletions

View File

@@ -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 ()