diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-06-12 20:09:43 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-06-12 20:09:43 +0300 |
commit | ceea2df59634ab09d165943bd7591e7125ee0f80 (patch) | |
tree | 4d3e7b2ecacb834f06262f777b7e8e54b1f20366 /indra | |
parent | b1f9de4d377c37d1e97f5ef06cbb438cdc755f6f (diff) |
SL-13421 Separated some sitting-exclusive controls
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llkeyconflict.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llkeyconflict.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/control_table_contents_camera.xml | 62 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/control_table_contents_camera_sitting.xml | 65 |
5 files changed, 95 insertions, 85 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 66f793a82c..dc5905b6e7 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2768,32 +2768,34 @@ void LLPanelPreferenceControls::populateControlTable() } addControlTableColumns(filename); - switch ((LLKeyConflictHandler::ESourceMode)mEditingMode) + + if (mEditingMode == LLKeyConflictHandler::MODE_FIRST_PERSON) { - case LLKeyConflictHandler::MODE_FIRST_PERSON: addControlTableRows("control_table_contents_movement.xml"); addControlTableSeparator(); addControlTableRows("control_table_contents_media.xml"); - break; - case LLKeyConflictHandler::MODE_THIRD_PERSON: - case LLKeyConflictHandler::MODE_EDIT_AVATAR: - case LLKeyConflictHandler::MODE_SITTING: + } + // MODE_THIRD_PERSON; MODE_EDIT_AVATAR; MODE_SITTING + else if (mEditingMode < LLKeyConflictHandler::MODE_SAVED_SETTINGS) + { + // In case of 'sitting' mode, movements still apply due to vehicles addControlTableRows("control_table_contents_movement.xml"); addControlTableSeparator(); - // contains couple 'sitting' options, might be good idea to recheck - // those and move to own group with sitting/spinning icon - addControlTableRows("control_table_contents_camera.xml"); + addControlTableRows("control_table_contents_camera.xml"); + if (mEditingMode == LLKeyConflictHandler::MODE_SITTING) + { + addControlTableRows("control_table_contents_camera_sitting.xml"); + } addControlTableSeparator(); - // Do we need this outside of MODE_EDIT_AVATAR? addControlTableRows("control_table_contents_editing.xml"); addControlTableSeparator(); addControlTableRows("control_table_contents_media.xml"); - break; - default: - // 'saved settings' mode doesn't have UI or actual settings yet + } + else + { LL_INFOS() << "Unimplemented mode" << LL_ENDL; return; } diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp index be774e7765..e44f79000e 100644 --- a/indra/newview/llkeyconflict.cpp +++ b/indra/newview/llkeyconflict.cpp @@ -294,8 +294,9 @@ void LLKeyConflictHandler::loadFromSettings(const LLViewerInput::KeyMode& keymod LLKeyboard::maskFromString(it->mask, &mask); // Note: it->command is also the name of UI element, howhever xml we are loading from // might not know all the commands, so UI will have to know what to fill by its own + // Assumes U32_MAX conflict mask, and is assignable by default, + // but assignability might have been overriden by generatePlaceholders. LLKeyConflict &type_data = (*destination)[it->command]; - type_data.mAssignable = true; type_data.mKeyBind.addKeyData(mouse, key, mask, true); } } @@ -777,12 +778,8 @@ void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode) 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"); @@ -791,8 +788,6 @@ void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode) 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"); @@ -802,6 +797,16 @@ void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode) registerTemporaryControl("edit_avatar_move_forward"); registerTemporaryControl("edit_avatar_move_backward"); } + + if (load_mode != MODE_SITTING) + { + registerTemporaryControl("move_forward_sitting"); + registerTemporaryControl("move_backward_sitting"); + registerTemporaryControl("spin_over_sitting"); + registerTemporaryControl("spin_under_sitting"); + registerTemporaryControl("spin_around_ccw_sitting"); + registerTemporaryControl("spin_around_cw_sitting"); + } } bool LLKeyConflictHandler::removeConflicts(const LLKeyData &data, const U32 &conlict_mask) @@ -853,11 +858,11 @@ void LLKeyConflictHandler::registerTemporaryControl(const std::string &control_n type_data->mKeyBind.addKeyData(mouse, key, mask, false); } -void LLKeyConflictHandler::registerTemporaryControl(const std::string &control_name) +void LLKeyConflictHandler::registerTemporaryControl(const std::string &control_name, U32 conflict_mask) { LLKeyConflict *type_data = &mControlsMap[control_name]; type_data->mAssignable = false; - type_data->mConflictMask = 0; + type_data->mConflictMask = conflict_mask; } bool LLKeyConflictHandler::clearUnsavedChanges() diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h index 1bb29bc302..73d59cc217 100644 --- a/indra/newview/llkeyconflict.h +++ b/indra/newview/llkeyconflict.h @@ -127,7 +127,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); - void registerTemporaryControl(const std::string &control_name); + void registerTemporaryControl(const std::string &control_name, U32 conflict_mask = 0); typedef std::map<std::string, LLKeyConflict> control_map_t; void loadFromSettings(const LLViewerInput::KeyMode& keymode, control_map_t *destination); diff --git a/indra/newview/skins/default/xui/en/control_table_contents_camera.xml b/indra/newview/skins/default/xui/en/control_table_contents_camera.xml index 35cbb02271..aba81e3134 100644 --- a/indra/newview/skins/default/xui/en/control_table_contents_camera.xml +++ b/indra/newview/skins/default/xui/en/control_table_contents_camera.xml @@ -74,26 +74,6 @@ value="Camera Backward Fast" /> </rows> <rows - name="move_forward_sitting" - value="move_forward_sitting"> - <columns - column="lst_action" - font="SansSerif" - halign="left" - name="lst_action" - value="Camera Forward Sitting" /> - </rows> - <rows - name="move_backward_sitting" - value="move_backward_sitting"> - <columns - column="lst_action" - font="SansSerif" - halign="left" - name="lst_action" - value="Camera Backward Sitting" /> - </rows> - <rows name="spin_over" value="spin_over"> <columns @@ -114,26 +94,6 @@ value="Camera Spin Under" /> </rows> <rows - name="spin_over_sitting" - value="spin_over_sitting"> - <columns - column="lst_action" - font="SansSerif" - halign="left" - name="lst_action" - value="Camera Spin Over Sitting" /> - </rows> - <rows - name="spin_under_sitting" - value="spin_under_sitting"> - <columns - column="lst_action" - font="SansSerif" - halign="left" - name="lst_action" - value="Camera Spin Under Sitting" /> - </rows> - <rows name="pan_up" value="pan_up"> <columns @@ -215,26 +175,4 @@ tool_tip="Camera spin around clockwise" value="Clockwise" /> </rows> - <rows - name="spin_around_ccw_sitting" - value="spin_around_ccw_sitting"> - <columns - column="lst_action" - font="SansSerif" - halign="left" - name="lst_action" - tool_tip="Camera spin around counterclockwise sitting" - value="Counterclockwise Sitting" /> - </rows> - <rows - name="spin_around_cw_sitting" - value="spin_around_cw_sitting"> - <columns - column="lst_action" - font="SansSerif" - halign="left" - name="lst_action" - tool_tip="Camera spin around clockwise sitting" - value="Clockwise Sitting" /> - </rows> </contents> diff --git a/indra/newview/skins/default/xui/en/control_table_contents_camera_sitting.xml b/indra/newview/skins/default/xui/en/control_table_contents_camera_sitting.xml new file mode 100644 index 0000000000..9334c6e179 --- /dev/null +++ b/indra/newview/skins/default/xui/en/control_table_contents_camera_sitting.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<contents> + <rows + name="move_forward_sitting" + value="move_forward_sitting"> + <columns + column="lst_action" + font="SansSerif" + halign="left" + name="lst_action" + value="Camera Forward Sitting" /> + </rows> + <rows + name="move_backward_sitting" + value="move_backward_sitting"> + <columns + column="lst_action" + font="SansSerif" + halign="left" + name="lst_action" + value="Camera Backward Sitting" /> + </rows> + <rows + name="spin_over_sitting" + value="spin_over_sitting"> + <columns + column="lst_action" + font="SansSerif" + halign="left" + name="lst_action" + value="Camera Spin Over Sitting" /> + </rows> + <rows + name="spin_under_sitting" + value="spin_under_sitting"> + <columns + column="lst_action" + font="SansSerif" + halign="left" + name="lst_action" + value="Camera Spin Under Sitting" /> + </rows> + <rows + name="spin_around_ccw_sitting" + value="spin_around_ccw_sitting"> + <columns + column="lst_action" + font="SansSerif" + halign="left" + name="lst_action" + tool_tip="Camera spin around counterclockwise sitting" + value="Counterclockwise Sitting" /> + </rows> + <rows + name="spin_around_cw_sitting" + value="spin_around_cw_sitting"> + <columns + column="lst_action" + font="SansSerif" + halign="left" + name="lst_action" + tool_tip="Camera spin around clockwise sitting" + value="Clockwise Sitting" /> + </rows> +</contents> |