mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Merge pull request #26 from G-e-n-e-v-e-n-s-i-S/get-mse-version
Add get_mse_version script function
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Function: get_mse_version
|
||||
|
||||
--Usage--
|
||||
> get_mse_version()
|
||||
|
||||
Returns the current MSE app version in a string of the form:
|
||||
"major.minor.patch"
|
||||
@@ -111,6 +111,7 @@ These functions are built into the program, other [[type:function]]s can be defi
|
||||
| [[fun:write_set_file]] Write a MSE set file to the output directory.
|
||||
|
||||
! Other functions <<<
|
||||
| [[fun:get_mse_version]] Get the MSE app version.
|
||||
| [[fun:trace]] Output a message for debugging purposes.
|
||||
| [[fun:assert]] Check a condition for debugging purposes.
|
||||
| [[fun:warning]] Output a warning message.
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <util/prec.hpp>
|
||||
#include <util/version.hpp>
|
||||
#include <script/functions/functions.hpp>
|
||||
#include <script/functions/util.hpp>
|
||||
#include <util/tagged_string.hpp>
|
||||
@@ -21,6 +22,10 @@
|
||||
|
||||
// ----------------------------------------------------------------------------- : Debugging
|
||||
|
||||
SCRIPT_FUNCTION(get_mse_version) {
|
||||
SCRIPT_RETURN(app_version.toString());
|
||||
}
|
||||
|
||||
SCRIPT_FUNCTION(trace) {
|
||||
SCRIPT_PARAM_C(String, input);
|
||||
#if defined(_DEBUG) && 0
|
||||
@@ -764,6 +769,7 @@ SCRIPT_FUNCTION(rule) {
|
||||
|
||||
void init_script_basic_functions(Context& ctx) {
|
||||
// debugging
|
||||
ctx.setVariable(_("get_mse_version"), script_get_mse_version);
|
||||
ctx.setVariable(_("trace"), script_trace);
|
||||
ctx.setVariable(_("warning"), script_warning);
|
||||
ctx.setVariable(_("error"), script_error);
|
||||
|
||||
@@ -102,6 +102,7 @@ $built_in_functions = array(
|
||||
'write_image_file' =>'',
|
||||
'write_set_file' =>'',
|
||||
// other
|
||||
'get_mse_version' =>'',
|
||||
'trace' =>'',
|
||||
'assert' =>'',
|
||||
'exists_in_package' =>'',
|
||||
|
||||
Reference in New Issue
Block a user