100NvimTree_1 done with functionality to export collisions
This commit is contained in:
@@ -22,6 +22,7 @@ int KEY_O = GLFW_KEY_O;
|
|||||||
int KEY_A = GLFW_KEY_A;
|
int KEY_A = GLFW_KEY_A;
|
||||||
int KEY_W = GLFW_KEY_W;
|
int KEY_W = GLFW_KEY_W;
|
||||||
int KEY_H = GLFW_KEY_H;
|
int KEY_H = GLFW_KEY_H;
|
||||||
|
int KEY_C = GLFW_KEY_C;
|
||||||
|
|
||||||
int KEY_ENTER = GLFW_KEY_ENTER;
|
int KEY_ENTER = GLFW_KEY_ENTER;
|
||||||
int KEY_SPACE = GLFW_KEY_SPACE;
|
int KEY_SPACE = GLFW_KEY_SPACE;
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ struct
|
|||||||
_symbol "KEY_G" public : ( unit -> int ) * ( int -> unit );
|
_symbol "KEY_G" public : ( unit -> int ) * ( int -> unit );
|
||||||
val (KEY_B, _) =
|
val (KEY_B, _) =
|
||||||
_symbol "KEY_B" public : ( unit -> int ) * ( int -> unit );
|
_symbol "KEY_B" public : ( unit -> int ) * ( int -> unit );
|
||||||
|
val (KEY_C, _) =
|
||||||
|
_symbol "KEY_C" public : ( unit -> int ) * ( int -> unit );
|
||||||
|
|
||||||
val (KEY_T, _) =
|
val (KEY_T, _) =
|
||||||
_symbol "KEY_T" public : ( unit -> int ) * ( int -> unit );
|
_symbol "KEY_T" public : ( unit -> int ) * ( int -> unit );
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ struct
|
|||||||
val structureName = "Green"
|
val structureName = "Green"
|
||||||
val filename = "green.dsc"
|
val filename = "green.dsc"
|
||||||
val exportFilename = "green.sml"
|
val exportFilename = "green.sml"
|
||||||
|
val collisionFilename = "green-collisions.sml"
|
||||||
|
|
||||||
fun loadIO (io, str) =
|
fun loadIO (io, str) =
|
||||||
case TextIO.inputLine io of
|
case TextIO.inputLine io of
|
||||||
@@ -33,18 +34,10 @@ struct
|
|||||||
| NONE => ()
|
| NONE => ()
|
||||||
end
|
end
|
||||||
|
|
||||||
fun saveSquares squaresString =
|
fun saveString (filename, toSaveString) =
|
||||||
let
|
let
|
||||||
val io = TextIO.openOut filename
|
val io = TextIO.openOut filename
|
||||||
val () = TextIO.output (io, squaresString)
|
val () = TextIO.output (io, toSaveString)
|
||||||
in
|
|
||||||
TextIO.closeOut io
|
|
||||||
end
|
|
||||||
|
|
||||||
fun exportSquares squaresString =
|
|
||||||
let
|
|
||||||
val io = TextIO.openOut exportFilename
|
|
||||||
val () = TextIO.output (io, squaresString)
|
|
||||||
in
|
in
|
||||||
TextIO.closeOut io
|
TextIO.closeOut io
|
||||||
end
|
end
|
||||||
@@ -83,9 +76,10 @@ struct
|
|||||||
let
|
let
|
||||||
val _ =
|
val _ =
|
||||||
case Mailbox.recv fileMailbox of
|
case Mailbox.recv fileMailbox of
|
||||||
SAVE_SQUARES str => saveSquares str
|
SAVE_SQUARES str => saveString (filename, str)
|
||||||
|
| EXPORT_SQUARES str => saveString (exportFilename, str)
|
||||||
|
| EXPORT_COLLISIONS str => saveString (collisionFilename, str)
|
||||||
| LOAD_SQUARES => loadSquares (filename, inputMailbox)
|
| LOAD_SQUARES => loadSquares (filename, inputMailbox)
|
||||||
| EXPORT_SQUARES str => exportSquares str
|
|
||||||
| LOAD_FILES path => loadFiles (path, inputMailbox)
|
| LOAD_FILES path => loadFiles (path, inputMailbox)
|
||||||
| SELECT_PATH path => selectPath (path, inputMailbox)
|
| SELECT_PATH path => selectPath (path, inputMailbox)
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -68,6 +68,11 @@ struct
|
|||||||
key = Input.KEY_E () andalso action = Input.PRESS () andalso mods = 0x002
|
key = Input.KEY_E () andalso action = Input.PRESS () andalso mods = 0x002
|
||||||
then
|
then
|
||||||
Mailbox.send (mailbox, KEY_CTRL_E)
|
Mailbox.send (mailbox, KEY_CTRL_E)
|
||||||
|
else if
|
||||||
|
(* ctrl-c *)
|
||||||
|
key = Input.KEY_C () andalso action = Input.PRESS () andalso mods = 0x002
|
||||||
|
then
|
||||||
|
Mailbox.send (mailbox, KEY_CTRL_C)
|
||||||
else if
|
else if
|
||||||
key = Input.KEY_A () andalso action = Input.PRESS () andalso mods = 0
|
key = Input.KEY_A () andalso action = Input.PRESS () andalso mods = 0
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user