Example #1
0
void LLFloaterLuaConsole::onClickReset(void *data)
{
    LLFloaterLuaConsole *self = (LLFloaterLuaConsole *)data;

	FLLua::init();

    LLLineEditor *editor = self->getChild<LLLineEditor>("Lua Editor", TRUE);

    if(editor->getLength()) 
	{
		editor->updateHistory();
		editor->clear();
	}
}
Example #2
0
void LLFloaterLuaConsole::onClickSend(void *data)
{
	LLFloaterLuaConsole *self = (LLFloaterLuaConsole *)data;
	LLLineEditor *editor = self->getChild<LLLineEditor>("Lua Editor", TRUE);

	if(editor->getLength()) 
	{
		LLColor4 text_color = gSavedSettings.getColor4("llOwnerSayChatColor");
		LLViewerTextEditor *out = self->getChild<LLViewerTextEditor>("Lua Output Editor");
		out->appendColoredText("] "+editor->getText(), false, true, text_color); //echo command, like a proper console.
		FLLua::callCommand(editor->getText());
		editor->updateHistory();
		editor->clear();
	}
}