From 2793ca9e048bf20170b1089ade3290afc5d52082 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 25 Jun 2013 16:21:51 -0500 Subject: [PATCH] Applied moap beacon patch. --- indra/newview/app_settings/settings.xml | 22 ++--- indra/newview/llfloaterbeacons.cpp | 96 ++++++++----------- indra/newview/llfloaterbeacons.h | 3 +- .../default/xui/en-us/floater_beacons.xml | 83 ++++++++++++---- .../skins/default/xui/es/floater_beacons.xml | 25 ++--- .../skins/default/xui/fr/floater_beacons.xml | 22 ++--- .../skins/default/xui/pt/floater_beacons.xml | 11 ++- 7 files changed, 147 insertions(+), 115 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ededd2462..7894e27a2 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16633,6 +16633,17 @@ This should be as low as possible, but too low may break functionality Value 0.40000000596 + moapbeacon + + Comment + Beacon / Highlight media on a prim sources + Persist + 1 + Type + Boolean + Value + 0 + particlesbeacon Comment @@ -16765,17 +16776,6 @@ This should be as low as possible, but too low may break functionality Value 0 - keepbeacons - - Comment - Keep beacons when closing floater - Persist - 1 - Type - Boolean - Value - 0 - ClearBeaconAfterTeleport Comment diff --git a/indra/newview/llfloaterbeacons.cpp b/indra/newview/llfloaterbeacons.cpp index b8d457fa9..696708a50 100644 --- a/indra/newview/llfloaterbeacons.cpp +++ b/indra/newview/llfloaterbeacons.cpp @@ -36,7 +36,6 @@ #include "llviewercontrol.h" #include "lluictrlfactory.h" #include "llcheckboxctrl.h" -#include "llsliderctrl.h" #include "pipeline.h" // [RLVa:KB] @@ -45,8 +44,6 @@ LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_beacons.xml"); - // Initialize pipeline states from saved settings. // OK to do at floater constructor time because beacons do not display unless the floater is open // therefore it is OK to not initialize the pipeline state before needed. @@ -59,20 +56,14 @@ LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed) LLPipeline::setRenderParticleBeacons( gSavedSettings.getBOOL("particlesbeacon")); LLPipeline::setRenderHighlights( gSavedSettings.getBOOL("renderhighlights")); LLPipeline::setRenderBeacons( gSavedSettings.getBOOL("renderbeacons")); - getChild("beacon_width_label")->setEnabled(gSavedSettings.getBOOL("renderbeacons")); - getChild("beacon_width")->setEnabled(gSavedSettings.getBOOL("renderbeacons")); + LLPipeline::setRenderMOAPBeacons( gSavedSettings.getBOOL("moapbeacon")); + mCommitCallbackRegistrar.add("Beacons.UICheck", boost::bind(&LLFloaterBeacons::onClickUICheck, this,_1)); + + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_beacons.xml"); } BOOL LLFloaterBeacons::postBuild() { - childSetCommitCallback("always_on", onClickUICheck, this); - childSetCommitCallback("touch_only", onClickUICheck, this); - childSetCommitCallback("scripted", onClickUICheck, this); - childSetCommitCallback("physical", onClickUICheck, this); - childSetCommitCallback("sounds", onClickUICheck, this); - childSetCommitCallback("particles", onClickUICheck, this); - childSetCommitCallback("highlights", onClickUICheck, this); - childSetCommitCallback("beacons", onClickUICheck, this); return TRUE; } @@ -105,64 +96,59 @@ void LLFloaterBeacons::close(bool app_quitting) // Callback attached to each check box control to both affect their main purpose // and to implement the couple screwy interdependency rules that some have. -//static -void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl, void* data) + +void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) { LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; std::string name = check->getName(); - LLFloaterBeacons* view = (LLFloaterBeacons*)data; - if (name == "always_on") gSavedSettings.setBOOL("BeaconsKeepVisible", check->get()); - else if (name == "touch_only") LLPipeline::setRenderScriptedTouchBeacons(check->get()); - else if (name == "scripted") LLPipeline::setRenderScriptedBeacons(check->get()); - else if (name == "physical") LLPipeline::setRenderPhysicalBeacons(check->get()); - else if (name == "sounds") LLPipeline::setRenderSoundBeacons(check->get()); - else if (name == "particles") LLPipeline::setRenderParticleBeacons(check->get()); - else if (name == "highlights") LLPipeline::setRenderHighlights(check->get()); - else if (name == "beacons") - { - bool enabled = check->get(); - LLPipeline::setRenderBeacons(enabled); - view->getChild("beacon_width_label")->setEnabled(enabled); - view->getChild("beacon_width")->setEnabled(enabled); - } - - if (check->get()) + if (name == "touch_only") { + LLPipeline::toggleRenderScriptedTouchBeacons(NULL); // Don't allow both to be ON at the same time. Toggle the other one off if both now on. if (LLPipeline::getRenderScriptedTouchBeacons(NULL) && LLPipeline::getRenderScriptedBeacons(NULL) ) { - if (name == "touch_only") - { - LLPipeline::setRenderScriptedBeacons(FALSE); - view->getChild("scripted")->setControlValue(LLSD(FALSE)); - } - else - { - LLPipeline::setRenderScriptedTouchBeacons(FALSE); - view->getChild("touch_only")->setControlValue(LLSD(FALSE)); - } + LLPipeline::setRenderScriptedBeacons(FALSE); + getChild("scripted")->setControlValue(LLSD(FALSE)); } } - else + + else if (name == "scripted") + { + LLPipeline::toggleRenderScriptedBeacons(NULL); + // Don't allow both to be ON at the same time. Toggle the other one off if both now on. + if (LLPipeline::getRenderScriptedTouchBeacons(NULL) && + LLPipeline::getRenderScriptedBeacons(NULL) ) + { + LLPipeline::setRenderScriptedTouchBeacons(FALSE); + getChild("touch_only")->setControlValue(LLSD(FALSE)); + } + } + else if (name == "physical") LLPipeline::setRenderPhysicalBeacons(check->get()); + else if (name == "sounds") LLPipeline::setRenderSoundBeacons(check->get()); + else if (name == "particles") LLPipeline::setRenderParticleBeacons(check->get()); + else if (name == "moapbeacon") LLPipeline::setRenderMOAPBeacons(check->get()); + else if (name == "highlights") { + LLPipeline::toggleRenderHighlights(NULL); // Don't allow both to be OFF at the same time. Toggle the other one on if both now off. if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL)) { - if (name == "highlights") - { - LLPipeline::setRenderBeacons(TRUE); - view->getChild("beacons")->setControlValue(LLSD(TRUE)); - view->getChild("beacon_width_label")->setEnabled(TRUE); - view->getChild("beacon_width")->setEnabled(TRUE); - } - else - { - LLPipeline::setRenderHighlights(TRUE); - view->getChild("highlights")->setControlValue(LLSD(TRUE)); - } + LLPipeline::setRenderBeacons(TRUE); + getChild("beacons")->setControlValue(LLSD(TRUE)); + } + } + else if (name == "beacons") + { + LLPipeline::toggleRenderBeacons(NULL); + // Don't allow both to be OFF at the same time. Toggle the other one on if both now off. + if (!LLPipeline::getRenderBeacons(NULL) && + !LLPipeline::getRenderHighlights(NULL)) + { + LLPipeline::setRenderHighlights(TRUE); + getChild("highlights")->setControlValue(LLSD(TRUE)); } } } diff --git a/indra/newview/llfloaterbeacons.h b/indra/newview/llfloaterbeacons.h index c7a7b8803..03ec20d41 100644 --- a/indra/newview/llfloaterbeacons.h +++ b/indra/newview/llfloaterbeacons.h @@ -46,11 +46,10 @@ public: // Needed to make the floater visibility toggle the beacons. /*virtual*/ void open(); /*virtual*/ void close(bool app_quitting); + void onClickUICheck(LLUICtrl *ctrl); private: LLFloaterBeacons(const LLSD& seed); - - static void onClickUICheck(LLUICtrl *ctrl, void* data); }; #endif diff --git a/indra/newview/skins/default/xui/en-us/floater_beacons.xml b/indra/newview/skins/default/xui/en-us/floater_beacons.xml index ff9ed0b0a..68724ff1e 100644 --- a/indra/newview/skins/default/xui/en-us/floater_beacons.xml +++ b/indra/newview/skins/default/xui/en-us/floater_beacons.xml @@ -3,23 +3,68 @@ width="250" height="255" name="beacons" title="Beacons" rect_control="FloaterBeaconsRect" control_name="ShowBeaconsFloater"> - - - - - - - - - - - Beacon Width: - - - + + + + + + + + + + Beacon Width: + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/es/floater_beacons.xml b/indra/newview/skins/default/xui/es/floater_beacons.xml index 87b1124b8..0047f7166 100644 --- a/indra/newview/skins/default/xui/es/floater_beacons.xml +++ b/indra/newview/skins/default/xui/es/floater_beacons.xml @@ -1,16 +1,17 @@ - - - - - - - - - - Ancho de la Baliza: - - + + + + + Ancho de la Baliza: + + + + + + + + diff --git a/indra/newview/skins/default/xui/fr/floater_beacons.xml b/indra/newview/skins/default/xui/fr/floater_beacons.xml index f6e4f1b37..ce05f433e 100644 --- a/indra/newview/skins/default/xui/fr/floater_beacons.xml +++ b/indra/newview/skins/default/xui/fr/floater_beacons.xml @@ -1,16 +1,16 @@ - - - - - - - - - - Largeur de la balise : - + + + + Largeur de la balise : + + + + + + + diff --git a/indra/newview/skins/default/xui/pt/floater_beacons.xml b/indra/newview/skins/default/xui/pt/floater_beacons.xml index edd1e0809..6b53e003d 100644 --- a/indra/newview/skins/default/xui/pt/floater_beacons.xml +++ b/indra/newview/skins/default/xui/pt/floater_beacons.xml @@ -1,15 +1,16 @@ - - - - - Largura da Baliza + + + + + +