summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-11-07 20:09:25 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-11-07 20:09:25 +0200
commit6ba0b97c851db7822e17a5a8dbb2d0964ca835f7 (patch)
tree23f4b3145ec70e1a855b75d06956ff2d6b367c10
parent65f2c039237b0c538134c17e7958090dc40d4559 (diff)
SL-6109
- Edit mode appears to be obsolete and is not used, cleaned up - Improved ability to set defaults - Improved some labels - Made buttons bigger to accomodate languages with longer descriptions - Added ability to assign key for all modes simultaneously
-rw-r--r--indra/newview/app_settings/key_bindings.xml60
-rw-r--r--indra/newview/llfloaterpreference.cpp85
-rw-r--r--indra/newview/llfloaterpreference.h7
-rw-r--r--indra/newview/llkeyconflict.cpp13
-rw-r--r--indra/newview/llkeyconflict.h1
-rw-r--r--indra/newview/llsetkeybinddialog.cpp12
-rw-r--r--indra/newview/llsetkeybinddialog.h7
-rw-r--r--indra/newview/llviewerinput.cpp7
-rw-r--r--indra/newview/llviewerinput.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_select_key.xml8
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml13
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_controls.xml18
12 files changed, 104 insertions, 129 deletions
diff --git a/indra/newview/app_settings/key_bindings.xml b/indra/newview/app_settings/key_bindings.xml
index 536199c696..dd74293644 100644
--- a/indra/newview/app_settings/key_bindings.xml
+++ b/indra/newview/app_settings/key_bindings.xml
@@ -129,65 +129,6 @@
<binding key="" mask="NONE" mouse="MMB" command="toggle_voice"/>
<binding key="" mask="NONE" mouse="LMB" command="walk_to"/>
</third_person>
-
- <!-- Basic editing camera control -->
- <edit>
- <binding key="A" mask="NONE" command="spin_around_cw"/>
- <binding key="D" mask="NONE" command="spin_around_ccw"/>
- <binding key="W" mask="NONE" command="move_forward"/>
- <binding key="S" mask="NONE" command="move_backward"/>
- <binding key="E" mask="NONE" command="spin_over"/>
- <binding key="C" mask="NONE" command="spin_under"/>
- <binding key="ENTER" mask="NONE" command="start_chat"/>
- <binding key="DIVIDE" mask="NONE" command="start_gesture"/>
- <binding key="PAD_ENTER" mask="NONE" command="start_chat"/>
- <binding key="PAD_DIVIDE" mask="NONE" command="start_gesture"/>
-
- <binding key="LEFT" mask="NONE" command="spin_around_cw"/>
- <binding key="RIGHT" mask="NONE" command="spin_around_ccw"/>
- <binding key="UP" mask="NONE" command="move_forward"/>
- <binding key="DOWN" mask="NONE" command="move_backward"/>
- <binding key="PGUP" mask="NONE" command="spin_over"/>
- <binding key="PGDN" mask="NONE" command="spin_under"/>
-
- <binding key="A" mask="SHIFT" command="pan_left"/>
- <binding key="D" mask="SHIFT" command="pan_right"/>
- <binding key="W" mask="SHIFT" command="pan_up"/>
- <binding key="S" mask="SHIFT" command="pan_down"/>
-
- <binding key="LEFT" mask="SHIFT" command="pan_left"/>
- <binding key="RIGHT" mask="SHIFT" command="pan_right"/>
- <binding key="UP" mask="SHIFT" command="pan_up"/>
- <binding key="DOWN" mask="SHIFT" command="pan_down"/>
-
- <!--Walking works with ALT held down.-->
- <binding key="A" mask="ALT" command="slide_left"/>
- <binding key="D" mask="ALT" command="slide_right"/>
- <binding key="W" mask="ALT" command="push_forward"/>
- <binding key="S" mask="ALT" command="push_backward"/>
- <binding key="E" mask="ALT" command="jump"/>
- <binding key="C" mask="ALT" command="push_down"/>
-
- <binding key="LEFT" mask="ALT" command="slide_left"/>
- <binding key="RIGHT" mask="ALT" command="slide_right"/>
- <binding key="UP" mask="ALT" command="push_forward"/>
- <binding key="DOWN" mask="ALT" command="push_backward"/>
- <binding key="PGUP" mask="ALT" command="jump"/>
- <binding key="PGDN" mask="ALT" command="push_down"/>
- <binding key="HOME" mask="ALT" command="toggle_fly"/>
-
- <binding key="PAD_LEFT" mask="ALT" command="slide_left"/>
- <binding key="PAD_RIGHT" mask="ALT" command="slide_right"/>
- <binding key="PAD_UP" mask="ALT" command="push_forward"/>
- <binding key="PAD_DOWN" mask="ALT" command="push_backward"/>
- <binding key="PAD_PGUP" mask="ALT" command="jump"/>
- <binding key="PAD_PGDN" mask="ALT" command="push_down"/>
- <binding key="PAD_ENTER" mask="ALT" command="start_chat"/>
- <binding key="PAD_DIVIDE" mask="ALT" command="start_gesture"/>
-
- <binding key="" mask="NONE" mouse="MMB" command="toggle_voice"/>
- <binding key="" mask="NONE" mouse="LMB" command="walk_to"/>
- </edit>
<sitting>
<binding key="A" mask="ALT" command="spin_around_cw"/>
<binding key="D" mask="ALT" command="spin_around_ccw"/>
@@ -312,6 +253,5 @@
<binding key="PAD_DIVIDE" mask="NONE" command="start_gesture"/>
<binding key="" mask="NONE" mouse="MMB" command="toggle_voice"/>
- <binding key="" mask="NONE" mouse="LMB" command="walk_to"/>
</edit_avatar>
</keys>
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index ffd83a8555..98f4881eb6 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -2688,7 +2688,7 @@ BOOL LLPanelPreferenceControls::postBuild()
pControlsTable->setCommitCallback(boost::bind(&LLPanelPreferenceControls::onListCommit, this));
pKeyModeBox->setCommitCallback(boost::bind(&LLPanelPreferenceControls::onModeCommit, this));
- getChild<LLButton>("restore_defaults")->setCommitCallback(boost::bind(&LLPanelPreferenceControls::onRestoreDefaults, this));
+ getChild<LLButton>("restore_defaults")->setCommitCallback(boost::bind(&LLPanelPreferenceControls::onRestoreDefaultsBtn, this));
return TRUE;
}
@@ -2710,7 +2710,6 @@ void LLPanelPreferenceControls::populateControlTable()
{
case LLKeyConflictHandler::MODE_THIRD_PERSON:
case LLKeyConflictHandler::MODE_FIRST_PERSON:
- case LLKeyConflictHandler::MODE_EDIT:
case LLKeyConflictHandler::MODE_EDIT_AVATAR:
case LLKeyConflictHandler::MODE_SITTING:
filename = "control_table_contents.xml";
@@ -2918,20 +2917,42 @@ void LLPanelPreferenceControls::onModeCommit()
populateControlTable();
}
-void LLPanelPreferenceControls::onRestoreDefaults()
+void LLPanelPreferenceControls::onRestoreDefaultsBtn()
{
- for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i)
+ LLNotificationsUtil::add("PreferenceControlsDefaults", LLSD(), LLSD(), boost::bind(&LLPanelPreferenceControls::onRestoreDefaultsResponse, this, _1, _2));
+}
+
+void LLPanelPreferenceControls::onRestoreDefaultsResponse(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ switch(option)
{
- mConflictHandler[i].resetToDefaults();
+ case 0: // All
+ for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i)
+ {
+ mConflictHandler[i].resetToDefaults();
+ // Apply changes to viewer as 'temporary'
+ mConflictHandler[i].saveToSettings(true);
+ }
+
+ updateTable();
+ break;
+ case 1: // Current
+ mConflictHandler[mEditingMode].resetToDefaults();
// Apply changes to viewer as 'temporary'
- mConflictHandler[i].saveToSettings(true);
- }
+ mConflictHandler[mEditingMode].saveToSettings(true);
- updateTable();
+ updateTable();
+ break;
+ case 2: // Cancel
+ default:
+ //exit;
+ break;
+ }
}
// todo: copy onSetKeyBind to interface and inherit from interface
-bool LLPanelPreferenceControls::onSetKeyBind(EMouseClickType click, KEY key, MASK mask, bool ignore_mask)
+bool LLPanelPreferenceControls::onSetKeyBind(EMouseClickType click, KEY key, MASK mask, bool all_modes)
{
if (!mConflictHandler[mEditingMode].canAssignControl(mEditingControl))
{
@@ -2940,16 +2961,32 @@ bool LLPanelPreferenceControls::onSetKeyBind(EMouseClickType click, KEY key, MAS
if ( mEditingColumn > 0)
{
- mConflictHandler[mEditingMode].registerControl(mEditingControl, mEditingColumn - 1, click, key, mask, true);
- // Apply changes to viewer as 'temporary'
- mConflictHandler[mEditingMode].saveToSettings(true);
+ if (all_modes)
+ {
+ for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i)
+ {
+ if (mConflictHandler[i].empty())
+ {
+ mConflictHandler[i].loadFromSettings((LLKeyConflictHandler::ESourceMode)i);
+ }
+ mConflictHandler[i].registerControl(mEditingControl, mEditingColumn - 1, click, key, mask, true);
+ // Apply changes to viewer as 'temporary'
+ mConflictHandler[i].saveToSettings(true);
+ }
+ }
+ else
+ {
+ mConflictHandler[mEditingMode].registerControl(mEditingControl, mEditingColumn - 1, click, key, mask, true);
+ // Apply changes to viewer as 'temporary'
+ mConflictHandler[mEditingMode].saveToSettings(true);
+ }
}
updateTable();
return true;
}
-void LLPanelPreferenceControls::onDefaultKeyBind()
+void LLPanelPreferenceControls::onDefaultKeyBind(bool all_modes)
{
if (!mConflictHandler[mEditingMode].canAssignControl(mEditingControl))
{
@@ -2958,9 +2995,25 @@ void LLPanelPreferenceControls::onDefaultKeyBind()
if (mEditingColumn > 0)
{
- mConflictHandler[mEditingMode].resetToDefault(mEditingControl, mEditingColumn - 1);
- // Apply changes to viewer as 'temporary'
- mConflictHandler[mEditingMode].saveToSettings(true);
+ if (all_modes)
+ {
+ for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i)
+ {
+ if (mConflictHandler[i].empty())
+ {
+ mConflictHandler[i].loadFromSettings((LLKeyConflictHandler::ESourceMode)i);
+ }
+ mConflictHandler[i].resetToDefault(mEditingControl, mEditingColumn - 1);
+ // Apply changes to viewer as 'temporary'
+ mConflictHandler[i].saveToSettings(true);
+ }
+ }
+ else
+ {
+ mConflictHandler[mEditingMode].resetToDefault(mEditingControl, mEditingColumn - 1);
+ // Apply changes to viewer as 'temporary'
+ mConflictHandler[mEditingMode].saveToSettings(true);
+ }
}
updateTable();
}
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 112784b83e..9ede7d5bcf 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -301,9 +301,10 @@ public:
void onListCommit();
void onModeCommit();
- void onRestoreDefaults();
- /*virtual*/ bool onSetKeyBind(EMouseClickType click, KEY key, MASK mask, bool ignore_mask);
- /*virtual*/ void onDefaultKeyBind();
+ void onRestoreDefaultsBtn();
+ void onRestoreDefaultsResponse(const LLSD& notification, const LLSD& response);
+ /*virtual*/ bool onSetKeyBind(EMouseClickType click, KEY key, MASK mask, bool all_modes);
+ /*virtual*/ void onDefaultKeyBind(bool all_modes);
/*virtual*/ void onCancelKeyBind();
private:
diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp
index d9c2b3d53a..b4f5ec4d57 100644
--- a/indra/newview/llkeyconflict.cpp
+++ b/indra/newview/llkeyconflict.cpp
@@ -345,13 +345,6 @@ bool LLKeyConflictHandler::loadFromSettings(const ESourceMode &load_mode, const
res = true;
}
break;
- case MODE_EDIT:
- if (keys.edit.isProvided())
- {
- loadFromSettings(keys.edit, destination);
- res = true;
- }
- break;
case MODE_EDIT_AVATAR:
if (keys.edit_avatar.isProvided())
{
@@ -553,12 +546,6 @@ void LLKeyConflictHandler::saveToSettings(bool temporary)
keys.third_person.bindings.set(mode.bindings, true);
}
break;
- case MODE_EDIT:
- if (keys.edit.isProvided())
- {
- keys.edit.bindings.set(mode.bindings, true);
- }
- break;
case MODE_EDIT_AVATAR:
if (keys.edit_avatar.isProvided())
{
diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h
index 4ebe054f22..48af0ccdfe 100644
--- a/indra/newview/llkeyconflict.h
+++ b/indra/newview/llkeyconflict.h
@@ -59,7 +59,6 @@ public:
{
MODE_FIRST_PERSON,
MODE_THIRD_PERSON,
- MODE_EDIT,
MODE_EDIT_AVATAR,
MODE_SITTING,
MODE_SAVED_SETTINGS, // for settings from saved settings
diff --git a/indra/newview/llsetkeybinddialog.cpp b/indra/newview/llsetkeybinddialog.cpp
index 806c70aa03..8d0d71daaf 100644
--- a/indra/newview/llsetkeybinddialog.cpp
+++ b/indra/newview/llsetkeybinddialog.cpp
@@ -86,7 +86,7 @@ BOOL LLSetKeyBindDialog::postBuild()
childSetAction("Cancel", onCancel, this);
getChild<LLUICtrl>("Cancel")->setFocus(TRUE);
- pCheckBox = getChild<LLCheckBoxCtrl>("ignore_masks");
+ pCheckBox = getChild<LLCheckBoxCtrl>("apply_all");
pDesription = getChild<LLTextBase>("descritption");
gFocusMgr.setKeystrokesOnly(TRUE);
@@ -148,10 +148,6 @@ void LLSetKeyBindDialog::setParent(LLKeyBindResponderInterface* parent, LLView*
}
pDesription->setText(getString("basic_description"));
pDesription->setTextArg("[INPUT]", input);
-
- bool can_ignore_masks = (key_mask & CAN_IGNORE_MASKS) != 0;
- pCheckBox->setVisible(can_ignore_masks);
- pCheckBox->setValue(false);
}
// static
@@ -308,7 +304,7 @@ void LLSetKeyBindDialog::onDefault(void* user_data)
LLSetKeyBindDialog* self = (LLSetKeyBindDialog*)user_data;
if (self->pParent)
{
- self->pParent->onDefaultKeyBind();
+ self->pParent->onDefaultKeyBind(self->pCheckBox->getValue().asBoolean());
self->pParent = NULL;
}
self->closeFloater();
@@ -326,11 +322,11 @@ void LLSetKeyBindDialog::onClickTimeout(void* user_data, MASK mask)
self->closeFloater();
}
-void LLSetKeyBindDialog::setKeyBind(EMouseClickType click, KEY key, MASK mask, bool ignore)
+void LLSetKeyBindDialog::setKeyBind(EMouseClickType click, KEY key, MASK mask, bool all_modes)
{
if (pParent)
{
- pParent->onSetKeyBind(click, key, mask, ignore);
+ pParent->onSetKeyBind(click, key, mask, all_modes);
pParent = NULL;
}
}
diff --git a/indra/newview/llsetkeybinddialog.h b/indra/newview/llsetkeybinddialog.h
index 16a2d768e4..c7b4e3c364 100644
--- a/indra/newview/llsetkeybinddialog.h
+++ b/indra/newview/llsetkeybinddialog.h
@@ -40,7 +40,6 @@ static const U32 ALLOW_MASK_MOUSE = 2;
static const U32 ALLOW_KEYS = 4; //keyboard
static const U32 ALLOW_MASK_KEYS = 8;
static const U32 ALLOW_MASKS = 16;
-static const U32 CAN_IGNORE_MASKS = 32; // For example W (aka Forward) should work regardless of SHIFT being pressed
static const U32 DEFAULT_KEY_FILTER = ALLOW_MOUSE | ALLOW_MASK_MOUSE | ALLOW_KEYS | ALLOW_MASK_KEYS;
@@ -50,9 +49,9 @@ public:
virtual ~LLKeyBindResponderInterface() {};
virtual void onCancelKeyBind() = 0;
- virtual void onDefaultKeyBind() = 0;
+ virtual void onDefaultKeyBind(bool all_modes) = 0;
// returns true if parent failed to set key due to key being in use
- virtual bool onSetKeyBind(EMouseClickType click, KEY key, MASK mask, bool ignore) = 0;
+ virtual bool onSetKeyBind(EMouseClickType click, KEY key, MASK mask, bool all_modes) = 0;
};
class LLSetKeyBindDialog : public LLModalDialog, public LLDrawFrustum
@@ -82,7 +81,7 @@ public:
private:
bool recordAndHandleKey(KEY key, MASK mask);
- void setKeyBind(EMouseClickType click, KEY key, MASK mask, bool ignore);
+ void setKeyBind(EMouseClickType click, KEY key, MASK mask, bool all_modes);
LLKeyBindResponderInterface *pParent;
LLCheckBoxCtrl *pCheckBox;
LLTextBase *pDesription;
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp
index 50618350be..eaad5ab632 100644
--- a/indra/newview/llviewerinput.cpp
+++ b/indra/newview/llviewerinput.cpp
@@ -934,11 +934,6 @@ BOOL LLViewerInput::modeFromString(const std::string& string, S32 *mode) const
*mode = MODE_THIRD_PERSON;
return TRUE;
}
- else if (string == "EDIT")
- {
- *mode = MODE_EDIT;
- return TRUE;
- }
else if (string == "EDIT_AVATAR")
{
*mode = MODE_EDIT_AVATAR;
@@ -1153,7 +1148,6 @@ LLViewerInput::KeyMode::KeyMode()
LLViewerInput::Keys::Keys()
: first_person("first_person"),
third_person("third_person"),
- edit("edit"),
sitting("sitting"),
edit_avatar("edit_avatar")
{}
@@ -1180,7 +1174,6 @@ S32 LLViewerInput::loadBindingsXML(const std::string& filename)
{
binding_count += loadBindingMode(keys.first_person, MODE_FIRST_PERSON);
binding_count += loadBindingMode(keys.third_person, MODE_THIRD_PERSON);
- binding_count += loadBindingMode(keys.edit, MODE_EDIT);
binding_count += loadBindingMode(keys.sitting, MODE_SITTING);
binding_count += loadBindingMode(keys.edit_avatar, MODE_EDIT_AVATAR);
}
diff --git a/indra/newview/llviewerinput.h b/indra/newview/llviewerinput.h
index b7124a54b2..eff42600fd 100644
--- a/indra/newview/llviewerinput.h
+++ b/indra/newview/llviewerinput.h
@@ -65,7 +65,6 @@ typedef enum e_keyboard_mode
{
MODE_FIRST_PERSON,
MODE_THIRD_PERSON,
- MODE_EDIT,
MODE_EDIT_AVATAR,
MODE_SITTING,
MODE_COUNT
@@ -99,7 +98,6 @@ public:
{
Optional<KeyMode> first_person,
third_person,
- edit,
sitting,
edit_avatar;
diff --git a/indra/newview/skins/default/xui/en/floater_select_key.xml b/indra/newview/skins/default/xui/en/floater_select_key.xml
index 255de60d00..48d9eee4cd 100644
--- a/indra/newview/skins/default/xui/en/floater_select_key.xml
+++ b/indra/newview/skins/default/xui/en/floater_select_key.xml
@@ -44,11 +44,11 @@ Allowed input: [INPUT].
follows="top|left"
height="20"
initial_value="false"
- label="Ignore extra accelerator keys"
+ label="Apply to all"
layout="topleft"
- left="28"
- name="ignore_masks"
- tool_tip="Ignore extra Shift, Alt and Ctrl keys. Example: This allows to hold W (forward, ignores shift) and Shift+A (slide left) simultaneously and agent will both move forward and slide left."
+ left="90"
+ name="apply_all"
+ tool_tip="Viewer uses different control combinations depending on what you are doing in world, setting this will apply your change to all combinations"
top_pad="8"
width="160" />
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index a757a4beaa..f2e6848e1a 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -11275,6 +11275,19 @@ Cannot create large prims that intersect other residents. Please re-try when ot
notext="Cancel"
yestext="OK"/>
</notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="PreferenceControlsDefaults"
+ type="alertmodal">
+ Do you want to restore default values for controls?
+ <tag>confirm</tag>
+ <usetemplate
+ canceltext="Cancel"
+ name="yesnocancelbuttons"
+ notext="Current mode"
+ yestext="All modes"/>
+ </notification>
<notification
icon="alertmodal.tga"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_controls.xml b/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
index bd39343093..0f830ef0c9 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel
border="true"
follows="all"
@@ -15,28 +15,24 @@
top="6"
left="10"
height="23"
- width="110"
+ width="140"
name="key_mode">
<combo_box.item
label="Third Person "
name="third_person"
value="1"/>
<combo_box.item
- label="First Person "
+ label="First Person (Mouselook)"
name="first_person"
value="0"/>
<combo_box.item
- label="Edit"
- name="edit"
- value="2"/>
- <combo_box.item
label="Edit Avatar"
name="edit_avatar"
- value="3"/>
+ value="2"/>
<combo_box.item
label="Sitting"
name="sitting"
- value="4"/>
+ value="3"/>
</combo_box>
<button
@@ -45,8 +41,8 @@
top="6"
right="-10"
height="23"
- width="110"
- label="Restore Default"
+ width="140"
+ label="Restore Defaults"
tooltip="Restores default values for all control modes."
name="restore_defaults"/>