Guiaki
Member
- Joined
- Jan 3, 2011
- Messages
- 137
- Reaction score
- 8
I was wondering if there was something like that possible, ex:
Can I change the title of the current ModalWindow? (Or open a new one without user noticing)
--EDIT--
Just made the function myself:
Do I need to put the declaration of luaModalWindowChangeTitle anywhere else before compiling? ( I already put on luascript.h and luascript.cpp)
Code:
local newModalWindow = modalWindow:getId()
newModalWindow:changeTitle("New title")
--EDIT--
Just made the function myself:
Code:
int32_t LuaScriptInterface::luaModalWindowChangeTitle(lua_State* L)
{
// modalWindow:changeTitle(text)
const std::string& text = getString(L, 2);
ModalWindow* window = getUserdata<ModalWindow>(L, 1);
if (window) {
window->title = text;
pushBoolean(L, true);
}
else {
pushNil(L);
}
return 1;
}
Do I need to put the declaration of luaModalWindowChangeTitle anywhere else before compiling? ( I already put on luascript.h and luascript.cpp)
Last edited: