• 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!

ModalWindow change title

Guiaki

Member
Joined
Jan 3, 2011
Messages
137
Reaction score
8
I was wondering if there was something like that possible, ex:
Code:
local newModalWindow = modalWindow:getId()
newModalWindow:changeTitle("New title")
Can I change the title of the current ModalWindow? (Or open a new one without user noticing)

--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:
Back
Top