add get_mse_path script function

This commit is contained in:
GenevensiS
2025-05-22 12:39:09 +02:00
parent 94369f5969
commit c577417191
4 changed files with 19 additions and 0 deletions
+11
View File
@@ -19,11 +19,21 @@
#include <data/card.hpp>
#include <data/game.hpp>
#include <random>
#include <wx/filename.h>
#include <wx/stdpaths.h>
// ----------------------------------------------------------------------------- : Debugging
SCRIPT_FUNCTION(get_mse_version) {
SCRIPT_RETURN(app_version.toString());
}
SCRIPT_FUNCTION(get_mse_path) {
wxFileName app_path(wxStandardPaths::Get().GetExecutablePath());
String app_folder = app_path.GetPath();
app_folder.Replace("\\", "/");
SCRIPT_RETURN(app_folder);
}
SCRIPT_FUNCTION(trace) {
@@ -770,6 +780,7 @@ SCRIPT_FUNCTION(rule) {
void init_script_basic_functions(Context& ctx) {
// debugging
ctx.setVariable(_("get_mse_version"), script_get_mse_version);
ctx.setVariable(_("get_mse_path"), script_get_mse_path);
ctx.setVariable(_("trace"), script_trace);
ctx.setVariable(_("warning"), script_warning);
ctx.setVariable(_("error"), script_error);