VERSIÓ 1.4.2

- [NEW] excutar "mini --version" torna la versió
- [NEW] executar "mini dura/a/un/data.jf2" usará eixe arxiu jf2
- [NEW] sys.version()
This commit is contained in:
2026-03-16 14:25:47 +01:00
parent afa022d838
commit d92a903c61
4 changed files with 19 additions and 8 deletions

View File

@@ -808,6 +808,10 @@ extern "C" {
} }
} }
static int cpp_sys_version(lua_State *L) {
lua_pushstring(L, MINI_VERSION);
return 1;
}
// win // 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_fps); lua_setfield(L, -2, "fps");
lua_pushcfunction(L,cpp_sys_debug); lua_setfield(L, -2, "debug"); 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_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, 0); lua_setfield(L, -2, "UPDATE_ALWAYS");
lua_pushinteger(L, 1); lua_setfield(L, -2, "UPDATE_WAIT"); lua_pushinteger(L, 1); lua_setfield(L, -2, "UPDATE_WAIT");

View File

@@ -459,6 +459,9 @@ int main(int argc,char*argv[]){
if (strcmp(command, "new")==0) { if (strcmp(command, "new")==0) {
createNewProject(); createNewProject();
exit(0); exit(0);
} else if (strcmp(command, "version")==0) {
//createNewProject();
exit(0);
} }
} else if (strstr(argv[1], ".lua")!=nullptr) { } else if (strstr(argv[1], ".lua")!=nullptr) {
file_setresourcefolder("./"); file_setresourcefolder("./");
@@ -466,6 +469,12 @@ int main(int argc,char*argv[]){
strcpy(main_lua_file, argv[1]); strcpy(main_lua_file, argv[1]);
strcpy(window_title, argv[1]); strcpy(window_title, argv[1]);
override_ini = true; 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 { } else {
char path[256] = "./"; char path[256] = "./";
strcat(path, argv[1]); strcat(path, argv[1]);

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define MINI_VERSION "1.4.1" #define MINI_VERSION "1.4.2"

View File

@@ -310,13 +310,6 @@ function draw.surfrot(sx, sy, sw, sh, x, y, a) end
---Draw text to (x,y) using the specified color ---Draw text to (x,y) using the specified color
function draw.text(text, x, y, color) end 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 ---@param mode number
---Specify the mode for the drawing functions ---Specify the mode for the drawing functions
function draw.mode(mode) end 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. ---Returns true if running on debug version of mini. False otherwise.
function sys.debug() end function sys.debug() end
---@return string
---Returns the current mini version as a string.
function sys.version() end
---@class win ---@class win
win = {} win = {}