From 2c557ffcfb9e225f0b168c1ce515134a908204c7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 1 Jul 2021 17:04:51 +0300 Subject: SL-15507 Remove no longer used search token and no longer used search URL --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a2933b85a5..e9fe139557 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4723,7 +4723,7 @@ Type String Value - https://search.[GRID]/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + https://search.[GRID]/viewer/[CATEGORY]/?q=[QUERY]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] GuidebookURL -- cgit v1.3 From a93151ac86747145584c3096a45481f37f17928b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 5 Jul 2021 15:58:15 +0300 Subject: SL-15527 remove redundant flag --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llstartup.cpp | 4 ---- 2 files changed, 15 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e9fe139557..10aba07885 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5860,17 +5860,6 @@ Value 0 - LoginAsGod - - Comment - Attempt to login with god powers (Linden accounts only) - Persist - 1 - Type - Boolean - Value - 0 - LoginLocation Comment diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c5d5be3509..077da6caf0 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2214,10 +2214,6 @@ bool idle_startup() // Have the agent start watching the friends list so we can update proxies gAgent.observeFriends(); - if (gSavedSettings.getBOOL("LoginAsGod")) - { - gAgent.requestEnterGodMode(); - } // Start automatic replay if the flag is set. if (gSavedSettings.getBOOL("StatsAutoRun") || gAgentPilot.getReplaySession()) -- cgit v1.3 From 0814ba33222fa86e73ca3e5351175ba4b7b545e8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Jul 2021 17:34:16 +0300 Subject: SL-443 Keybindings: Support reassigment of script interaction button --- indra/newview/app_settings/key_bindings.xml | 8 +++ indra/newview/llkeyconflict.cpp | 58 ++++++++++++++-- indra/newview/llkeyconflict.h | 4 +- indra/newview/lltoolcomp.cpp | 10 ++- indra/newview/lltoolpie.cpp | 2 +- indra/newview/llviewerinput.cpp | 81 +++++++++++++++++++--- indra/newview/llviewerinput.h | 5 +- .../xui/en/control_table_contents_media.xml | 10 +++ 8 files changed, 158 insertions(+), 20 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/key_bindings.xml b/indra/newview/app_settings/key_bindings.xml index 4f6deb1f98..ffc1b2e7cc 100644 --- a/indra/newview/app_settings/key_bindings.xml +++ b/indra/newview/app_settings/key_bindings.xml @@ -33,6 +33,8 @@ + + @@ -127,6 +129,8 @@ + + @@ -224,6 +228,8 @@ + + @@ -251,5 +257,7 @@ + + diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp index d7a17b237e..58a740e16a 100644 --- a/indra/newview/llkeyconflict.cpp +++ b/indra/newview/llkeyconflict.cpp @@ -868,7 +868,7 @@ void LLKeyConflictHandler::resetKeyboardBindings() void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode) { - // These controls are meant to cause conflicts when user tries to assign same control somewhere else + // These placeholds are meant to cause conflict resolution when user tries to assign same control somewhere else // also this can be used to pre-record controls that should not conflict or to assign conflict groups/masks if (load_mode == MODE_FIRST_PERSON) @@ -928,25 +928,73 @@ void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode) registerTemporaryControl("spin_around_ccw_sitting"); registerTemporaryControl("spin_around_cw_sitting"); } + + + // Special case, mouse clicks passed to scripts have 'lowest' piority + // thus do not conflict, everything else has a chance before them + // also in ML they have highest priority, but only when script-grabbed, + // thus do not conflict + // (see AGENT_CONTROL_ML_LBUTTON_DOWN and CONTROL_LBUTTON_DOWN_INDEX) + LLKeyConflict *type_data = &mControlsMap[script_mouse_handler_name]; + type_data->mAssignable = true; + type_data->mConflictMask = U32_MAX - CONFLICT_LMOUSE; } -bool LLKeyConflictHandler::removeConflicts(const LLKeyData &data, const U32 &conlict_mask) +bool LLKeyConflictHandler::removeConflicts(const LLKeyData &data, U32 conlict_mask) { if (conlict_mask == CONFLICT_NOTHING) { // Can't conflict return true; } + + if (data.mMouse == CLICK_LEFT + && data.mMask == MASK_NONE + && data.mKey == KEY_NONE) + { + if ((conlict_mask & CONFLICT_LMOUSE) == 0) + { + // Can't conflict + return true; + } + else + { + // simplify conflict mask + conlict_mask = CONFLICT_LMOUSE; + } + } + else + { + // simplify conflict mask + conlict_mask &= ~CONFLICT_LMOUSE; + } + std::map conflict_list; control_map_t::iterator cntrl_iter = mControlsMap.begin(); control_map_t::iterator cntrl_end = mControlsMap.end(); for (; cntrl_iter != cntrl_end; ++cntrl_iter) { + const U32 cmp_mask = cntrl_iter->second.mConflictMask; + if ((cmp_mask & conlict_mask) == 0) + { + // can't conflict + continue; + } S32 index = cntrl_iter->second.mKeyBind.findKeyData(data); - if (index >= 0 - && cntrl_iter->second.mConflictMask != CONFLICT_NOTHING - && (cntrl_iter->second.mConflictMask & conlict_mask) != 0) + if (index >= 0) { + if (cmp_mask != U32_MAX) + { + const LLKeyData cmp_data = cntrl_iter->second.mKeyBind.getKeyData(index); + if ((cmp_mask & CONFLICT_LMOUSE) == 0 + && cmp_data.mMouse == CLICK_LEFT + && cmp_data.mMask == MASK_NONE + && cmp_data.mKey == KEY_NONE) + { + // Does not conflict + continue; + } + } if (cntrl_iter->second.mAssignable) { // Potentially we can have multiple conflict flags conflicting diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h index 2926ca3aeb..e78d2fa33b 100644 --- a/indra/newview/llkeyconflict.h +++ b/indra/newview/llkeyconflict.h @@ -66,6 +66,7 @@ public: }; const U32 CONFLICT_NOTHING = 0; + const U32 CONFLICT_LMOUSE = 0x1 << 1; // at the moment this just means that key will conflict with everything that is identical const U32 CONFLICT_ANY = U32_MAX; @@ -145,6 +146,7 @@ private: // at the moment these kind of control is not savable, but takes part in conflict resolution void registerTemporaryControl(const std::string &control_name, EMouseClickType mouse_ind, KEY key, MASK mask, U32 conflict_mask); + // conflict mask 0 means that any conflicts will be ignored void registerTemporaryControl(const std::string &control_name, U32 conflict_mask = 0); typedef std::map control_map_t; @@ -152,7 +154,7 @@ private: bool loadFromSettings(const ESourceMode &load_mode, const std::string &filename, control_map_t *destination); void generatePlaceholders(ESourceMode load_mode); //E.x. non-assignable values // returns false in case user is trying to reuse control that can't be reassigned - bool removeConflicts(const LLKeyData &data, const U32 &conlict_mask); + bool removeConflicts(const LLKeyData &data, U32 conlict_mask); // removes flags and removes temporary file, returns 'true' if file was removed bool clearUnsavedChanges(); diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index f9c327b46e..9ac1810964 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -44,6 +44,7 @@ #include "lltoolmgr.h" #include "lltoolselectrect.h" #include "lltoolplacer.h" +#include "llviewerinput.h" #include "llviewermenu.h" #include "llviewerobject.h" #include "llviewerwindow.h" @@ -743,7 +744,7 @@ BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask) BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask) { // if the left button is grabbed, don't put up the pie menu - if (gAgent.leftButtonGrabbed()) + if (gAgent.leftButtonGrabbed() && gViewerInput.isLMouseHandlingDefault(MODE_FIRST_PERSON)) { gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); return FALSE; @@ -760,7 +761,7 @@ BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask) { // if the left button is grabbed, don't put up the pie menu - if (gAgent.leftButtonGrabbed()) + if (gAgent.leftButtonGrabbed() && gViewerInput.isLMouseHandlingDefault(MODE_FIRST_PERSON)) { gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); return FALSE; @@ -794,7 +795,10 @@ BOOL LLToolCompGun::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolCompGun::handleMouseUp(S32 x, S32 y, MASK mask) { - gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP); + if (gViewerInput.isLMouseHandlingDefault(MODE_FIRST_PERSON)) + { + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP); + } setCurrentTool( (LLTool*) mGun ); return TRUE; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 322d0bc727..543a93bf9b 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -746,7 +746,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) else if (!mMouseOutsideSlop && mMouseButtonDown // disable camera steering if click on land is not used for moving - && gViewerInput.isMouseBindUsed(CLICK_LEFT)) + && gViewerInput.isMouseBindUsed(CLICK_LEFT, MASK_NONE, MODE_THIRD_PERSON)) { S32 delta_x = x - mMouseDownX; S32 delta_y = y - mMouseDownY; diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index f269be035e..f163e871c3 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -61,7 +61,7 @@ const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed const LLKeyData agent_control_lbutton(CLICK_LEFT, KEY_NONE, MASK_NONE, true); struct LLKeyboardActionRegistry -: public LLRegistrySingleton, LLKeyboardActionRegistry> +: public LLRegistrySingleton, LLKeyboardActionRegistry> { LLSINGLETON_EMPTY_CTOR(LLKeyboardActionRegistry); }; @@ -836,7 +836,49 @@ bool voice_follow_key(EKeystate s) return false; } -bool agen_control_lbutton_handle(EKeystate s) +bool sript_trigger_lbutton(EKeystate s) +{ + // Check for script overriding/expecting left mouse button. + // Note that this does not pass event further and depends onto mouselook. + // Checks CONTROL_ML_LBUTTON_DOWN_INDEX for mouselook, + // CONTROL_LBUTTON_DOWN_INDEX for normal camera + if (gAgent.leftButtonGrabbed()) + { + bool mouselook = gAgentCamera.cameraMouselook(); + switch (s) + { + case KEYSTATE_DOWN: + // at the moment sript_trigger_lbutton is only intended for mouselook + // but handling other modes just in case + if (mouselook) + { + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); + } + else + { + gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN); + } + return true; + case KEYSTATE_UP: + if (mouselook) + { + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP); + } + else + { + gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP); + } + return true; + default: + break; + } + } + return false; +} + +// Used by scripts, for overriding/handling left mouse button +// see mControlsTakenCount +bool agent_control_lbutton_handle(EKeystate s) { switch (s) { @@ -905,6 +947,7 @@ REGISTER_KEYBOARD_ACTION("teleport_to", teleport_to); REGISTER_KEYBOARD_ACTION("walk_to", walk_to); REGISTER_KEYBOARD_ACTION("toggle_voice", toggle_voice); REGISTER_KEYBOARD_ACTION("voice_follow_key", voice_follow_key); +REGISTER_KEYBOARD_ACTION(script_mouse_handler_name, sript_trigger_lbutton); #undef REGISTER_KEYBOARD_ACTION LLViewerInput::LLViewerInput() @@ -1104,6 +1147,20 @@ BOOL LLViewerInput::bindMouse(const S32 mode, const EMouseClickType mouse, const typedef boost::function function_t; function_t function = NULL; + if (mouse == CLICK_LEFT + && mask == MASK_NONE + && function_name == script_mouse_handler_name) + { + // Special case + // Left click has script overrides and by default + // is handled via agent_control_lbutton as last option + // In case of mouselook and present overrides it has highest + // priority even over UI and is handled in LLToolCompGun::handleMouseDown + // so just mark it as having default handler + mLMouseDefaultHandling[mode] = true; + return TRUE; + } + function_t* result = LLKeyboardActionRegistry::getValue(function_name); if (result) { @@ -1164,6 +1221,7 @@ void LLViewerInput::resetBindings() { mKeyBindings[i].clear(); mMouseBindings[i].clear(); + mLMouseDefaultHandling[i] = false; } } @@ -1355,13 +1413,14 @@ bool LLViewerInput::scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level) if (!res && agent_control_lbutton.canHandle(CLICK_NONE, key, mask)) { + // pass mouse left button press to script if (key_down && !repeat) { - res = agen_control_lbutton_handle(KEYSTATE_DOWN); + res = agent_control_lbutton_handle(KEYSTATE_DOWN); } if (key_up) { - res = agen_control_lbutton_handle(KEYSTATE_UP); + res = agent_control_lbutton_handle(KEYSTATE_UP); } } return res; @@ -1481,24 +1540,28 @@ bool LLViewerInput::scanMouse(EMouseClickType click, EMouseState state) const S32 mode = getMode(); MASK mask = gKeyboard->currentMask(TRUE); res = scanMouse(mMouseBindings[mode], mMouseBindings[mode].size(), click, mask, state); + // no user defined actions found or those actions can't handle the key/button, handle control if nessesary - if (!res && agent_control_lbutton.canHandle(click, KEY_NONE, mask)) + // This will pass AGENT_CONTROL_LBUTTON_DOWN to server, no idea why it doesn't do mouselook variant _ML_ + // but it was set this way forever (moved as is from LLTool::handleMouseDown) so lots of scripts probably + // rely on this. + if (!res && mLMouseDefaultHandling[mode] && agent_control_lbutton.canHandle(click, KEY_NONE, mask)) { switch (state) { case MOUSE_STATE_DOWN: - agen_control_lbutton_handle(KEYSTATE_DOWN); + agent_control_lbutton_handle(KEYSTATE_DOWN); res = true; break; case MOUSE_STATE_CLICK: // might not work best with some functions, // but some function need specific states too specifically - agen_control_lbutton_handle(KEYSTATE_DOWN); - agen_control_lbutton_handle(KEYSTATE_UP); + agent_control_lbutton_handle(KEYSTATE_DOWN); + agent_control_lbutton_handle(KEYSTATE_UP); res = true; break; case MOUSE_STATE_UP: - agen_control_lbutton_handle(KEYSTATE_UP); + agent_control_lbutton_handle(KEYSTATE_UP); res = true; break; default: diff --git a/indra/newview/llviewerinput.h b/indra/newview/llviewerinput.h index 281a209896..32dd3c0e28 100644 --- a/indra/newview/llviewerinput.h +++ b/indra/newview/llviewerinput.h @@ -31,6 +31,7 @@ #include "llinitparam.h" const S32 MAX_KEY_BINDINGS = 128; // was 60 +const std::string script_mouse_handler_name = "sript_trigger_lbutton"; class LLNamedFunction { @@ -124,7 +125,8 @@ public: BOOL handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down); void scanMouse(); - bool isMouseBindUsed(const EMouseClickType mouse, const MASK mask = MASK_NONE, const S32 mode = MODE_THIRD_PERSON); + bool isMouseBindUsed(const EMouseClickType mouse, const MASK mask, const S32 mode); + bool isLMouseHandlingDefault(const S32 mode) { return mLMouseDefaultHandling[mode]; } private: bool scanKey(const std::vector &binding, @@ -163,6 +165,7 @@ private: // to send what we think function wants based on collection of bools (mKeyRepeated, mKeyLevel, mKeyDown) std::vector mKeyBindings[MODE_COUNT]; std::vector mMouseBindings[MODE_COUNT]; + bool mLMouseDefaultHandling[MODE_COUNT]; // Due to having special priority typedef std::map key_remap_t; key_remap_t mRemapKeys[MODE_COUNT]; diff --git a/indra/newview/skins/default/xui/en/control_table_contents_media.xml b/indra/newview/skins/default/xui/en/control_table_contents_media.xml index ce5d3556b6..a97c45dd6f 100644 --- a/indra/newview/skins/default/xui/en/control_table_contents_media.xml +++ b/indra/newview/skins/default/xui/en/control_table_contents_media.xml @@ -73,4 +73,14 @@ name="lst_action" value="Start Gesture" /> + + + -- cgit v1.3 From 48921a62322bd4eae17d1085256693aa66041dbd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Jul 2021 20:22:53 +0300 Subject: SL-443 Keybindings: Backward compatibility --- indra/newview/app_settings/key_bindings.xml | 2 +- indra/newview/llkeyconflict.cpp | 22 ++++++++++++++++++++++ indra/newview/llkeyconflict.h | 4 ++-- indra/newview/llviewerinput.cpp | 13 ++++++++++++- indra/newview/llviewerinput.h | 2 +- 5 files changed, 38 insertions(+), 5 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/key_bindings.xml b/indra/newview/app_settings/key_bindings.xml index ffc1b2e7cc..5c32ed9afd 100644 --- a/indra/newview/app_settings/key_bindings.xml +++ b/indra/newview/app_settings/key_bindings.xml @@ -1,5 +1,5 @@ - + diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp index 58a740e16a..3d3d652aa3 100644 --- a/indra/newview/llkeyconflict.cpp +++ b/indra/newview/llkeyconflict.cpp @@ -376,6 +376,22 @@ bool LLKeyConflictHandler::loadFromSettings(const ESourceMode &load_mode, const LL_ERRS() << "Not implememted mode " << load_mode << LL_ENDL; break; } + + // verify version + if (keys.version < 1) + { + // Updating from a version that was not aware of LMouse bindings. + // Assign defaults. + // + // mDefaultsMap is always going to have correct version so + // registerControl is usable, but using 'destination' just in case. + LLKeyConflict &type_data = (*destination)[script_mouse_handler_name]; + LLKeyData data(CLICK_LEFT, KEY_NONE, MASK_NONE, true); + type_data.mKeyBind.replaceKeyData(data, 0); + + // Mark this mode for an update + mHasUnsavedChanges = true; + } } return res; } @@ -416,6 +432,12 @@ void LLKeyConflictHandler::loadFromSettings(ESourceMode load_mode) } } mLoadMode = load_mode; + + if (mHasUnsavedChanges) + { + // We ended up with some settings assigned due to changes in version, resave + saveToSettings(false); + } } void LLKeyConflictHandler::saveToSettings(bool temporary) diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h index e78d2fa33b..e60d6d27b7 100644 --- a/indra/newview/llkeyconflict.h +++ b/indra/newview/llkeyconflict.h @@ -129,14 +129,14 @@ public: // resets current mode to defaults void resetToDefaults(); - bool empty() { return mControlsMap.empty(); } + bool empty() const { return mControlsMap.empty(); } void clear(); // reloads bindings from last valid user's xml or from default xml // to keyboard's handler static void resetKeyboardBindings(); - bool hasUnsavedChanges() { return mHasUnsavedChanges; } + bool hasUnsavedChanges() const { return mHasUnsavedChanges; } void setLoadMode(ESourceMode mode) { mLoadMode = mode; } ESourceMode getLoadMode() { return mLoadMode; } diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index f163e871c3..dff199d791 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -1212,7 +1212,8 @@ LLViewerInput::Keys::Keys() : first_person("first_person"), third_person("third_person"), sitting("sitting"), - edit_avatar("edit_avatar") + edit_avatar("edit_avatar"), + version("version", 0) {} void LLViewerInput::resetBindings() @@ -1240,6 +1241,16 @@ S32 LLViewerInput::loadBindingsXML(const std::string& filename) binding_count += loadBindingMode(keys.third_person, MODE_THIRD_PERSON); binding_count += loadBindingMode(keys.sitting, MODE_SITTING); binding_count += loadBindingMode(keys.edit_avatar, MODE_EDIT_AVATAR); + + // verify version + if (keys.version < 1) + { + // updating from a version that was not aware of LMouse bindings + for (S32 i = 0; i < MODE_COUNT; i++) + { + mLMouseDefaultHandling[i] = true; + } + } } return binding_count; } diff --git a/indra/newview/llviewerinput.h b/indra/newview/llviewerinput.h index 32dd3c0e28..5340ec5fd0 100644 --- a/indra/newview/llviewerinput.h +++ b/indra/newview/llviewerinput.h @@ -101,7 +101,7 @@ public: third_person, sitting, edit_avatar; - + Optional version; Keys(); }; -- cgit v1.3 From e7563ff13fe1e6e77a0c6de5dcf0c1b67a6d2e2c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Jul 2021 20:28:26 +0300 Subject: SL-443 Keybindings: Backward compatibility #2 --- indra/newview/app_settings/key_bindings.xml | 10 +++--- indra/newview/llkeyconflict.cpp | 37 +++++++--------------- indra/newview/llkeyconflict.h | 4 +-- indra/newview/llviewerinput.cpp | 12 +++---- indra/newview/llviewerinput.h | 9 +++--- .../xui/en/control_table_contents_media.xml | 4 +-- 6 files changed, 30 insertions(+), 46 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/key_bindings.xml b/indra/newview/app_settings/key_bindings.xml index 5c32ed9afd..e527b7f1df 100644 --- a/indra/newview/app_settings/key_bindings.xml +++ b/indra/newview/app_settings/key_bindings.xml @@ -1,5 +1,5 @@ - + @@ -34,7 +34,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -258,6 +258,6 @@ - + diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp index 3d3d652aa3..86f3e2fc37 100644 --- a/indra/newview/llkeyconflict.cpp +++ b/indra/newview/llkeyconflict.cpp @@ -378,7 +378,7 @@ bool LLKeyConflictHandler::loadFromSettings(const ESourceMode &load_mode, const } // verify version - if (keys.version < 1) + if (keys.xml_version < 1) { // Updating from a version that was not aware of LMouse bindings. // Assign defaults. @@ -389,7 +389,8 @@ bool LLKeyConflictHandler::loadFromSettings(const ESourceMode &load_mode, const LLKeyData data(CLICK_LEFT, KEY_NONE, MASK_NONE, true); type_data.mKeyBind.replaceKeyData(data, 0); - // Mark this mode for an update + // Mark this mode for an update, once user clicks 'OK' in preferences + // it should get saved mHasUnsavedChanges = true; } } @@ -432,12 +433,6 @@ void LLKeyConflictHandler::loadFromSettings(ESourceMode load_mode) } } mLoadMode = load_mode; - - if (mHasUnsavedChanges) - { - // We ended up with some settings assigned due to changes in version, resave - saveToSettings(false); - } } void LLKeyConflictHandler::saveToSettings(bool temporary) @@ -597,6 +592,8 @@ void LLKeyConflictHandler::saveToSettings(bool temporary) break; } + keys.xml_version.set(keybindings_xml_version, true); + if (temporary) { // write to temporary xml and use it for gViewerInput @@ -821,9 +818,9 @@ void LLKeyConflictHandler::resetToDefault(const std::string &control_name) resetToDefaultAndResolve(control_name, false); } -void LLKeyConflictHandler::resetToDefaults(ESourceMode mode) +void LLKeyConflictHandler::resetToDefaultsAndResolve() { - if (mode == MODE_SAVED_SETTINGS) + if (mLoadMode == MODE_SAVED_SETTINGS) { control_map_t::iterator iter = mControlsMap.begin(); control_map_t::iterator end = mControlsMap.end(); @@ -836,7 +833,7 @@ void LLKeyConflictHandler::resetToDefaults(ESourceMode mode) else { mControlsMap.clear(); - generatePlaceholders(mode); + generatePlaceholders(mLoadMode); mControlsMap.insert(mDefaultsMap.begin(), mDefaultsMap.end()); } @@ -847,7 +844,7 @@ void LLKeyConflictHandler::resetToDefaults() { if (!empty()) { - resetToDefaults(mLoadMode); + resetToDefaultsAndResolve(); } else { @@ -857,7 +854,7 @@ void LLKeyConflictHandler::resetToDefaults() // 3. We are loading 'current' only to replace it // but it is reliable and works Todo: consider optimizing. loadFromSettings(mLoadMode); - resetToDefaults(mLoadMode); + resetToDefaultsAndResolve(); } } @@ -890,7 +887,7 @@ void LLKeyConflictHandler::resetKeyboardBindings() void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode) { - // These placeholds are meant to cause conflict resolution when user tries to assign same control somewhere else + // These placeholders are meant to cause conflict resolution when user tries to assign same control somewhere else // also this can be used to pre-record controls that should not conflict or to assign conflict groups/masks if (load_mode == MODE_FIRST_PERSON) @@ -1005,18 +1002,6 @@ bool LLKeyConflictHandler::removeConflicts(const LLKeyData &data, U32 conlict_ma S32 index = cntrl_iter->second.mKeyBind.findKeyData(data); if (index >= 0) { - if (cmp_mask != U32_MAX) - { - const LLKeyData cmp_data = cntrl_iter->second.mKeyBind.getKeyData(index); - if ((cmp_mask & CONFLICT_LMOUSE) == 0 - && cmp_data.mMouse == CLICK_LEFT - && cmp_data.mMask == MASK_NONE - && cmp_data.mKey == KEY_NONE) - { - // Does not conflict - continue; - } - } if (cntrl_iter->second.mAssignable) { // Potentially we can have multiple conflict flags conflicting diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h index e60d6d27b7..23c1adf1e4 100644 --- a/indra/newview/llkeyconflict.h +++ b/indra/newview/llkeyconflict.h @@ -138,11 +138,11 @@ public: bool hasUnsavedChanges() const { return mHasUnsavedChanges; } void setLoadMode(ESourceMode mode) { mLoadMode = mode; } - ESourceMode getLoadMode() { return mLoadMode; } + ESourceMode getLoadMode() const { return mLoadMode; } private: void resetToDefaultAndResolve(const std::string &control_name, bool ignore_conflicts); - void resetToDefaults(ESourceMode mode); + void resetToDefaultsAndResolve(); // at the moment these kind of control is not savable, but takes part in conflict resolution void registerTemporaryControl(const std::string &control_name, EMouseClickType mouse_ind, KEY key, MASK mask, U32 conflict_mask); diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index dff199d791..1ca7d8024a 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -836,7 +836,7 @@ bool voice_follow_key(EKeystate s) return false; } -bool sript_trigger_lbutton(EKeystate s) +bool script_trigger_lbutton(EKeystate s) { // Check for script overriding/expecting left mouse button. // Note that this does not pass event further and depends onto mouselook. @@ -848,8 +848,6 @@ bool sript_trigger_lbutton(EKeystate s) switch (s) { case KEYSTATE_DOWN: - // at the moment sript_trigger_lbutton is only intended for mouselook - // but handling other modes just in case if (mouselook) { gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); @@ -947,7 +945,7 @@ REGISTER_KEYBOARD_ACTION("teleport_to", teleport_to); REGISTER_KEYBOARD_ACTION("walk_to", walk_to); REGISTER_KEYBOARD_ACTION("toggle_voice", toggle_voice); REGISTER_KEYBOARD_ACTION("voice_follow_key", voice_follow_key); -REGISTER_KEYBOARD_ACTION(script_mouse_handler_name, sript_trigger_lbutton); +REGISTER_KEYBOARD_ACTION(script_mouse_handler_name, script_trigger_lbutton); #undef REGISTER_KEYBOARD_ACTION LLViewerInput::LLViewerInput() @@ -1213,7 +1211,7 @@ LLViewerInput::Keys::Keys() third_person("third_person"), sitting("sitting"), edit_avatar("edit_avatar"), - version("version", 0) + xml_version("xml_version", 0) {} void LLViewerInput::resetBindings() @@ -1243,7 +1241,7 @@ S32 LLViewerInput::loadBindingsXML(const std::string& filename) binding_count += loadBindingMode(keys.edit_avatar, MODE_EDIT_AVATAR); // verify version - if (keys.version < 1) + if (keys.xml_version < 1) { // updating from a version that was not aware of LMouse bindings for (S32 i = 0; i < MODE_COUNT; i++) @@ -1602,7 +1600,7 @@ void LLViewerInput::scanMouse() } } -bool LLViewerInput::isMouseBindUsed(const EMouseClickType mouse, const MASK mask, const S32 mode) +bool LLViewerInput::isMouseBindUsed(const EMouseClickType mouse, const MASK mask, const S32 mode) const { S32 size = mMouseBindings[mode].size(); for (S32 index = 0; index < size; index++) diff --git a/indra/newview/llviewerinput.h b/indra/newview/llviewerinput.h index 5340ec5fd0..b0c53b23ee 100644 --- a/indra/newview/llviewerinput.h +++ b/indra/newview/llviewerinput.h @@ -31,7 +31,8 @@ #include "llinitparam.h" const S32 MAX_KEY_BINDINGS = 128; // was 60 -const std::string script_mouse_handler_name = "sript_trigger_lbutton"; +const S32 keybindings_xml_version = 1; +const std::string script_mouse_handler_name = "script_trigger_lbutton"; class LLNamedFunction { @@ -101,7 +102,7 @@ public: third_person, sitting, edit_avatar; - Optional version; + Optional xml_version; // 'xml', because 'version' appears to be reserved Keys(); }; @@ -125,8 +126,8 @@ public: BOOL handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down); void scanMouse(); - bool isMouseBindUsed(const EMouseClickType mouse, const MASK mask, const S32 mode); - bool isLMouseHandlingDefault(const S32 mode) { return mLMouseDefaultHandling[mode]; } + bool isMouseBindUsed(const EMouseClickType mouse, const MASK mask, const S32 mode) const; + bool isLMouseHandlingDefault(const S32 mode) const { return mLMouseDefaultHandling[mode]; } private: bool scanKey(const std::vector &binding, diff --git a/indra/newview/skins/default/xui/en/control_table_contents_media.xml b/indra/newview/skins/default/xui/en/control_table_contents_media.xml index a97c45dd6f..43e8d730cd 100644 --- a/indra/newview/skins/default/xui/en/control_table_contents_media.xml +++ b/indra/newview/skins/default/xui/en/control_table_contents_media.xml @@ -74,8 +74,8 @@ value="Start Gesture" /> + name="script_trigger_lbutton" + value="script_trigger_lbutton"> Date: Fri, 27 Aug 2021 22:24:57 +0300 Subject: SL-15896 Remove unused PAD_ keys from keybndings On windows PAD_* keys are translated to either arrows or numbers, so PAD_* keybindings remain unused. On MAC QA did not manage to trigger PAD_* and instead got mac specific returns. --- indra/newview/app_settings/key_bindings.xml | 77 ----------------------------- 1 file changed, 77 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/key_bindings.xml b/indra/newview/app_settings/key_bindings.xml index e527b7f1df..55babc88bc 100644 --- a/indra/newview/app_settings/key_bindings.xml +++ b/indra/newview/app_settings/key_bindings.xml @@ -17,17 +17,6 @@ - - - - - - - - - - - @@ -62,19 +51,6 @@ - - - - - - - - - - - - - @@ -90,15 +66,6 @@ - - - - - - - - - @@ -106,9 +73,6 @@ - - - @@ -120,13 +84,6 @@ - - - - - - - @@ -172,16 +129,6 @@ - - - - - - - - - - @@ -197,15 +144,6 @@ - - - - - - - - - @@ -217,13 +155,6 @@ - - - - - - - @@ -247,14 +178,6 @@ - - - - - - - - -- cgit v1.3 From a09686bf547e3384ec3f409f20023c16c69e7e9c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 1 Mar 2022 21:40:12 +0200 Subject: SL-16953 Deprecated NoInventoryLibrary Due to changes in SL-16715 --- indra/newview/app_settings/cmd_line.xml | 8 -------- indra/newview/app_settings/settings.xml | 2 +- indra/newview/lllogininstance.cpp | 11 +++++------ 3 files changed, 6 insertions(+), 15 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 4e186292f7..3100baf943 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -207,14 +207,6 @@ map-to NoAudio - - - noinvlib - - desc - Do not request the inventory library. - map-to - NoInventoryLibrary nonotifications diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c4037a5144..fa699f9dbd 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7055,7 +7055,7 @@ NoInventoryLibrary Comment - Do not request inventory library. + (Deprecated) Do not request inventory library. Persist 1 Type diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index e81d2cc082..531f0b172d 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -165,13 +165,12 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia //requested_options.append("inventory-meat"); //requested_options.append("inventory-skel-targets"); #if (!defined LL_MINIMIAL_REQUESTED_OPTIONS) - if(FALSE == gSavedSettings.getBOOL("NoInventoryLibrary")) - { - requested_options.append("inventory-lib-root"); - requested_options.append("inventory-lib-owner"); - requested_options.append("inventory-skel-lib"); + + // Not requesting library will trigger mFatalNoLibraryRootFolder + requested_options.append("inventory-lib-root"); + requested_options.append("inventory-lib-owner"); + requested_options.append("inventory-skel-lib"); // requested_options.append("inventory-meat-lib"); - } requested_options.append("initial-outfit"); requested_options.append("gestures"); -- cgit v1.3 From 7c0f49435d118124c543639d117d3b304fadc197 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 8 Mar 2022 19:25:10 +0000 Subject: SL-16950 - handle case that an initial outfit is created in user inventory before first login --- indra/newview/app_settings/settings.xml | 11 ++++++++++ indra/newview/llstartup.cpp | 36 +++++++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 4 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6c36fa6f09..c241d76324 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6964,6 +6964,17 @@ Value 1000 + FakeInitialOutfitName + + Comment + Pretend that this is first time login and specified name was chosen + Persist + 1 + Type + String + Value + + MyOutfitsAutofill Comment diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 79ef0c075e..ebfda64abd 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2706,19 +2706,34 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, gAgentAvatarp->setSex(gender); - // try to find the outfit - if not there, create some default - // wearables. + // try to find the requested outfit or folder + + // -- check for existing outfit in My Outfits + bool do_copy = false; LLUUID cat_id = findDescendentCategoryIDByName( - gInventory.getLibraryRootFolderID(), + gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS), outfit_folder_name); + + // -- check for existing folder in Library + if (cat_id.isNull()) + { + cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + outfit_folder_name); + if (!cat_id.isNull()) + { + do_copy = true; + } + } + if (cat_id.isNull()) { + // -- final fallback: create standard wearables LL_DEBUGS() << "standard wearables" << LL_ENDL; gAgentWearables.createStandardWearables(); } else { - bool do_copy = true; bool do_append = false; LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); // Need to fetch cof contents before we can wear. @@ -3593,6 +3608,19 @@ bool process_login_success_response() } } + std::string fake_initial_outfit_name = gSavedSettings.getString("FakeInitialOutfitName"); + if (!fake_initial_outfit_name.empty()) + { + gAgent.setFirstLogin(TRUE); + sInitialOutfit = fake_initial_outfit_name; + if (sInitialOutfitGender.empty()) + { + sInitialOutfitGender = "female"; // just guess, will get overridden when outfit is worn anyway. + } + + LL_WARNS() << "Faking first-time login with initial outfit " << sInitialOutfit << LL_ENDL; + } + // set the location of the Agent Appearance service, from which we can request // avatar baked textures if they are supported by the current region std::string agent_appearance_url = response["agent_appearance_service"]; -- cgit v1.3