diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f1d5c93d8..4189c9924 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -497,6 +497,19 @@ IsCOA 1 + AOSwimForced + + Comment + Sets AOSwimEnabled to true, and plays swims instead of flies, even if not underwater. + Persist + 1 + Type + Boolean + Value + 0 + IsCOA + 1 + AONoStandsInMouselook Comment diff --git a/indra/newview/floaterao.cpp b/indra/newview/floaterao.cpp index 7b2618dd8..7df3387fb 100644 --- a/indra/newview/floaterao.cpp +++ b/indra/newview/floaterao.cpp @@ -460,12 +460,20 @@ AOSystem::AOSystem() #undef BASIC_OVERRIDE #undef ANY_OVERRIDE - sSwimming = is_underwater(); + auto swim_forced = gSavedSettings.getControl("AOSwimForced"); + sSwimming = swim_forced->get().asBoolean() || is_underwater(); mConnections[0] = gSavedSettings.getControl("AOSitsEnabled")->getSignal()->connect([this](LLControlVariable*, const LLSD& val) { if (!isAgentAvatarValid() || !gAgentAvatarp->isSitting()) return; gAgent.sendAnimationRequest(mAOOverrides[getSitType()]->ao_id, val.asBoolean() ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); }); - mConnections[1] = gSavedSettings.getControl("AOSwimEnabled")->getSignal()->connect(boost::bind(&AOSystem::toggleSwim, this, boost::bind(is_underwater))); + const auto& swim_cb = [=](LLControlVariable*, const LLSD&){ toggleSwim(swim_forced->get().asBoolean() || is_underwater()); }; + auto swim_enabled = gSavedSettings.getControl("AOSwimEnabled"); + mConnections[1] = swim_enabled->getSignal()->connect(swim_cb); + mConnections[2] = swim_forced->getSignal()->connect([swim_cb, swim_enabled](LLControlVariable*, const LLSD& val) { + if (val.asBoolean()) // Automatically enable Swim AO. + swim_enabled->set(true); + swim_cb(nullptr, LLSD()); + }); } AOSystem::~AOSystem() diff --git a/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml b/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml index 50a6c6db6..65d7640d6 100644 --- a/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml +++ b/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml @@ -2,9 +2,10 @@ - + +