done coding functionality to create a string suitable for exporting

This commit is contained in:
2025-07-12 19:16:36 +01:00
parent a97f838a64
commit dbb1676fbe
4 changed files with 16 additions and 8 deletions

View File

@@ -10,7 +10,7 @@ struct
fun getSaveSquaresMsg (model: app_type) =
let
val {canvasWidth, canvasHeight, squares, ...} = model
val str = CollisionTree.toString (squares, canvasWidth, canvasHeight)
val str = CollisionTree.toSaveString (squares, canvasWidth, canvasHeight)
val msg = SAVE_SQUARES str
in
(model, [FILE msg])
@@ -19,9 +19,17 @@ struct
fun getLoadSquaresMsg model =
(model, [FILE LOAD_SQUARES])
(* unimplemented *)
fun getExportSquaresMsg model = (model, [])
fun getExportSquaresMsg (model: app_type) =
let
val {squares, canvasWidth, canvasHeight, ...} = model
val exportString =
CollisionTree.toExportString (squares, canvasWidth, canvasHeight)
val msg = EXPORT_SQUARES exportString
in
(model, [FILE msg])
end
(* unimplemented *)
fun useSquaresInNormalMode (model, squares) = (model, [])
fun squaresLoadError model = (model, [])