100NvimTree_1 done with functionality to export collisions

This commit is contained in:
2025-07-13 15:45:09 +01:00
parent 7e96203f92
commit d392ad2c79
5 changed files with 14 additions and 12 deletions

BIN
dotscape

Binary file not shown.

View File

@@ -22,6 +22,7 @@ int KEY_O = GLFW_KEY_O;
int KEY_A = GLFW_KEY_A;
int KEY_W = GLFW_KEY_W;
int KEY_H = GLFW_KEY_H;
int KEY_C = GLFW_KEY_C;
int KEY_ENTER = GLFW_KEY_ENTER;
int KEY_SPACE = GLFW_KEY_SPACE;

View File

@@ -37,6 +37,8 @@ struct
_symbol "KEY_G" public : ( unit -> int ) * ( int -> unit );
val (KEY_B, _) =
_symbol "KEY_B" public : ( unit -> int ) * ( int -> unit );
val (KEY_C, _) =
_symbol "KEY_C" public : ( unit -> int ) * ( int -> unit );
val (KEY_T, _) =
_symbol "KEY_T" public : ( unit -> int ) * ( int -> unit );

View File

@@ -11,6 +11,7 @@ struct
val structureName = "Green"
val filename = "green.dsc"
val exportFilename = "green.sml"
val collisionFilename = "green-collisions.sml"
fun loadIO (io, str) =
case TextIO.inputLine io of
@@ -33,18 +34,10 @@ struct
| NONE => ()
end
fun saveSquares squaresString =
fun saveString (filename, toSaveString) =
let
val io = TextIO.openOut filename
val () = TextIO.output (io, squaresString)
in
TextIO.closeOut io
end
fun exportSquares squaresString =
let
val io = TextIO.openOut exportFilename
val () = TextIO.output (io, squaresString)
val () = TextIO.output (io, toSaveString)
in
TextIO.closeOut io
end
@@ -83,9 +76,10 @@ struct
let
val _ =
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)
| EXPORT_SQUARES str => exportSquares str
| LOAD_FILES path => loadFiles (path, inputMailbox)
| SELECT_PATH path => selectPath (path, inputMailbox)
in

View File

@@ -68,6 +68,11 @@ struct
key = Input.KEY_E () andalso action = Input.PRESS () andalso mods = 0x002
then
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
key = Input.KEY_A () andalso action = Input.PRESS () andalso mods = 0
then