diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index 92baa20706ea2d17fff2283d9dd9d4b5e86df1c7..a69201150c16e821fe59c6d1e01c2914d27e8a88 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -904,6 +904,28 @@ <key>Value</key> <string /> </map> + <key>DoubleClickAttachmentAdd</key> + <map> + <key>Comment</key> + <string>Double-clicking an attachment in inventory will add wear it rather than replace wear it</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <boolean>1</boolean> + </map> + <key>DoubleClickWearableAdd</key> + <map> + <key>Comment</key> + <string>Double-clicking a clothing wearable in inventory will add wear it rather than replace wear it</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <boolean>1</boolean> + </map> <key>GroupSnoozeTime</key> <map> <key>Comment</key> diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index dfab29e470aec75a7dd2def35ffa47b4cb80ed4d..efa459bdd5e54d00d119220ff0d1e3c0cd2f7922 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -6829,8 +6829,16 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) void LLObjectBridge::openItem() { // object double-click action is to wear/unwear object - performAction(getInventoryModel(), - get_is_item_worn(mUUID) ? "detach" : "attach"); +// [SL:KB] - Patch: Inventory-MultiAttach | Checked: 2011-10-04 (Catznip-3.0) + MASK mask = gKeyboard->currentMask(TRUE); + bool fCtrlDown = (MASK_CONTROL == mask); + bool fOpenAdd = gSavedSettings.getBOOL("DoubleClickAttachmentAdd"); + + const char* pstrAction = get_is_item_worn(mUUID) ? "detach" : ((fCtrlDown ^ fOpenAdd) ? "wear_add" : "attach"); + performAction(getInventoryModel(), pstrAction); +// [/SL:KB] +// performAction(getInventoryModel(), +// get_is_item_worn(mUUID) ? "detach" : "attach"); } std::string LLObjectBridge::getLabelSuffix() const @@ -7211,8 +7219,26 @@ void LLWearableBridge::performAction(LLInventoryModel* model, std::string action void LLWearableBridge::openItem() { - performAction(getInventoryModel(), - get_is_item_worn(mUUID) ? "take_off" : "wear"); + LLViewerInventoryItem* item = getItem(); + +// [SL:KB] - Patch: Inventory-MultiWear | Checked: 2011-10-04 (Catznip-3.0) + if ( (item) && (item->isWearableType()) ) + { + // Wearable double-click action should match attachment double-click action (=wear/unwear but don't attempt to unwear body parts) + bool fIsWorn = get_is_item_worn(mUUID); + if ( (!fIsWorn) || (LLAssetType::AT_BODYPART != item->getType()) ) + { + MASK mask = gKeyboard->currentMask(TRUE); + bool fCtrlDown = (MASK_CONTROL == mask); + bool fOpenAdd = gSavedSettings.getBOOL("DoubleClickWearableAdd"); + + const char* pstrAction = (fIsWorn) ? "take_off" : ((fCtrlDown ^ fOpenAdd) && (LLAssetType::AT_BODYPART != item->getType())) ? "wear_add" : "wear"; + performAction(getInventoryModel(), pstrAction); + } + } +// [/SL:KB] +// performAction(getInventoryModel(), +// get_is_item_worn(mUUID) ? "take_off" : "wear"); } void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 6bb55d584f55940117445ee91782477b8f591549..1fb97948cab92a8d19d219b4100d192fb39ecb63 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -485,6 +485,18 @@ void LLToolCompScale::render() } } +BOOL LLToolCompScale::handleMiddleMouseDown(S32 x, S32 y, MASK mask) +{ + LLToolCompScale::getInstance()->mManip->handleMiddleMouseDown(x,y,mask); + return handleMouseDown(x,y,mask); +} + +BOOL LLToolCompScale::handleMiddleMouseUp(S32 x, S32 y, MASK mask) +{ + LLToolCompScale::getInstance()->mManip->handleMiddleMouseUp(x,y,mask); + return handleMouseUp(x,y,mask); +} + //----------------------------------------------------------------------- // LLToolCompCreate diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h index 37c65412b4a4a654bc554b5bb2e518e28dc3eb32..178d48e2aa08b082f8dbc4294b876dd68f131d6e 100644 --- a/indra/newview/lltoolcomp.h +++ b/indra/newview/lltoolcomp.h @@ -164,6 +164,9 @@ class LLToolCompScale final : public LLToolComposite, public LLSingleton<LLToolC virtual LLTool* getOverrideTool(MASK mask) override; static void pickCallback(const LLPickInfo& pick_info); + + virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override; + virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override; }; diff --git a/indra/newview/skins/default/xui/en/panel_preferences_interface.xml b/indra/newview/skins/default/xui/en/panel_preferences_interface.xml index e2b7a386feadaca62a33519cb8f5e8829b3af16c..71702a0027042210fd2a6ad770dfb22578b28a8c 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_interface.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_interface.xml @@ -112,9 +112,42 @@ layout="topleft" left="45" name="HideHoverTextInCinematicMode" - top_delta="20" + top_pad="7" width="256"> <check_box.commit_callback function="Pref.RenderOptionUpdate" /> </check_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="30" + name="InventoryText" + mouse_opaque="false" + top_pad="7" + width="300"> + Inventory: + </text> + <check_box + control_name="DoubleClickAttachmentAdd" + height="16" + initial_value="true" + label="Double-click to add Attachments" + layout="topleft" + left="45" + name="DoubleClickAttachmentAddCheck" + top_pad="7" + width="256"/> + <check_box + control_name="DoubleClickWearableAdd" + height="16" + initial_value="true" + label="Double-click to add Wearables" + layout="topleft" + left="45" + name="DoubleClickWearableAddCheck" + top_pad="5" + width="256"/> </panel>