From f30cc7b5bb79aae6f012f04f54b461fdb7ee3f64 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 21 Sep 2021 00:17:05 +0300 Subject: =?UTF-8?q?Revert=20"SL-11841=20make=20=E2=80=98Push=20to=20talk?= =?UTF-8?q?=E2=80=99=20the=20default=20setting"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commits: 126877bc5ba45ff6b0b31368c55f894a0beaf5bf b661f62a7ad4dad9806eda8f4c8f2c9d64b3efbb ce660c7e7bb6e19a23d634fb6d3249330bf2d74c --- indra/newview/llappviewer.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 573cca248c..ecd62cadf8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4562,6 +4562,11 @@ void LLAppViewer::loadKeyBindings() LLKeyboard::keyFromString(key_string, &key); } + value = gSavedSettings.getBOOL("PushToTalkToggle"); + std::string control_name = value ? "toggle_voice" : "voice_follow_key"; + third_person_view.registerControl(control_name, 0, mouse, key, MASK_NONE, true); + sitting_view.registerControl(control_name, 0, mouse, key, MASK_NONE, true); + if (third_person_view.hasUnsavedChanges()) { // calls loadBindingsXML() @@ -4573,6 +4578,25 @@ void LLAppViewer::loadKeyBindings() // calls loadBindingsXML() sitting_view.saveToSettings(); } + + // in case of voice we need to repeat this in other modes + + for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i) + { + // edit and first person modes; MODE_SAVED_SETTINGS not in use at the moment + if (i != LLKeyConflictHandler::MODE_THIRD_PERSON && i != LLKeyConflictHandler::MODE_SITTING) + { + LLKeyConflictHandler handler((LLKeyConflictHandler::ESourceMode)i); + + handler.registerControl(control_name, 0, mouse, key, MASK_NONE, true); + + if (handler.hasUnsavedChanges()) + { + // calls loadBindingsXML() + handler.saveToSettings(); + } + } + } } // since something might have gone wrong or there might have been nothing to save // (and because otherwise following code will have to be encased in else{}), -- cgit v1.2.3