예제 #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();
	}
}
예제 #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();
	}
}