Exemplo n.º 1
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();
	}
}
Exemplo n.º 2
0
void LLFloaterLuaConsole::addOutput(std::string output, bool error)
{
	LLFloaterLuaConsole *self = sInstance;
	if(!self) //open but hidden
	{
		self=getInstance();
		self->setVisible(FALSE);
	}
	LLColor4 text_color;
	if(error)
		text_color = gSavedSettings.getColor4("ScriptErrorColor");
	else
		text_color = gSavedSettings.getColor4("ObjectChatColor");

	LLViewerTextEditor *editor = self->getChild<LLViewerTextEditor>("Lua Output Editor");
	editor->setParseHTML(TRUE);
	editor->setParseHighlights(TRUE);
	editor->appendColoredText(output, false, true, text_color);
}