• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Modal Window

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
87
Hello. How can I change this to version 0.3.6?
Code:
int32_t LuaScriptInterface::luaModalWindowGetId(lua_State* L)
{
   // modalWindow:getId()
   ModalWindow* window = getUserdata<ModalWindow>(L);
   if (window) {
       lua_pushnumber(L, window->id);
   } else {
       lua_pushnil(L);
   }
   return 1;
}
especially this:
Code:
ModalWindow* window = getUserdata<ModalWindow>(L);
getUserdata does not exist in 0.3.6
 
I know, but how to change the function "getUserdata" to it would work?
there is no such equivalent to 0.3, it's main difference between both apis, if you really need a lua userdata you can try doing it with
void *lua_touserdata (lua_State *L, int index);
or
void *lua_newuserdata (lua_State *L, size_t size);
 
I mean, how to exchange this function to other. I know there is no that function. I just want to work it.
You cannot, if you have copied & paste ModalWindow struct from tfs 1.2 it doesn't have any function you can use to get a modal window id.
 
Last edited:
Back
Top