diff --git a/lua.cpp b/lua.cpp index 53f61ac..ee36703 100644 --- a/lua.cpp +++ b/lua.cpp @@ -808,6 +808,10 @@ extern "C" { } } + static int cpp_sys_version(lua_State *L) { + lua_pushstring(L, MINI_VERSION); + return 1; + } // win // =============================================== @@ -1092,6 +1096,7 @@ void push_lua_funcs() { lua_pushcfunction(L,cpp_sys_fps); lua_setfield(L, -2, "fps"); lua_pushcfunction(L,cpp_sys_debug); lua_setfield(L, -2, "debug"); lua_pushcfunction(L,cpp_sys_clipboard); lua_setfield(L, -2, "clipboard"); + lua_pushcfunction(L,cpp_sys_version); lua_setfield(L, -2, "version"); lua_pushinteger(L, 0); lua_setfield(L, -2, "UPDATE_ALWAYS"); lua_pushinteger(L, 1); lua_setfield(L, -2, "UPDATE_WAIT"); diff --git a/mini.cpp b/mini.cpp index b32eb58..41afc06 100644 --- a/mini.cpp +++ b/mini.cpp @@ -459,6 +459,9 @@ int main(int argc,char*argv[]){ if (strcmp(command, "new")==0) { createNewProject(); exit(0); + } else if (strcmp(command, "version")==0) { + //createNewProject(); + exit(0); } } else if (strstr(argv[1], ".lua")!=nullptr) { file_setresourcefolder("./"); @@ -466,6 +469,12 @@ int main(int argc,char*argv[]){ strcpy(main_lua_file, argv[1]); strcpy(window_title, argv[1]); override_ini = true; + } else if (strstr(argv[1], ".jf2")!=nullptr) { + file_setresourcefilename(argv[1]); + file_setsource(SOURCE_FILE); + //strcpy(main_lua_file, argv[1]); + //strcpy(window_title, argv[1]); + //override_ini = true; } else { char path[256] = "./"; strcat(path, argv[1]); diff --git a/version.h b/version.h index 851dd0e..01e335a 100644 --- a/version.h +++ b/version.h @@ -1,3 +1,3 @@ #pragma once -#define MINI_VERSION "1.4.1" +#define MINI_VERSION "1.4.2" diff --git a/vscode/library.lua b/vscode/library.lua index cd8a766..b71dadb 100644 --- a/vscode/library.lua +++ b/vscode/library.lua @@ -310,13 +310,6 @@ function draw.surfrot(sx, sy, sw, sh, x, y, a) end ---Draw text to (x,y) using the specified color function draw.text(text, x, y, color) end ----@param text number ----@param x number ----@param y number ----@param color number ----Draw text to (x,y) using the specified color -function draw.text(text, x, y, color) end - ---@param mode number ---Specify the mode for the drawing functions function draw.mode(mode) end @@ -486,6 +479,10 @@ function sys.clipboard(value) end ---Returns true if running on debug version of mini. False otherwise. function sys.debug() end +---@return string +---Returns the current mini version as a string. +function sys.version() end + ---@class win win = {}