summaryrefslogtreecommitdiff
path: root/indra/newview/llkeyconflict.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-06-12 18:51:13 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-06-23 14:51:29 +0300
commit629cd92c47e90a1fb8711c46bd406476d01e9b9b (patch)
tree1baa0b520a6f8df605733ea8e83066a80c62c66b /indra/newview/llkeyconflict.cpp
parentbcaf860e7e37bd3f0c48be9d4b94e0912d52b3f1 (diff)
SL-13421 Removed camera control keybindings from mouselook
Diffstat (limited to 'indra/newview/llkeyconflict.cpp')
-rw-r--r--indra/newview/llkeyconflict.cpp51
1 files changed, 47 insertions, 4 deletions
diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp
index a94836c59d..be774e7765 100644
--- a/indra/newview/llkeyconflict.cpp
+++ b/indra/newview/llkeyconflict.cpp
@@ -160,7 +160,7 @@ bool LLKeyConflictHandler::canAssignControl(const std::string &control_name)
{
return iter->second.mAssignable;
}
- // If we don't know this control means it wasn't assigned by user yet and thus is editable
+ // If we don't know this control, means it wasn't assigned by user yet and thus is editable
return true;
}
@@ -195,7 +195,8 @@ bool LLKeyConflictHandler::registerControl(const std::string &control_name, U32
LLKeyConflict &type_data = mControlsMap[control_name];
if (!type_data.mAssignable)
{
- LL_ERRS() << "Error in code, user or system should not be able to change certain controls" << LL_ENDL;
+ // Example: user tried to assign camera spin to all modes, but first person mode doesn't support it
+ return false;
}
LLKeyData data(mouse, key, mask, ignore_mask);
if (type_data.mKeyBind.getKeyData(index) == data)
@@ -764,8 +765,43 @@ void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode)
{
// These controls are meant to cause conflicts 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
- /*registerTemporaryControl(CONTROL_RESERVED_MENU, CLICK_RIGHT, KEY_NONE, MASK_NONE, 0);
- registerTemporaryControl(CONTROL_DELETE, CLICK_NONE, KEY_DELETE, MASK_NONE, 0);*/
+
+ if (load_mode == MODE_FIRST_PERSON)
+ {
+ // First person view doesn't support camera controls
+ // Note: might be better idea to just load these from control_table_contents_camera.xml
+ // or to pass from floaterpreferences when it loads said file
+ registerTemporaryControl("look_up");
+ registerTemporaryControl("look_down");
+ registerTemporaryControl("move_forward");
+ registerTemporaryControl("move_backward");
+ registerTemporaryControl("move_forward_fast");
+ registerTemporaryControl("move_backward_fast");
+ registerTemporaryControl("move_forward_sitting");
+ registerTemporaryControl("move_backward_sitting");
+ registerTemporaryControl("spin_over");
+ registerTemporaryControl("spin_under");
+ registerTemporaryControl("spin_over_sitting");
+ registerTemporaryControl("spin_under_sitting");
+ registerTemporaryControl("pan_up");
+ registerTemporaryControl("pan_down");
+ registerTemporaryControl("pan_left");
+ registerTemporaryControl("pan_right");
+ registerTemporaryControl("pan_in");
+ registerTemporaryControl("pan_out");
+ registerTemporaryControl("spin_around_ccw");
+ registerTemporaryControl("spin_around_cw");
+ registerTemporaryControl("spin_around_ccw_sitting");
+ registerTemporaryControl("spin_around_cw_sitting");
+
+ // control_table_contents_editing.xml
+ registerTemporaryControl("edit_avatar_spin_ccw");
+ registerTemporaryControl("edit_avatar_spin_cw");
+ registerTemporaryControl("edit_avatar_spin_over");
+ registerTemporaryControl("edit_avatar_spin_under");
+ registerTemporaryControl("edit_avatar_move_forward");
+ registerTemporaryControl("edit_avatar_move_backward");
+ }
}
bool LLKeyConflictHandler::removeConflicts(const LLKeyData &data, const U32 &conlict_mask)
@@ -817,6 +853,13 @@ void LLKeyConflictHandler::registerTemporaryControl(const std::string &control_n
type_data->mKeyBind.addKeyData(mouse, key, mask, false);
}
+void LLKeyConflictHandler::registerTemporaryControl(const std::string &control_name)
+{
+ LLKeyConflict *type_data = &mControlsMap[control_name];
+ type_data->mAssignable = false;
+ type_data->mConflictMask = 0;
+}
+
bool LLKeyConflictHandler::clearUnsavedChanges()
{
bool result = false;