From 109ed70f9f518e80750cc648a7f8c1c85798079f Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 2 Sep 2024 16:51:15 +0200 Subject: [PATCH] refactor(script): allow to change load time and code --- include/saucer/script.h | 2 ++ src/script.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/saucer/script.h b/include/saucer/script.h index 42f79ee..c7ca061 100644 --- a/include/saucer/script.h +++ b/include/saucer/script.h @@ -27,7 +27,9 @@ extern "C" SAUCER_EXPORT void saucer_script_free(saucer_script *); SAUCER_EXPORT void saucer_script_set_frame(saucer_script *, SAUCER_WEB_FRAME frame); + SAUCER_EXPORT void saucer_script_set_time(saucer_script *, SAUCER_LOAD_TIME time); SAUCER_EXPORT void saucer_script_set_permanent(saucer_script *, bool permanent); + SAUCER_EXPORT void saucer_script_set_code(saucer_script *, const char *code); #ifdef __cplusplus } diff --git a/src/script.cpp b/src/script.cpp index d9eebeb..75acf72 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -18,8 +18,18 @@ extern "C" handle->value().frame = static_cast(frame); } + void saucer_script_set_time(saucer_script *handle, SAUCER_LOAD_TIME time) + { + handle->value().time = static_cast(time); + } + void saucer_script_set_permanent(saucer_script *handle, bool permanent) { handle->value().permanent = permanent; } + + void saucer_script_set_code(saucer_script *handle, const char *code) + { + handle->value().code = code; + } }