summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCinder <cinder.roxley@phoenixviewer.com>2014-05-16 09:27:37 -0600
committerCinder <cinder.roxley@phoenixviewer.com>2014-05-16 09:27:37 -0600
commitf697eb375e3b72f9b57cd5071552035c82bb3f0c (patch)
tree3c14b76fc1605607440cd4556908e37e481b68db
parent5850397c52bbc184584de6bb3e6d33bfb8abc5d7 (diff)
Update syntax coloring in the preview script on the fly.
-rw-r--r--indra/newview/llfloaterscriptedprefs.cpp11
-rw-r--r--indra/newview/llfloaterscriptedprefs.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp
index 12d4bd6faf..da075aa36c 100644
--- a/indra/newview/llfloaterscriptedprefs.cpp
+++ b/indra/newview/llfloaterscriptedprefs.cpp
@@ -34,6 +34,7 @@
LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key)
: LLFloater(key)
+, mEditor(NULL)
{
mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2));
mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2));
@@ -41,11 +42,11 @@ LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key)
BOOL LLFloaterScriptEdPrefs::postBuild()
{
- LLScriptEditor* editor = getChild<LLScriptEditor>("Script Preview");
- if (editor)
+ mEditor = getChild<LLScriptEditor>("Script Preview");
+ if (mEditor)
{
- editor->initKeywords();
- editor->loadKeywords();
+ mEditor->initKeywords();
+ mEditor->loadKeywords();
}
return TRUE;
}
@@ -54,6 +55,8 @@ void LLFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
{
LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
// *TODO: Signal all active script editors to change colors on the fly.
+ mEditor->initKeywords();
+ mEditor->loadKeywords();
}
void LLFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param)
diff --git a/indra/newview/llfloaterscriptedprefs.h b/indra/newview/llfloaterscriptedprefs.h
index 765db75abc..31df897aac 100644
--- a/indra/newview/llfloaterscriptedprefs.h
+++ b/indra/newview/llfloaterscriptedprefs.h
@@ -30,6 +30,7 @@
#include "llfloater.h"
+class LLScriptEditor;
class LLUICtrl;
class LLFloaterScriptEdPrefs : public LLFloater
@@ -43,6 +44,8 @@ private:
void applyUIColor(LLUICtrl* ctrl, const LLSD& param);
void getUIColor(LLUICtrl* ctrl, const LLSD& param);
+
+ LLScriptEditor* mEditor;
};
#endif // LL_FLOATERSCRIPTEDPREFS_H