Satisfy Issue 167: Ability to set global "add instead of wear" option in prefs

Adds debug setting LiruAddNotReplace.
Adds "Add clothing and wearables instead of replacing them" to Main (General) tab of Vanity Preferences.
This commit is contained in:
Inusaito Sayori
2012-12-17 17:17:12 -05:00
parent 36a698fee4
commit 9e8dafc4ca
5 changed files with 19 additions and 2 deletions

View File

@@ -693,6 +693,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruAddNotReplace</key>
<map>
<key>Comment</key>
<string>Add clothing and attachments instead of having them replace the currently worn or attached item at their destination.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruFlyAfterTeleport</key>
<map>
<key>Comment</key>

View File

@@ -178,6 +178,7 @@ void LLPrefsAscentVan::refreshValues()
mPlayTPSound = gSavedSettings.getBOOL("OptionPlayTpSound");
mShowLogScreens = !gSavedSettings.getBOOL("AscentDisableLogoutScreens");
mDisableChatAnimation = gSavedSettings.getBOOL("SGDisableChatAnimation");
mAddNotReplace = gSavedSettings.getBOOL("LiruAddNotReplace");
//Tags\Colors ----------------------------------------------------------------------------
mAscentUseTag = gSavedSettings.getBOOL("AscentUseTag");
@@ -252,6 +253,7 @@ void LLPrefsAscentVan::cancel()
gSavedSettings.setBOOL("OptionPlayTpSound", mPlayTPSound);
gSavedSettings.setBOOL("AscentDisableLogoutScreens", !mShowLogScreens);
gSavedSettings.setBOOL("SGDisableChatAnimation", mDisableChatAnimation);
gSavedSettings.setBOOL("LiruAddNotReplace", mAddNotReplace);
//Tags\Colors ----------------------------------------------------------------------------
gSavedSettings.setBOOL("AscentUseTag", mAscentUseTag);

View File

@@ -58,6 +58,7 @@ protected:
BOOL mPlayTPSound;
BOOL mShowLogScreens;
bool mDisableChatAnimation;
bool mAddNotReplace;
//Tags\Colors
BOOL mAscentUseTag;
std::string mReportClientUUID;

View File

@@ -5347,9 +5347,10 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action)
void LLObjectBridge::openItem()
{
static LLCachedControl<bool> add(gSavedSettings, "LiruAddNotReplace");
// object double-click action is to wear/unwear object
performAction(getInventoryModel(),
get_is_item_worn(mUUID) ? "detach" : "attach");
get_is_item_worn(mUUID) ? "detach" : (add ? "wear_add" : "attach"));
}
std::string LLObjectBridge::getLabelSuffix() const
@@ -6803,10 +6804,11 @@ void LLWearableBridgeAction::wearOnAvatar()
{
// TODO: investigate wearables may not be loaded at this point EXT-8231
static LLCachedControl<bool> add(gSavedSettings, "LiruAddNotReplace");
LLViewerInventoryItem* item = getItem();
if(item)
{
LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(), true, true);
LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(), true, !add);
}
}

View File

@@ -7,6 +7,7 @@
<check_box bottom_delta="-20" control_name="OptionPlayTpSound" follows="top" height="16" initial_value="true" label="Play the Teleport sound when moving between sims" tool_tip="Viewer will play the wooshing TP noise on teleport." name="tp_sound_check"/>
<check_box bottom_delta="-20" control_name="AscentDisableLogoutScreens" follows="top" height="16" initial_value="true" label="Hide the Login/Logout progress screens" tool_tip="If checked, the viewer will hide the login/logout progress screen." name="disable_logout_screen_check"/>
<check_box bottom_delta="-20" control_name="SGDisableChatAnimation" follows="top" height="16" initial_value="false" label="Disable chat, whisper and shout animations" tool_tip="Remove chat animations from your own avatar. Effect visible to everyone" name="disable_chat_animation"/>
<check_box bottom_delta="-20" control_name="LiruAddNotReplace" follows="top" height="16" label="Add clothing and wearables instead of replacing them" tool_tip="When double clicking or pressing enter in inventory with wearables or objects selected they will be added to your outfit, instead of replacing the wearable or object currently at their target destination." name="add_not_replace"/>
</panel>
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Tags/Colors" name="TagsColors">
<!-- Client tag options -->