diff options
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 93 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 19 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 38 | ||||
-rw-r--r-- | indra/newview/lltoolpie.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_move.xml | 162 |
6 files changed, 162 insertions, 153 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8804c40aff..be4ec93946 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13564,7 +13564,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ShowOfferedInventory</key> <map> diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d65928e385..9630d7b29f 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -304,7 +304,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mOriginalIMViaEmail(false), mLanguageChanged(false), mAvatarDataInitialized(false), - mDoubleClickActionDirty(false) + mClickActionDirty(false) { //Build Floater is now Called from LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); @@ -348,8 +348,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) sSkin = gSavedSettings.getString("SkinCurrent"); - mCommitCallbackRegistrar.add("Pref.CommitDoubleClickChekbox", boost::bind(&LLFloaterPreference::onDoubleClickCheckBox, this, _1)); - mCommitCallbackRegistrar.add("Pref.CommitRadioDoubleClick", boost::bind(&LLFloaterPreference::onDoubleClickRadio, this)); + mCommitCallbackRegistrar.add("Pref.ClickActionChange", boost::bind(&LLFloaterPreference::onClickActionChange, this)); gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); @@ -439,8 +438,6 @@ BOOL LLFloaterPreference::postBuild() if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); - updateDoubleClickControls(); - getChild<LLUICtrl>("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227) std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); setCacheLocation(cache_location); @@ -581,10 +578,10 @@ void LLFloaterPreference::apply() saveAvatarProperties(); - if (mDoubleClickActionDirty) + if (mClickActionDirty) { - updateDoubleClickSettings(); - mDoubleClickActionDirty = false; + updateClickActionSettings(); + mClickActionDirty = false; } } @@ -613,11 +610,12 @@ void LLFloaterPreference::cancel() // reverts any changes to current skin gSavedSettings.setString("SkinCurrent", sSkin); - if (mDoubleClickActionDirty) + if (mClickActionDirty) { - updateDoubleClickControls(); - mDoubleClickActionDirty = false; + updateClickActionControls(); + mClickActionDirty = false; } + LLFloaterPreferenceProxy * advanced_proxy_settings = LLFloaterReg::findTypedInstance<LLFloaterPreferenceProxy>("prefs_proxy"); if (advanced_proxy_settings) { @@ -681,6 +679,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) // Display selected maturity icons. onChangeMaturity(); + + // Load (double-)click to walk/teleport settings. + updateClickActionControls(); // Enabled/disabled popups, might have been changed by user actions // while preferences floater was closed. @@ -1503,72 +1504,34 @@ void LLFloaterPreference::onClickBlockList() } } -void LLFloaterPreference::onDoubleClickCheckBox(LLUICtrl* ctrl) +void LLFloaterPreference::onClickProxySettings() { - if (!ctrl) return; - mDoubleClickActionDirty = true; - LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action"); - if (!radio_double_click_action) return; - // select default value("teleport") in radio-group. - radio_double_click_action->setSelectedIndex(0); - // set radio-group enabled depending on state of checkbox - radio_double_click_action->setEnabled(ctrl->getValue()); + LLFloaterReg::showInstance("prefs_proxy"); } -void LLFloaterPreference::onDoubleClickRadio() +void LLFloaterPreference::onClickActionChange() { - mDoubleClickActionDirty = true; + mClickActionDirty = true; } -void LLFloaterPreference::updateDoubleClickSettings() +void LLFloaterPreference::updateClickActionSettings() { - LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox"); - if (!double_click_action_cb) return; - bool enable = double_click_action_cb->getValue().asBoolean(); + const int single_clk_action = getChild<LLComboBox>("single_click_action_combo")->getValue().asInteger(); + const int double_clk_action = getChild<LLComboBox>("double_click_action_combo")->getValue().asInteger(); - LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action"); - if (!radio_double_click_action) return; - - // enable double click radio-group depending on state of checkbox - radio_double_click_action->setEnabled(enable); - - if (!enable) - { - // set double click action settings values to false if checkbox was unchecked - gSavedSettings.setBOOL("DoubleClickAutoPilot", false); - gSavedSettings.setBOOL("DoubleClickTeleport", false); - } - else - { - std::string selected = radio_double_click_action->getValue().asString(); - bool teleport_selected = selected == "radio_teleport"; - // set double click action settings values depending on chosen radio-button - gSavedSettings.setBOOL( "DoubleClickTeleport", teleport_selected ); - gSavedSettings.setBOOL( "DoubleClickAutoPilot", !teleport_selected ); - } + gSavedSettings.setBOOL("ClickToWalk", single_clk_action == 1); + gSavedSettings.setBOOL("DoubleClickAutoPilot", double_clk_action == 1); + gSavedSettings.setBOOL("DoubleClickTeleport", double_clk_action == 2); } -void LLFloaterPreference::onClickProxySettings() +void LLFloaterPreference::updateClickActionControls() { - LLFloaterReg::showInstance("prefs_proxy"); -} + const bool click_to_walk = gSavedSettings.getBOOL("ClickToWalk"); + const bool dbl_click_to_walk = gSavedSettings.getBOOL("DoubleClickAutoPilot"); + const bool dbl_click_to_teleport = gSavedSettings.getBOOL("DoubleClickTeleport"); -void LLFloaterPreference::updateDoubleClickControls() -{ - // check is one of double-click actions settings enabled - bool double_click_action_enabled = gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport"); - LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox"); - if (double_click_action_cb) - { - // check checkbox if one of double-click actions settings enabled, uncheck otherwise - double_click_action_cb->setValue(double_click_action_enabled); - } - LLRadioGroup* double_click_action_radio = getChild<LLRadioGroup>("double_click_action"); - if (!double_click_action_radio) return; - // set radio-group enabled if one of double-click actions settings enabled - double_click_action_radio->setEnabled(double_click_action_enabled); - // select button in radio-group depending on setting - double_click_action_radio->setSelectedIndex(gSavedSettings.getBOOL("DoubleClickAutoPilot")); + getChild<LLComboBox>("single_click_action_combo")->setValue((int)click_to_walk); + getChild<LLComboBox>("double_click_action_combo")->setValue(dbl_click_to_teleport ? 2 : (int)dbl_click_to_walk); } void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index ef9bc2dd53..5c74e9f60c 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -104,14 +104,13 @@ protected: void setHardwareDefaults(); // callback for when client turns on shaders void onVertexShaderEnable(); - // callback for changing double click action checkbox - void onDoubleClickCheckBox(LLUICtrl* ctrl); - // callback for selecting double click action radio-button - void onDoubleClickRadio(); - // updates double-click action settings depending on controls from preferences - void updateDoubleClickSettings(); - // updates double-click action controls depending on values from settings.xml - void updateDoubleClickControls(); + + // callback for commit in the "Single click on land" and "Double click on land" comboboxes. + void onClickActionChange(); + // updates click/double-click action settings depending on controls values + void updateClickActionSettings(); + // updates click/double-click action controls depending on values from settings.xml + void updateClickActionControls(); // This function squirrels away the current values of the controls so that // cancel() can restore them. @@ -164,9 +163,7 @@ public: static void refreshSkin(void* data); private: static std::string sSkin; - // set true if state of double-click action checkbox or radio-group was changed by user - // (reset back to false on apply or cancel) - bool mDoubleClickActionDirty; + bool mClickActionDirty; ///< Set to true when the click/double-click options get changed by user. bool mGotPersonalInfo; bool mOriginalIMViaEmail; bool mLanguageChanged; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index c38c8bad80..b0d9bd5d70 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -35,7 +35,6 @@ #include "llagent.h" #include "llagentcamera.h" #include "llavatarnamecache.h" -#include "llviewercontrol.h" #include "llfocusmgr.h" #include "llfirstuse.h" #include "llfloaterland.h" @@ -57,6 +56,7 @@ #include "lltrans.h" #include "llviewercamera.h" #include "llviewerparcelmedia.h" +#include "llviewercontrol.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" #include "llviewerobject.h" @@ -76,7 +76,6 @@ static void handle_click_action_play(); static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp); static ECursorType cursor_from_parcel_media(U8 click_action); - LLToolPie::LLToolPie() : LLTool(std::string("Pie")), mMouseButtonDown( false ), @@ -479,6 +478,18 @@ void LLToolPie::resetSelection() mClickAction = 0; } +void LLToolPie::walkToClickedLocation() +{ + if(mAutoPilotDestination) { mAutoPilotDestination->markDead(); } + mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE); + mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal); + mAutoPilotDestination->setPixelSize(5); + mAutoPilotDestination->setColor(LLColor4U(170, 210, 190)); + mAutoPilotDestination->setDuration(3.f); + + handle_go_to(); +} + // When we get object properties after left-clicking on an object // with left-click = buy, if it's the same object, do the buy. @@ -662,18 +673,9 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE; } gAgentCamera.setFocusOnAvatar(TRUE, TRUE); - if(mAutoPilotDestination) { mAutoPilotDestination->markDead(); } - mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE); - mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal); - mAutoPilotDestination->setPixelSize(5); - mAutoPilotDestination->setColor(LLColor4U(170, 210, 190)); - mAutoPilotDestination->setDuration(3.f); - - handle_go_to(); + walkToClickedLocation(); LLFirstUse::notMoving(false); - mBlockClickToWalk = false; - return TRUE; } gViewerWindow->setCursor(UI_CURSOR_ARROW); @@ -708,16 +710,10 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) { - if (mPick.mPickType == LLPickInfo::PICK_LAND - && !mPick.mPosGlobal.isExactlyZero()) - { - handle_go_to(); - return TRUE; - } - else if (mPick.mObjectID.notNull() - && !mPick.mPosGlobal.isExactlyZero()) + if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) || + (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero())) { - handle_go_to(); + walkToClickedLocation(); return TRUE; } } diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index d7c79ee223..68fe8bc4a5 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -66,6 +66,7 @@ public: LLViewerObject* getClickActionObject() { return mClickActionObject; } LLObjectSelection* getLeftClickSelection() { return (LLObjectSelection*)mLeftClickSelection; } void resetSelection(); + void walkToClickedLocation(); void blockClickToWalk() { mBlockClickToWalk = true; } void stopClickToWalk(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml index 1a8aae7f91..cb547d7c6b 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -105,16 +105,61 @@ mouse_opaque="false" visible="true" width="18" - top_pad="2" + top_pad="10" left="30" /> + <text + follows="left|top" + type="string" + length="1" + height="10" + layout="topleft" + left="78" + name="keyboard_lbl" + width="270" + top_delta="2"> + Keyboard: + </text> + <check_box + control_name="ArrowKeysAlwaysMove" + follows="left|top" + height="20" + label="Arrow keys always move me" + layout="topleft" + left_delta="5" + name="arrow_keys_move_avatar_check" + width="237" + top_pad="5"/> + <check_box + control_name="AllowTapTapHoldRun" + follows="left|top" + height="20" + label="Tap-tap-hold to run" + layout="topleft" + left_delta="0" + name="tap_tap_hold_to_run" + width="237" + top_pad="0"/> + <text + follows="left|top" + type="string" + length="1" + height="10" + layout="topleft" + left="78" + name="mouse_lbl" + width="270" + top_pad="15"> + Mouse: + </text> <check_box control_name="FirstPersonAvatarVisible" follows="left|top" height="20" label="Show me in Mouselook" layout="topleft" - left_pad="30" + left_delta="5" name="first_person_avatar_visible" + top_pad="5" width="256" /> <text type="string" @@ -136,7 +181,7 @@ initial_value="2" layout="topleft" show_text="false" - left_pad="5" + left_pad="0" max_val="15" name="mouse_sensitivity" top_delta="-1" @@ -150,63 +195,70 @@ name="invert_mouse" top_delta="0" width="128" /> - <check_box - control_name="ArrowKeysAlwaysMove" + <text follows="left|top" - height="20" - label="Arrow keys always move me" + type="string" + length="1" + height="10" layout="topleft" - left="78" - name="arrow_keys_move_avatar_check" - width="237" - top_pad="10"/> - <check_box - control_name="AllowTapTapHoldRun" - follows="left|top" - height="20" - label="Tap-tap-hold to run" + left="86" + name="single_click_action_lbl" + width="150" + top_pad="20"> + Single click on land: + </text> + <combo_box + height="23" layout="topleft" - left_delta="0" - name="tap_tap_hold_to_run" - width="237" - top_pad="0"/> - <check_box + left_pad="10" + top_delta="-6" + name="single_click_action_combo" + width="200"> + <combo_box.item + label="No action" + name="0" + value="0"/> + <combo_box.item + label="Move to clicked point" + name="1" + value="1"/> + <combo_box.commit_callback + function="Pref.ClickActionChange"/> + </combo_box> + <text follows="left|top" - height="20" - label="Double-Click to:" + type="string" + length="1" + height="10" layout="topleft" - left_delta="0" - name="double_click_chkbox" - width="237" - top_pad="0"> - <check_box.commit_callback - function="Pref.CommitDoubleClickChekbox"/> - </check_box> - <radio_group - height="20" - layout="topleft" - left_delta="17" - top_pad="2" - name="double_click_action"> - <radio_item - height="16" - label="Teleport" - layout="topleft" - left="0" - name="radio_teleport" - top_delta="20" - width="110" /> - <radio_item - height="16" - label="Auto-pilot" - left_pad="0" - layout="topleft" - name="radio_autopilot" - top_delta="0" - width="75" /> - <radio_group.commit_callback - function="Pref.CommitRadioDoubleClick"/> - </radio_group> + left="86" + name="double_click_action_lbl" + width="150" + top_pad="12"> + Double click on land: + </text> + <combo_box + height="23" + layout="topleft" + left_pad="10" + top_delta="-6" + name="double_click_action_combo" + width="200"> + <combo_box.item + label="No action" + name="0" + value="0"/> + <combo_box.item + label="Move to clicked point" + name="1" + value="1"/> + <combo_box.item + label="Teleport to clicked point" + name="2" + value="2"/> + <combo_box.commit_callback + function="Pref.ClickActionChange"/> + </combo_box> <button height="23" label="Other Devices" |