From 0433bd85607d07c2f8aca42378c09f1247148c03 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 26 Dec 2012 13:09:05 -0500 Subject: [PATCH 01/18] Gemini young age color should look more natural for Gemini. --- indra/newview/skins/apollo/colors.xml | 2 +- indra/newview/skins/gemini/colors.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/apollo/colors.xml b/indra/newview/skins/apollo/colors.xml index 434115514..eb3cbaeb0 100644 --- a/indra/newview/skins/apollo/colors.xml +++ b/indra/newview/skins/apollo/colors.xml @@ -152,7 +152,7 @@ - + diff --git a/indra/newview/skins/gemini/colors.xml b/indra/newview/skins/gemini/colors.xml index 331979419..f7afd3e12 100644 --- a/indra/newview/skins/gemini/colors.xml +++ b/indra/newview/skins/gemini/colors.xml @@ -151,7 +151,7 @@ - + From 246315c723fa068f2f68af19f09057b283bc1cbc Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Thu, 27 Dec 2012 15:15:27 -0500 Subject: [PATCH 02/18] This is the Cupcake Commit. Cupcakes. Also may fix linux fmodex64. --- indra/cmake/FMODEX.cmake | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/indra/cmake/FMODEX.cmake b/indra/cmake/FMODEX.cmake index 0a4bc0647..902af05fb 100644 --- a/indra/cmake/FMODEX.cmake +++ b/indra/cmake/FMODEX.cmake @@ -17,15 +17,25 @@ find_library(FMODEX_LIBRARY if (NOT FMODEX_LIBRARY) set(FMODEX_SDK_DIR CACHE PATH "Path to the FMOD Ex SDK.") if (FMODEX_SDK_DIR) - find_library(FMODEX_LIBRARY - fmodex_vc fmodexL_vc fmodex fmodexL fmodex64 fmodexL64 - PATHS - ${FMODEX_SDK_DIR}/api/lib - ${FMODEX_SDK_DIR}/api - ${FMODEX_SDK_DIR}/lib - ${FMODEX_SDK_DIR} - ) - + if(WORD_SIZE EQUAL 32) + find_library(FMODEX_LIBRARY + fmodex_vc fmodexL_vc fmodex fmodexL + PATHS + ${FMODEX_SDK_DIR}/api/lib + ${FMODEX_SDK_DIR}/api + ${FMODEX_SDK_DIR}/lib + ${FMODEX_SDK_DIR} + ) + elseif(WORD_SIZE EQUAL 64) + find_library(FMODEX_LIBRARY + fmodex64 fmodexL64 + PATHS + ${FMODEX_SDK_DIR}/api/lib + ${FMODEX_SDK_DIR}/api + ${FMODEX_SDK_DIR}/lib + ${FMODEX_SDK_DIR} + ) + endif(WORD_SIZE EQUAL 32) endif(FMODEX_SDK_DIR) if(WINDOWS AND NOT FMODEX_LIBRARY) set(FMODEX_PROG_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows") From f6ee966e172de9fdd0e021b2d20378d8d5d54e8b Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 27 Dec 2012 21:59:59 -0600 Subject: [PATCH 03/18] Clean up LLAvatarListEntry creation/destruction and resolve LLAvatarPropertiesProcessor retaining deleted observers. --- indra/newview/llfloateravatarlist.cpp | 80 +++++++++++++++------------ indra/newview/llfloateravatarlist.h | 7 ++- 2 files changed, 50 insertions(+), 37 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 2058df593..319610e2e 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -161,7 +161,10 @@ LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string &name, mIsInList(false), mAge(-1), mAgeAlert(false), mTime(time(NULL)) { if (mID.notNull()) + { LLAvatarPropertiesProcessor::getInstance()->addObserver(mID, this); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(mID); + } } LLAvatarListEntry::~LLAvatarListEntry() @@ -175,6 +178,7 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) { if(type == APT_PROPERTIES) { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(mID, this); const LLAvatarData* pAvatarData = static_cast(data); if (pAvatarData && (pAvatarData->avatar_id != LLUUID::null)) { @@ -608,10 +612,9 @@ void LLFloaterAvatarList::updateAvatarList() else { // Avatar not there yet, add it - LLAvatarListEntry entry(avid, name, position); if(announce && avatarp->getRegion() == gAgent.getRegion()) announce_keys.push(avid); - mAvatars.push_back(entry); + mAvatars.push_back(LLAvatarListEntryPtr(new LLAvatarListEntry(avid, name, position))); } } else @@ -640,10 +643,9 @@ void LLFloaterAvatarList::updateAvatarList() } else { - LLAvatarListEntry entry(avid, name, position); if(announce && gAgent.getRegion()->pointInRegionGlobal(position)) announce_keys.push(avid); - mAvatars.push_back(entry); + mAvatars.push_back(LLAvatarListEntryPtr(new LLAvatarListEntry(avid, name, position))); } } } @@ -707,10 +709,19 @@ void LLFloaterAvatarList::expireAvatarList() // llinfos << "radar: expiring" << llendl; for(av_list_t::iterator it = mAvatars.begin(); it != mAvatars.end();) { - if(!it->isDead()) - (it++)->getAlive(); + LLAvatarListEntry* entry = it->get(); + if(!entry->isDead()) + { + entry->getAlive(); + ++it; + } else { + if(mAvatars.back() == *it) + { + mAvatars.pop_back(); + return; + } *it = mAvatars.back(); mAvatars.pop_back(); if(mAvatars.empty()) @@ -771,17 +782,17 @@ void LLFloaterAvatarList::refreshAvatarList() std::string av_name; // Skip if avatar hasn't been around - if (entry.isDead()) + if (entry->isDead()) { continue; } - entry.setInList(); + entry->setInList(); - av_id = entry.getID(); - av_name = entry.getName().c_str(); + av_id = entry->getID(); + av_name = entry->getName().c_str(); - LLVector3d position = entry.getPosition(); + LLVector3d position = entry->getPosition(); BOOL UnknownAltitude = false; LLVector3d delta = position - mypos; @@ -814,14 +825,13 @@ void LLFloaterAvatarList::refreshAvatarList() } //Request properties here, so we'll have them later on when we need them - LLAvatarPropertiesProcessor::getInstance()->addObserver(entry.mID, &entry); - LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(entry.mID); + element["id"] = av_id; element["columns"][LIST_MARK]["column"] = "marked"; element["columns"][LIST_MARK]["type"] = "text"; - if (entry.isMarked()) + if (entry->isMarked()) { element["columns"][LIST_MARK]["value"] = "X"; element["columns"][LIST_MARK]["color"] = LLColor4::blue.getValue(); @@ -835,7 +845,7 @@ void LLFloaterAvatarList::refreshAvatarList() element["columns"][LIST_AVATAR_NAME]["column"] = "avatar_name"; element["columns"][LIST_AVATAR_NAME]["type"] = "text"; element["columns"][LIST_AVATAR_NAME]["value"] = av_name; - if (entry.isFocused()) + if (entry->isFocused()) { element["columns"][LIST_AVATAR_NAME]["font-style"] = "BOLD"; } @@ -843,7 +853,7 @@ void LLFloaterAvatarList::refreshAvatarList() // custom colors for certain types of avatars! //Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB //element["columns"][LIST_AVATAR_NAME]["color"] = gColors.getColor( "MapAvatar" ).getValue(); - LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry.getPosition()); + LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition()); LLUUID estate_owner = LLUUID::null; if(parent_estate && parent_estate->isAlive()) { @@ -895,7 +905,7 @@ void LLFloaterAvatarList::refreshAvatarList() if (UnknownAltitude) { strcpy(temp, "?"); - if (entry.isDrawn()) + if (entry->isDrawn()) { color = sRadarTextDrawDist; } @@ -916,7 +926,7 @@ void LLFloaterAvatarList::refreshAvatarList() } else { - if (entry.isDrawn()) + if (entry->isDrawn()) { color = sRadarTextDrawDist; } @@ -975,7 +985,7 @@ void LLFloaterAvatarList::refreshAvatarList() std::string activity_icon = ""; std::string activity_tip = ""; - switch(entry.getActivity()) + switch(entry->getActivity()) { case LLAvatarListEntry::ACTIVITY_MOVING: { @@ -1030,17 +1040,17 @@ void LLFloaterAvatarList::refreshAvatarList() element["columns"][LIST_AGE]["column"] = "age"; element["columns"][LIST_AGE]["type"] = "text"; color = sDefaultListText; - std::string age = boost::lexical_cast(entry.mAge); - if (entry.mAge > -1) + std::string age = boost::lexical_cast(entry->mAge); + if (entry->mAge > -1) { static LLCachedControl sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays"); - if ((U32)entry.mAge < sAvatarAgeAlertDays) + if ((U32)entry->mAge < sAvatarAgeAlertDays) { color = sRadarTextYoung; - if (!entry.mAgeAlert) //Only announce age once per entry. + if (!entry->mAgeAlert) //Only announce age once per entry. { - entry.mAgeAlert = true; - chat_avatar_status(entry.getName().c_str(), av_id, ALERT_TYPE_AGE, true); + entry->mAgeAlert = true; + chat_avatar_status(entry->getName().c_str(), av_id, ALERT_TYPE_AGE, true); } } } @@ -1051,7 +1061,7 @@ void LLFloaterAvatarList::refreshAvatarList() element["columns"][LIST_AGE]["value"] = age; element["columns"][LIST_AGE]["color"] = color.getValue(); - int dur = difftime(time(NULL), entry.getTime()); + int dur = difftime(time(NULL), entry->getTime()); int hours = dur / 3600; int mins = (dur % 3600) / 60; int secs = (dur % 3600) % 60; @@ -1225,7 +1235,7 @@ LLAvatarListEntry * LLFloaterAvatarList::getAvatarEntry(LLUUID avatar) av_list_t::iterator iter = std::find_if(mAvatars.begin(),mAvatars.end(),LLAvatarListEntry::uuidMatch(avatar)); if(iter != mAvatars.end()) - return &(*iter); + return iter->get(); else return NULL; } @@ -1297,7 +1307,7 @@ void LLFloaterAvatarList::removeFocusFromAll() { BOOST_FOREACH(av_list_t::value_type& entry, mAvatars) { - entry.setFocus(FALSE); + entry->setFocus(FALSE); } } @@ -1309,7 +1319,7 @@ void LLFloaterAvatarList::setFocusAvatar(const LLUUID& id) if(!gAgentCamera.lookAtObject(id, false)) return; removeFocusFromAll(); - iter->setFocus(TRUE); + (*iter)->setFocus(TRUE); } } @@ -1317,22 +1327,22 @@ template void decrement_focus_target(T begin, T end, BOOL marked_only) { T iter = begin; - while(iter != end && !iter->isFocused()) ++iter; + while(iter != end && !(*iter)->isFocused()) ++iter; if(iter == end) return; T prev_iter = iter; while(prev_iter != begin) { - LLAvatarListEntry& entry = *(--prev_iter); + const LLAvatarListEntry& entry = *((--prev_iter)->get()); if(entry.isInList() && (entry.isMarked() || !marked_only) && gAgentCamera.lookAtObject(entry.getID(), false)) { - iter->setFocus(FALSE); - prev_iter->setFocus(TRUE); - gAgentCamera.lookAtObject(prev_iter->getID(), false); + (*iter)->setFocus(FALSE); + (*prev_iter)->setFocus(TRUE); + gAgentCamera.lookAtObject((*prev_iter)->getID(), false); return; } } - gAgentCamera.lookAtObject(iter->getID(), false); + gAgentCamera.lookAtObject((*iter)->getID(), false); } void LLFloaterAvatarList::focusOnPrev(BOOL marked_only) diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index 8aa3d3665..3bcf4ea67 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -22,6 +22,8 @@ #include #include +#include + class LLFloaterAvatarList; /** @@ -130,7 +132,7 @@ enum ACTIVITY_TYPE struct uuidMatch { uuidMatch(const LLUUID& id) : mID(id) {} - bool operator()(const LLAvatarListEntry& l) { return l.getID() == mID; } + bool operator()(const boost::shared_ptr& l) { return l->getID() == mID; } LLUUID mID; }; @@ -243,7 +245,8 @@ public: static void sound_trigger_hook(LLMessageSystem* msg,void **); void sendKeys(); - typedef std::vector av_list_t; + typedef boost::shared_ptr LLAvatarListEntryPtr; + typedef std::vector< LLAvatarListEntryPtr > av_list_t; private: // when a line editor loses keyboard focus, it is committed. From ffa405dad9cec7b0d615f91ee3bfa6604bace63b Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 28 Dec 2012 01:25:11 -0500 Subject: [PATCH 04/18] Comment cleanup. --- indra/newview/llfloateravatarlist.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 319610e2e..e12b95156 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -824,8 +824,6 @@ void LLFloaterAvatarList::refreshAvatarList() continue; } - //Request properties here, so we'll have them later on when we need them - element["id"] = av_id; From 50eb45991d0f7ed741b9d36cfbde41d44740ceb6 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 28 Dec 2012 02:13:50 -0500 Subject: [PATCH 05/18] "attachments and wearables", not "clothing and wearables" --- .../skins/default/xui/en-us/panel_preferences_ascent_vanity.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index 02c163641..e60190d45 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -7,7 +7,7 @@ - + From 23469c00de6a8bfb4f62265801db94fd34d770ab Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 29 Dec 2012 07:45:05 -0500 Subject: [PATCH 06/18] Satisfy Issue 411: Song list in local chat - not a floater AnnounceStreamMetadata debug setting. "Announce music stream's metadata in local chat when tuned in" checkbox added to vanity main preferences. Made the words Title and Artist translatable, as well as the "Now playing" string. --- indra/newview/app_settings/settings.xml | 11 ++++++++++ indra/newview/ascentprefsvan.cpp | 6 ++++++ indra/newview/ascentprefsvan.h | 1 + indra/newview/llmediaremotectrl.cpp | 21 ++++++++++++++++--- .../xui/en-us/panel_media_remote_expanded.xml | 3 +++ .../en-us/panel_preferences_ascent_vanity.xml | 1 + 6 files changed, 40 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 988a2b196..5bca1ce16 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -843,6 +843,17 @@ This should be as low as possible, but too low may break functionality Value 1 + AnnounceStreamMetadata + + Comment + Announce the metadata of the track playing, in chat, during streams. + Persist + 1 + Type + Boolean + Value + 0 + InventorySortOrder Comment diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 5fdc90bed..e51e3c0e2 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -36,6 +36,8 @@ #include "ascentprefsvan.h" //project includes +#include "llaudioengine.h" //For gAudiop +#include "llstreamingaudio.h" //For LLStreamingAudioInterface #include "llcolorswatch.h" #include "llvoavatarself.h" #include "llagent.h" @@ -54,6 +56,8 @@ LLPrefsAscentVan::LLPrefsAscentVan() { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_vanity.xml"); + childSetVisible("announce_streaming_metadata", gAudiop && gAudiop->getStreamingAudioImpl() && gAudiop->getStreamingAudioImpl()->supportsMetaData()); + childSetCommitCallback("tag_spoofing_combobox", onCommitClientTag, this); childSetCommitCallback("show_my_tag_check", onCommitCheckBox, this); @@ -180,6 +184,7 @@ void LLPrefsAscentVan::refreshValues() mDisableChatAnimation = gSavedSettings.getBOOL("SGDisableChatAnimation"); mAddNotReplace = gSavedSettings.getBOOL("LiruAddNotReplace"); mTurnAround = gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards"); + mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata"); //Tags\Colors ---------------------------------------------------------------------------- mAscentUseTag = gSavedSettings.getBOOL("AscentUseTag"); @@ -256,6 +261,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setBOOL("SGDisableChatAnimation", mDisableChatAnimation); gSavedSettings.setBOOL("LiruAddNotReplace", mAddNotReplace); gSavedSettings.setBOOL("TurnAroundWhenWalkingBackwards", mTurnAround); + gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata); //Tags\Colors ---------------------------------------------------------------------------- gSavedSettings.setBOOL("AscentUseTag", mAscentUseTag); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index ec96b8cac..fd2cd7044 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -60,6 +60,7 @@ protected: bool mDisableChatAnimation; bool mAddNotReplace; bool mTurnAround; + bool mAnnounceStreamMetadata; //Tags\Colors BOOL mAscentUseTag; std::string mReportClientUUID; diff --git a/indra/newview/llmediaremotectrl.cpp b/indra/newview/llmediaremotectrl.cpp index 50d3276b8..e5fa89e16 100644 --- a/indra/newview/llmediaremotectrl.cpp +++ b/indra/newview/llmediaremotectrl.cpp @@ -35,6 +35,8 @@ #include "llmediaremotectrl.h" #include "llaudioengine.h" +#include "llchat.h" +#include "llfloaterchat.h" #include "lliconctrl.h" #include "llmimetypes.h" #include "lloverlaybar.h" @@ -53,6 +55,7 @@ // static LLRegisterWidget r("media_remote"); +static std::string sLastTooltip; LLMediaRemoteCtrl::LLMediaRemoteCtrl() { @@ -263,10 +266,22 @@ void LLMediaRemoteCtrl::enableMediaButtons() if(artist.isDefined() && title.isDefined()) info_text = artist.asString() + " -- " + title.asString(); else if(title.isDefined()) - info_text = std::string("Title: ") + title.asString(); + info_text = getString("Title") + ": " + title.asString(); else if(artist.isDefined()) - info_text = std::string("Artist: ") + artist.asString(); - music_pause_btn->setToolTip(info_text); + info_text = getString("Artist") + ": " + artist.asString(); + if(music_pause_btn->getToolTip() != info_text) //Has info_text changed since last call? + { + music_pause_btn->setToolTip(info_text); + static LLCachedControl announce_stream_metadata("AnnounceStreamMetadata"); + if(announce_stream_metadata && info_text != sLastTooltip && info_text != "Loading...") //Are we announcing? Don't annoounce what we've last announced. Don't announce Loading. + { + sLastTooltip = info_text; + LLChat chat; + chat.mText = getString("Now_playing") + " " + info_text; + chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChat(chat); + } + } } else music_pause_btn->setToolTip(mCachedPauseTip); diff --git a/indra/newview/skins/default/xui/en-us/panel_media_remote_expanded.xml b/indra/newview/skins/default/xui/en-us/panel_media_remote_expanded.xml index 726653614..94702ca97 100644 --- a/indra/newview/skins/default/xui/en-us/panel_media_remote_expanded.xml +++ b/indra/newview/skins/default/xui/en-us/panel_media_remote_expanded.xml @@ -15,6 +15,9 @@ Pause + Title + Artist + Now playing No Media Specified diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index e60190d45..ea9031f65 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -9,6 +9,7 @@ + From cf5838505f343904200d075d4268731ac815d382 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 29 Dec 2012 07:58:06 -0500 Subject: [PATCH 07/18] In-world feature request: Announce in chat when someone has taken a snapshot. AnnounceSnapshots debug setting. "Announce when someone takes a snapshot" added to Vanity Main Preferences. took_a_snapshot translatable string added to strings.xml Also in this commit: Turned PlayTypingSound check into LLCachedControl. In preparation for the crippling of all old viewers, the Vanity Main tab shall henceforth only be called Main, not Main (General) This change has been made in the code comments and the UI itself. --- indra/newview/app_settings/settings.xml | 14 ++++++++++++++ indra/newview/ascentprefsvan.cpp | 8 +++++--- indra/newview/ascentprefsvan.h | 3 ++- indra/newview/llvoavatar.cpp | 15 ++++++++++++++- .../xui/en-us/panel_preferences_ascent_vanity.xml | 5 +++-- indra/newview/skins/default/xui/en-us/strings.xml | 3 +++ 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5bca1ce16..4c0f5db9c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -843,6 +843,20 @@ This should be as low as possible, but too low may break functionality Value 1 + AnnounceSnapshots + + Comment + +Announce if someone nearby has taken a snapshot in chat +(Won't work on people who hide/quiet snapshots) + + Persist + 1 + Type + Boolean + Value + 0 + AnnounceStreamMetadata Comment diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index e51e3c0e2..ac6a2a28e 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -176,7 +176,7 @@ void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) // Store current settings for cancel void LLPrefsAscentVan::refreshValues() { - //General -------------------------------------------------------------------------------- + //Main ----------------------------------------------------------------------------------- mUseAccountSettings = gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"); mShowTPScreen = !gSavedSettings.getBOOL("AscentDisableTeleportScreens"); mPlayTPSound = gSavedSettings.getBOOL("OptionPlayTpSound"); @@ -184,6 +184,7 @@ void LLPrefsAscentVan::refreshValues() mDisableChatAnimation = gSavedSettings.getBOOL("SGDisableChatAnimation"); mAddNotReplace = gSavedSettings.getBOOL("LiruAddNotReplace"); mTurnAround = gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards"); + mAnnounceSnapshots = gSavedSettings.getBOOL("AnnounceStreamMetadata"); mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata"); //Tags\Colors ---------------------------------------------------------------------------- @@ -224,7 +225,7 @@ void LLPrefsAscentVan::refreshValues() // Update controls based on current settings void LLPrefsAscentVan::refresh() { - //General -------------------------------------------------------------------------------- + //Main ----------------------------------------------------------------------------------- //Tags\Colors ---------------------------------------------------------------------------- LLComboBox* combo = getChild("tag_spoofing_combobox"); @@ -253,7 +254,7 @@ void LLPrefsAscentVan::refresh() // Reset settings to local copy void LLPrefsAscentVan::cancel() { - //General -------------------------------------------------------------------------------- + //Main ----------------------------------------------------------------------------------- gSavedSettings.setBOOL("AscentStoreSettingsPerAccount", mUseAccountSettings); gSavedSettings.setBOOL("AscentDisableTeleportScreens", !mShowTPScreen); gSavedSettings.setBOOL("OptionPlayTpSound", mPlayTPSound); @@ -261,6 +262,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setBOOL("SGDisableChatAnimation", mDisableChatAnimation); gSavedSettings.setBOOL("LiruAddNotReplace", mAddNotReplace); gSavedSettings.setBOOL("TurnAroundWhenWalkingBackwards", mTurnAround); + gSavedSettings.setBOOL("AnnounceSnapshots", mAnnounceSnapshots); gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata); //Tags\Colors ---------------------------------------------------------------------------- diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index fd2cd7044..271d2af59 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -52,7 +52,7 @@ protected: static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); static void onCommitTextModified(LLUICtrl* ctrl, void* userdata); static void onManualClientUpdate(void* data); - //General + //Main BOOL mUseAccountSettings; BOOL mShowTPScreen; BOOL mPlayTPSound; @@ -60,6 +60,7 @@ protected: bool mDisableChatAnimation; bool mAddNotReplace; bool mTurnAround; + bool mAnnounceSnapshots; bool mAnnounceStreamMetadata; //Tags\Colors BOOL mAscentUseTag; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bbaa976da..9e6fbb461 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5606,7 +5606,9 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL if ( start ) // start animation { - if (anim_id == ANIM_AGENT_TYPE && gSavedSettings.getBOOL("PlayTypingSound")) + static LLCachedControl play_typing_sound("PlayTypingSound"); + static LLCachedControl announce_snapshots("AnnounceSnapshots"); + if (anim_id == ANIM_AGENT_TYPE && play_typing_sound) { if (gAudiop) { @@ -5632,6 +5634,17 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL { sitDown(TRUE); } + else if(anim_id == ANIM_AGENT_SNAPSHOT && announce_snapshots) + { + std::string name; + LLAvatarNameCache::getPNSName(mID, name); + LLChat chat; + chat.mFromName = name; + chat.mText = name + " " + LLTrans::getString("took_a_snapshot") + "."; + chat.mURL = llformat("secondlife:///app/agent/%s/about",mID.asString().c_str()); + chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChat(chat); + } if (startMotion(anim_id)) diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index ea9031f65..46a679fe2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -1,7 +1,7 @@ - - + + @@ -9,6 +9,7 @@ + diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index 1570f8114..43a32c59d 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -2946,6 +2946,9 @@ Where tag = tag string to match. Removes bot's matching the tag. Currently set to an item not on this account Not logged in + + took a snapshot + Not Away Away From 2c491bc9051b98eae5cfb186263cd43632274931 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 29 Dec 2012 19:24:17 -0500 Subject: [PATCH 08/18] Break out LLMakeOutfitDialog. Added "Make Outfit..." to Edit menu and Create->"New Outfit" to inventory floater menu. Cleaned up LLMakeOutfitDialog, using boost::bind and less waste. Moved onMakeOutfitCommit() to LLMakeOutfitDialog as makeOutfit() Also changes LLFloaterCustomize's callbacks to use boost::bind Give new outfit dialog a title instead of a heading. Small fix to mistake with AnnounceSnapshots xmlstuffs. --- indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 5 +- indra/newview/ascentprefsvan.cpp | 2 +- indra/newview/llfloatercustomize.cpp | 284 +----------------- indra/newview/llfloatercustomize.h | 10 +- indra/newview/llinventoryactions.cpp | 5 + indra/newview/llmakeoutfitdialog.cpp | 218 ++++++++++++++ indra/newview/llmakeoutfitdialog.h | 66 ++++ indra/newview/llviewermenu.cpp | 7 +- .../default/xui/en-us/floater_inventory.xml | 4 + .../xui/en-us/floater_new_outfit_dialog.xml | 6 +- .../skins/default/xui/en-us/menu_viewer.xml | 4 + 12 files changed, 327 insertions(+), 286 deletions(-) create mode 100644 indra/newview/llmakeoutfitdialog.cpp create mode 100644 indra/newview/llmakeoutfitdialog.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fafe4e4e8..e4b4cdd30 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -301,6 +301,7 @@ set(viewer_SOURCE_FILES lllogchat.cpp llloginhandler.cpp llmainlooprepeater.cpp + llmakeoutfitdialog.cpp llmanip.cpp llmaniprotate.cpp llmanipscale.cpp @@ -808,6 +809,7 @@ set(viewer_HEADER_FILES lllogchat.h llloginhandler.h llmainlooprepeater.h + llmakeoutfitdialog.h llmanip.h llmaniprotate.h llmanipscale.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4c0f5db9c..e0a106ed3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -846,10 +846,7 @@ This should be as low as possible, but too low may break functionality AnnounceSnapshots Comment - -Announce if someone nearby has taken a snapshot in chat -(Won't work on people who hide/quiet snapshots) - + Announce if someone nearby has taken a snapshot in chat (Won't work on people who hide/quiet snapshots) Persist 1 Type diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index ac6a2a28e..0fb702115 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -184,7 +184,7 @@ void LLPrefsAscentVan::refreshValues() mDisableChatAnimation = gSavedSettings.getBOOL("SGDisableChatAnimation"); mAddNotReplace = gSavedSettings.getBOOL("LiruAddNotReplace"); mTurnAround = gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards"); - mAnnounceSnapshots = gSavedSettings.getBOOL("AnnounceStreamMetadata"); + mAnnounceSnapshots = gSavedSettings.getBOOL("AnnounceSnapshots"); mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata"); //Tags\Colors ---------------------------------------------------------------------------- diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp index 890d80829..680df5f05 100644 --- a/indra/newview/llfloatercustomize.cpp +++ b/indra/newview/llfloatercustomize.cpp @@ -32,7 +32,6 @@ #include "llviewerprecompiledheaders.h" -#include "llappearancemgr.h" #include "llimagejpeg.h" #include "llfloatercustomize.h" #include "llfontgl.h" @@ -64,7 +63,6 @@ #include "llviewercamera.h" #include "llappearance.h" #include "imageids.h" -#include "llmodaldialog.h" #include "llassetstorage.h" #include "lltexturectrl.h" #include "lltextureentry.h" @@ -79,9 +77,9 @@ #include "lluictrlfactory.h" #include "llnotificationsutil.h" #include "llpaneleditwearable.h" +#include "llmakeoutfitdialog.h" #include "statemachine/aifilepicker.h" -#include "hippogridmanager.h" using namespace LLVOAvatarDefines; @@ -119,220 +117,6 @@ BOOL edit_wearable_for_teens(LLWearableType::EType type) } } -class LLMakeOutfitDialog : public LLModalDialog -{ -private: - std::string mFolderName; - void (*mCommitCallback)(LLMakeOutfitDialog*,void*); - void* mCallbackUserData; - std::vector > mCheckBoxList; - -public: - LLMakeOutfitDialog( void(*commit_cb)(LLMakeOutfitDialog*,void*), void* userdata ) - : LLModalDialog(LLStringUtil::null,515, 510, TRUE ), - mCommitCallback( commit_cb ), - mCallbackUserData( userdata ) - { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_new_outfit_dialog.xml"); - - // Build list of check boxes - for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ ) - { - std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel( (LLWearableType::EType)i ); - mCheckBoxList.push_back(std::make_pair(name,i)); - // Hide teen items - if (gAgent.isTeen() && - !edit_wearable_for_teens((LLWearableType::EType)i)) - { - // hide wearable checkboxes that don't apply to this account - std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel( (LLWearableType::EType)i ); - childSetVisible(name, FALSE); - } - } - - // NOTE: .xml needs to be updated if attachments are added or their names are changed! - LLVOAvatar* avatar = gAgentAvatarp; - if( avatar ) - { - for (LLVOAvatar::attachment_map_t::iterator iter = avatar->mAttachmentPoints.begin(); - iter != avatar->mAttachmentPoints.end(); ) - { - LLVOAvatar::attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - S32 attachment_pt = curiter->first; - BOOL object_attached = ( attachment->getNumObjects() > 0 ); - std::string name = std::string("checkbox_") + attachment->getName(); - mCheckBoxList.push_back(std::make_pair(name,attachment_pt)); - childSetEnabled(name, object_attached); - } - } - - if(!gHippoGridManager->getConnectedGrid()->supportsInvLinks()) { - childSetEnabled("checkbox_use_links", FALSE); - childSetValue("checkbox_use_links", FALSE); - childSetEnabled("checkbox_use_outfits", FALSE); - childSetValue("checkbox_use_outfits", FALSE); - } - - childSetAction("Save", onSave, this ); - childSetAction("Cancel", onCancel, this ); - childSetAction("Check All", onCheckAll, this ); - childSetAction("Uncheck All", onUncheckAll, this ); - - LLCheckBoxCtrl* pOutfitFoldersCtrl = getChild("checkbox_use_outfits"); - pOutfitFoldersCtrl->setCommitCallback(&LLMakeOutfitDialog::onOutfitFoldersToggle); - pOutfitFoldersCtrl->setCallbackUserData(this); - } - - bool getUseOutfits() - { - return childGetValue("checkbox_use_outfits").asBoolean(); - } - bool getUseLinks() - { - return childGetValue("checkbox_use_links").asBoolean(); - } - /*bool getRenameClothing() - { - return childGetValue("rename").asBoolean(); - }*/ - virtual void draw() - { - BOOL one_or_more_items_selected = FALSE; - for( S32 i = 0; i < (S32)mCheckBoxList.size(); i++ ) - { - if( childGetValue(mCheckBoxList[i].first).asBoolean() ) - { - one_or_more_items_selected = TRUE; - break; - } - } - - childSetEnabled("Save", one_or_more_items_selected ); - - LLModalDialog::draw(); - } - - const std::string& getFolderName() { return mFolderName; } - - void setWearableToInclude( S32 wearable, S32 enabled, S32 selected ) - { - LLWearableType::EType wtType = (LLWearableType::EType)wearable; - if ( ( (0 <= wtType) && (wtType < LLWearableType::WT_COUNT) ) && - ( (LLAssetType::AT_BODYPART != LLWearableType::getAssetType(wtType)) || (!getUseOutfits()) ) ) - { - std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel(wtType); - childSetEnabled(name, enabled); - childSetValue(name, selected); - } - } - - void getIncludedItems( LLInventoryModel::item_array_t& item_list ) - { - LLInventoryModel::cat_array_t *cats; - LLInventoryModel::item_array_t *items; - gInventory.getDirectDescendentsOf(LLAppearanceMgr::instance().getCOF(), cats, items); - for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); - iter != items->end(); - ++iter) - { - LLViewerInventoryItem* item = (*iter); - if(!item) - continue; - if(item->isWearableType()) - { - LLWearableType::EType type = item->getWearableType(); - if (type < LLWearableType::WT_COUNT && childGetValue(mCheckBoxList[type].first).asBoolean()) - { - item_list.push_back(item); - } - } - else - { - LLViewerJointAttachment* attachment = gAgentAvatarp->getWornAttachmentPoint(item->getLinkedUUID()); - if(attachment && childGetValue(std::string("checkbox_")+attachment->getName()).asBoolean()) - { - item_list.push_back(item); - } - } - } - } - - static void onSave( void* userdata ) - { - LLMakeOutfitDialog* self = (LLMakeOutfitDialog*) userdata; - self->mFolderName = self->childGetValue("name ed").asString(); - LLStringUtil::trim(self->mFolderName); - if( !self->mFolderName.empty() ) - { - if( self->mCommitCallback ) - { - self->mCommitCallback( self, self->mCallbackUserData ); - } - self->close(); // destroys this object - } - } - - static void onCheckAll( void* userdata ) - { - LLMakeOutfitDialog* self = (LLMakeOutfitDialog*) userdata; - for( S32 i = 0; i < (S32)(self->mCheckBoxList.size()); i++) - { - std::string name = self->mCheckBoxList[i].first; - if(self->childIsEnabled(name))self->childSetValue(name,TRUE); - } - } - - static void onUncheckAll( void* userdata ) - { - LLMakeOutfitDialog* self = (LLMakeOutfitDialog*) userdata; - for( S32 i = 0; i < (S32)(self->mCheckBoxList.size()); i++) - { - std::string name = self->mCheckBoxList[i].first; - if(self->childIsEnabled(name))self->childSetValue(name,FALSE); - } - } - - static void onCancel( void* userdata ) - { - LLMakeOutfitDialog* self = (LLMakeOutfitDialog*) userdata; - self->close(); // destroys this object - } - - BOOL postBuild() - { - refresh(); - return TRUE; - } - - void refresh() - { - BOOL fUseOutfits = getUseOutfits(); - - for (S32 idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++ ) - { - LLWearableType::EType wtType = (LLWearableType::EType)idxType; - if (LLAssetType::AT_BODYPART != LLWearableType::getAssetType(wtType)) - continue; - LLCheckBoxCtrl* pCheckCtrl = getChild(std::string("checkbox_") + LLWearableType::getTypeLabel(wtType)); - if (!pCheckCtrl) - continue; - - pCheckCtrl->setEnabled(!fUseOutfits); - if (fUseOutfits) - pCheckCtrl->setValue(TRUE); - } - childSetEnabled("checkbox_use_links", !fUseOutfits); - } - - static void onOutfitFoldersToggle(LLUICtrl*, void* pParam) - { - LLMakeOutfitDialog* pSelf = (LLMakeOutfitDialog*)pParam; - if (pSelf) - pSelf->refresh(); - } -}; - //////////////////////////////////////////////////////////////////////////// void updateAvatarHeightDisplay() @@ -393,13 +177,13 @@ LLFloaterCustomize::LLFloaterCustomize() BOOL LLFloaterCustomize::postBuild() { - childSetAction("Make Outfit", LLFloaterCustomize::onBtnMakeOutfit, (void*)this); - childSetAction("Ok", LLFloaterCustomize::onBtnOk, (void*)this); - childSetAction("Cancel", LLFloater::onClickClose, (void*)this); + getChild("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this)); + getChild("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this)); + getChild("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this)); // reX - childSetAction("Import", LLFloaterCustomize::onBtnImport, (void*)this); - childSetAction("Export", LLFloaterCustomize::onBtnExport, (void*)this); + getChild("Import")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnImport, this)); + getChild("Export")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnExport, this)); // Wearable panels initWearablePanels(); @@ -459,7 +243,7 @@ void LLFloaterCustomize::setCurrentWearableType( LLWearableType::EType type ) } // reX: new function -void LLFloaterCustomize::onBtnImport( void* userdata ) +void LLFloaterCustomize::onBtnImport() { AIFilePicker* filepicker = AIFilePicker::create(); filepicker->open(FFLOAD_XML); @@ -519,7 +303,7 @@ void LLFloaterCustomize::onBtnImport_continued(AIFilePicker* filepicker) } // reX: new function -void LLFloaterCustomize::onBtnExport( void* userdata ) +void LLFloaterCustomize::onBtnExport() { AIFilePicker* filepicker = AIFilePicker::create(); filepicker->open("", FFSAVE_XML); @@ -592,10 +376,8 @@ void LLFloaterCustomize::onBtnExport_continued(AIFilePicker* filepicker) fclose(fp); } -// static -void LLFloaterCustomize::onBtnOk( void* userdata ) +void LLFloaterCustomize::onBtnOk() { - LLFloaterCustomize* floater = (LLFloaterCustomize*) userdata; gAgentWearables.saveAllWearables(); if ( gAgentAvatarp ) @@ -607,55 +389,13 @@ void LLFloaterCustomize::onBtnOk( void* userdata ) gAgent.sendAgentSetAppearance(); } - gFloaterView->sendChildToBack(floater); + gFloaterView->sendChildToBack(this); handle_reset_view(); // Calls askToSaveIfDirty } -// static -void LLFloaterCustomize::onBtnMakeOutfit( void* userdata ) +void LLFloaterCustomize::onBtnMakeOutfit() { - LLVOAvatar* avatar = gAgentAvatarp; - if(avatar) - { - LLMakeOutfitDialog* dialog = new LLMakeOutfitDialog( onMakeOutfitCommit, NULL ); - // LLMakeOutfitDialog deletes itself. - - for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ ) - { - BOOL enabled = (gAgentWearables.getWearableCount( (LLWearableType::EType) i )); // TODO: MULTI-WEARABLE - BOOL selected = (enabled && (LLWearableType::WT_SHIRT <= i) && (i < LLWearableType::WT_COUNT)); // only select clothing by default - if (gAgent.isTeen() - && !edit_wearable_for_teens((LLWearableType::EType)i)) - { - dialog->setWearableToInclude( i, FALSE, FALSE ); - } - else - { - dialog->setWearableToInclude( i, enabled, selected ); - } - } - dialog->startModal(); - } -} - -// static -void LLFloaterCustomize::onMakeOutfitCommit( LLMakeOutfitDialog* dialog, void* userdata ) -{ - LLVOAvatar* avatar = gAgentAvatarp; - if(avatar) - { - LLDynamicArray wearables_to_include; - LLDynamicArray attachments_to_include; // attachment points - - LLInventoryModel::item_array_t item_list; - dialog->getIncludedItems(item_list); - - // MULTI-WEARABLES TODO - if(dialog->getUseOutfits()) - LLAppearanceMgr::instance().makeNewOutfitLinks( dialog->getFolderName(), item_list); - else - LLAppearanceMgr::instance().makeNewOutfitLegacy( dialog->getFolderName(), item_list, dialog->getUseLinks()); - } + new LLMakeOutfitDialog(true); // LLMakeOutfitDialog deletes itself. } //////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloatercustomize.h b/indra/newview/llfloatercustomize.h index e603209fe..d82d7c267 100644 --- a/indra/newview/llfloatercustomize.h +++ b/indra/newview/llfloatercustomize.h @@ -98,12 +98,12 @@ public: static LLWearableType::EType getCurrentWearableType() { return sCurrentWearableType; } // Callbacks - static void onBtnOk( void* userdata ); - static void onBtnMakeOutfit( void* userdata ); - static void onMakeOutfitCommit( LLMakeOutfitDialog* dialog, void* userdata ); - static void onBtnImport( void* userdata ); + void onBtnOk(); + void onBtnMakeOutfit(); + void onMakeOutfitCommit(); + void onBtnImport(); static void onBtnImport_continued(AIFilePicker* filepicker); - static void onBtnExport( void* userdata ); + void onBtnExport(); static void onBtnExport_continued(AIFilePicker* filepicker); static void onTabChanged( const LLSD& param ); diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index 372b9bf83..074c4132a 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -67,6 +67,7 @@ #include "llinventoryclipboard.h" #include "llinventorymodelbackgroundfetch.h" #include "lllineeditor.h" +#include "llmakeoutfitdialog.h" #include "llmenugl.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" @@ -382,6 +383,10 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type, LLInventoryType::IT_GESTURE, PERM_ALL); } + else if ("outfit" == type) + { + new LLMakeOutfitDialog(false); + } else { LLWearableType::EType wear_type = LLWearableType::typeNameToType(type); diff --git a/indra/newview/llmakeoutfitdialog.cpp b/indra/newview/llmakeoutfitdialog.cpp new file mode 100644 index 000000000..b84e668b6 --- /dev/null +++ b/indra/newview/llmakeoutfitdialog.cpp @@ -0,0 +1,218 @@ +/** + * @file llmakeoutfitdialog.cpp + * @brief The Make Outfit Dialog, triggered by "Make Outfit" and similar UICtrls. + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llmakeoutfitdialog.h" + +#include "llagent.h" +#include "llappearancemgr.h" +#include "lluictrlfactory.h" +#include "llvoavatarself.h" + +#include "hippogridmanager.h" + +LLMakeOutfitDialog::LLMakeOutfitDialog(bool modal) : LLModalDialog(LLStringUtil::null, 515, 510, modal) +{ + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_new_outfit_dialog.xml"); + + setCanClose(!modal); + setCanMinimize(!modal); + + // Build list of check boxes + for (S32 i = 0; i < LLWearableType::WT_COUNT; i++) + { + std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel((LLWearableType::EType)i); + mCheckBoxList.push_back(std::make_pair(name, i)); + // Hide undergarments from teens + if (gAgent.isTeen() && ((LLWearableType::WT_UNDERSHIRT == (LLWearableType::EType)i) || (LLWearableType::WT_UNDERPANTS == (LLWearableType::EType)i))) + { + childSetVisible(name, false); // Lest they know what's beyond their reach. + } + else + { + bool enabled = gAgentWearables.getWearableCount((LLWearableType::EType)i); // TODO: MULTI-WEARABLE + bool selected = enabled && (LLWearableType::WT_SHIRT <= i); // only select clothing by default + childSetEnabled(name, enabled); + childSetValue(name, selected); + } + } + + // NOTE: .xml needs to be updated if attachments are added or their names are changed! + LLVOAvatar* avatar = gAgentAvatarp; + if (avatar) + { + for (LLVOAvatar::attachment_map_t::iterator iter = avatar->mAttachmentPoints.begin(); iter != avatar->mAttachmentPoints.end();) + { + LLVOAvatar::attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + S32 attachment_pt = curiter->first; + bool object_attached = (attachment->getNumObjects() > 0); + std::string name = std::string("checkbox_") + attachment->getName(); + mCheckBoxList.push_back(std::make_pair(name, attachment_pt)); + childSetEnabled(name, object_attached); + } + } + + if (!gHippoGridManager->getConnectedGrid()->supportsInvLinks()) + { + childSetEnabled("checkbox_use_links", false); + childSetValue("checkbox_use_links", false); + childSetEnabled("checkbox_use_outfits", false); + childSetValue("checkbox_use_outfits", false); + } + + getChild("Save")->setCommitCallback(boost::bind(&LLMakeOutfitDialog::onSave, this)); + getChild("Cancel")->setCommitCallback(boost::bind(&LLMakeOutfitDialog::close, this, _1)); + getChild("Check All")->setCommitCallback(boost::bind(&LLMakeOutfitDialog::onCheckAll, this, true)); + getChild("Uncheck All")->setCommitCallback(boost::bind(&LLMakeOutfitDialog::onCheckAll, this, false)); + getChild("checkbox_use_outfits")->setCommitCallback(boost::bind(&LLMakeOutfitDialog::refresh, this)); + startModal(); +} + +//virtual +void LLMakeOutfitDialog::draw() +{ + bool one_or_more_items_selected = false; + for (S32 i = 0; i < (S32)mCheckBoxList.size(); i++) + { + if (childGetValue(mCheckBoxList[i].first).asBoolean()) + { + one_or_more_items_selected = true; + break; + } + } + childSetEnabled("Save", one_or_more_items_selected); + + LLModalDialog::draw(); +} + +BOOL LLMakeOutfitDialog::postBuild() +{ + refresh(); + return true; +} + +void LLMakeOutfitDialog::refresh() +{ + bool fUseOutfits = getUseOutfits(); + + for (S32 idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++) + { + LLWearableType::EType wtType = (LLWearableType::EType)idxType; + if (LLAssetType::AT_BODYPART != LLWearableType::getAssetType(wtType)) + continue; + LLUICtrl* pCheckCtrl = getChild(std::string("checkbox_") + LLWearableType::getTypeLabel(wtType)); + if (!pCheckCtrl) + continue; + + pCheckCtrl->setEnabled(!fUseOutfits); + if (fUseOutfits) + pCheckCtrl->setValue(true); + } + childSetEnabled("checkbox_use_links", !fUseOutfits); +} + + +void LLMakeOutfitDialog::setWearableToInclude(S32 wearable, bool enabled, bool selected) +{ + LLWearableType::EType wtType = (LLWearableType::EType)wearable; + if (((0 <= wtType) && (wtType < LLWearableType::WT_COUNT)) && + ((LLAssetType::AT_BODYPART != LLWearableType::getAssetType(wtType)) || !getUseOutfits())) + { + std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel(wtType); + childSetEnabled(name, enabled); + childSetValue(name, selected); + } +} + +void LLMakeOutfitDialog::getIncludedItems(LLInventoryModel::item_array_t& item_list) +{ + LLInventoryModel::cat_array_t *cats; + LLInventoryModel::item_array_t *items; + gInventory.getDirectDescendentsOf(LLAppearanceMgr::instance().getCOF(), cats, items); + for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); iter != items->end(); ++iter) + { + LLViewerInventoryItem* item = (*iter); + if (!item) + continue; + if (item->isWearableType()) + { + LLWearableType::EType type = item->getWearableType(); + if (type < LLWearableType::WT_COUNT && childGetValue(mCheckBoxList[type].first).asBoolean()) + { + item_list.push_back(item); + } + } + else + { + LLViewerJointAttachment* attachment = gAgentAvatarp->getWornAttachmentPoint(item->getLinkedUUID()); + if (attachment && childGetValue(std::string("checkbox_")+attachment->getName()).asBoolean()) + { + item_list.push_back(item); + } + } + } +} + +void LLMakeOutfitDialog::onSave() +{ + std::string folder_name = childGetValue("name ed").asString(); + LLStringUtil::trim(folder_name); + if (!folder_name.empty()) + { + makeOutfit(folder_name); + close(); // destroys this object + } +} + +void LLMakeOutfitDialog::onCheckAll(bool check) +{ + for (S32 i = 0; i < (S32)(mCheckBoxList.size()); i++) + { + std::string name = mCheckBoxList[i].first; + if (childIsEnabled(name)) childSetValue(name, check); + } +} + +void LLMakeOutfitDialog::makeOutfit(const std::string folder_name) +{ + LLInventoryModel::item_array_t item_list; + getIncludedItems(item_list); + + // MULTI-WEARABLES TODO + if (getUseOutfits()) + LLAppearanceMgr::instance().makeNewOutfitLinks(folder_name, item_list); + else + LLAppearanceMgr::instance().makeNewOutfitLegacy(folder_name, item_list, getUseLinks()); +} + diff --git a/indra/newview/llmakeoutfitdialog.h b/indra/newview/llmakeoutfitdialog.h new file mode 100644 index 000000000..caed1ceef --- /dev/null +++ b/indra/newview/llmakeoutfitdialog.h @@ -0,0 +1,66 @@ +/** + * @file llmakeoutfitdialog.h + * @brief The Make Outfit Dialog, triggered by "Make Outfit" and similar UICtrls. + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLMAKEOUTFITDIALOG_H +#define LLMAKEOUTFITDIALOG_H + + +#include "llinventorymodel.h" +#include "llmodaldialog.h" + +class LLMakeOutfitDialog : public LLModalDialog +{ +private: + std::vector > mCheckBoxList; + +public: + LLMakeOutfitDialog(bool modal = true); + /*virtual*/ void draw(); + BOOL postBuild(); + void refresh(); + + void setWearableToInclude(S32 wearable, bool enabled, bool selected); //TODO: Call this when Wearables are added or removed to update the Dialog in !modal mode. + void onSave(); + void onCheckAll(bool check); + + //Accessors + void getIncludedItems(LLInventoryModel::item_array_t& item_list); + bool getUseOutfits() { return childGetValue("checkbox_use_outfits").asBoolean(); } + bool getUseLinks() { return childGetValue("checkbox_use_links").asBoolean(); } + //bool getRenameClothing() { return childGetValue("rename").asBoolean(); } + +protected: + void makeOutfit(const std::string folder_name); +}; + +#endif //LLMAKEOUTFITDIALOG_H + diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d4fc9c02c..c8fa64f01 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -178,7 +178,7 @@ #include "llinventorypanel.h" #include "llinventorybridge.h" #include "llkeyboard.h" -#include "llpanellogin.h" +#include "llmakeoutfitdialog.h" #include "llmenucommands.h" #include "llmenugl.h" #include "llmimetypes.h" @@ -187,6 +187,7 @@ #include "llmoveview.h" #include "llmutelist.h" #include "llnotify.h" +#include "llpanellogin.h" #include "llpanelobject.h" #include "llparcel.h" @@ -6524,6 +6525,10 @@ class LLShowFloater : public view_listener_t gAgentCamera.changeCameraToCustomizeAvatar(); } } + else if (floater_name == "outfit") + { + new LLMakeOutfitDialog(false); + } // Phoenix: Wolfspirit: Enabled Show Floater out of viewer menu else if (floater_name == "displayname") { diff --git a/indra/newview/skins/default/xui/en-us/floater_inventory.xml b/indra/newview/skins/default/xui/en-us/floater_inventory.xml index aa860ce0b..28da7d9a7 100644 --- a/indra/newview/skins/default/xui/en-us/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_inventory.xml @@ -190,6 +190,10 @@ + + + + mouse_opaque="true" name="modal container" title="Make New Outfit" width="515"> diff --git a/indra/newview/skins/default/xui/es/panel_avatar.xml b/indra/newview/skins/default/xui/es/panel_avatar.xml index c70b745ea..2260bb77c 100644 --- a/indra/newview/skins/default/xui/es/panel_avatar.xml +++ b/indra/newview/skins/default/xui/es/panel_avatar.xml @@ -1,6 +1,6 @@ - + [ACCTTYPE] @@ -58,7 +58,7 @@ From f94f4a1191a12358edb412e663040c57ee1d594a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 31 Dec 2012 04:54:59 -0500 Subject: [PATCH 13/18] Satisfy Issue 100: When timestamp it set to include seconds, the seconds do not get included with IM & chat logs. Best viewed without space changes. SecondsInLog debug setting added. Seconds in Log timestamps checkbox added to Adv. Chat prefs. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/ascentprefschat.cpp | 2 ++ indra/newview/ascentprefschat.h | 1 + indra/newview/lllogchat.cpp | 11 +++++++++-- .../xui/en-us/panel_preferences_ascent_chat.xml | 1 + 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e0a106ed3..b3bd8fb3a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5835,6 +5835,17 @@ This should be as low as possible, but too low may break functionality Value 0 + SecondsInLog + + Comment + TRUE to add seconds to timestamps for Log + Persist + 1 + Type + Boolean + Value + 0 + FloaterAboutRect Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index cb7b9e906..2cdfad841 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -335,6 +335,7 @@ void LLPrefsAscentChat::refreshValues() mEnableOOCAutoClose = gSavedSettings.getBOOL("AscentAutoCloseOOC"); mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects"); mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs"); + mSecondsInLog = gSavedSettings.getBOOL("SecondsInLog"); std::string format = gSavedSettings.getString("ShortTimeFormat"); if (format.find("%p") == -1) @@ -540,6 +541,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("AscentAutoCloseOOC", mEnableOOCAutoClose); gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects); gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs); + gSavedSettings.setBOOL("SecondsInLog", mSecondsInLog); std::string short_date, long_date, short_time, long_time, timestamp; diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index cc335cf3e..ba6476d6e 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -76,6 +76,7 @@ protected: U32 tempTimeFormat; U32 tempDateFormat; BOOL mSecondsInChatAndIMs; + BOOL mSecondsInLog; BOOL mIMResponseAnyone; BOOL mIMResponseFriends; diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index e80032239..192c5f531 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -88,11 +88,18 @@ std::string LLLogChat::timestamp(bool withdate) // it's daylight savings time there. timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); + static LLCachedControl withseconds("SecondsInLog"); std::string text; if (withdate) - text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); + if (withseconds) + text = llformat("[%d-%02d-%02d %02d:%02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec); + else + text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); else - text = llformat("[%02d:%02d] ", timep->tm_hour, timep->tm_min); + if (withseconds) + text = llformat("[%02d:%02d:%02d] ", timep->tm_hour, timep->tm_min, timep->tm_sec); + else + text = llformat("[%02d:%02d] ", timep->tm_hour, timep->tm_min); return text; } diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 4517105a2..5bc7d73b2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -44,6 +44,7 @@ DD/MM/YYYY MM/DD/YYYY + Date: Mon, 31 Dec 2012 06:24:35 -0500 Subject: [PATCH 14/18] In-group feature request: Allow coloring chat of special people (Friends, Estate Owner, Lindens, Muted Residents) Added ColorFriendChat, ColorEstateOwnerChat, ColorLindenChat, and ColorMutedChat. Did some spaces to tabs work, view without space changes. Add checkboxes beneath corresponding color swatches and "Use colors for chat:" text to Vanity. Fix Ascent*Color Comments strings. Also fix the issue where clicking ones name in a group chat would result in it opening a random profile. --- .../app_settings/settings_ascent_coa.xml | 62 +++++++++++++++++-- indra/newview/ascentprefsvan.cpp | 32 +++++++--- indra/newview/ascentprefsvan.h | 4 ++ indra/newview/llfloaterchat.cpp | 42 +++++++++++-- indra/newview/llimview.cpp | 30 ++++++--- .../en-us/panel_preferences_ascent_vanity.xml | 5 ++ 6 files changed, 148 insertions(+), 27 deletions(-) diff --git a/indra/newview/app_settings/settings_ascent_coa.xml b/indra/newview/app_settings/settings_ascent_coa.xml index 792c600e7..f9cf9e010 100644 --- a/indra/newview/app_settings/settings_ascent_coa.xml +++ b/indra/newview/app_settings/settings_ascent_coa.xml @@ -135,7 +135,7 @@ AscentFriendColor Comment - Color of chat messages from other residents + Special color to distinguish friends from other residents Persist 1 Type @@ -153,7 +153,7 @@ AscentLindenColor Comment - Color of chat messages from other residents + Special color to distinguish Lindens(/grid operators) from other residents Persist 1 Type @@ -171,7 +171,7 @@ AscentMutedColor Comment - Color of chat messages from other residents + Special color to distinguish those who have been muted from other residents Persist 1 Type @@ -189,7 +189,7 @@ AscentEstateOwnerColor Comment - Color of chat messages from other residents + Special color to distinguish estate owners from other residents Persist 1 Type @@ -204,7 +204,59 @@ IsCOA 1 - AscentReportClientUUID + ColorFriendChat + + Comment + Color chat from friends using AscentFriendColor + Persist + 1 + Type + Boolean + Value + 0 + IsCOA + 1 + + ColorLindenChat + + Comment + Color chat from Lindens(/grid operators) using AscentLindenColor + Persist + 1 + Type + Boolean + Value + 0 + IsCOA + 1 + + ColorMutedChat + + Comment + Color chat from muted residents using AscentMutedColor + Persist + 1 + Type + Boolean + Value + 0 + IsCOA + 1 + + ColorEstateOwnerChat + + Comment + Color chat from estate owners using AscentEstateOwnerColor + Persist + 1 + Type + Boolean + Value + 0 + IsCOA + 1 + + AscentReportClientUUID Comment Broadcasted Client Key diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 0fb702115..e80be45d3 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -156,12 +156,16 @@ void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) if (ctrl->getName() == "use_status_check") { - BOOL showCustomColors = gSavedSettings.getBOOL("AscentUseStatusColors"); - self->childSetEnabled("friends_color_textbox", showCustomColors); - self->childSetEnabled("friend_color_swatch", showCustomColors); - self->childSetEnabled("estate_owner_color_swatch", showCustomColors); - self->childSetEnabled("linden_color_swatch", showCustomColors); - self->childSetEnabled("muted_color_swatch", showCustomColors); + bool showCustomColors = gSavedSettings.getBOOL("AscentUseStatusColors"); + self->childSetEnabled("friends_color_textbox", showCustomColors); + bool frColors = gSavedSettings.getBOOL("ColorFriendChat"); + self->childSetEnabled("friend_color_swatch", showCustomColors || frColors); + bool eoColors = gSavedSettings.getBOOL("ColorEstateOwnerChat"); + self->childSetEnabled("estate_owner_color_swatch", showCustomColors || eoColors); + bool lindColors = gSavedSettings.getBOOL("ColorLindenChat"); + self->childSetEnabled("linden_color_swatch", showCustomColors || lindColors); + bool muteColors = gSavedSettings.getBOOL("ColorMutedChat"); + self->childSetEnabled("muted_color_swatch", showCustomColors || muteColors); } else if (ctrl->getName() == "customize_own_tag_check") { @@ -208,6 +212,10 @@ void LLPrefsAscentVan::refreshValues() mLindenColor = gSavedSettings.getColor4("AscentLindenColor"); mMutedColor = gSavedSettings.getColor4("AscentMutedColor"); //mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor"); + mColorFriendChat = gSavedSettings.getBOOL("ColorFriendChat"); + mColorEOChat = gSavedSettings.getBOOL("ColorEstateOwnerChat"); + mColorLindenChat = gSavedSettings.getBOOL("ColorLindenChat"); + mColorMutedChat = gSavedSettings.getBOOL("ColorMutedChat"); //Body Dynamics -------------------------------------------------------------------------- mBreastPhysicsToggle = gSavedSettings.getBOOL("EmeraldBreastPhysicsToggle"); @@ -232,10 +240,10 @@ void LLPrefsAscentVan::refresh() combo->setCurrentByIndex(mSelectedClient); childSetEnabled("friends_color_textbox", mUseStatusColors); - childSetEnabled("friend_color_swatch", mUseStatusColors); - childSetEnabled("estate_owner_color_swatch", mUseStatusColors); - childSetEnabled("linden_color_swatch", mUseStatusColors); - childSetEnabled("muted_color_swatch", mUseStatusColors); + childSetEnabled("friend_color_swatch", mUseStatusColors || mColorFriendChat); + childSetEnabled("estate_owner_color_swatch", mUseStatusColors || mColorEOChat); + childSetEnabled("linden_color_swatch", mUseStatusColors || mColorLindenChat); + childSetEnabled("muted_color_swatch", mUseStatusColors || mColorMutedChat); childSetEnabled("custom_tag_label_text", mCustomTagOn); childSetEnabled("custom_tag_label_box", mCustomTagOn); @@ -286,6 +294,10 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setColor4("AscentLindenColor", mLindenColor); gSavedSettings.setColor4("AscentMutedColor", mMutedColor); // gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor); + gSavedSettings.setBOOL("ColorFriendChat", mColorFriendChat); + gSavedSettings.setBOOL("ColorEstateOwnerChat", mColorEOChat); + gSavedSettings.setBOOL("ColorLindenChat", mColorLindenChat); + gSavedSettings.setBOOL("ColorMutedChat", mColorMutedChat); //Body Dynamics -------------------------------------------------------------------------- gSavedSettings.setBOOL("EmeraldBreastPhysicsToggle", mBreastPhysicsToggle); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 271d2af59..0c84ce432 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -82,6 +82,10 @@ protected: LLColor4 mEstateOwnerColor; LLColor4 mLindenColor; LLColor4 mMutedColor; + bool mColorFriendChat; + bool mColorEOChat; + bool mColorLindenChat; + bool mColorMutedChat; //Body Dynamics BOOL mBreastPhysicsToggle; F32 mBoobMass; diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 22281826d..bfb4892c6 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -317,8 +317,9 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) } else { + static LLCachedControl color_muted_chat("ColorMutedChat"); // desaturate muted chat - LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f); + LLColor4 muted_color = lerp(color, color_muted_chat ? gSavedSettings.getColor4("AscentMutedColor") : LLColor4::grey, 0.5f); add_timestamped_line(history_editor_with_mute, chat, muted_color); } @@ -493,7 +494,7 @@ void LLFloaterChat::triggerAlerts(const std::string& text) { // Cannot instantiate LLTextParser before logging in. if (gDirUtilp->getLindenUserDir(true).empty()) - return; + return; LLTextParser* parser = LLTextParser::getInstance(); // bool spoken=FALSE; @@ -539,7 +540,11 @@ LLColor4 get_text_color(const LLChat& chat) if(chat.mMuted) { - text_color.setVec(0.8f, 0.8f, 0.8f, 1.f); + static LLCachedControl color_muted_chat("ColorMutedChat"); + if (color_muted_chat) + text_color = gSavedSettings.getColor4("AscentMutedColor"); + else + text_color.setVec(0.8f, 0.8f, 0.8f, 1.f); } else { @@ -549,7 +554,7 @@ LLColor4 get_text_color(const LLChat& chat) text_color = gSavedSettings.getColor4("SystemChatColor"); break; case CHAT_SOURCE_AGENT: - if (chat.mFromID.isNull()) + if (chat.mFromID.isNull()) { text_color = gSavedSettings.getColor4("SystemChatColor"); } @@ -561,7 +566,34 @@ LLColor4 get_text_color(const LLChat& chat) } else { - text_color = gSavedSettings.getColor4("AgentChatColor"); + static LLCachedControl color_linden_chat("ColorLindenChat"); + if (color_linden_chat && LLMuteList::getInstance()->isLinden(chat.mFromName)) + { + text_color = gSavedSettings.getColor4("AscentLindenColor"); + } + else if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + static LLCachedControl color_friend_chat("ColorFriendChat"); + static LLCachedControl color_eo_chat("ColorEstateOwnerChat"); + if (color_friend_chat && LLAvatarTracker::instance().isBuddy(chat.mFromID)) + { + text_color = gSavedSettings.getColor4("AscentFriendColor"); + } + else if (color_eo_chat) + { + LLViewerRegion* parent_estate = gAgent.getRegion(); + if (parent_estate && parent_estate->isAlive() && chat.mFromID == parent_estate->getOwner()) + text_color = gSavedSettings.getColor4("AscentEstateOwnerColor"); + else + text_color = gSavedSettings.getColor4("AgentChatColor"); + } + else + text_color = gSavedSettings.getColor4("AgentChatColor"); + } + else + { + text_color = gSavedSettings.getColor4("AgentChatColor"); + } } } break; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d6dabcdae..b72a80755 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -483,8 +483,8 @@ void LLIMMgr::addMessage( } //not sure why...but if it is from ourselves we set the target_id - //to be NULL - if( other_participant_id == gAgent.getID() ) + //to be NULL, which seems to be breaking links on group chats, so let's not there. + if (other_participant_id == gAgent.getID() && !gAgent.isInGroup(session_id)) { other_participant_id = LLUUID::null; } @@ -553,7 +553,6 @@ void LLIMMgr::addMessage( // when answering questions. if(gAgent.isGodlike()) { - // *TODO:translate (low priority, god ability) std::ostringstream bonus_info; bonus_info << LLTrans::getString("***")+ " "+ LLTrans::getString("IMParentEstate") + LLTrans::getString(":") + " " << parent_estate_id @@ -574,9 +573,26 @@ void LLIMMgr::addMessage( // now add message to floater bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM); - const LLColor4& color = ( is_from_system ? - gSavedSettings.getColor4("SystemChatColor") : - gSavedSettings.getColor("IMChatColor")); + + static LLCachedControl color_linden_chat("ColorLindenChat"); + bool linden = color_linden_chat && LLMuteList::getInstance()->isLinden(from); + + static LLCachedControl color_friend_chat("ColorFriendChat"); + bool contact = color_friend_chat && LLAvatarTracker::instance().isBuddy(other_participant_id); + + static LLCachedControl color_eo_chat("ColorEstateOwnerChat"); + bool estate_owner = false; + if (color_eo_chat) + { + LLViewerRegion* parent_estate = gAgent.getRegion(); + estate_owner = (parent_estate && parent_estate->isAlive() && other_participant_id == parent_estate->getOwner()); + } + + const LLColor4& color = ( is_from_system ? gSavedSettings.getColor4("SystemChatColor") + : linden ? gSavedSettings.getColor4("AscentLindenColor") + : contact ? gSavedSettings.getColor4("AscentFriendColor") + : estate_owner ? gSavedSettings.getColor4("AscentEstateOwnerColor") + : gSavedSettings.getColor("IMChatColor")); if ( !link_name ) { floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally @@ -1153,7 +1169,7 @@ void LLIMMgr::noteOfflineUsers( std::string full_name; if (info && !info->isOnline() - && gCacheName->getFullName(ids.get(i), full_name)) + && LLAvatarNameCache::getPNSName(ids.get(i), full_name)) { LLUIString offline = LLTrans::getString("offline_message"); offline.setArg("[NAME]", full_name); diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index 46a679fe2..bba6be356 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -42,6 +42,11 @@ + Use colors for chat: + + + + From 4ec6f853d829c7dab068f1d9675a32d2bd945669 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 31 Dec 2012 17:06:30 -0500 Subject: [PATCH 15/18] In-Group feature request: Ability to have chats torn off, by default. Best viewed without space changes... or maybe it doesn't matter any more. Debug setting OtherChatsTornOff added. Added Open new IMs in separate floaters checkbox to Adv. Chat. Moved Show group name in chat to the right column on top of Adv. Chat panel. So how's this work? Two ways.. 1. The user opens a chat; 2. A chat is started from another party to the user. In 1, we open the chat in a separate floater and focus the floater. In 2, we check if there is a floater currently in focus before opening the chat if so, we minimize the floater, setting focus back to whatever floater the user was focused on; if not, we leave the new chat floater open and focused. Note that this will NOT alter the default behavior at all, we can't be having that. --- indra/newview/app_settings/settings.xml | 11 ++++++ indra/newview/ascentprefschat.cpp | 2 + indra/newview/ascentprefschat.h | 1 + indra/newview/llfloaterfriends.cpp | 4 +- indra/newview/llfloatergroups.cpp | 4 +- indra/newview/llimview.cpp | 39 ++++++++++++++++++- .../en-us/panel_preferences_ascent_chat.xml | 5 ++- 7 files changed, 60 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b3bd8fb3a..2d228ce3e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -749,6 +749,17 @@ Found in Advanced->Rendering->Info Displays Value 1 + OtherChatsTornOff + + Comment + When true, chats other than local chat open torn off of the Communicate window. + Persist + 1 + Type + Boolean + Value + 0 + MarketImporterUpdateFreq Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 2cdfad841..d4b8c3407 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -336,6 +336,7 @@ void LLPrefsAscentChat::refreshValues() mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects"); mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs"); mSecondsInLog = gSavedSettings.getBOOL("SecondsInLog"); + mOtherChatsTornOff = gSavedSettings.getBOOL("OtherChatsTornOff"); std::string format = gSavedSettings.getString("ShortTimeFormat"); if (format.find("%p") == -1) @@ -542,6 +543,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects); gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs); gSavedSettings.setBOOL("SecondsInLog", mSecondsInLog); + gSavedSettings.setBOOL("OtherChatsTornOff", mOtherChatsTornOff); std::string short_date, long_date, short_time, long_time, timestamp; diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index ba6476d6e..03e980c3f 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -77,6 +77,7 @@ protected: U32 tempDateFormat; BOOL mSecondsInChatAndIMs; BOOL mSecondsInLog; + BOOL mOtherChatsTornOff; BOOL mIMResponseAnyone; BOOL mIMResponseFriends; diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 40af23889..e0ac0a06e 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -855,6 +855,8 @@ void LLPanelFriends::onClickIM(void* user_data) const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs(); if(!ids.empty()) { + static LLCachedControl tear_off("OtherChatsTornOff"); + if(!tear_off) gIMMgr->setFloaterOpen(TRUE); if(ids.size() == 1) { LLUUID agent_id = ids[0]; @@ -862,13 +864,11 @@ void LLPanelFriends::onClickIM(void* user_data) std::string fullname; if(info && gCacheName->getFullName(agent_id, fullname)) { - gIMMgr->setFloaterOpen(TRUE); gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id); } } else { - gIMMgr->setFloaterOpen(TRUE); gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], ids); } make_ui_sound("UISndStartIM"); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index c786e94a6..eff6d409b 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -386,7 +386,9 @@ void LLPanelGroups::startIM() LLGroupData group_data; if (gAgent.getGroupData(group_id, group_data)) { - gIMMgr->setFloaterOpen(TRUE); + static LLCachedControl tear_off("OtherChatsTornOff"); + if (!tear_off) + gIMMgr->setFloaterOpen(TRUE); gIMMgr->addSession( group_data.mName, IM_SESSION_GROUP_START, diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b72a80755..69e2c78d3 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -747,7 +747,18 @@ LLUUID LLIMMgr::addSession( { noteMutedUsers(floater, ids); } - LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater); + + static LLCachedControl tear_off("OtherChatsTornOff"); + if(tear_off) + { + // removal sets up relationship for re-attach + LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); + // reparent to floater view + gFloaterView->addChild(floater); + gFloaterView->bringToFront(floater); + } + else + LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater); } else { @@ -1119,6 +1130,19 @@ LLFloaterIMPanel* LLIMMgr::createFloater( dialog); LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt); + static LLCachedControl tear_off("OtherChatsTornOff"); + if (tear_off) + { + LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach + gFloaterView->addChild(floater); // reparent to floater view + LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater + floater->open(); // make the new chat floater appear + if (focused_floater != NULL) // there was a focused floater + { + floater->setMinimized(true); // so minimize this one, for now + focused_floater->setFocus(true); // and work around focus being removed by focusing on the last + } + } mFloaters.insert(floater->getHandle()); return floater; } @@ -1145,6 +1169,19 @@ LLFloaterIMPanel* LLIMMgr::createFloater( dialog); LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt); + static LLCachedControl tear_off("OtherChatsTornOff"); + if (tear_off) + { + LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach + gFloaterView->addChild(floater); // reparent to floater view + LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater + floater->open(); // make the new chat floater appear + if (focused_floater != NULL) // there was a focused floater + { + floater->setMinimized(true); // so minimize this one, for now + focused_floater->setFocus(true); // and work around focus being removed by focusing on the last + } + } mFloaters.insert(floater->getHandle()); return floater; } diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 5bc7d73b2..f912135af 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -6,12 +6,11 @@ IMs: + -