mirror of
https://github.com/keharriso/love-nuklear.git
synced 2025-09-10 16:17:47 -04:00
Make presses parameter to mousepressed/mousereleased mandatory
This commit is contained in:
parent
2fd70e6062
commit
541b259591
1 changed files with 4 additions and 4 deletions
|
@ -1161,13 +1161,13 @@ static int nk_love_keyreleased(lua_State *L)
|
|||
|
||||
static int nk_love_mousepressed(lua_State *L)
|
||||
{
|
||||
nk_love_assert_argc(lua_gettop(L) == 5 || lua_gettop(L) == 6);
|
||||
nk_love_assert_argc(lua_gettop(L) == 6);
|
||||
struct nk_love_context *ctx = nk_love_checkcontext(1);
|
||||
int x = luaL_checkint(L, 2);
|
||||
int y = luaL_checkint(L, 3);
|
||||
int button = luaL_checkint(L, 4);
|
||||
int istouch = nk_love_checkboolean(L, 5);
|
||||
int presses = lua_gettop(L) == 6 ? luaL_checkint(L, 6) : 1;
|
||||
int presses = luaL_checkint(L, 6);
|
||||
int consume = nk_love_clickevent(ctx, x, y, button, istouch, presses, 1);
|
||||
lua_pushboolean(L, consume);
|
||||
return 1;
|
||||
|
@ -1175,13 +1175,13 @@ static int nk_love_mousepressed(lua_State *L)
|
|||
|
||||
static int nk_love_mousereleased(lua_State *L)
|
||||
{
|
||||
nk_love_assert_argc(lua_gettop(L) == 5 || lua_gettop(L) == 6);
|
||||
nk_love_assert_argc(lua_gettop(L) == 6);
|
||||
struct nk_love_context *ctx = nk_love_checkcontext(1);
|
||||
int x = luaL_checkint(L, 2);
|
||||
int y = luaL_checkint(L, 3);
|
||||
int button = luaL_checkint(L, 4);
|
||||
int istouch = nk_love_checkboolean(L, 5);
|
||||
int presses = lua_gettop(L) == 6 ? luaL_checkint(L, 6) : 1;
|
||||
int presses = luaL_checkint(L, 6);
|
||||
int consume = nk_love_clickevent(ctx, x, y, button, istouch, presses, 0);
|
||||
lua_pushboolean(L, consume);
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue