diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 0f54723867..901a61bbf6 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -63,6 +63,7 @@ AOEngine::AOEngine() : { gSavedPerAccountSettings.getControl("UseAO")->getCommitSignal()->connect(boost::bind(&AOEngine::onToggleAOControl, this)); gSavedPerAccountSettings.getControl("UseAOStands")->getCommitSignal()->connect(boost::bind(&AOEngine::onToggleAOStandsControl, this)); + gSavedPerAccountSettings.getControl("PauseAO")->getCommitSignal()->connect(boost::bind(&AOEngine::onPauseAO, this)); mRegionChangeConnection = gAgent.addRegionChangedCallback(boost::bind(&AOEngine::onRegionChange, this)); } @@ -117,6 +118,15 @@ void AOEngine::onToggleAOStandsControl() enableStands(gSavedPerAccountSettings.getBOOL("UseAOStands")); } +void AOEngine::onPauseAO() +{ + // can't use mEnabled here as that gets switched over by enable() + if (gSavedPerAccountSettings.getBOOL("UseAO")) + { + enable(!gSavedPerAccountSettings.getBOOL("PauseAO")); + } +} + void AOEngine::clear(bool from_timer) { mOldSets.insert(mOldSets.end(), mSets.begin(), mSets.end()); diff --git a/indra/newview/aoengine.h b/indra/newview/aoengine.h index 2bfb85d10b..23b6dd9ba3 100644 --- a/indra/newview/aoengine.h +++ b/indra/newview/aoengine.h @@ -183,6 +183,8 @@ class AOEngine void onToggleAOControl(); void onToggleAOStandsControl(); + void onPauseAO(); + static void onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLAssetType::EType type, void* userdata, S32 status, LLExtStat extStatus); void parseNotecard(const char* buffer); diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index e35efe7f38..267f34b562 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -744,6 +744,17 @@ Value 0 + UseAO + + Comment + Pause the viewer side Animation Overrider + Persist + 0 + Type + Boolean + Value + 0 + UseAOStands Comment diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index c14b11162c..79015fedaf 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -16,7 +16,7 @@ * may be used to endorse or promote products derived from this * software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS AND CONTRIBUTORS “AS IS” + * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS AND CONTRIBUTORS �AS IS� * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS @@ -673,13 +673,28 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge std::string status; if (i >> status) { + // send appropriate enable/disable messages to nearby chat - FIRE-24160 + bool aoWasEnabled = gSavedPerAccountSettings.getBOOL("UseAO"); + if (status == "on") { gSavedPerAccountSettings.setBOOL("UseAO", TRUE); + + // send appropriate enable/disable messages to nearby chat - FIRE-24160 + if (!aoWasEnabled) + { + report_to_nearby_chat(LLTrans::getString("FSAOEnabled")); + } } else if (status == "off") { gSavedPerAccountSettings.setBOOL("UseAO", FALSE); + + // send appropriate enable/disable messages to nearby chat - FIRE-24160 + if (aoWasEnabled) + { + report_to_nearby_chat(LLTrans::getString("FSAODisabled")); + } } else if (status == "sit") { diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index 380abb2ad5..9294f9850e 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -316,18 +316,31 @@ bool FSLSLBridge::lslToViewer(const std::string& message, const LLUUID& fromID, } if (tag == " do nothing when the FS AO is disabled + if (!gSavedPerAccountSettings.getBOOL("UseAO")) + { + return true; + } + status = true; size_t valuepos = message.find(FS_STATE_ATTRIBUTE); if (valuepos != std::string::npos) { + // send appropriate enable/disable messages to nearby chat - FIRE-24160 + bool aoWasPaused = gSavedPerAccountSettings.getBOOL("PauseAO"); + bool aoStandsWasEnabled = gSavedPerAccountSettings.getBOOL("UseAOStands"); + // + if (message.substr(valuepos + FS_STATE_ATTRIBUTE.size(), 2) == "on") { - gSavedPerAccountSettings.setBOOL("UseAO", TRUE); + // Pause AO via bridge instead of switch AO on or off - FIRE-9305 + gSavedPerAccountSettings.setBOOL("PauseAO", FALSE); gSavedPerAccountSettings.setBOOL("UseAOStands", TRUE); } else if (message.substr(valuepos + FS_STATE_ATTRIBUTE.size(), 3) == "off") { - gSavedPerAccountSettings.setBOOL("UseAO", FALSE); + // Pause AO via bridge instead of switch AO on or off - FIRE-9305 + gSavedPerAccountSettings.setBOOL("PauseAO", TRUE); } else if (message.substr(valuepos + FS_STATE_ATTRIBUTE.size(), 7) == "standon") { @@ -341,6 +354,41 @@ bool FSLSLBridge::lslToViewer(const std::string& message, const LLUUID& fromID, { LL_WARNS("FSLSLBridge") << "AO control - Received unknown state" << LL_ENDL; } + + // send appropriate enable/disable messages to nearby chat - FIRE-24160 + std::string aoMessage; + + if (aoWasPaused != gSavedPerAccountSettings.getBOOL("PauseAO")) + { + if (aoWasPaused) + { + aoMessage = LLTrans::getString("FSAOResumedScript"); + } + else + { + aoMessage = LLTrans::getString("FSAOPausedScript"); + } + } + + if (aoStandsWasEnabled != gSavedPerAccountSettings.getBOOL("UseAOStands")) + { + if (aoStandsWasEnabled) + { + aoMessage = LLTrans::getString("FSAOStandsPausedScript"); + } + else + { + aoMessage = LLTrans::getString("FSAOStandsResumedScript"); + } + } + + if (!aoMessage.empty()) + { + LLSD args; + args["AO_MESSAGE"] = aoMessage; + LLNotificationsUtil::add("FSAOScriptedNotification", args); + } + // } } // FIRE-962 diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 4845cfc543..be51a1d4f4 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -13609,4 +13609,19 @@ Cannot create inventory item: [NAME] type="notifytip"> Bulk import of Windlights has finished. + + + + FSAOScriptedNotification + +Firestorm Animation Overrider: [AO_MESSAGE] + + + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7122d13ef3..3a4ecc2b0e 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3024,6 +3024,14 @@ Your current position: [AVATAR_POS] NOTICE: One or more scripts have been added to your Firestorm bridge! If you did not expect this message, use the Firestorm 'Avatar/Avatar Health/Recreate Bridge' menu option to re-create your bridge now. NOTICE: Bridge script is using old LSO (16 KB memory limit) instead of new Mono (64 KB memory limit) virtual machine, which creates high probability of stack-heap collision and bridge failure by running out of memory. Please use the Firestorm 'Avatar/Avatar Health/Recreate Bridge' menu option to recreate the bridge. If you'll see this message again - please try again in a different region. + + Firestorm Animation Overrider enabled. + Firestorm Animation Overrider disabled. + Paused by scripted attachment. + Resumed by scripted attachment. + Standing animations paused by scripted attachment. + Standing animations resumed by scripted attachment. + Draw Distance Max Particles