when game is first loaded, assign parsed controls (or at least default controls) to imperative shell's state

This commit is contained in:
2025-02-17 03:53:04 +00:00
parent 18495a0cca
commit 6d028214d5
2 changed files with 4 additions and 0 deletions

View File

@@ -278,6 +278,8 @@ struct
, jump = CoreKey.KEY_Z , jump = CoreKey.KEY_Z
, attack = CoreKey.KEY_X , attack = CoreKey.KEY_X
} }
val () = InputState.setControls controls
in in
helpLoop (shellState, GameType.initial controls) helpLoop (shellState, GameType.initial controls)
end end

View File

@@ -9,6 +9,8 @@ struct
, jump = CoreKey.KEY_K , jump = CoreKey.KEY_K
} }
fun setControls controls = keyMappings := controls
(* global state detecting button inputs *) (* global state detecting button inputs *)
val state = val state =
{ leftHeld = ref false { leftHeld = ref false