Skip to content
Snippets Groups Projects
Commit f697eb37 authored by Cinder's avatar Cinder
Browse files

Update syntax coloring in the preview script on the fly.

parent 5850397c
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key) LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key)
: LLFloater(key) : LLFloater(key)
, mEditor(NULL)
{ {
mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2));
mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2));
...@@ -41,11 +42,11 @@ LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key) ...@@ -41,11 +42,11 @@ LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key)
BOOL LLFloaterScriptEdPrefs::postBuild() BOOL LLFloaterScriptEdPrefs::postBuild()
{ {
LLScriptEditor* editor = getChild<LLScriptEditor>("Script Preview"); mEditor = getChild<LLScriptEditor>("Script Preview");
if (editor) if (mEditor)
{ {
editor->initKeywords(); mEditor->initKeywords();
editor->loadKeywords(); mEditor->loadKeywords();
} }
return TRUE; return TRUE;
} }
...@@ -54,6 +55,8 @@ void LLFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param) ...@@ -54,6 +55,8 @@ void LLFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
{ {
LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue())); LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
// *TODO: Signal all active script editors to change colors on the fly. // *TODO: Signal all active script editors to change colors on the fly.
mEditor->initKeywords();
mEditor->loadKeywords();
} }
void LLFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param) void LLFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param)
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "llfloater.h" #include "llfloater.h"
class LLScriptEditor;
class LLUICtrl; class LLUICtrl;
class LLFloaterScriptEdPrefs : public LLFloater class LLFloaterScriptEdPrefs : public LLFloater
...@@ -43,6 +44,8 @@ class LLFloaterScriptEdPrefs : public LLFloater ...@@ -43,6 +44,8 @@ class LLFloaterScriptEdPrefs : public LLFloater
void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void applyUIColor(LLUICtrl* ctrl, const LLSD& param);
void getUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param);
LLScriptEditor* mEditor;
}; };
#endif // LL_FLOATERSCRIPTEDPREFS_H #endif // LL_FLOATERSCRIPTEDPREFS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment