VERSIÓ 1.4.3

- [NEW] key.text()
- [NEW] key.utf8char()
- [NEW] pal.trans() ara torna el color transparent
- [NEW] pal.subpal(index) i pal.subpal(index,color) ara tornen el color al que estaba abans asignat el index
This commit is contained in:
2026-03-17 13:47:25 +01:00
parent 6f5d90ee49
commit 560d67ca3d
5 changed files with 63 additions and 21 deletions

20
lua.cpp
View File

@@ -310,12 +310,16 @@ extern "C" {
break;
case 1:
index = luaL_checkinteger(L, 1);
subpal(index,index);
const uint8_t old = subpal(index,index);
lua_pushinteger(L, old);
return 1;
break;
case 2:
index = luaL_checkinteger(L, 1);
color = luaL_checkinteger(L, 2);
subpal(index, color);
const uint8_t old = subpal(index, color);
lua_pushinteger(L, old);
return 1;
break;
case 3:
index = luaL_checkinteger(L, 1);
@@ -956,6 +960,16 @@ extern "C" {
return 1;
}
static int cpp_key_text(lua_State *L) {
textenable(lua_toboolean(L, 1));
return 0;
}
static int cpp_key_utf8char(lua_State *L) {
lua_pushstring(L, textinput());
return 1;
}
// pad
// ===============================================
@@ -1134,6 +1148,8 @@ void push_lua_funcs() {
lua_pushcfunction(L,cpp_key_down); lua_setfield(L, -2, "down");
lua_pushcfunction(L,cpp_key_press); lua_setfield(L, -2, "press");
lua_pushcfunction(L,cpp_key_any); lua_setfield(L, -2, "any");
lua_pushcfunction(L,cpp_key_text); lua_setfield(L, -2, "text");
lua_pushcfunction(L,cpp_key_utf8char); lua_setfield(L, -2, "utf8char");
//lua_setglobal(L, "key");
//lua_newtable(L);