diff options
author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-09-09 17:10:06 -0700 |
---|---|---|
committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-09-09 17:10:06 -0700 |
commit | a997e131d4262f0a18a6f4f8c305c73edbfea6b6 (patch) | |
tree | 5b7f8595e7911f4fd7ba6f2824c6b92f8478a9ef /indra/newview | |
parent | cab31b572d1a3b717b7f8b9fdf2a49f0b2eb6995 (diff) | |
parent | bbf497469c4d71d5308421f1ef06d0a2098772c8 (diff) |
Merge with SVN viewer-2.0.0-3 branch
Diffstat (limited to 'indra/newview')
89 files changed, 2240 insertions, 1574 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 767f93cf45..cd20648f74 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -196,6 +196,7 @@ set(viewer_SOURCE_FILES llfloatersettingsdebug.cpp llfloatersnapshot.cpp llfloatertelehub.cpp + llfloatertestinspectors.cpp llfloatertestlistview.cpp llfloatertools.cpp llfloatertopobjects.cpp @@ -220,7 +221,6 @@ set(viewer_SOURCE_FILES llgroupmgr.cpp llgroupnotify.cpp llhomelocationresponder.cpp - llhoverview.cpp llhudeffectbeam.cpp llhudeffect.cpp llhudeffectlookat.cpp @@ -652,6 +652,7 @@ set(viewer_HEADER_FILES llfloatersettingsdebug.h llfloatersnapshot.h llfloatertelehub.h + llfloatertestinspectors.h llfloatertestlistview.h llfloatertools.h llfloatertopobjects.h @@ -676,7 +677,6 @@ set(viewer_HEADER_FILES llgroupmgr.h llgroupnotify.h llhomelocationresponder.h - llhoverview.h llhudeffect.h llhudeffectbeam.h llhudeffectlookat.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 32b1443157..bbe69531b4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1706,7 +1706,18 @@ <key>Value</key> <integer>0</integer> </map> - <key>DebugStatModeFPS</key> + <key>DebugShowXUINames</key> + <map> + <key>Comment</key> + <string>Show tooltips with XUI path to widget</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>DebugStatModeFPS</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -3642,6 +3653,17 @@ <key>Value</key> <real>0.0</real> </map> + <key>InspectorFadeTime</key> + <map> + <key>Comment</key> + <string>Fade out timing for inspectors</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <string>0.1</string> + </map> <key>InstallLanguage</key> <map> <key>Comment</key> @@ -6864,7 +6886,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ShowCameraAndMoveControls</key> <map> @@ -7309,17 +7331,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowXUINames</key> - <map> - <key>Comment</key> - <string>Display XUI Names as Tooltips</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>SkinCurrent</key> <map> <key>Comment</key> @@ -7713,7 +7724,18 @@ <key>Value</key> <real>0.2</real> </map> - <key>ToolboxAutoMove</key> + <key>ToolTipVisibleTime</key> + <map> + <key>Comment</key> + <string>Fade tooltip after mouse is idle for this long</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>10.0</real> + </map> + <key>ToolboxAutoMove</key> <map> <key>Comment</key> <string>[NOT USED]</string> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 800c555113..9fe02a8ead 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -128,7 +128,7 @@ #include "lldebugview.h" #include "llconsole.h" #include "llcontainerview.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llsdserialize.h" @@ -409,7 +409,6 @@ static void settings_to_globals() gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); gMapScale = gSavedSettings.getF32("MapScale"); - LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); } @@ -2353,7 +2352,7 @@ void LLAppViewer::cleanupSavedSettings() } gSavedSettings.setF32("MapScale", gMapScale ); - gSavedSettings.setBOOL("ShowHoverTips", LLHoverView::sShowHoverTips); + gSavedSettings.setBOOL("ShowHoverTips", gToolTipView->getVisible()); // Some things are cached in LLAgent. if (gAgent.mInitialized) diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 05addf3f3a..a8b1ff6c92 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -147,7 +147,7 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) if (mAvatarId != value.asUUID()) { LLAvatarPropertiesProcessor::getInstance()->addObserver(value.asUUID(), this); - LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(value.asUUID(),APT_PROPERTIES); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(value.asUUID()); mAvatarId = value.asUUID(); // Check if cache already contains image_id for that avatar diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index ecd67e44ae..edf6e84b68 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -34,10 +34,16 @@ #include "llavatarpropertiesprocessor.h" -#include "message.h" +// Viewer includes #include "llagent.h" #include "llviewergenericmessage.h" +// Linden library includes +#include "llavatarconstants.h" // AVATAR_TRANSACTED, etc. +#include "lldate.h" +#include "lltrans.h" +#include "message.h" + LLAvatarPropertiesProcessor::LLAvatarPropertiesProcessor() { } @@ -87,35 +93,18 @@ void LLAvatarPropertiesProcessor::removeObserver(const LLUUID& avatar_id, LLAvat } } -void LLAvatarPropertiesProcessor::sendDataRequest(const LLUUID& avatar_id, EAvatarProcessorType type, - const void * data) + +void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string method) { - switch(type) + // Suppress duplicate requests while waiting for a response from the network + if (isPendingRequest(avatar_id, type)) { - case APT_PROPERTIES: - sendAvatarPropertiesRequest(avatar_id); - break; - case APT_PICKS: - sendGenericRequest(avatar_id, "avatarpicksrequest"); - break; - case APT_PICK_INFO: - if (data) { - sendPickInfoRequest(avatar_id, *static_cast<const LLUUID*>(data)); - } - break; - case APT_NOTES: - sendGenericRequest(avatar_id, "avatarnotesrequest"); - break; - case APT_GROUPS: - sendGenericRequest(avatar_id, "avatargroupsrequest"); - break; - default: - break; + // waiting for a response, don't re-request + return; } -} + // indicate we're going to make a request + addPendingRequest(avatar_id, type); -void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, const std::string method) -{ std::vector<std::string> strings; strings.push_back( avatar_id.asString() ); send_generic_message(method, strings); @@ -123,6 +112,14 @@ void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, co void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequest(const LLUUID& avatar_id) { + if (isPendingRequest(avatar_id, APT_PROPERTIES)) + { + // waiting for a response, don't re-request + return; + } + // indicate we're going to make a request + addPendingRequest(avatar_id, APT_PROPERTIES); + LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_AvatarPropertiesRequest); @@ -133,40 +130,29 @@ void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequest(const LLUUID& avat gAgent.sendReliableMessage(); } -void LLAvatarPropertiesProcessor::sendDataUpdate(const void* data, EAvatarProcessorType type) +void LLAvatarPropertiesProcessor::sendAvatarPicksRequest(const LLUUID& avatar_id) { - switch(type) - { - case APT_PROPERTIES: - sendAvatarPropertiesUpdate(data); - break; - case APT_PICK_INFO: - sendPicInfoUpdate(data); - case APT_PICKS: -// sendGenericRequest(avatar_id, "avatarpicksrequest"); - break; - case APT_NOTES: -// sendGenericRequest(avatar_id, "avatarnotesrequest"); - break; - case APT_GROUPS: -// sendGenericRequest(avatar_id, "avatargroupsrequest"); - break; - default: - break; - } + sendGenericRequest(avatar_id, APT_PICKS, "avatarpicksrequest"); +} +void LLAvatarPropertiesProcessor::sendAvatarNotesRequest(const LLUUID& avatar_id) +{ + sendGenericRequest(avatar_id, APT_NOTES, "avatarnotesrequest"); +} + +void LLAvatarPropertiesProcessor::sendAvatarGroupsRequest(const LLUUID& avatar_id) +{ + sendGenericRequest(avatar_id, APT_GROUPS, "avatargroupsrequest"); } -void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const void* data) + +void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props) { llinfos << "Sending avatarinfo update" << llendl; - const LLAvatarData* avatar_props = static_cast<const LLAvatarData*>(data); // This value is required by sendAvatarPropertiesUpdate method. //A profile should never be mature. (From the original code) BOOL mature = FALSE; - - LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_AvatarPropertiesUpdate); @@ -186,6 +172,156 @@ void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const void* data) gAgent.sendReliableMessage(); } +//static +std::string LLAvatarPropertiesProcessor::ageFromDate(const std::string& date_string) +{ + // Convert string date to malleable representation + S32 month, day, year; + S32 matched = sscanf(date_string.c_str(), "%d/%d/%d", &month, &day, &year); + if (matched != 3) return "???"; + + // Create ISO-8601 date string + std::string iso8601_date_string = + llformat("%04d-%02d-%02dT00:00:00Z", year, month, day); + LLDate date(iso8601_date_string); + + // Correct for the fact that account creation dates are in Pacific time, + // == UTC - 8 + F64 date_secs_since_epoch = date.secondsSinceEpoch(); + date_secs_since_epoch += 8.0 * 60.0 * 60.0; + + // Convert seconds from epoch to seconds from now + F64 now_secs_since_epoch = LLDate::now().secondsSinceEpoch(); + F64 age_secs = now_secs_since_epoch - date_secs_since_epoch; + + // We don't care about sub-day times + const F64 SEC_PER_DAY = 24.0 * 60.0 * 60.0; + S32 age_days = lltrunc(age_secs / SEC_PER_DAY); + + // Assume most values won't be used to fill in the format string: + // "[AGEYEARS][AGEMONTHS][AGEWEEKS][AGEDAYS]old" + LLStringUtil::format_map_t final_args; + final_args["[AGEYEARS]"] = ""; + final_args["[AGEMONTHS]"] = ""; + final_args["[AGEWEEKS]"] = ""; + final_args["[AGEDAYS]"] = ""; + + // Try for age in round number of years + LLStringUtil::format_map_t args; + S32 age_years = age_days / 365; + age_days = age_days % 365; + if (age_years > 1) + { + args["[YEARS]"] = llformat("%d", age_years); + final_args["[AGEYEARS]"] = LLTrans::getString("AgeYears", args); + } + else if (age_years == 1) + { + final_args["[AGEYEARS]"] = LLTrans::getString("Age1Year"); + } + // fall through because we show years + months for ages > 1 year + + S32 age_months = age_days / 30; + age_days = age_days % 30; + if (age_months > 1) + { + args["[MONTHS]"] = llformat("%d", age_months); + final_args["[AGEMONTHS]"] = LLTrans::getString("AgeMonths", args); + // Either N years M months, or just M months, + // so we can exit. + return LLTrans::getString("YearsMonthsOld", final_args); + } + else if (age_months == 1) + { + final_args["[AGEMONTHS]"] = LLTrans::getString("Age1Month"); + return LLTrans::getString("YearsMonthsOld", final_args); + } + + // Now for age in weeks + S32 age_weeks = age_days / 7; + age_days = age_days % 7; + if (age_weeks > 1) + { + args["[WEEKS]"] = llformat("%d", age_weeks); + final_args["[AGEWEEKS]"] = LLTrans::getString("AgeWeeks", args); + return LLTrans::getString("WeeksOld", final_args); + } + else if (age_weeks == 1) + { + final_args["[AGEWEEKS]"] = LLTrans::getString("Age1Week"); + return LLTrans::getString("WeeksOld", final_args); + } + + // Down to days now + if (age_days > 1) + { + args["[DAYS]"] = llformat("%d", age_days); + final_args["[AGEDAYS]"] = LLTrans::getString("AgeDays", args); + return LLTrans::getString("DaysOld", final_args); + } + else if (age_days == 1) + { + final_args["[AGEDAYS]"] = LLTrans::getString("Age1Day"); + return LLTrans::getString("DaysOld", final_args); + } + else + { + return LLTrans::getString("TodayOld"); + } +} + + +//static +std::string LLAvatarPropertiesProcessor::accountType(const LLAvatarData* avatar_data) +{ + // If you have a special account, like M Linden ("El Jefe!") + // return an untranslated "special" string + if (!avatar_data->caption_text.empty()) + { + return avatar_data->caption_text; + } + const char* const ACCT_TYPE[] = { + "AcctTypeResident", + "AcctTypeTrial", + "AcctTypeCharterMember", + "AcctTypeEmployee" + }; + U8 caption_max = (U8)LL_ARRAY_SIZE(ACCT_TYPE)-1; + U8 caption_index = llclamp(avatar_data->caption_index, (U8)0, caption_max); + return LLTrans::getString(ACCT_TYPE[caption_index]); +} + +//static +std::string LLAvatarPropertiesProcessor::paymentInfo(const LLAvatarData* avatar_data) +{ + // Special accounts like M Linden don't have payment info revealed. + if (!avatar_data->caption_text.empty()) return ""; + + // Linden employees don't have payment info revealed + const S32 LINDEN_EMPLOYEE_INDEX = 3; + if (avatar_data->caption_index == LINDEN_EMPLOYEE_INDEX) return ""; + + BOOL transacted = (avatar_data->flags & AVATAR_TRANSACTED); + BOOL identified = (avatar_data->flags & AVATAR_IDENTIFIED); + // Not currently getting set in dataserver/lldataavatar.cpp for privacy considerations + //BOOL age_verified = (avatar_data->flags & AVATAR_AGEVERIFIED); + + const char* payment_text; + if(transacted) + { + payment_text = "PaymentInfoUsed"; + } + else if (identified) + { + payment_text = "PaymentInfoOnFile"; + } + else + { + payment_text = "NoPaymentInfoOnFile"; + } + return LLTrans::getString(payment_text); +} + void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* msg, void**) { LLAvatarData avatar_data; @@ -214,7 +350,10 @@ void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* { msg->getString(_PREHASH_PropertiesData, _PREHASH_CharterMember, avatar_data.caption_text); } - notifyObservers(avatar_data.avatar_id,&avatar_data,APT_PROPERTIES); + LLAvatarPropertiesProcessor* self = getInstance(); + // Request processed, no longer pending + self->removePendingRequest(avatar_data.avatar_id, APT_PROPERTIES); + self->notifyObservers(avatar_data.avatar_id,&avatar_data,APT_PROPERTIES); } void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* msg, void**) @@ -228,11 +367,13 @@ void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* m WARNING: LLTemplateMessageReader::decodeData: Message from 216.82.37.237:13000 with no handler function received: AvatarInterestsReply */ } + void LLAvatarPropertiesProcessor::processAvatarClassifiedReply(LLMessageSystem* msg, void**) { // avatarclassifiedsrequest is not sent according to new UI design but // keep this method according to resolved issues. } + void LLAvatarPropertiesProcessor::processAvatarNotesReply(LLMessageSystem* msg, void**) { LLAvatarNotes avatar_notes; @@ -241,7 +382,10 @@ void LLAvatarPropertiesProcessor::processAvatarNotesReply(LLMessageSystem* msg, msg->getUUID(_PREHASH_Data, _PREHASH_TargetID, avatar_notes.target_id); msg->getString(_PREHASH_Data, _PREHASH_Notes, avatar_notes.notes); - notifyObservers(avatar_notes.target_id,&avatar_notes,APT_NOTES); + LLAvatarPropertiesProcessor* self = getInstance(); + // Request processed, no longer pending + self->removePendingRequest(avatar_notes.target_id, APT_NOTES); + self->notifyObservers(avatar_notes.target_id,&avatar_notes,APT_NOTES); } void LLAvatarPropertiesProcessor::processAvatarPicksReply(LLMessageSystem* msg, void**) @@ -261,7 +405,10 @@ void LLAvatarPropertiesProcessor::processAvatarPicksReply(LLMessageSystem* msg, avatar_picks.picks_list.push_back(std::make_pair(pick_id,pick_name)); } - notifyObservers(avatar_picks.target_id,&avatar_picks,APT_PICKS); + LLAvatarPropertiesProcessor* self = getInstance(); + // Request processed, no longer pending + self->removePendingRequest(avatar_picks.target_id, APT_PICKS); + self->notifyObservers(avatar_picks.target_id,&avatar_picks,APT_PICKS); } void LLAvatarPropertiesProcessor::processPickInfoReply(LLMessageSystem* msg, void**) @@ -306,7 +453,9 @@ void LLAvatarPropertiesProcessor::processPickInfoReply(LLMessageSystem* msg, voi msg->getS32(_PREHASH_Data, _PREHASH_SortOrder, pick_data.sort_order); msg->getBOOL(_PREHASH_Data, _PREHASH_Enabled, pick_data.enabled); - notifyObservers(pick_data.creator_id, &pick_data, APT_PICK_INFO); + LLAvatarPropertiesProcessor* self = getInstance(); + // don't need to remove pending request as we don't track pick info + self->notifyObservers(pick_data.creator_id, &pick_data, APT_PICK_INFO); } void LLAvatarPropertiesProcessor::processAvatarGroupsReply(LLMessageSystem* msg, void**) @@ -329,12 +478,15 @@ void LLAvatarPropertiesProcessor::processAvatarGroupsReply(LLMessageSystem* msg, avatar_groups.group_list.push_back(group_data); } - notifyObservers(avatar_groups.avatar_id,&avatar_groups,APT_GROUPS); + LLAvatarPropertiesProcessor* self = getInstance(); + self->removePendingRequest(avatar_groups.avatar_id, APT_GROUPS); + self->notifyObservers(avatar_groups.avatar_id,&avatar_groups,APT_GROUPS); } void LLAvatarPropertiesProcessor::notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type) { - LLAvatarPropertiesProcessor::observer_multimap_t observers = LLAvatarPropertiesProcessor::getInstance()->mObservers; + // Copy the map (because observers may delete themselves when updated?) + LLAvatarPropertiesProcessor::observer_multimap_t observers = mObservers; observer_multimap_t::iterator oi = observers.lower_bound(id); observer_multimap_t::iterator end = observers.upper_bound(id); @@ -397,10 +549,8 @@ void LLAvatarPropertiesProcessor::sendPickDelete( const LLUUID& pick_id ) gAgent.sendReliableMessage(); } -void LLAvatarPropertiesProcessor::sendPicInfoUpdate(const void* pick_data) +void LLAvatarPropertiesProcessor::sendPickInfoUpdate(const LLPickData* new_pick) { - if (!pick_data) return; - const LLPickData *new_pick = static_cast<const LLPickData*>(pick_data); if (!new_pick) return; LLMessageSystem* msg = gMessageSystem; @@ -440,3 +590,38 @@ void LLAvatarPropertiesProcessor::sendPickInfoRequest(const LLUUID& creator_id, request_params.push_back(pick_id.asString() ); send_generic_message("pickinforequest", request_params); } + + +bool LLAvatarPropertiesProcessor::isPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type) +{ + timestamp_map_t::key_type key = std::make_pair(avatar_id, type); + timestamp_map_t::iterator it = mRequestTimestamps.find(key); + + // Is this a new request? + if (it == mRequestTimestamps.end()) return false; + + // We found a request, check if it has timed out + U32 now = time(NULL); + const U32 REQUEST_EXPIRE_SECS = 5; + U32 expires = it->second + REQUEST_EXPIRE_SECS; + + // Request is still pending if it hasn't expired yet + // *NOTE: Expired requests will accumulate in this map, but they are rare, + // the data is small, and they will be updated if the same data is + // re-requested + return (now < expires); +} + +void LLAvatarPropertiesProcessor::addPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type) +{ + timestamp_map_t::key_type key = std::make_pair(avatar_id, type); + U32 now = time(NULL); + // Add or update existing (expired) request + mRequestTimestamps[ key ] = now; +} + +void LLAvatarPropertiesProcessor::removePendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type) +{ + timestamp_map_t::key_type key = std::make_pair(avatar_id, type); + mRequestTimestamps.erase(key); +} diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index 2e10dea834..24675c44c0 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -43,10 +43,6 @@ - Remove EAvatarProcessorType in favor of separate observers, derived from a common parent (to get rid of void*). */ -/* -*TODO: mantipov: get rid of sendDataRequest and sendDataUpdate methods. Use exact methods instead of. -*/ - class LLMessageSystem; enum EAvatarProcessorType @@ -157,10 +153,20 @@ public: void addObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer); void removeObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer); - - void sendDataRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const void * data = NULL); - void sendDataUpdate(const void* data, EAvatarProcessorType type); + // Request various types of avatar data. Duplicate requests will be + // suppressed while waiting for a response from the network. + void sendAvatarPropertiesRequest(const LLUUID& avatar_id); + void sendAvatarPicksRequest(const LLUUID& avatar_id); + void sendAvatarNotesRequest(const LLUUID& avatar_id); + void sendAvatarGroupsRequest(const LLUUID& avatar_id); + + // Duplicate pick info requests are not suppressed. + void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id); + + void sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props); + + void sendPickInfoUpdate(const LLPickData* new_pick); void sendFriendRights(const LLUUID& avatar_id, S32 rights); @@ -168,6 +174,20 @@ public: void sendPickDelete(const LLUUID& pick_id); + // Convert a date provided by the server (MM/DD/YYYY) into a localized, + // human-readable age (1 year, 2 months) using translation strings from + // the XML file. + static std::string ageFromDate(const std::string& date_string); + + // Returns translated, human readable string for account type, such + // as "Resident" or "Linden Employee". Used for profiles, inspectors. + static std::string accountType(const LLAvatarData* avatar_data); + + // Returns translated, human readable string for payment info, such + // as "Payment Info on File" or "Payment Info Used". + // Used for profiles, inspectors. + static std::string paymentInfo(const LLAvatarData* avatar_data); + static void processAvatarPropertiesReply(LLMessageSystem* msg, void**); static void processAvatarInterestsReply(LLMessageSystem* msg, void**); @@ -181,19 +201,23 @@ public: static void processAvatarPicksReply(LLMessageSystem* msg, void**); static void processPickInfoReply(LLMessageSystem* msg, void**); + protected: - void sendAvatarPropertiesRequest(const LLUUID& avatar_id); + void sendGenericRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string method); - void sendGenericRequest(const LLUUID& avatar_id, const std::string method); - - void sendAvatarPropertiesUpdate(const void* data); + void notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type); - void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id); - - void sendPicInfoUpdate(const void * pick_data); + // Is there a pending, not timed out, request for this avatar's data? + // Use this to suppress duplicate requests for data when a request is + // pending. + bool isPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type); - static void notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type); + // Call this when a request has been sent + void addPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type); + + // Call this when the reply to the request is received + void removePendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type); typedef void* (*processor_method_t)(LLMessageSystem*); static processor_method_t getProcessor(EAvatarProcessorType type); @@ -203,6 +227,13 @@ protected: typedef std::multimap<LLUUID, LLAvatarPropertiesObserver*> observer_multimap_t; observer_multimap_t mObservers; + + // Keep track of pending requests for data by avatar id and type. + // Maintain a timestamp for each request so a request that receives no reply + // does not block future requests forever. + // Map avatar_id+request_type -> U32 timestamp in seconds + typedef std::map< std::pair<LLUUID, EAvatarProcessorType>, U32> timestamp_map_t; + timestamp_map_t mRequestTimestamps; }; #endif // LL_LLAVATARPROPERTIESPROCESSOR_H diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 861f23abb7..d166715038 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -37,12 +37,12 @@ #include "llchiclet.h" #include "llfloaterreg.h" #include "llflyoutbutton.h" +#include "llimpanel.h" // for LLIMFloater #include "lllayoutstack.h" #include "llnearbychatbar.h" #include "llsplitbutton.h" #include "llsyswellwindow.h" #include "llfloatercamera.h" -#include "llimpanel.h" LLBottomTray::LLBottomTray(const LLSD&) : mChicletPanel(NULL), @@ -119,6 +119,7 @@ void LLBottomTray::onChicletClick(LLUICtrl* ctrl) } } +// *TODO Vadim: why void* ? void* LLBottomTray::createNearbyChatBar(void* userdata) { return new LLNearbyChatBar(); @@ -126,30 +127,19 @@ void* LLBottomTray::createNearbyChatBar(void* userdata) LLIMChiclet* LLBottomTray::createIMChiclet(const LLUUID& session_id) { - if(session_id.isNull()) - { - return NULL; - } + LLIMChiclet::EType im_chiclet_type = LLIMChiclet::getIMSessionType(session_id); - LLFloaterIMPanel* im = LLIMMgr::getInstance()->findFloaterBySession(session_id); - if (!im) + switch (im_chiclet_type) { - return NULL; //should never happen - } - - switch(im->getDialogType()) - { - case IM_NOTHING_SPECIAL: + case LLIMChiclet::TYPE_IM: return getChicletPanel()->createChiclet<LLIMP2PChiclet>(session_id); - break; - case IM_SESSION_GROUP_START: - case IM_SESSION_INVITE: + case LLIMChiclet::TYPE_GROUP: return getChicletPanel()->createChiclet<LLIMGroupChiclet>(session_id); - break; - default: - return NULL; + case LLIMChiclet::TYPE_UNKNOWN: break; } + + return NULL; } //virtual @@ -182,6 +172,14 @@ void LLBottomTray::sessionRemoved(const LLUUID& session_id) { if(getChicletPanel()) { + // IM floater should be closed when session removed and associated chiclet closed + LLIMFloater* iMfloater = LLFloaterReg::findTypedInstance<LLIMFloater>( + "impanel", session_id); + if (iMfloater != NULL) + { + iMfloater->closeFloater(); + } + getChicletPanel()->removeChiclet(session_id); } } @@ -265,4 +263,10 @@ void LLBottomTray::showCameraAndMoveControls(BOOL visible) { mCamPanel->setVisible(visible); mMovementPanel->setVisible(visible); + + if (!visible) + { + LLFloaterReg::hideFloaterInstance("moveview"); + LLFloaterReg::hideFloaterInstance("camera"); + } } diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index f5dfbb2851..6fb6552f2d 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -38,6 +38,7 @@ #include "llchatmsgbox.h" #include "llavatariconctrl.h" #include "llfloaterreg.h" +#include "lllocalcliprect.h" #include "lltrans.h" #include "llviewercontrol.h" diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 808fcde312..9ce194c712 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -40,6 +40,7 @@ #include "llimpanel.h" // LLFloaterIMPanel #include "llimview.h" #include "llfloaterreg.h" +#include "lllocalcliprect.h" #include "llmenugl.h" #include "lloutputmonitorctrl.h" #include "lltextbox.h" @@ -210,19 +211,38 @@ void LLIMChiclet::draw() { LLUICtrl::draw(); - //if we have a docked floater, we want to position it relative to us - LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", getSessionId()); + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE); +} + +// static +LLIMChiclet::EType LLIMChiclet::getIMSessionType(const LLUUID& session_id) +{ + EType type = TYPE_UNKNOWN; + LLFloaterIMPanel* im = NULL; + + if(session_id.isNull()) + return type; - if (im_floater && im_floater->isDocked()) + if (!(im = LLIMMgr::getInstance()->findFloaterBySession(session_id))) { - S32 x, y; - getParent()->localPointToScreen(getRect().getCenterX(), 0, &x, &y); - im_floater->translate(x - im_floater->getRect().getCenterX(), 10 - im_floater->getRect().mBottom); - //set this so the docked floater knows it's been positioned and can now draw - im_floater->setPositioned(true); + llassert_always(0 && "IM session not found"); // should never happen + return type; } - gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE); + switch(im->getDialogType()) + { + case IM_NOTHING_SPECIAL: + type = TYPE_IM; + break; + case IM_SESSION_GROUP_START: + case IM_SESSION_INVITE: + type = TYPE_GROUP; + break; + default: + break; + } + + return type; } ////////////////////////////////////////////////////////////////////////// @@ -235,6 +255,7 @@ LLIMP2PChiclet::Params::Params() , speaker("speaker") , show_speaker("show_speaker") { + // *TODO Vadim: Get rid of hardcoded values. rect(LLRect(0, 25, 45, 0)); avatar_icon.name("avatar_icon"); @@ -1039,11 +1060,14 @@ BOOL LLChicletPanel::handleScrollWheel(S32 x, S32 y, S32 clicks) ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// +// *TODO Vadim: Move this out of llchiclet.cpp. + LLTalkButton::Params::Params() : speak_button("speak_button") , show_button("show_button") , monitor("monitor") { + // *TODO Vadim: move hardcoded labels (!) and other params to XUI. speak_button.name("left"); speak_button.label("Speak"); speak_button.label_selected("Speak"); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index f96dfb69ec..91f55915ed 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -272,6 +272,11 @@ private: class LLIMChiclet : public LLChiclet { public: + enum EType { + TYPE_UNKNOWN, + TYPE_IM, + TYPE_GROUP + }; /*virtual*/ ~LLIMChiclet() {}; @@ -307,6 +312,19 @@ public: /*virtual*/ void draw(); /** + * Determine whether given ID refers to a group or an IM chat session. + * + * This is used when we need to chose what IM chiclet (P2P/group) + * class to instantiate. + * + * @param session_id session ID. + * @return TYPE_GROUP in case of group chat session, + * TYPE_IM in case of P2P session, + * TYPE_UNKNOWN otherwise. + */ + static EType getIMSessionType(const LLUUID& session_id); + + /** * The action taken on mouse down event. * * Made public so that it can be triggered from outside @@ -368,7 +386,7 @@ public: Params(); }; - void setOtherParticipantId(const LLUUID& other_participant_id); + /* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id); /*virtual*/ void setShowSpeaker(bool show); diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 31c2d93c05..113f4c2c54 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -197,6 +197,7 @@ BOOL LLColorSwatchCtrl::handleMouseUp(S32 x, S32 y, MASK mask) // assumes GL state is set for 2D void LLColorSwatchCtrl::draw() { + F32 alpha = getDrawContext().mAlpha; mBorder->setKeyboardFocusHighlight(hasFocus()); // Draw border LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); @@ -232,15 +233,15 @@ void LLColorSwatchCtrl::draw() { gl_rect_2d_checkerboard( interior ); } - gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), fallback_image); + gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), fallback_image, LLColor4::white % alpha); fallback_image->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); } else { // Draw grey and an X - gl_rect_2d(interior, LLColor4::grey, TRUE); + gl_rect_2d(interior, LLColor4::grey % alpha, TRUE); - gl_draw_x(interior, LLColor4::black); + gl_draw_x(interior, LLColor4::black % alpha); } } diff --git a/indra/newview/llconfirmationmanager.cpp b/indra/newview/llconfirmationmanager.cpp index 00ffff79a8..225f177546 100644 --- a/indra/newview/llconfirmationmanager.cpp +++ b/indra/newview/llconfirmationmanager.cpp @@ -37,8 +37,7 @@ #include "lluictrlfactory.h" // viewer includes -#include "llviewerwindow.h" -#include "lllineeditor.h" +#include "llnotifications.h" #include "llstring.h" LLConfirmationManager::ListenerBase::~ListenerBase() diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 8ceb41c27a..8af3a8b539 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -32,16 +32,18 @@ #include "llviewerprecompiledheaders.h" -#include "indra_constants.h" #include "llfasttimerview.h" + #include "llviewerwindow.h" #include "llrect.h" #include "llerror.h" #include "llgl.h" #include "llrender.h" +#include "lllocalcliprect.h" #include "llmath.h" #include "llfontgl.h" #include "llsdserialize.h" +#include "lltooltip.h" #include "llappviewer.h" #include "llviewertexturelist.h" @@ -242,15 +244,20 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } -BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) +BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) { if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y)) { // tooltips for timer bars if (mHoverTimer) { - localRectToScreen(mToolTipRect, sticky_rect_screen); - msg = mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex); + LLRect screen_rect; + localRectToScreen(mToolTipRect, &screen_rect); + + LLToolTipMgr::instance().show(LLToolTipParams() + .message(mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex)) + .sticky_rect(screen_rect)); + return TRUE; } } @@ -262,11 +269,11 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* stic LLFastTimer::NamedTimer* idp = getLegendID(y); if (idp) { - msg = idp->getToolTip(); + LLToolTipMgr::instance().show(idp->getToolTip()); + return TRUE; } } - } return FALSE; diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index f301888984..97e4e94460 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -57,7 +57,7 @@ public: virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void draw(); diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index a7f0a8ff9a..ef71e35254 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -42,6 +42,7 @@ #include "lltrans.h" #include "lluictrlfactory.h" #include "llmenugl.h" +#include "lltooltip.h" #include "llagent.h" #include "llclipboard.h" @@ -122,14 +123,9 @@ class LLFavoriteLandmarkButton : public LLButton { public: - BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) + BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect) { - if(LLUI::sShowXUINames) - { - return LLButton::handleToolTip(x, y, msg, sticky_rect); - } - - msg = mUrlGetter.getSLURL(); + LLToolTipMgr::instance().show(mUrlGetter.getSLURL()); return TRUE; } @@ -193,14 +189,9 @@ private: class LLFavoriteLandmarkMenuItem : public LLMenuItemCallGL { public: - BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) + BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect) { - if(LLUI::sShowXUINames) - { - return LLMenuItemCallGL::handleToolTip(x, y, msg, sticky_rect); - } - - msg = mUrlGetter.getSLURL(); + LLToolTipMgr::instance().show(mUrlGetter.getSLURL()); return TRUE; } @@ -227,6 +218,36 @@ private: LLSLURLGetter mUrlGetter; }; +/** + * This class is needed to update an item being copied to the favorites folder + * with a sort field value (required to save favorites bar's tabs order). + * See method handleNewFavoriteDragAndDrop for more details on how this class is used. + */ +class LLItemCopiedCallback : public LLInventoryCallback +{ +public: + LLItemCopiedCallback(S32 sortField): mSortField(sortField) {} + + virtual void fire(const LLUUID& inv_item) + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + + if (item) + { + item->setSortField(mSortField); + item->setComplete(TRUE); + item->updateServer(FALSE); + + gInventory.updateItem(item); + gInventory.notifyObservers(); + } + + LLView::getWindow()->setCursor(UI_CURSOR_ARROW); + } + +private: + S32 mSortField; +}; // updateButtons's helper struct LLFavoritesSort @@ -378,7 +399,27 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con mItems.push_back(gInventory.getItem(item->getUUID())); } - saveItemsOrder(mItems); + int sortField = 0; + LLPointer<LLItemCopiedCallback> cb; + + // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field + for (LLInventoryModel::item_array_t::iterator i = mItems.begin(); i != mItems.end(); ++i) + { + LLViewerInventoryItem* currItem = *i; + + if (currItem->getUUID() == item->getUUID()) + { + cb = new LLItemCopiedCallback(++sortField); + } + else + { + currItem->setSortField(++sortField); + currItem->setComplete(TRUE); + currItem->updateServer(FALSE); + + gInventory.updateItem(currItem); + } + } copy_inventory_item( gAgent.getID(), @@ -386,9 +427,7 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con item->getUUID(), favorites_id, std::string(), - LLPointer<LLInventoryCallback>(NULL)); - - getWindow()->setCursor(UI_CURSOR_ARROW); + cb); llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; } diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index dec27db74b..c062e6ccf2 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -505,7 +505,7 @@ BOOL LLFloaterAnimPreview::handleHover(S32 x, S32 y, MASK mask) mAnimPreview->requestUpdate(); - LLUI::setCursorPositionLocal(this, mLastMouseX, mLastMouseY); + LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY); } if (!mPreviewRect.pointInRect(x, y) || !mAnimPreview) diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 07dbf98a1e..61568df12e 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -547,7 +547,7 @@ BOOL LLFloaterImagePreview::handleHover(S32 x, S32 y, MASK mask) mSculptedPreview->refresh(); } - LLUI::setCursorPositionLocal(this, mLastMouseX, mLastMouseY); + LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY); } if (!mPreviewRect.pointInRect(x, y) || !mAvatarPreview || !mSculptedPreview) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d389cf06ec..e2e9734012 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -103,6 +103,7 @@ #include "llviewermedia.h" #include "llpluginclassmedia.h" +#include <boost/regex.hpp> //RN temporary includes for resolution switching #include "llglheaders.h" diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index b5c36b1083..13a2594c45 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -75,6 +75,7 @@ #include "llimagepng.h" #include "llimagebmp.h" #include "llimagej2c.h" +#include "lllocalcliprect.h" #include "llresmgr.h" // LLLocale #include "llvfile.h" #include "llvfs.h" diff --git a/indra/newview/llfloatertestinspectors.cpp b/indra/newview/llfloatertestinspectors.cpp new file mode 100644 index 0000000000..c56586cb95 --- /dev/null +++ b/indra/newview/llfloatertestinspectors.cpp @@ -0,0 +1,109 @@ +/** +* @file llfloatertestinspectors.cpp +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 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 "llfloatertestinspectors.h" + +// Viewer includes +#include "llstartup.h" + +// Linden library includes +#include "llfloaterreg.h" +//#include "lluictrlfactory.h" + +LLFloaterTestInspectors::LLFloaterTestInspectors(const LLSD& seed) +: LLFloater(seed) +{ + mCommitCallbackRegistrar.add("ShowAvatarInspector", + boost::bind(&LLFloaterTestInspectors::showAvatarInspector, this, _1, _2)); +} + +LLFloaterTestInspectors::~LLFloaterTestInspectors() +{} + +BOOL LLFloaterTestInspectors::postBuild() +{ +// getChild<LLUICtrl>("avatar_2d_btn")->setCommitCallback( +// boost::bind(&LLFloaterTestInspectors::onClickAvatar2D, this)); + getChild<LLUICtrl>("avatar_3d_btn")->setCommitCallback( + boost::bind(&LLFloaterTestInspectors::onClickAvatar3D, this)); + getChild<LLUICtrl>("object_2d_btn")->setCommitCallback( + boost::bind(&LLFloaterTestInspectors::onClickObject2D, this)); + getChild<LLUICtrl>("object_3d_btn")->setCommitCallback( + boost::bind(&LLFloaterTestInspectors::onClickObject3D, this)); + getChild<LLUICtrl>("group_btn")->setCommitCallback( + boost::bind(&LLFloaterTestInspectors::onClickGroup, this)); + getChild<LLUICtrl>("place_btn")->setCommitCallback( + boost::bind(&LLFloaterTestInspectors::onClickPlace, this)); + getChild<LLUICtrl>("event_btn")->setCommitCallback( + boost::bind(&LLFloaterTestInspectors::onClickEvent, this)); + + return LLFloater::postBuild(); +} + +void LLFloaterTestInspectors::showAvatarInspector(LLUICtrl*, const LLSD& avatar_id) +{ + LLUUID id; // defaults to null + if (LLStartUp::getStartupState() >= STATE_STARTED) + { + id = avatar_id.asUUID(); + } + // spawns off mouse position automatically + LLFloaterReg::showInstance("inspect_avatar", id); +} + +void LLFloaterTestInspectors::onClickAvatar2D() +{ +} + +void LLFloaterTestInspectors::onClickAvatar3D() +{ +} + +void LLFloaterTestInspectors::onClickObject2D() +{ +} + +void LLFloaterTestInspectors::onClickObject3D() +{ +} + +void LLFloaterTestInspectors::onClickGroup() +{ +} + +void LLFloaterTestInspectors::onClickPlace() +{ +} + +void LLFloaterTestInspectors::onClickEvent() +{ +} diff --git a/indra/newview/llfloatertestinspectors.h b/indra/newview/llfloatertestinspectors.h new file mode 100644 index 0000000000..d2dc2248bb --- /dev/null +++ b/indra/newview/llfloatertestinspectors.h @@ -0,0 +1,64 @@ +/** +* @file llfloatertestinspectors.h +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 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 LLFLOATERTESTINSPECTORS_H +#define LLFLOATERTESTINSPECTORS_H + +#include "llfloater.h" + +class LLSD; + +class LLFloaterTestInspectors : public LLFloater +{ + friend class LLFloaterReg; +public: + // nothing yet + +private: + // Construction handled by LLFloaterReg + LLFloaterTestInspectors(const LLSD& seed); + ~LLFloaterTestInspectors(); + + /*virtual*/ BOOL postBuild(); + + // Button callback to show + void showAvatarInspector(LLUICtrl*, const LLSD& avatar_id); + + // Debug function hookups for buttons + void onClickAvatar2D(); + void onClickAvatar3D(); + void onClickObject2D(); + void onClickObject3D(); + void onClickGroup(); + void onClickPlace(); + void onClickEvent(); +}; + +#endif diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 3b3ada46a8..43fbe362d5 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -161,8 +161,6 @@ void LLAgent::renderAutoPilotTarget() } } -extern BOOL gDebugSelect; - // Returns true if you got at least one object void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 73d3a60701..cddc67cb0a 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -77,14 +77,20 @@ BOOL LLGroupList::update(const std::string& name_filter) const LLGroupData& group_data = gAgent.mGroups.get(i); if (name_filter != LLStringUtil::null && !findInsensitive(group_data.mName, name_filter)) continue; - addItem(id, group_data.mName, highlight_id == id, ADD_BOTTOM); + addItem(id, group_data.mName, highlight_id == id, ADD_BOTTOM); // ADD_SORTED can only sort by first column anyway } + // Force sorting the list. + updateSort(); + // add "none" to list at top { std::string loc_none = LLTrans::getString("GroupsNone"); if (name_filter == LLStringUtil::null || findInsensitive(loc_none, name_filter)) addItem(LLUUID::null, loc_none, highlight_id.isNull(), ADD_TOP); + + // Prevent the "none" item from being sorted. + setNeedsSort(false); } group_list->selectByValue(highlight_id); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 674fff4040..0efe9b9849 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1917,19 +1917,8 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string void LLFloaterIMPanel::showSessionStartError( const std::string& error_string) { - //the error strings etc. should be really be static and local - //to this file instead of in the LLFloaterIM - //but they were in llimview.cpp first and unfortunately - //some translations into non English languages already occurred - //thus making it a tad harder to change over to a - //"correct" solution. The best solution - //would be to store all of the misc. strings into - //their own XML file which would be read in by any LLIMPanel - //post build function instead of repeating the same info - //in the group, adhoc and normal IM xml files. LLSD args; - args["REASON"] = - LLFloaterIM::sErrorStringsMap[error_string]; + args["REASON"] = LLTrans::getString(error_string); args["RECIPIENT"] = getTitle(); LLSD payload; @@ -1948,9 +1937,9 @@ void LLFloaterIMPanel::showSessionEventError( { LLSD args; args["REASON"] = - LLFloaterIM::sErrorStringsMap[error_string]; + LLTrans::getString(error_string); args["EVENT"] = - LLFloaterIM::sEventStringsMap[event_string]; + LLTrans::getString(event_string); args["RECIPIENT"] = getTitle(); LLNotifications::instance().add( @@ -1964,7 +1953,7 @@ void LLFloaterIMPanel::showSessionForceClose( LLSD args; args["NAME"] = getTitle(); - args["REASON"] = LLFloaterIM::sForceCloseSessionMap[reason_string]; + args["REASON"] = LLTrans::getString(reason_string); LLSD payload; payload["session_id"] = mSessionUUID; @@ -2000,7 +1989,7 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const LLIMFloater::LLIMFloater(const LLUUID& session_id) - : LLFloater(session_id), + : LLDockableFloater(NULL, session_id), mControlPanel(NULL), mSessionID(session_id), mLastMessageIndex(-1), @@ -2130,9 +2119,7 @@ BOOL LLIMFloater::postBuild() setTitle(LLIMModel::instance().getName(mSessionID)); setDocked(true); - mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); - - return TRUE; + return LLDockableFloater::postBuild(); } @@ -2156,8 +2143,6 @@ void* LLIMFloater::createPanelGroupControl(void* userdata) return self->mControlPanel; } - -const U32 UNDOCK_LEAP_HEIGHT = 12; const U32 DOCK_ICON_HEIGHT = 6; //virtual @@ -2175,20 +2160,6 @@ void LLIMFloater::onFocusLost() } } - - -//virtual -void LLIMFloater::setDocked(bool docked, bool pop_on_undock) -{ - LLFloater::setDocked(docked); - - if (!docked && pop_on_undock) - { - // visually pop up a little bit to emphasize the undocking - translate(0, UNDOCK_LEAP_HEIGHT); - } -} - void LLIMFloater::onSlide() { LLPanel* im_control_panel = getChild<LLPanel>("panel_im_control_panel"); @@ -2217,6 +2188,20 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->updateMessages(); floater->mInputEditor->setFocus(TRUE); + + if (floater->getDockControl() == NULL) + { + LLView* chiclet = + LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLView>( + session_id); + if (chiclet == NULL) + { + llerror("Dock chiclet for LLIMFloater doesn't exists", 0); + } + floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), + LLDockControl::TOP, floater->isDocked())); + } + return floater; } @@ -2316,18 +2301,3 @@ void LLIMFloater::setTyping(BOOL typing) { } - -void LLIMFloater::draw() -{ - //if we are docked, make sure we've been positioned by the chiclet - if (!isDocked() || mPositioned) - { - LLFloater::draw(); - - if (isDocked()) - { - mDockTongue->draw( (getRect().getWidth()/2) - mDockTongue->getWidth()/2, -mDockTongue->getHeight()); - } - } -} - diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 284a486b0f..1d69f1567c 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -33,7 +33,7 @@ #ifndef LL_IMPANEL_H #define LL_IMPANEL_H -#include "llfloater.h" +#include "lldockablefloater.h" #include "lllogchat.h" #include "lluuid.h" #include "lldarray.h" @@ -363,7 +363,7 @@ private: // Individual IM window that appears at the bottom of the screen, // optionally "docked" to the bottom tray. -class LLIMFloater : public LLFloater +class LLIMFloater : public LLDockableFloater { public: LLIMFloater(const LLUUID& session_id); @@ -372,18 +372,11 @@ public: // LLView overrides /*virtual*/ BOOL postBuild(); - - // LLView overrides for drawing dock tongue - /*virtual*/ - void draw(); // Floater should close when user clicks away to other UI area, // hence causing focus loss. /*virtual*/ void onFocusLost(); - // LLFloater overrides - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); - // Make IM conversion visible and update the message history static LLIMFloater* show(const LLUUID& session_id); @@ -426,7 +419,6 @@ private: LLViewerTextEditor* mHistoryEditor; LLLineEditor* mInputEditor; bool mPositioned; - LLUIImagePtr mDockTongue; }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c1a5f21010..901b3351c8 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -83,14 +83,7 @@ LLIMMgr* gIMMgr = NULL; // Statics // // *FIXME: make these all either UIStrings or Strings -static std::string sOnlyUserMessage; -static LLUIString sOfflineMessage; -static std::string sMutedMessage; -static LLUIString sInviteMessage; -std::map<std::string,std::string> LLFloaterIM::sEventStringsMap; -std::map<std::string,std::string> LLFloaterIM::sErrorStringsMap; -std::map<std::string,std::string> LLFloaterIM::sForceCloseSessionMap; std::map<LLUUID, LLIMModel::LLIMSession*> LLIMModel::sSessionsMap; @@ -750,101 +743,6 @@ LLUUID LLIMMgr::computeSessionID( } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// LLFloaterIM -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -LLFloaterIM::LLFloaterIM() - : LLMultiFloater(LLSD()) -{ - // autoresize=false is necessary to avoid resizing of the IM window whenever - // a session is opened or closed (it would otherwise resize the window to match - // the size of the im-sesssion when they were created. This happens in - // LLMultiFloater::resizeToContents() when called through LLMultiFloater::addFloater()) - mAutoResize = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml", NULL); -} - -BOOL LLFloaterIM::postBuild() -{ - // IM session initiation warnings - sOnlyUserMessage = getString("only_user_message"); - sOfflineMessage = getString("offline_message"); - sMutedMessage = getString("muted_message"); - - sInviteMessage = getString("invite_message"); - - if ( sErrorStringsMap.find("generic") == sErrorStringsMap.end() ) - { - sErrorStringsMap["generic"] = - getString("generic_request_error"); - } - - if ( sErrorStringsMap.find("unverified") == - sErrorStringsMap.end() ) - { - sErrorStringsMap["unverified"] = - getString("insufficient_perms_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("no_ability") ) - { - sErrorStringsMap["no_ability"] = - getString("no_ability_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("muted") ) - { - sErrorStringsMap["muted"] = - getString("muted_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("not_a_moderator") ) - { - sErrorStringsMap["not_a_moderator"] = - getString("not_a_mod_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("does not exist") ) - { - sErrorStringsMap["does not exist"] = - getString("session_does_not_exist_error"); - } - - if ( sEventStringsMap.end() == sEventStringsMap.find("add") ) - { - sEventStringsMap["add"] = - getString("add_session_event"); - } - - if ( sEventStringsMap.end() == sEventStringsMap.find("message") ) - { - sEventStringsMap["message"] = - getString("message_session_event"); - } - - - if ( sForceCloseSessionMap.end() == - sForceCloseSessionMap.find("removed") ) - { - sForceCloseSessionMap["removed"] = - getString("removed_from_group"); - } - - if ( sForceCloseSessionMap.end() == - sForceCloseSessionMap.find("no ability") ) - { - sForceCloseSessionMap["no ability"] = - getString("close_on_no_ability"); - } - - return TRUE; -} - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLIncomingCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : @@ -1151,11 +1049,6 @@ LLIMMgr::LLIMMgr() : mFriendObserver = new LLIMViewFriendObserver(this); LLAvatarTracker::instance().addObserver(mFriendObserver); - // *HACK: use floater to initialize string constants from xml file - // then delete it right away - LLFloaterIM* dummy_floater = new LLFloaterIM(); - delete dummy_floater; - mPendingInvitations = LLSD::emptyMap(); mPendingAgentListUpdates = LLSD::emptyMap(); } @@ -1809,7 +1702,7 @@ void LLIMMgr::noteOfflineUsers( S32 count = ids.count(); if(count == 0) { - floater->addHistoryLine(sOnlyUserMessage, LLUIColorTable::instance().getColor("SystemChatColor")); + floater->addHistoryLine(LLTrans::getString("only_user_message"), LLUIColorTable::instance().getColor("SystemChatColor")); } else { @@ -1822,7 +1715,7 @@ void LLIMMgr::noteOfflineUsers( if(info && !info->isOnline() && gCacheName->getName(ids.get(i), first, last)) { - LLUIString offline = sOfflineMessage; + LLUIString offline = LLTrans::getString("offline_message"); offline.setArg("[FIRST]", first); offline.setArg("[LAST]", last); floater->addHistoryLine(offline, LLUIColorTable::instance().getColor("SystemChatColor")); @@ -1848,7 +1741,7 @@ void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater, { if( ml->isMuted(ids.get(i)) ) { - LLUIString muted = sMutedMessage; + LLUIString muted = LLTrans::getString("muted_message"); floater->addHistoryLine(muted); break; } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index aed3b68471..4eb743b1ac 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -44,7 +44,6 @@ class LLFloaterChatterBox; class LLUUID; class LLFloaterIMPanel; class LLFriendObserver; -class LLFloaterIM; class LLIMModel : public LLSingleton<LLIMModel> { @@ -269,18 +268,6 @@ private: LLUUID mBeingRemovedSessionID; }; - -class LLFloaterIM : public LLMultiFloater -{ -public: - LLFloaterIM(); - /*virtual*/ BOOL postBuild(); - - static std::map<std::string,std::string> sEventStringsMap; - static std::map<std::string,std::string> sErrorStringsMap; - static std::map<std::string,std::string> sForceCloseSessionMap; -}; - class LLIncomingCallDialog : public LLModalDialog { public: diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 5bb96f0469..72f89d2e72 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -36,22 +36,72 @@ // viewer files #include "llagentdata.h" #include "llavataractions.h" +#include "llavatarpropertiesprocessor.h" #include "llcallingcard.h" // linden libraries +#include "lltooltip.h" // positionViewNearMouse() #include "lluictrl.h" +// This object represents a pending request for avatar properties information +class LLFetchAvatarData : public LLAvatarPropertiesObserver +{ +public: + // If the inspector closes it will delete the pending request object, so the + // inspector pointer will be valid for the lifetime of this object + LLFetchAvatarData(const LLUUID& avatar_id, LLInspectAvatar* inspector) + : mAvatarID(avatar_id), + mInspector(inspector) + { + LLAvatarPropertiesProcessor* processor = + LLAvatarPropertiesProcessor::getInstance(); + // register ourselves as an observer + processor->addObserver(mAvatarID, this); + // send a request (duplicates will be suppressed inside the avatar + // properties processor) + processor->sendAvatarPropertiesRequest(mAvatarID); + } + + ~LLFetchAvatarData() + { + // remove ourselves as an observer + LLAvatarPropertiesProcessor::getInstance()-> + removeObserver(mAvatarID, this); + } + + void processProperties(void* data, EAvatarProcessorType type) + { + // route the data to the inspector + if (data + && type == APT_PROPERTIES) + { + LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data); + mInspector->processAvatarData(avatar_data); + } + } -LLInspectAvatar::LLInspectAvatar(const LLSD& avatar_id) -: LLFloater(avatar_id), - mAvatarID( avatar_id.asUUID() ), + // Store avatar ID so we can un-register the observer on destruction + LLUUID mAvatarID; + LLInspectAvatar* mInspector; +}; + +LLInspectAvatar::LLInspectAvatar(const LLSD& sd) +: LLFloater( LLSD() ), // single_instance, doesn't really need key + mAvatarID(), // set in onOpen() mFirstName(), - mLastName() + mLastName(), + mPropertiesRequest(NULL) { + // can't make the properties request until the widgets are constructed + // as it might return immediately, so do it in postBuild. } LLInspectAvatar::~LLInspectAvatar() { + // clean up any pending requests so they don't call back into a deleted + // view + delete mPropertiesRequest; + mPropertiesRequest = NULL; } /*virtual*/ @@ -63,31 +113,94 @@ BOOL LLInspectAvatar::postBuild(void) getChild<LLUICtrl>("view_profile_btn")->setCommitCallback( boost::bind(&LLInspectAvatar::onClickViewProfile, this) ); - // can't call from constructor as widgets are not built yet - refresh(); - return TRUE; } -void LLInspectAvatar::setAvatarID(const LLUUID &avatar_id) +void LLInspectAvatar::draw() { - mAvatarID = avatar_id; - refresh(); + static LLCachedControl<F32> FADE_OUT_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f); + if (mCloseTimer.getStarted()) + { + F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_OUT_TIME, 1.f, 0.f); + LLViewDrawContext context(alpha); + LLFloater::draw(); + if (mCloseTimer.getElapsedTimeF32() > FADE_OUT_TIME) + { + closeFloater(false); + } + } + else + { + LLFloater::draw(); + } } -void LLInspectAvatar::refresh() + +// Multiple calls to showInstance("inspect_avatar", foo) will provide different +// LLSD for foo, which we will catch here. +//virtual +void LLInspectAvatar::onOpen(const LLSD& data) { - // *HACK: Don't stomp data when spawning from login screen - if (mAvatarID.isNull()) return; + mCloseTimer.stop(); + + // Extract appropriate avatar id + mAvatarID = data.isUUID() ? data : data["avatar_id"]; + + // Position the inspector relative to the mouse cursor + // Similar to how tooltips are positioned + // See LLToolTipMgr::createToolTip + if (data.has("pos")) + { + LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); + } + else + { + LLUI::positionViewNearMouse(this); + } + + // can't call from constructor as widgets are not built yet + requestUpdate(); +} + +//virtual +void LLInspectAvatar::onFocusLost() +{ + // Start closing when we lose focus + mCloseTimer.start(); +} + +void LLInspectAvatar::requestUpdate() +{ + // Don't make network requests when spawning from the debug menu at the + // login screen (which is useful to work on the layout). + if (mAvatarID.isNull()) + { + getChild<LLUICtrl>("user_subtitle")-> + setValue("Test subtitle"); + getChild<LLUICtrl>("user_details")-> + setValue("Test details\nTest line 2"); + return; + } + + // Clear out old data so it doesn't flash between old and new + getChild<LLUICtrl>("user_name")->setValue(""); + getChild<LLUICtrl>("user_subtitle")->setValue(""); + getChild<LLUICtrl>("user_details")->setValue(""); + + // Make a new request for properties + delete mPropertiesRequest; + mPropertiesRequest = new LLFetchAvatarData(mAvatarID, this); // You can't re-add someone as a friend if they are already your friend bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL; bool is_self = (mAvatarID == gAgentID); childSetEnabled("add_friend_btn", !is_friend && !is_self); - // *TODO: replace with generic - // LLAvatarPropertiesProcessor::getInstance()->addObserver() - // ->sendDataRequest() + // Use an avatar_icon even though the image id will come down with the + // avatar properties because the avatar_icon code maintains a cache of icons + // and this may result in the image being visible sooner. + // *NOTE: This may generate a duplicate avatar properties request, but that + // will be suppressed internally in the avatar properties processor. childSetValue("avatar_icon", LLSD(mAvatarID) ); gCacheName->get(mAvatarID, FALSE, @@ -95,6 +208,26 @@ void LLInspectAvatar::refresh() this, _1, _2, _3, _4)); } +void LLInspectAvatar::processAvatarData(LLAvatarData* data) +{ + LLStringUtil::format_map_t args; + args["[BORN_ON]"] = data->born_on; + args["[AGE]"] = LLAvatarPropertiesProcessor::ageFromDate(data->born_on); + args["[SL_PROFILE]"] = data->about_text; + args["[RW_PROFILE"] = data->fl_about_text; + args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(data); + args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(data); + + std::string subtitle = getString("Subtitle", args); + getChild<LLUICtrl>("user_subtitle")->setValue( LLSD(subtitle) ); + std::string details = getString("Details", args); + getChild<LLUICtrl>("user_details")->setValue( LLSD(details) ); + + // Delete the request object as it has been satisfied + delete mPropertiesRequest; + mPropertiesRequest = NULL; +} + void LLInspectAvatar::nameUpdatedCallback( const LLUUID& id, const std::string& first, @@ -114,14 +247,14 @@ void LLInspectAvatar::nameUpdatedCallback( void LLInspectAvatar::onClickAddFriend() { std::string name; - name.assign(getFirstName()); + name.assign(mFirstName); name.append(" "); - name.append(getLastName()); + name.append(mLastName); - LLAvatarActions::requestFriendshipDialog(getAvatarID(), name); + LLAvatarActions::requestFriendshipDialog(mAvatarID, name); } void LLInspectAvatar::onClickViewProfile() { - LLAvatarActions::showProfile(getAvatarID()); + LLAvatarActions::showProfile(mAvatarID); } diff --git a/indra/newview/llinspectavatar.h b/indra/newview/llinspectavatar.h index 05b0d6fe20..8d490382d2 100644 --- a/indra/newview/llinspectavatar.h +++ b/indra/newview/llinspectavatar.h @@ -1,8 +1,5 @@ /** * @file llinspectavatar.h - * @brief Avatar Inspector, a small information window used when clicking - * on avatar names in the 2D UI and in the ambient inspector widget for - * the 3D world. * * $LicenseInfo:firstyear=2009&license=viewergpl$ * @@ -37,32 +34,45 @@ #include "llfloater.h" +struct LLAvatarData; +class LLFetchAvatarData; + +// Avatar Inspector, a small information window used when clicking +// on avatar names in the 2D UI and in the ambient inspector widget for +// the 3D world. class LLInspectAvatar : public LLFloater { friend class LLFloaterReg; public: - // key is the UUID of avatar for whom to show information - // *TODO: Needs to take a spawn location + // avatar_id - Avatar ID for which to show information + // Inspector will be positioned relative to current mouse position LLInspectAvatar(const LLSD& avatar_id); virtual ~LLInspectAvatar(); /*virtual*/ BOOL postBuild(void); + /*virtual*/ void draw(); + + // Because floater is single instance, need to re-parse data on each spawn + // (for example, inspector about same avatar but in different position) + /*virtual*/ void onOpen(const LLSD& avatar_id); - void setAvatarID(const LLUUID &avatar_id); + // Inspectors close themselves when they lose focus + /*virtual*/ void onFocusLost(); - const LLUUID& getAvatarID() const { return mAvatarID; } - const std::string& getFirstName() const { return mFirstName; } - const std::string& getLastName() const { return mLastName; } + // Update view based on information from avatar properties processor + void processAvatarData(LLAvatarData* data); private: - // Update widgets, including avatar name, buttons enabled, etc. - // Used after avatar id changes. - void refresh(); + // Make network requests for all the data to display in this view. + // Used on construction and if avatar id changes. + void requestUpdate(); + // Button callbacks void onClickAddFriend(); void onClickViewProfile(); + // Callback for gCacheName to look up avatar name void nameUpdatedCallback( const LLUUID& id, const std::string& first, @@ -74,6 +84,10 @@ private: // Need avatar name information to spawn friend add request std::string mFirstName; std::string mLastName; + // an in-flight request for avatar properties from LLAvatarPropertiesProcessor + // is represented by this object + LLFetchAvatarData* mPropertiesRequest; + LLFrameTimer mCloseTimer; }; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index f54a614f62..1d9220cf3d 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -42,6 +42,7 @@ #include "llstring.h" #include "lltrans.h" #include "lluictrlfactory.h" +#include "lltooltip.h" // newview includes #include "llinventorymodel.h" @@ -290,12 +291,13 @@ void LLLocationInputCtrl::hideList() focusTextEntry(); } -BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) +BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) { // Let the buttons show their tooltips. if (LLUICtrl::handleToolTip(x, y, msg, sticky_rect_screen) && !msg.empty()) { - if (mList->getRect().pointInRect(x, y)) { + if (mList->getRect().pointInRect(x, y)) + { S32 loc_x, loc_y; //x,y - contain coordinates related to the location input control, but without taking the expanded list into account //So we have to convert it again into local coordinates of mList @@ -307,7 +309,7 @@ BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* LLSD value = item->getValue(); if (value.has("tooltip")) { - msg = value["tooltip"].asString(); + LLToolTipMgr::instance().show(value["tooltip"]); } } } @@ -315,15 +317,14 @@ BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* return TRUE; } - msg = LLUI::sShowXUINames ? getShowNamesToolTip() : ""; - return mTextEntry->getRect().pointInRect(x, y); + return FALSE; } BOOL LLLocationInputCtrl::handleKeyHere(KEY key, MASK mask) { BOOL result = LLComboBox::handleKeyHere(key, mask); - if (key == KEY_DOWN && hasFocus() && mList->getItemCount() != 0) + if (key == KEY_DOWN && hasFocus() && mList->getItemCount() != 0 && !mList->getVisible()) { showList(); } diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 3c43e1a321..6edae9a9e2 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -71,7 +71,7 @@ public: // LLView interface /*virtual*/ void setEnabled(BOOL enabled); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void onFocusReceived(); /*virtual*/ void onFocusLost(); diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index d1d112c4bf..14a8b7cb59 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -49,7 +49,7 @@ #include "llbutton.h" #include "llviewercontrol.h" #include "llcriticaldamp.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llfloatertools.h" #include "llselectmgr.h" #include "llstatusbar.h" diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index cc2531d139..2153f77336 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -379,7 +379,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) } else if (gSavedSettings.getBOOL("SnapToMouseCursor")) { - LLUI::setCursorPositionScreen(mouse_pos.mX, mouse_pos.mY); + LLUI::setMousePositionScreen(mouse_pos.mX, mouse_pos.mY); x = mouse_pos.mX; y = mouse_pos.mY; } diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp index 3c7716e9c2..b3aa67733b 100644 --- a/indra/newview/llmemoryview.cpp +++ b/indra/newview/llmemoryview.cpp @@ -32,11 +32,11 @@ #include "llviewerprecompiledheaders.h" -#include "indra_constants.h" #include "llmemoryview.h" #include "llappviewer.h" #include "llallocator_heap_profile.h" +#include "llgl.h" // LLGLSUIDefault #include "llviewerwindow.h" #include "llviewercontrol.h" diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index c283b3a05f..69cebcfb5e 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -62,6 +62,8 @@ #include "llfavoritesbar.h" #include "llagentui.h" +#include <boost/regex.hpp> + //-- LLTeleportHistoryMenuItem ----------------------------------------------- /** @@ -300,8 +302,8 @@ void LLNavigationBar::onSearchCommit() if(!search_query.empty()) { LLSearchHistory::getInstance()->addEntry(search_query); - invokeSearch(mSearchComboBox->getValue().asString()); } + invokeSearch(search_query); } void LLNavigationBar::onTeleportHistoryMenuItemClicked(const LLSD& userdata) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 7b0b0c2fb7..5e65f2244d 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -35,15 +35,19 @@ #include "llnetmap.h" +// Library includes (should move below) #include "indra_constants.h" #include "llmath.h" #include "llfloaterreg.h" #include "llfocusmgr.h" +#include "lllocalcliprect.h" #include "llrender.h" #include "llui.h" +#include "lltooltip.h" #include "llglheaders.h" +// Viewer includes #include "llagent.h" #include "llappviewer.h" // for gDisconnected #include "llcallingcard.h" // LLAvatarTracker @@ -286,7 +290,7 @@ void LLNetMap::draw() S32 local_mouse_x; S32 local_mouse_y; //localMouse(&local_mouse_x, &local_mouse_y); - LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); + LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); mClosestAgentToCursor.setNull(); F32 closest_dist = F32_MAX; @@ -496,9 +500,8 @@ BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } -BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ) +BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ) { - BOOL handled = FALSE; if (gDisconnected) { return FALSE; @@ -530,19 +533,23 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec msg = mToolTipMsg; LLStringUtil::format(msg, args); + LLRect sticky_rect; // set sticky_rect if (region) { S32 SLOP = 4; localPointToScreen( x - SLOP, y - SLOP, - &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) ); - sticky_rect_screen->mRight = sticky_rect_screen->mLeft + 2 * SLOP; - sticky_rect_screen->mTop = sticky_rect_screen->mBottom + 2 * SLOP; + &(sticky_rect.mLeft), &(sticky_rect.mBottom) ); + sticky_rect.mRight = sticky_rect.mLeft + 2 * SLOP; + sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP; } - - handled = TRUE; - return handled; + + LLToolTipMgr::instance().show(LLToolTipParams() + .message(msg) + .sticky_rect(sticky_rect)); + + return TRUE; } diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index a673ea3f57..7598154480 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -67,7 +67,7 @@ public: /*virtual*/ void draw(); /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); + /*virtual*/ BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ); void setScale( F32 scale ); void setRotateMap( BOOL b ) { mRotateMap = b; } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index fd3519bf4b..ba383a8dee 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -35,7 +35,7 @@ #include "llagent.h" #include "llavataractions.h" -#include "llavatarconstants.h" +#include "llavatarconstants.h" // AVATAR_ONLINE #include "llcallingcard.h" #include "llcombobox.h" #include "llimview.h" @@ -131,7 +131,8 @@ LLPanelAvatarNotes::LLPanelAvatarNotes() void LLPanelAvatarNotes::updateData() { - LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_NOTES); + LLAvatarPropertiesProcessor::getInstance()-> + sendAvatarNotesRequest(getAvatarId()); } BOOL LLPanelAvatarNotes::postBuild() @@ -356,8 +357,10 @@ void LLPanelAvatarProfile::updateData() { if (getAvatarId().notNull()) { - LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_PROPERTIES); - LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_GROUPS); + LLAvatarPropertiesProcessor::getInstance()-> + sendAvatarPropertiesRequest(getAvatarId()); + LLAvatarPropertiesProcessor::getInstance()-> + sendAvatarGroupsRequest(getAvatarId()); } } @@ -486,55 +489,13 @@ void LLPanelAvatarProfile::fillOnlineStatus(const LLAvatarData* avatar_data) void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data) { - std::string caption_text = avatar_data->caption_text; - if(caption_text.empty()) - { - LLStringUtil::format_map_t args; - caption_text = getString("CaptionTextAcctInfo"); - BOOL transacted = (avatar_data->flags & AVATAR_TRANSACTED); - BOOL identified = (avatar_data->flags & AVATAR_IDENTIFIED); - BOOL age_verified = (avatar_data->flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy considerations - - const char* ACCT_TYPE[] = { - "AcctTypeResident", - "AcctTypeTrial", - "AcctTypeCharterMember", - "AcctTypeEmployee" - }; - U8 caption_index = llclamp(avatar_data->caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1)); - args["[ACCTTYPE]"] = getString(ACCT_TYPE[caption_index]); - - std::string payment_text = " "; - const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3; - if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX) - { - if(transacted) - { - payment_text = "PaymentInfoUsed"; - } - else if (identified) - { - payment_text = "PaymentInfoOnFile"; - } - else - { - payment_text = "NoPaymentInfoOnFile"; - } - args["[PAYMENTINFO]"] = getString(payment_text); - - std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; - // Do not display age verification status at this time - //args["[[AGEVERIFICATION]]"] = mPanelSecondLife->getString(age_text); - args["[AGEVERIFICATION]"] = " "; - } - else - { - args["[PAYMENTINFO]"] = " "; - args["[AGEVERIFICATION]"] = " "; - } - LLStringUtil::format(caption_text, args); - } - + LLStringUtil::format_map_t args; + args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(avatar_data); + args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(avatar_data); + // *NOTE: AVATAR_AGEVERIFIED not currently getting set in + // dataserver/lldataavatar.cpp for privacy considerations + args["[AGEVERIFICATION]"] = ""; + std::string caption_text = getString("CaptionTextAcctInfo", args); childSetValue("acc_status_text", caption_text); } diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index f7ca54c732..bde6d1cf6c 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -159,7 +159,7 @@ void LLPanelPick::requestData() { mDataReceived = FALSE; LLAvatarPropertiesProcessor::instance().addObserver(mCreatorId, this); - LLAvatarPropertiesProcessor::instance().sendDataRequest(mCreatorId, APT_PICK_INFO, &mPickId); + LLAvatarPropertiesProcessor::instance().sendPickInfoRequest(mCreatorId, mPickId); } void LLPanelPick::init(LLPickData *pick_data) @@ -335,7 +335,7 @@ void LLPanelPick::sendUpdate() mDataReceived = FALSE; LLAvatarPropertiesProcessor::instance().addObserver(gAgentID, this); - LLAvatarPropertiesProcessor::instance().sendDataUpdate(&pick_data, APT_PICK_INFO); + LLAvatarPropertiesProcessor::instance().sendPickInfoUpdate(&pick_data); } diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index c34038c672..d374d24316 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -88,7 +88,7 @@ void* LLPanelPicks::create(void* data /* = NULL */) void LLPanelPicks::updateData() { - LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_PICKS); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId()); } void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) @@ -447,7 +447,7 @@ const std::string LLPickItem::getDescription() void LLPickItem::update() { mNeedData = true; - LLAvatarPropertiesProcessor::instance().sendDataRequest(mCreatorID, APT_PICK_INFO, &mPickID); + LLAvatarPropertiesProcessor::instance().sendPickInfoRequest(mCreatorID, mPickID); mNeedData = false; } diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index ec1c10d8c9..457109f869 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -894,7 +894,7 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& global_pos) pick_data.sort_order = 0; pick_data.enabled = TRUE; - LLAvatarPropertiesProcessor::instance().sendDataUpdate(&pick_data, APT_PICK_INFO); + LLAvatarPropertiesProcessor::instance().sendPickInfoUpdate(&pick_data); } // virtual diff --git a/indra/newview/llsearchcombobox.cpp b/indra/newview/llsearchcombobox.cpp index c903f40f3f..29d31e8b56 100644 --- a/indra/newview/llsearchcombobox.cpp +++ b/indra/newview/llsearchcombobox.cpp @@ -152,19 +152,16 @@ void LLSearchComboBox::onSelectionCommit() { std::string search_query = getSimple(); LLStringUtil::trim(search_query); - if(search_query.empty()) - { - mTextEntry->setText(search_query); - setControlValue(search_query); - - return; - } - remove(search_query); - add(search_query, ADD_TOP); mTextEntry->setText(search_query); setControlValue(search_query); + if(!search_query.empty()) + { + remove(search_query); + add(search_query, ADD_TOP); + } + LLUICtrl::onCommit(); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 32fe996125..b25331e439 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -393,7 +393,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, } // Collect all of the objects - LLDynamicArray<LLViewerObject*> objects; + std::vector<LLViewerObject*> objects; root->addThisAndNonJointChildren(objects); addAsFamily(objects, add_to_end); @@ -439,7 +439,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vector<LLV BOOL send_to_sim) { // Collect all of the objects, children included - LLDynamicArray<LLViewerObject*> objects; + std::vector<LLViewerObject*> objects; //clear primary object (no primary object) mSelectedObjects->mPrimaryObject = NULL; @@ -563,7 +563,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s if(!object->isSelected()) return; // Collect all of the objects, and remove them - LLDynamicArray<LLViewerObject*> objects; + std::vector<LLViewerObject*> objects; if (include_entire_object) { @@ -779,47 +779,55 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32 face) { - // Always blitz hover list when setting - mHoverObjects->deleteAllNodes(); - if (!objectp) { + mHoverObjects->deleteAllNodes(); return NULL; } // Can't select yourself if (objectp->mID == gAgentID) { + mHoverObjects->deleteAllNodes(); return NULL; } // Can't select land if (objectp->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) { + mHoverObjects->deleteAllNodes(); return NULL; } - // Collect all of the objects - LLDynamicArray<LLViewerObject*> objects; objectp = objectp->getRootEdit(); - objectp->addThisAndNonJointChildren(objects); - for (std::vector<LLViewerObject*>::iterator iter = objects.begin(); - iter != objects.end(); ++iter) + // is the requested object the same as the existing hover object root? + // NOTE: there is only ever one linked set in mHoverObjects + if (mHoverObjects->getFirstRootObject() != objectp) { - LLViewerObject* cur_objectp = *iter; - LLSelectNode* nodep = new LLSelectNode(cur_objectp, FALSE); - nodep->selectTE(face, TRUE); - mHoverObjects->addNodeAtEnd(nodep); + // Collect all of the objects + std::vector<LLViewerObject*> objects; + objectp = objectp->getRootEdit(); + objectp->addThisAndNonJointChildren(objects); + + for (std::vector<LLViewerObject*>::iterator iter = objects.begin(); + iter != objects.end(); ++iter) + { + LLViewerObject* cur_objectp = *iter; + LLSelectNode* nodep = new LLSelectNode(cur_objectp, FALSE); + nodep->selectTE(face, TRUE); + mHoverObjects->addNodeAtEnd(nodep); + } + + requestObjectPropertiesFamily(objectp); } - requestObjectPropertiesFamily(objectp); return mHoverObjects; } LLSelectNode *LLSelectMgr::getHoverNode() { - return getHoverObjects()->getFirstRootNode(); + return mHoverObjects->getFirstRootNode(); } void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp) @@ -1286,7 +1294,7 @@ void LLSelectMgr::promoteSelectionToRoot() //----------------------------------------------------------------------------- void LLSelectMgr::demoteSelectionToIndividuals() { - LLDynamicArray<LLViewerObject*> objects; + std::vector<LLViewerObject*> objects; for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++) @@ -1295,7 +1303,7 @@ void LLSelectMgr::demoteSelectionToIndividuals() object->addThisAndNonJointChildren(objects); } - if (objects.getLength()) + if (!objects.empty()) { deselectAll(); for (std::vector<LLViewerObject*>::iterator iter = objects.begin(); @@ -4480,7 +4488,7 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use return (node->getObject() && node->getObject()->mID == mID); } } func(id); - LLSelectNode* node = LLSelectMgr::getInstance()->getHoverObjects()->getFirstNode(&func); + LLSelectNode* node = LLSelectMgr::getInstance()->mHoverObjects->getFirstNode(&func); if (node) { diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index c41a86e355..08c2783746 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -411,6 +411,7 @@ public: LLObjectSelectionHandle selectHighlightedObjects(); LLObjectSelectionHandle setHoverObject(LLViewerObject *objectp, S32 face = -1); + LLSelectNode *getHoverNode(); void highlightObjectOnly(LLViewerObject *objectp); void highlightObjectAndFamily(LLViewerObject *objectp); @@ -445,14 +446,11 @@ public: //////////////////////////////////////////////////////////////// // Selection accessors //////////////////////////////////////////////////////////////// - LLObjectSelectionHandle getHoverObjects() { return mHoverObjects; } LLObjectSelectionHandle getSelection() { return mSelectedObjects; } // right now this just renders the selection with root/child colors instead of a single color LLObjectSelectionHandle getEditSelection() { convertTransient(); return mSelectedObjects; } LLObjectSelectionHandle getHighlightedObjects() { return mHighlightedObjects; } - LLSelectNode *getHoverNode(); - //////////////////////////////////////////////////////////////// // Grid manipulation //////////////////////////////////////////////////////////////// diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 7ddbf0a744..98428bf0f7 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -154,6 +154,8 @@ void LLSysWellWindow::toggleWindow() getDockTongue(), LLDockControl::TOP, isDocked())); } setVisible(!getVisible()); + //set window in foreground + setFocus(getVisible()); } //--------------------------------------------------------------------------------- @@ -179,7 +181,7 @@ void LLSysWellWindow::setVisible(BOOL visible) if(mChannel) mChannel->setShowToasts(!visible); - LLFloater::setVisible(visible); + LLDockableFloater::setVisible(visible); } //--------------------------------------------------------------------------------- @@ -329,11 +331,28 @@ void LLSysWellWindow::sessionRemoved(const LLUUID& sessionId) //--------------------------------------------------------------------------------- LLSysWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& sessionId, S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) : - LLScrollingPanel(LLPanel::Params()), mParent(parent) + LLScrollingPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_activeim_row.xml", NULL); - mChiclet = getChild<LLIMChiclet>("chiclet"); + // Choose which of the pre-created chiclets (IM/group) to use. + // The other one gets hidden. + + LLIMChiclet::EType im_chiclet_type = LLIMChiclet::getIMSessionType(sessionId); + switch (im_chiclet_type) + { + case LLIMChiclet::TYPE_GROUP: + mChiclet = getChild<LLIMChiclet>("group_chiclet"); + childSetVisible("p2p_chiclet", false); + break; + case LLIMChiclet::TYPE_UNKNOWN: // assign mChiclet a non-null value anyway + case LLIMChiclet::TYPE_IM: + mChiclet = getChild<LLIMChiclet>("p2p_chiclet"); + childSetVisible("group_chiclet", false); + break; + } + + // Initialize chiclet. mChiclet->setCounter(chicletCounter); mChiclet->setSessionId(sessionId); mChiclet->setIMSessionName(name); diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index ef0974b428..d76147b489 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -69,6 +69,7 @@ public: virtual void setVisible(BOOL visible); void adjustWindowPosition(); void toggleWindow(); + /*virtua*/BOOL canClose() { return FALSE; } // Handlers void onItemClick(LLSysWellItem* item); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 70a8ab9f61..9da2446354 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -43,7 +43,7 @@ #include "llimageworker.h" #include "llrender.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llselectmgr.h" #include "lltexlayer.h" #include "lltexturecache.h" @@ -662,16 +662,20 @@ void LLTextureView::draw() #if 1 if (pri < HIGH_PRIORITY && (cur_discard< 0 || desired_discard < cur_discard)) { - LLViewerObject *objectp = gHoverView->getLastHoverObject(); - if (objectp) + LLSelectNode* hover_node = LLSelectMgr::instance().getHoverNode(); + if (hover_node) { - S32 tex_count = objectp->getNumTEs(); - for (S32 i = 0; i < tex_count; i++) + LLViewerObject *objectp = hover_node->getObject(); + if (objectp) { - if (imagep == objectp->getTEImage(i)) + S32 tex_count = objectp->getNumTEs(); + for (S32 i = 0; i < tex_count; i++) { - pri += 2*HIGH_PRIORITY; - break; + if (imagep == objectp->getTEImage(i)) + { + pri += 2*HIGH_PRIORITY; + break; + } } } } diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 7b058e9efa..ceb1358d1c 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -65,6 +65,20 @@ LLTool::~LLTool() } } +BOOL LLTool::handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) +{ + // This is necessary to force clicks in the world to cause edit + // boxes that might have keyboard focus to relinquish it, and hence + // cause a commit to update their value. JC + if (down) + { + gFocusMgr.setKeyboardFocus(NULL); + } + + return LLMouseHandler::handleAnyMouseClick(x, y, mask, clicktype, down); +} + + BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask) { if (gDebugClicks) @@ -139,7 +153,7 @@ BOOL LLTool::handleMiddleMouseUp(S32 x, S32 y, MASK mask) return FALSE; } -BOOL LLTool::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) +BOOL LLTool::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) { // by default, didn't handle it // llinfos << "LLTool::handleToolTip" << llendl; diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index f954a8c243..bef4a2e1fd 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -55,6 +55,7 @@ public: virtual BOOL isView() const { return FALSE; } // Virtual functions inherited from LLMouseHandler + virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); @@ -65,9 +66,7 @@ public: virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen); - - virtual EShowToolTip getShowToolTip() { return SHOW_ALWAYS; }; // tools should permit tips even when the mouse is down, as that's pretty normal for tools + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); // Return FALSE to allow context menu to be shown. virtual void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index c58457d599..b35208cd03 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -56,6 +56,7 @@ #include "llpreviewnotecard.h" #include "llselectmgr.h" #include "lltoolmgr.h" +#include "lltooltip.h" #include "lltrans.h" #include "llui.h" #include "llviewertexturelist.h" @@ -758,12 +759,13 @@ BOOL LLToolDragAndDrop::handleKey(KEY key, MASK mask) return FALSE; } -BOOL LLToolDragAndDrop::handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen) +BOOL LLToolDragAndDrop::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) { if (!mToolTipMsg.empty()) { - msg = mToolTipMsg; - //*sticky_rect_screen = gViewerWindow->getWindowRect(); + LLToolTipMgr::instance().show(LLToolTipParams() + .message(mToolTipMsg) + .delay_time(gSavedSettings.getF32( "DragAndDropToolTipDelay" ))); return TRUE; } return FALSE; diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index f9e5bec143..c9fef26b58 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -57,7 +57,7 @@ public: virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleKey(KEY key, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); virtual void onMouseCaptureLost(); virtual void handleDeselect(); diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 297cf2c667..9400840bdf 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -45,7 +45,7 @@ #include "llbutton.h" #include "llviewercontrol.h" #include "lldrawable.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llhudmanager.h" #include "llfloatertools.h" #include "llselectmgr.h" @@ -287,12 +287,12 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) BOOL success = LLViewerCamera::getInstance()->projectPosAgentToScreen(focus_pos, mouse_pos); if (success) { - LLUI::setCursorPositionScreen(mouse_pos.mX, mouse_pos.mY); + LLUI::setMousePositionScreen(mouse_pos.mX, mouse_pos.mY); } } else if (mMouseSteering) { - LLUI::setCursorPositionScreen(mMouseDownX, mMouseDownY); + LLUI::setMousePositionScreen(mMouseDownX, mMouseDownY); } else { @@ -302,7 +302,7 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) else { // not a valid zoomable object - LLUI::setCursorPositionScreen(mMouseDownX, mMouseDownY); + LLUI::setMousePositionScreen(mMouseDownX, mMouseDownY); } // calls releaseMouse() internally diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index abadd251c1..b7a97562bd 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -134,7 +134,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask) if (!gAgent.leftButtonGrabbed()) { // can grab transparent objects (how touch event propagates, scripters rely on this) - gViewerWindow->pickAsync(x, y, mask, pickCallback, TRUE, TRUE); + gViewerWindow->pickAsync(x, y, mask, pickCallback, TRUE); } return TRUE; } @@ -996,7 +996,7 @@ void LLToolGrab::onMouseCaptureLost() // ...move cursor "naturally", as if it had moved when hidden S32 x = mGrabPick.mMousePt.mX + mAccumDeltaX; S32 y = mGrabPick.mMousePt.mY + mAccumDeltaY; - LLUI::setCursorPositionScreen(x, y); + LLUI::setMousePositionScreen(x, y); } else if (mHasMoved) { @@ -1006,13 +1006,13 @@ void LLToolGrab::onMouseCaptureLost() LLCoordGL gl_point; if (LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_point_agent, gl_point)) { - LLUI::setCursorPositionScreen(gl_point.mX, gl_point.mY); + LLUI::setMousePositionScreen(gl_point.mX, gl_point.mY); } } else { // ...move cursor back to click position - LLUI::setCursorPositionScreen(mGrabPick.mMousePt.mX, mGrabPick.mMousePt.mY); + LLUI::setMousePositionScreen(mGrabPick.mMousePt.mX, mGrabPick.mMousePt.mY); } gViewerWindow->showCursor(); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 235d4acf9d..d6297c30c7 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -45,7 +45,7 @@ #include "llfloaterland.h" #include "llfloaterreg.h" #include "llfloaterscriptdebug.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llmenugl.h" @@ -55,6 +55,7 @@ #include "lltoolgrab.h" #include "lltoolmgr.h" #include "lltoolselect.h" +#include "lltrans.h" #include "llviewercamera.h" #include "llviewerparcelmedia.h" #include "llviewermenu.h" @@ -68,6 +69,7 @@ #include "llworld.h" #include "llui.h" #include "llweb.h" +#include "llinspectavatar.h" extern void handle_buy(void*); @@ -91,7 +93,7 @@ LLToolPie::LLToolPie() BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) { //left mouse down always picks transparent - gViewerWindow->pickAsync(x, y, mask, leftMouseCallback, TRUE, TRUE); + gViewerWindow->pickAsync(x, y, mask, leftMouseCallback, TRUE); mGrabMouseButtonDown = TRUE; return TRUE; } @@ -108,7 +110,7 @@ void LLToolPie::leftMouseCallback(const LLPickInfo& pick_info) BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) { // don't pick transparent so users can't "pay" transparent objects - gViewerWindow->pickAsync(x, y, mask, rightMouseCallback, FALSE, TRUE); + gViewerWindow->pickAsync(x, y, mask, rightMouseCallback, FALSE); // claim not handled so UI focus stays same return FALSE; } @@ -463,31 +465,13 @@ void LLToolPie::selectionPropertiesReceived() BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { - /* - // If auto-rotate occurs, tag mouse-outside-slop to make sure the drag - // gets started. - const S32 ROTATE_H_MARGIN = (S32) (0.1f * gViewerWindow->getWindowWidth() ); - const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD; - const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped; - // ...normal modes can only yaw - if (x < ROTATE_H_MARGIN) - { - gAgent.yaw(rotate_angle); - mMouseOutsideSlop = TRUE; - } - else if (x > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN) - { - gAgent.yaw(-rotate_angle); - mMouseOutsideSlop = TRUE; - } - */ + mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE); // FIXME: This was in the pluginapi branch, but I don't think it's correct. // gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); - LLViewerObject *object = NULL; LLViewerObject *parent = NULL; - object = gViewerWindow->getHoverPick().getObject(); + LLViewerObject *object = mHoverPick.getObject(); if (object) { @@ -500,7 +484,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) gViewerWindow->setCursor(cursor); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } - else if (handle_media_hover(gViewerWindow->getHoverPick())) + else if (handle_media_hover(mHoverPick)) { // cursor set by media object lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; @@ -553,7 +537,7 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) // same object anymore. gViewerWindow->setCursor(UI_CURSOR_ARROW); // Make sure the hover-picked object is ignored. - gHoverView->resetLastHoverObject(); + //gToolTipView->resetLastHoverObject(); break; default: break; @@ -584,41 +568,439 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) else if (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero()) { - // Hit an object - // HACK: Call the last hit position the point we hit on the object - //gLastHitPosGlobal += gLastHitObjectOffset; handle_go_to(); return TRUE; } } return FALSE; +} - /* JC - don't do go-there, because then double-clicking on physical - objects gets you into trouble. +//FIXME - RN: get this in LLToolSelectLand too or share some other way? +const char* DEFAULT_DESC = "(No Description)"; - // If double-click on object or land, go there. - LLViewerObject *object = gViewerWindow->getLastPick().getObject(); - if (object) +BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, std::string& msg, LLRect& sticky_rect_screen) +{ + if (!LLUI::sSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE; + if (!mHoverPick.isValid()) return TRUE; + + LLViewerObject* hover_object = mHoverPick.getObject(); + + // update hover object and hover parcel + LLSelectMgr::getInstance()->setHoverObject(hover_object, mHoverPick.mObjectFace); + + if (mHoverPick.mPickType == LLPickInfo::PICK_LAND) + { + LLViewerParcelMgr::getInstance()->setHoverParcel( mHoverPick.mPosGlobal ); + } + + std::string tooltip_msg; + std::string line; + + if ( hover_object ) { - if (object->isAvatar()) + if ( hover_object->isHUDAttachment() ) { - LLFloaterAvatarInfo::showFromAvatar(object->getID()); + // no hover tips for HUD elements, since they can obscure + // what the HUD is displaying + return TRUE; + } + + if ( hover_object->isAttachment() ) + { + // get root of attachment then parent, which is avatar + LLViewerObject* root_edit = hover_object->getRootEdit(); + if (!root_edit) + { + // Strange parenting issue, don't show any text + return TRUE; + } + hover_object = (LLViewerObject*)root_edit->getParent(); + if (!hover_object) + { + // another strange parenting issue, bail out + return TRUE; + } + } + + line.clear(); + if (hover_object->isAvatar()) + { + // only show tooltip if inspector not already open + if (!LLFloaterReg::instanceVisible("inspect_avatar")) + { + std::string avatar_name; + LLNameValue* firstname = hover_object->getNVPair("FirstName"); + LLNameValue* lastname = hover_object->getNVPair("LastName"); + if (firstname && lastname) + { + avatar_name = llformat("%s %s", firstname->getString(), lastname->getString()); + } + else + { + avatar_name = LLTrans::getString("TooltipPerson"); + } + LLToolTipParams params; + params.message(avatar_name); + params.image.name("Info"); + params.sticky_rect(gViewerWindow->getVirtualWorldViewRect()); + params.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); + LLToolTipMgr::instance().show(params); + } } else { - handle_go_to(NULL); + // + // We have hit a regular object (not an avatar or attachment) + // + + // + // Default prefs will suppress display unless the object is interactive + // + BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip"); + + LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode(); + if (nodep) + { + line.clear(); + if (nodep->mName.empty()) + { + line.append(LLTrans::getString("TooltipNoName")); + } + else + { + line.append( nodep->mName ); + } + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + + if (!nodep->mDescription.empty() + && nodep->mDescription != DEFAULT_DESC) + { + tooltip_msg.append( nodep->mDescription ); + tooltip_msg.push_back('\n'); + } + + // Line: "Owner: James Linden" + line.clear(); + line.append(LLTrans::getString("TooltipOwner") + " "); + + if (nodep->mValid) + { + LLUUID owner; + std::string name; + if (!nodep->mPermissions->isGroupOwned()) + { + owner = nodep->mPermissions->getOwner(); + if (LLUUID::null == owner) + { + line.append(LLTrans::getString("TooltipPublic")); + } + else if(gCacheName->getFullName(owner, name)) + { + line.append(name); + } + else + { + line.append(LLTrans::getString("RetrievingData")); + } + } + else + { + std::string name; + owner = nodep->mPermissions->getGroup(); + if (gCacheName->getGroupName(owner, name)) + { + line.append(name); + line.append(LLTrans::getString("TooltipIsGroup")); + } + else + { + line.append(LLTrans::getString("RetrievingData")); + } + } + } + else + { + line.append(LLTrans::getString("RetrievingData")); + } + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + + // Build a line describing any special properties of this object. + LLViewerObject *object = hover_object; + LLViewerObject *parent = (LLViewerObject *)object->getParent(); + + if (object && + (object->usePhysics() || + object->flagScripted() || + object->flagHandleTouch() || (parent && parent->flagHandleTouch()) || + object->flagTakesMoney() || (parent && parent->flagTakesMoney()) || + object->flagAllowInventoryAdd() || + object->flagTemporary() || + object->flagPhantom()) ) + { + line.clear(); + if (object->flagScripted()) + { + line.append(LLTrans::getString("TooltipFlagScript") + " "); + } + + if (object->usePhysics()) + { + line.append(LLTrans::getString("TooltipFlagPhysics") + " "); + } + + if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ) + { + line.append(LLTrans::getString("TooltipFlagTouch") + " "); + suppressObjectHoverDisplay = FALSE; // Show tip + } + + if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ) + { + line.append(LLTrans::getString("TooltipFlagL$") + " "); + suppressObjectHoverDisplay = FALSE; // Show tip + } + + if (object->flagAllowInventoryAdd()) + { + line.append(LLTrans::getString("TooltipFlagDropInventory") + " "); + suppressObjectHoverDisplay = FALSE; // Show tip + } + + if (object->flagPhantom()) + { + line.append(LLTrans::getString("TooltipFlagPhantom") + " "); + } + + if (object->flagTemporary()) + { + line.append(LLTrans::getString("TooltipFlagTemporary") + " "); + } + + if (object->usePhysics() || + object->flagHandleTouch() || + (parent && parent->flagHandleTouch()) ) + { + line.append(LLTrans::getString("TooltipFlagRightClickMenu") + " "); + } + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + } + + // Free to copy / For Sale: L$ + line.clear(); + if (nodep->mValid) + { + BOOL for_copy = nodep->mPermissions->getMaskEveryone() & PERM_COPY && object->permCopy(); + BOOL for_sale = nodep->mSaleInfo.isForSale() && + nodep->mPermissions->getMaskOwner() & PERM_TRANSFER && + (nodep->mPermissions->getMaskOwner() & PERM_COPY || + nodep->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY); + if (for_copy) + { + line.append(LLTrans::getString("TooltipFreeToCopy")); + suppressObjectHoverDisplay = FALSE; // Show tip + } + else if (for_sale) + { + LLStringUtil::format_map_t args; + args["[AMOUNT]"] = llformat("%d", nodep->mSaleInfo.getSalePrice()); + line.append(LLTrans::getString("TooltipForSaleL$", args)); + suppressObjectHoverDisplay = FALSE; // Show tip + } + else + { + // Nothing if not for sale + // line.append("Not for sale"); + } + } + else + { + LLStringUtil::format_map_t args; + args["[MESSAGE]"] = LLTrans::getString("RetrievingData"); + line.append(LLTrans::getString("TooltipForSaleMsg", args)); + } + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + + if (!suppressObjectHoverDisplay) + { + LLToolTipMgr::instance().show(tooltip_msg); + } + } } } - else if (!gLastHitPosGlobal.isExactlyZero()) + else if ( mHoverPick.mPickType == LLPickInfo::PICK_LAND ) { - handle_go_to(NULL); + // + // Do not show hover for land unless prefs are set to allow it. + // + + if (!gSavedSettings.getBOOL("ShowLandHoverTip")) return TRUE; + + // Didn't hit an object, but since we have a land point we + // must be hovering over land. + + LLParcel* hover_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel(); + LLUUID owner; + S32 width = 0; + S32 height = 0; + + if ( hover_parcel ) + { + owner = hover_parcel->getOwnerID(); + width = S32(LLViewerParcelMgr::getInstance()->getHoverParcelWidth()); + height = S32(LLViewerParcelMgr::getInstance()->getHoverParcelHeight()); + } + + // Line: "Land" + line.clear(); + line.append(LLTrans::getString("TooltipLand")); + if (hover_parcel) + { + line.append(hover_parcel->getName()); + } + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + + // Line: "Owner: James Linden" + line.clear(); + line.append(LLTrans::getString("TooltipOwner") + " "); + + if ( hover_parcel ) + { + std::string name; + if (LLUUID::null == owner) + { + line.append(LLTrans::getString("TooltipPublic")); + } + else if (hover_parcel->getIsGroupOwned()) + { + if (gCacheName->getGroupName(owner, name)) + { + line.append(name); + line.append(LLTrans::getString("TooltipIsGroup")); + } + else + { + line.append(LLTrans::getString("RetrievingData")); + } + } + else if(gCacheName->getFullName(owner, name)) + { + line.append(name); + } + else + { + line.append(LLTrans::getString("RetrievingData")); + } + } + else + { + line.append(LLTrans::getString("RetrievingData")); + } + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + + // Line: "no fly, not safe, no build" + + // Don't display properties for your land. This is just + // confusing, because you can do anything on your own land. + if ( hover_parcel && owner != gAgent.getID() ) + { + S32 words = 0; + + line.clear(); + // JC - Keep this in the same order as the checkboxes + // on the land info panel + if ( !hover_parcel->getAllowModify() ) + { + if ( hover_parcel->getAllowGroupModify() ) + { + line.append(LLTrans::getString("TooltipFlagGroupBuild")); + } + else + { + line.append(LLTrans::getString("TooltipFlagNoBuild")); + } + words++; + } + + if ( !hover_parcel->getAllowTerraform() ) + { + if (words) line.append(", "); + line.append(LLTrans::getString("TooltipFlagNoEdit")); + words++; + } + + if ( hover_parcel->getAllowDamage() ) + { + if (words) line.append(", "); + line.append(LLTrans::getString("TooltipFlagNotSafe")); + words++; + } + + // Maybe we should reflect the estate's block fly bit here as well? DK 12/1/04 + if ( !hover_parcel->getAllowFly() ) + { + if (words) line.append(", "); + line.append(LLTrans::getString("TooltipFlagNoFly")); + words++; + } + + if ( !hover_parcel->getAllowOtherScripts() ) + { + if (words) line.append(", "); + if ( hover_parcel->getAllowGroupScripts() ) + { + line.append(LLTrans::getString("TooltipFlagGroupScripts")); + } + else + { + line.append(LLTrans::getString("TooltipFlagNoScripts")); + } + + words++; + } + + if (words) + { + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + } + } + + if (hover_parcel && hover_parcel->getParcelFlag(PF_FOR_SALE)) + { + LLStringUtil::format_map_t args; + args["[AMOUNT]"] = llformat("%d", hover_parcel->getSalePrice()); + line = LLTrans::getString("TooltipForSaleL$", args); + tooltip_msg.append(line); + tooltip_msg.push_back('\n'); + } + LLToolTipMgr::instance().show(tooltip_msg); } + return TRUE; - */ } +// static +void LLToolPie::showAvatarInspector(const LLUUID& avatar_id) +{ + LLSD params; + params["avatar_id"] = avatar_id; + if (LLToolTipMgr::instance().toolTipVisible()) + { + LLRect rect = LLToolTipMgr::instance().getToolTipRect(); + params["pos"]["x"] = rect.mLeft; + params["pos"]["y"] = rect.mTop; + } + + LLFloaterReg::showInstance("inspect_avatar", params); +} void LLToolPie::handleDeselect() { @@ -627,6 +1009,7 @@ void LLToolPie::handleDeselect() setMouseCapture( FALSE ); // Calls onMouseCaptureLost() indirectly } // remove temporary selection for pie menu + LLSelectMgr::getInstance()->setHoverObject(NULL); LLSelectMgr::getInstance()->validateSelection(); } diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index a55e435282..be6e539ffd 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -52,6 +52,7 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); virtual void render(); @@ -72,6 +73,7 @@ public: static void selectionPropertiesReceived(); + static void showAvatarInspector(const LLUUID& id); private: BOOL outsideSlop (S32 x, S32 y, S32 start_x, S32 start_y); @@ -84,6 +86,7 @@ private: BOOL mGrabMouseButtonDown; BOOL mMouseOutsideSlop; // for this drag, has mouse moved outside slop region LLPickInfo mPick; + LLPickInfo mHoverPick; LLPointer<LLViewerObject> mClickActionObject; U8 mClickAction; LLSafeHandle<LLObjectSelection> mLeftClickSelection; diff --git a/indra/newview/lltoolpipette.cpp b/indra/newview/lltoolpipette.cpp index 878ed0f9a9..9a92f2ae3f 100644 --- a/indra/newview/lltoolpipette.cpp +++ b/indra/newview/lltoolpipette.cpp @@ -40,6 +40,7 @@ #include "lltoolpipette.h" // Library includes +#include "lltooltip.h" // Viewer includes #include "llviewerobjectlist.h" @@ -92,15 +93,19 @@ BOOL LLToolPipette::handleHover(S32 x, S32 y, MASK mask) return FALSE; } -BOOL LLToolPipette::handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen) +BOOL LLToolPipette::handleToolTip(S32 x, S32 y, std::string& msg, LLRect &sticky_rect_screen) { if (mTooltipMsg.empty()) { return FALSE; } - // keep tooltip message up when mouse in this part of screen - sticky_rect_screen->setCenterAndSize(x, y, 20, 20); - msg = mTooltipMsg; + + LLRect sticky_rect; + sticky_rect.setCenterAndSize(x, y, 20, 20); + LLToolTipMgr::instance().show(LLToolTipParams() + .message(mTooltipMsg) + .sticky_rect(sticky_rect)); + return TRUE; } diff --git a/indra/newview/lltoolpipette.h b/indra/newview/lltoolpipette.h index 3b6ebec67e..cce5b6ce54 100644 --- a/indra/newview/lltoolpipette.h +++ b/indra/newview/lltoolpipette.h @@ -56,7 +56,7 @@ public: virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); // Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots typedef boost::signals2::signal<void (const LLTextureEntry& te)> signal_t; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 8e65c7e65e..6d2482d3f0 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1260,10 +1260,6 @@ void render_ui_2d() stop_glerror(); } gViewerWindow->draw(); - if (gDebugSelect) - { - gViewerWindow->drawPickBuffer(); - } // reset current origin for font rendering, in case of tiling render LLFontGL::sCurOrigin.set(0, 0); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index c8f2e03903..1fc387027d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -95,6 +95,7 @@ #include "llfloatersettingsdebug.h" #include "llfloatersnapshot.h" #include "llfloatertelehub.h" +#include "llfloatertestinspectors.h" #include "llfloatertestlistview.h" #include "llfloatertools.h" #include "llfloatertos.h" @@ -207,6 +208,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("properties", "floater_inventory_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterProperties>); LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build<LLFloaterTelehub>); + LLFloaterReg::add("test_inspectors", "floater_test_inspectors.xml", + &LLFloaterReg::build<LLFloaterTestInspectors>); LLFloaterReg::add("test_list_view", "floater_test_list_view.xml",&LLFloaterReg::build<LLFloaterTestListView>); LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", &LLFloaterReg::build<LLFloater>); LLFloaterReg::add("top_objects", "floater_top_objects.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTopObjects>); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index a06d913fd6..f033d66c1f 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -34,18 +34,17 @@ #include "llviewermedia.h" #include "llviewermediafocus.h" -#include "llhoverview.h" #include "llmimetypes.h" #include "llviewercontrol.h" #include "llviewertexture.h" #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" -#include "llviewerwindow.h" #include "llversionviewer.h" #include "llviewertexturelist.h" #include "llpluginclassmedia.h" #include "llevent.h" // LLSimpleListener +#include "llnotifications.h" #include "lluuid.h" #include <boost/bind.hpp> // for SkinFolder listener diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 68a49662e7..9a61394383 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -180,10 +180,11 @@ public: /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) { return FALSE; }; /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { return FALSE; }; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) { return FALSE; }; /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; }; /*virtual*/ const std::string& getName() const { return LLStringUtil::null; }; + /*virtual*/ BOOL isView() const { return FALSE; }; /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {}; /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {}; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5536951ce6..338bb7ad7c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -134,7 +134,7 @@ #include "llmemoryview.h" #include "llgivemoney.h" #include "llgroupmgr.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llimage.h" @@ -582,6 +582,8 @@ void init_menus() gLoginMenuBarView->setBackgroundColor( color ); gMenuHolder->addChild(gLoginMenuBarView); + // tooltips are on top of EVERYTHING, including menus + gViewerWindow->getRootView()->sendChildToFront(gToolTipView); } /////////////////// @@ -1517,14 +1519,6 @@ class LLAdvancedSendTestIms : public view_listener_t } }; -class LLAdvancedAvatarInspector : public view_listener_t -{ - bool handleEvent(const LLSD& avatar_id) - { - LLFloaterReg::showInstance("inspect_avatar", avatar_id); - return true; - } -}; /////////////// // XUI NAMES // @@ -2905,7 +2899,7 @@ class LLObjectMute : public view_listener_t bool handle_go_to() { - // JAMESDEBUG try simulator autopilot + // try simulator autopilot std::vector<std::string> strings; std::string val; LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; @@ -6729,15 +6723,12 @@ BOOL enable_god_basic(void*) void toggle_show_xui_names(void *) { - BOOL showXUINames = gSavedSettings.getBOOL("ShowXUINames"); - - showXUINames = !showXUINames; - gSavedSettings.setBOOL("ShowXUINames", showXUINames); + gSavedSettings.setBOOL("DebugShowXUINames", !gSavedSettings.getBOOL("DebugShowXUINames")); } BOOL check_show_xui_names(void *) { - return gSavedSettings.getBOOL("ShowXUINames"); + return gSavedSettings.getBOOL("DebugShowXUINames"); } class LLToolsSelectOnlyMyObjects : public view_listener_t @@ -7157,7 +7148,7 @@ class LLViewShowHoverTips : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLHoverView::sShowHoverTips = !LLHoverView::sShowHoverTips; + gSavedSettings.setBOOL("ShowHoverTips", !gSavedSettings.getBOOL("ShowHoverTips")); return true; } }; @@ -7166,7 +7157,7 @@ class LLViewCheckShowHoverTips : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = LLHoverView::sShowHoverTips; + bool new_value = gSavedSettings.getBOOL("ShowHoverTips"); return new_value; } }; @@ -7852,7 +7843,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleXUINames(), "Advanced.ToggleXUINames"); view_listener_t::addMenu(new LLAdvancedCheckXUINames(), "Advanced.CheckXUINames"); view_listener_t::addMenu(new LLAdvancedSendTestIms(), "Advanced.SendTestIMs"); - view_listener_t::addMenu(new LLAdvancedAvatarInspector(), "Advanced.AvatarInspector"); // Advanced > Character > Grab Baked Texture view_listener_t::addMenu(new LLAdvancedGrabBakedTexture(), "Advanced.GrabBakedTexture"); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1594a68f36..cf77f7e2b6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -582,9 +582,9 @@ void LLViewerObject::removeChild(LLViewerObject *childp) } } -void LLViewerObject::addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& objects) +void LLViewerObject::addThisAndAllChildren(std::vector<LLViewerObject*>& objects) { - objects.put(this); + objects.push_back(this); for (child_list_t::iterator iter = mChildList.begin(); iter != mChildList.end(); iter++) { @@ -596,9 +596,9 @@ void LLViewerObject::addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& obje } } -void LLViewerObject::addThisAndNonJointChildren(LLDynamicArray<LLViewerObject*>& objects) +void LLViewerObject::addThisAndNonJointChildren(std::vector<LLViewerObject*>& objects) { - objects.put(this); + objects.push_back(this); // don't add any attachments when temporarily selecting avatar if (isAvatar()) { @@ -3475,7 +3475,7 @@ void LLViewerObject::setMediaType(U8 media_type) { if (!mMedia) { - // JAMESDEBUG TODO what if we don't have a media pointer? + // TODO what if we don't have a media pointer? } else if (mMedia->mMediaType != media_type) { @@ -3677,7 +3677,7 @@ void LLViewerObject::sendTEUpdate() const msg->addString("MediaURL", NULL); } - // JAMESDEBUG TODO send media type + // TODO send media type packTEMessage(msg); @@ -3688,7 +3688,7 @@ void LLViewerObject::sendTEUpdate() const void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { LLPrimitive::setTE(te, texture_entry); -// JAMESDEBUG This doesn't work, don't get any textures. +// This doesn't work, don't get any textures. // if (mDrawable.notNull() && mDrawable->isVisible()) // { const LLUUID& image_id = getTE(te)->getID(); @@ -3865,7 +3865,7 @@ S32 LLViewerObject::setTEFullbright(const U8 te, const U8 fullbright) S32 LLViewerObject::setTEMediaFlags(const U8 te, const U8 media_flags) { - // JAMESDEBUG this might need work for media type + // this might need work for media type S32 retval = 0; const LLTextureEntry *tep = getTE(te); if (!tep) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index cda2c5114f..836e05728f 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -242,8 +242,8 @@ public: virtual void removeChild(LLViewerObject *childp); const_child_list_t& getChildren() const { return mChildList; } S32 numChildren() const { return mChildList.size(); } - void addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& objects); - void addThisAndNonJointChildren(LLDynamicArray<LLViewerObject*>& objects); + void addThisAndAllChildren(std::vector<LLViewerObject*>& objects); + void addThisAndNonJointChildren(std::vector<LLViewerObject*>& objects); BOOL isChild(LLViewerObject *childp) const; BOOL isSeat() const; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index a8232e9a9d..acdc2c2513 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -49,7 +49,7 @@ #include "llagent.h" #include "pipeline.h" #include "llspatialpartition.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llworld.h" #include "llstring.h" #include "llhudtext.h" @@ -574,10 +574,14 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) // Slam priorities for textures that we care about (hovered, selected, and focused) // Hovered // Assumes only one level deep of parenting - objectp = gHoverView->getLastHoverObject(); - if (objectp) + LLSelectNode* nodep = LLSelectMgr::instance().getHoverNode(); + if (nodep) { - objectp->boostTexturePriority(); + objectp = nodep->getObject(); + if (objectp) + { + objectp->boostTexturePriority(); + } } } diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index cb233085e5..86d51bfd4b 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -43,7 +43,7 @@ #include "message.h" #include "llviewermediafocus.h" #include "llviewerparcelmediaautoplay.h" -#include "llviewerwindow.h" +#include "llnotifications.h" #include "llfirstuse.h" #include "llpluginclassmedia.h" diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index ca3061e083..c5b09403cb 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1283,9 +1283,11 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag } -void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) +void LLViewerParcelMgr::setHoverParcel(const LLVector3d& pos) { - LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos ); + //FIXME: only request parcel info when tooltip is shown + return; + /*LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos ); if (!region) { return; @@ -1317,7 +1319,7 @@ void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) msg->addBOOL("SnapSelection", FALSE ); msg->sendReliable( region->getHost() ); - mHoverRequestResult = PARCEL_RESULT_NO_DATA; + mHoverRequestResult = PARCEL_RESULT_NO_DATA;*/ } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 7373366cd7..275c79fd3b 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -217,7 +217,7 @@ public: void sendParcelDwellRequest(); // If the point is outside the current hover parcel, request more data - void requestHoverParcelProperties(const LLVector3d& pos_global); + void setHoverParcel(const LLVector3d& pos_global); bool canAgentBuyParcel(LLParcel*, bool forGroup) const; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 5bb0c9a120..ceb2698223 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -658,45 +658,6 @@ void LLViewerTextEditor::makePristine() LLTextEditor::makePristine(); } -/////////////////////////////////////////////////////////////////// - -BOOL LLViewerTextEditor::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) -{ - for (child_list_const_iter_t child_iter = getChildList()->begin(); - child_iter != getChildList()->end(); ++child_iter) - { - LLView *viewp = *child_iter; - S32 local_x = x - viewp->getRect().mLeft; - S32 local_y = y - viewp->getRect().mBottom; - if( viewp->pointInView(local_x, local_y) - && viewp->getVisible() - && viewp->getEnabled() - && viewp->handleToolTip(local_x, local_y, msg, sticky_rect_screen ) ) - { - return TRUE; - } - } - - if( mSegments.empty() ) - { - return TRUE; - } - - const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); - if( cur_segment && cur_segment->getToolTip( msg ) ) - { - // Just use a slop area around the cursor - // Convert rect local to screen coordinates - S32 SLOP = 8; - localPointToScreen( - x - SLOP, y - SLOP, - &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) ); - sticky_rect_screen->mRight = sticky_rect_screen->mLeft + 2 * SLOP; - sticky_rect_screen->mTop = sticky_rect_screen->mBottom + 2 * SLOP; - } - return TRUE; -} - BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 2dfea4a589..100fa343af 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -68,7 +68,6 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask ); - virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6ea1522b47..ec82f62a8b 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1810,7 +1810,7 @@ void LLViewerLODTexture::processTextureStats() // data than we need to. /*if (mBoostLevel == LLViewerTexture::BOOST_UI || mBoostLevel == LLViewerTexture::BOOST_PREVIEW || - mBoostLevel == LLViewerTexture::BOOST_AVATAR_SELF) // JAMESDEBUG what about AVATAR_BAKED_SELF? + mBoostLevel == LLViewerTexture::BOOST_AVATAR_SELF) // what about AVATAR_BAKED_SELF? { discard_level = 0; // full res } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 241c6fd511..e5d0e3ebb2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -74,6 +74,7 @@ #include "lltimer.h" #include "timing.h" #include "llviewermenu.h" +#include "lltooltip.h" // newview includes #include "llagent.h" @@ -111,7 +112,7 @@ #include "llfontfreetype.h" #include "llgesturemgr.h" #include "llglheaders.h" -#include "llhoverview.h" +#include "lltooltip.h" #include "llhudmanager.h" #include "llhudview.h" #include "llimagebmp.h" @@ -208,22 +209,14 @@ extern BOOL gDebugClicks; extern BOOL gDisplaySwapBuffers; extern BOOL gDepthDirty; extern BOOL gResizeScreenTexture; -extern S32 gJamesInt; LLViewerWindow *gViewerWindow = NULL; - -BOOL gDebugSelect = FALSE; - -LLFrameTimer gMouseIdleTimer; LLFrameTimer gAwayTimer; LLFrameTimer gAwayTriggerTimer; -LLFrameTimer gAlphaFadeTimer; BOOL gShowOverlayTitle = FALSE; -BOOL gPickTransparent = TRUE; -BOOL gDebugFastUIRender = FALSE; LLViewerObject* gDebugRaycastObject = NULL; LLVector3 gDebugRaycastIntersection; LLVector2 gDebugRaycastTexCoord; @@ -234,7 +227,6 @@ S32 gDebugRaycastFaceHit; // HUD display lines in lower right BOOL gDisplayWindInfo = FALSE; BOOL gDisplayCameraPos = FALSE; -BOOL gDisplayNearestWater = FALSE; BOOL gDisplayFOV = FALSE; S32 CHAT_BAR_HEIGHT = 28; @@ -599,21 +591,6 @@ void LLViewerWindow::updateDebugText() // LLViewerWindow // -bool LLViewerWindow::shouldShowToolTipFor(LLMouseHandler *mh) -{ - if (mToolTip && mh) - { - LLMouseHandler::EShowToolTip showlevel = mh->getShowToolTip(); - - bool tool_tip_allowed = (showlevel == LLMouseHandler::SHOW_ALWAYS - || (showlevel == LLMouseHandler::SHOW_IF_NOT_BLOCKED - && !mToolTipBlocked)); - - return tool_tip_allowed; - } - return false; -} - BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) { std::string buttonname; @@ -673,16 +650,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mWindow->releaseMouse(); // Indicate mouse was active - gMouseIdleTimer.reset(); - - // Hide tooltips on mousedown - mToolTipBlocked = down; - - // Also hide hover info on mousedown/mouseup - if (gHoverView) - { - gHoverView->cancelHover(); - } + LLUI::resetMouseIdleTimer(); // Don't let the user move the mouse out of the window until mouse up. if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) @@ -749,10 +717,6 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK if(LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) { - // This is necessary to force clicks in the world to cause edit - // boxes that might have keyboard focus to relinquish it, and hence - // cause a commit to update their value. JC - gFocusMgr.setKeyboardFocus(NULL); return TRUE; } } @@ -870,13 +834,10 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask // Save mouse point for access during idle() and display() - LLCoordGL prev_saved_mouse_point = mCurrentMousePoint; LLCoordGL mouse_point(x, y); saveLastMouse(mouse_point); - BOOL mouse_actually_moved = !gFocusMgr.getMouseCapture() && // mouse is not currenty captured - ((prev_saved_mouse_point.mX != mCurrentMousePoint.mX) || (prev_saved_mouse_point.mY != mCurrentMousePoint.mY)); // mouse moved from last recorded position - gMouseIdleTimer.reset(); + LLUI::resetMouseIdleTimer(); mWindow->showCursorFromMouseMove(); @@ -884,17 +845,6 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask { gAgent.clearAFK(); } - - if(mouse_actually_moved) - { - mToolTipBlocked = FALSE; - } - - // Activate the hover picker on mouse move. - if (gHoverView) - { - gHoverView->setTyping(FALSE); - } } void LLViewerWindow::handleMouseLeave(LLWindow *window) @@ -902,10 +852,6 @@ void LLViewerWindow::handleMouseLeave(LLWindow *window) // Note: we won't get this if we have captured the mouse. llassert( gFocusMgr.getMouseCapture() == NULL ); mMouseInWindow = FALSE; - if (mToolTip) - { - mToolTip->setVisible( FALSE ); - } } BOOL LLViewerWindow::handleCloseRequest(LLWindow *window) @@ -1245,16 +1191,12 @@ LLViewerWindow::LLViewerWindow( mLeftMouseDown(FALSE), mMiddleMouseDown(FALSE), mRightMouseDown(FALSE), - mToolTip(NULL), - mToolTipBlocked(FALSE), mMouseInWindow( FALSE ), mLastMask( MASK_NONE ), mToolStored( NULL ), - mSuppressToolbox( FALSE ), mHideCursorPermanent( FALSE ), mCursorHidden(FALSE), mIgnoreActivate( FALSE ), - mHoverPick(), mResDirty(false), mStatesDirty(false), mIsFullscreenChecked(false), @@ -1479,7 +1421,7 @@ void LLViewerWindow::initBase() cp.font_size_index(gSavedSettings.getS32("ChatFontSize")); cp.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); gConsole = LLUICtrlFactory::create<LLConsole>(cp); - mRootView->addChild(gConsole); + getRootView()->addChild(gConsole); // optionally forward warnings to chat console/chat floater // for qa runs and dev builds @@ -1499,11 +1441,11 @@ void LLViewerWindow::initBase() debug_p.follows.flags(FOLLOWS_ALL); debug_p.visible(true); gDebugView = LLUICtrlFactory::create<LLDebugView>(debug_p); - mRootView->addChild(gDebugView); + getRootView()->addChild(gDebugView); // Add floater view at the end so it will be on top, and give it tab priority over others - mRootView->addChild(gFloaterView, -1); - mRootView->addChild(gSnapshotFloaterView); + getRootView()->addChild(gFloaterView, -1); + getRootView()->addChild(gSnapshotFloaterView); // notify above floaters! LLRect notify_rect = floater_view_rect; @@ -1513,28 +1455,18 @@ void LLViewerWindow::initBase() p.mouse_opaque(false); p.follows.flags(FOLLOWS_ALL); gNotifyBoxView = LLUICtrlFactory::create<LLNotifyBoxView> (p); - mRootView->addChild(gNotifyBoxView, -2); - - // Tooltips go above floaters - LLTextBox::Params params; - params.text("tool tip"); - params.name(params.text); - params.rect(LLRect (0, 1, 1, 0)); - params.h_pad(4); - params.v_pad(2); - params.text_color(LLUIColorTable::instance().getColor( "ToolTipTextColor" )); - params.border_color(LLUIColorTable::instance().getColor( "ToolTipBorderColor" )); - params.border_visible(false); - params.background_color(LLUIColorTable::instance().getColor( "ToolTipBgColor" )); - params.bg_visible(true); - params.font.style("NORMAL"); - params.border_drop_shadow_visible(true); - params.visible(false); - mToolTip = LLUICtrlFactory::create<LLTextBox> (params); + getRootView()->addChild(gNotifyBoxView, -2); + + // View for tooltips + LLToolTipView::Params hvp; + hvp.name("tooltip view"); + hvp.rect(full_window); + gToolTipView = LLUICtrlFactory::create<LLToolTipView>(hvp); + getRootView()->addChild(gToolTipView); // Add the progress bar view (startup view), which overrides everything mProgressView = new LLProgressView(full_window); - mRootView->addChild(mProgressView); + getRootView()->addChild(mProgressView); setShowProgress(FALSE); setProgressCancelButtonVisible(FALSE); } @@ -1560,13 +1492,6 @@ void LLViewerWindow::initWorldUI() LLBottomTray::getInstance()->reshape(rc.getWidth(),rc.getHeight(),FALSE); LLBottomTray::getInstance()->setRect(rc); - // View for hover information - LLHoverView::Params hvp; - hvp.name("gHoverview"); - hvp.rect(full_window); - gHoverView = LLUICtrlFactory::create<LLHoverView>(hvp); - mRootView->addChild(gHoverView); - // Pre initialize instance communicate instance; // currently needs to happen before initializing chat or IM LLFloaterReg::getInstance("communicate"); @@ -1584,7 +1509,7 @@ void LLViewerWindow::initWorldUI() mvp.rect(morph_view_rect); mvp.visible(false); gMorphView = LLUICtrlFactory::create<LLMorphView>(mvp); - mRootView->addChild(gMorphView); + getRootView()->addChild(gMorphView); // Make space for nav bar. LLRect floater_view_rect = gFloaterView->getRect(); @@ -1674,6 +1599,9 @@ void LLViewerWindow::initWorldUI() // this allows not to see UI elements created while UI initializing after Alt+Tab was pressed during login. EXT-744. moveProgressViewToFront(); + + // tooltips are always on top + getRootView()->sendChildToFront(gToolTipView); } // Destroy the UI @@ -1691,10 +1619,6 @@ void LLViewerWindow::shutdownViews() gMorphView->setVisible(FALSE); } - // Delete Tool Tip - delete mToolTip; - mToolTip = NULL; - // Delete all child views. delete mRootView; mRootView = NULL; @@ -1702,7 +1626,7 @@ void LLViewerWindow::shutdownViews() // Automatically deleted as children of mRootView. Fix the globals. gStatusBar = NULL; gIMMgr = NULL; - gHoverView = NULL; + gToolTipView = NULL; gFloaterView = NULL; gMorphView = NULL; @@ -1775,12 +1699,6 @@ void LLViewerWindow::showCursor() void LLViewerWindow::hideCursor() { - // Hide tooltips - if(mToolTip ) mToolTip->setVisible( FALSE ); - - // Also hide hover info - if (gHoverView) gHoverView->cancelHover(); - // And hide the cursor mWindow->hideCursor(); @@ -2035,9 +1953,9 @@ void LLViewerWindow::draw() // No translation needed, this view is glued to 0,0 mRootView->draw(); - if (mToolTip->getVisible() && LLView::sDebugRects) + if (LLView::sDebugRects) { - gl_rect_2d(mToolTipStickyRect, LLColor4::white, false); + gToolTipView->drawStickyRect(); } // Draw optional on-top-of-everyone view @@ -2054,31 +1972,6 @@ void LLViewerWindow::draw() LLUI::popMatrix(); } - // Draw tooltips - // Adjust their rectangle so they don't go off the top or bottom - // of the screen. - if( mToolTip && mToolTip->getVisible() ) - { - glMatrixMode(GL_MODELVIEW); - LLUI::pushMatrix(); - { - S32 tip_height = mToolTip->getRect().getHeight(); - - S32 screen_x, screen_y; - mToolTip->localPointToScreen(0, -24 - tip_height, - &screen_x, &screen_y); - - // If tooltip would draw off the bottom of the screen, - // show it from the cursor tip position. - if (screen_y < tip_height) - { - mToolTip->localPointToScreen(0, 0, &screen_x, &screen_y); - } - LLUI::translate( (F32) screen_x, (F32) screen_y, 0); - mToolTip->draw(); - } - LLUI::popMatrix(); - } if( gShowOverlayTitle && !mOverlayTitle.empty() ) { @@ -2120,26 +2013,9 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) } } - //// HACK look for UI editing keys - //if (LLView::sEditingUI) - //{ - // if (LLFloaterEditUI::processKeystroke(key, mask)) - // { - // return TRUE; - // } - //} - - // Hide tooltips on keypress - mToolTipBlocked = TRUE; // block until next time mouse is moved - - // Also hide hover info on keypress - if (gHoverView) - { - gHoverView->cancelHover(); - - gHoverView->setTyping(TRUE); - } - + // hide tooltips on keypress + LLToolTipMgr::instance().hideToolTips(); + // Explicit hack for debug menu. if ((MASK_ALT & mask) && (MASK_CONTROL & mask) && @@ -2197,6 +2073,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { return TRUE; } + //some of context menus use this container, let context menu handle navigation keys + if(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE)) + { + return TRUE; + } // Traverses up the hierarchy LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); @@ -2360,14 +2241,8 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) { LLView::sMouseHandlerMessage.clear(); - gMouseIdleTimer.reset(); - - // Hide tooltips - if( mToolTip ) - { - mToolTip->setVisible( FALSE ); - } - + LLUI::resetMouseIdleTimer(); + LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); if( mouse_captor ) { @@ -2420,7 +2295,7 @@ void LLViewerWindow::moveCursorToCenter() mLastMousePoint.set(x,y); mCurrentMouseDelta.set(0,0); - LLUI::setCursorPositionScreen(x, y); + LLUI::setMousePositionScreen(x, y); } void LLViewerWindow::updateBottomTrayRect() @@ -2452,6 +2327,35 @@ void LLViewerWindow::updateBottomTrayRect() // Hover handlers // +void append_xui_tooltip(LLView* viewp, std::string& tool_tip_msg) +{ + if (viewp) + { + if (!tool_tip_msg.empty()) + { + tool_tip_msg.append("\n---------\n"); + } + LLView::root_to_view_iterator_t end_tooltip_it = viewp->endRootToView(); + // NOTE: we skip "root" since it is assumed + for (LLView::root_to_view_iterator_t tooltip_it = ++viewp->beginRootToView(); + tooltip_it != end_tooltip_it; + ++tooltip_it) + { + LLView* viewp = *tooltip_it; + + tool_tip_msg.append(viewp->getName()); + LLPanel* panelp = dynamic_cast<LLPanel*>(viewp); + if (panelp && !panelp->getXMLFilename().empty()) + { + tool_tip_msg.append("("); + tool_tip_msg.append(panelp->getXMLFilename()); + tool_tip_msg.append(")"); + } + tool_tip_msg.append("/"); + } + } +} + // Update UI based on stored mouse position from mouse-move // event processing. void LLViewerWindow::updateUI() @@ -2473,6 +2377,17 @@ void LLViewerWindow::updateUI() return; } + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST)) + { + gDebugRaycastFaceHit = -1; + gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, + &gDebugRaycastFaceHit, + &gDebugRaycastIntersection, + &gDebugRaycastTexCoord, + &gDebugRaycastNormal, + &gDebugRaycastBinormal); + } + updateMouseDelta(); updateKeyboardFocus(); @@ -2500,8 +2415,8 @@ void LLViewerWindow::updateUI() if (top_ctrl && top_ctrl->calcScreenBoundingRect().pointInRect(x, y)) { // iterator over contents of top_ctrl, and throw into mouse_hover_set - for (LLView::tree_iterator_t it = top_ctrl->beginTree(); - it != top_ctrl->endTree(); + for (LLView::tree_iterator_t it = top_ctrl->beginTreeDFS(); + it != top_ctrl->endTreeDFS(); ++it) { LLView* viewp = *it; @@ -2521,9 +2436,8 @@ void LLViewerWindow::updateUI() else { // walk UI tree in depth-first order - LLView::tree_iterator_t end_it; - for (LLView::tree_iterator_t it = root_view->beginTree(); - it != end_it; + for (LLView::tree_iterator_t it = root_view->beginTreeDFS(); + it != root_view->endTreeDFS(); ++it) { LLView* viewp = *it; @@ -2536,7 +2450,7 @@ void LLViewerWindow::updateUI() if (viewp->getMouseOpaque()) { // constrain further iteration to children of this widget - it = viewp->beginTree(); + it = viewp->beginTreeDFS(); } // we have a view that contains the mouse, add it to the set @@ -2639,130 +2553,87 @@ void LLViewerWindow::updateUI() } } - if( !handled ) - { - lldebugst(LLERR_USER_INPUT) << "hover not handled by top view or root" << llendl; - } - } - - // *NOTE: sometimes tools handle the mouse as a captor, so this - // logic is a little confusing - LLTool *tool = NULL; - if (gHoverView) - { - tool = LLToolMgr::getInstance()->getCurrentTool(); - - if(!handled && tool) + if (!handled) { - handled = tool->handleHover(x, y, mask); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if (!mWindow->isCursorHidden()) + if(mMouseInWindow && tool) { - gHoverView->updateHover(tool); + handled = tool->handleHover(x, y, mask); } } - else - { - // Cancel hovering if any UI element handled the event. - gHoverView->cancelHover(); - } - - // Suppress the toolbox view if our source tool was the pie tool, - // and we've overridden to something else. - mSuppressToolbox = - (LLToolMgr::getInstance()->getBaseTool() == LLToolPie::getInstance()) && - (LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance()); - } - // Show a new tool tip (or update one that is alrady shown) + // Show a new tool tip (or update one that is already shown) BOOL tool_tip_handled = FALSE; std::string tool_tip_msg; if( handled - && !mWindow->isCursorHidden() - && mToolTip) + && !mWindow->isCursorHidden()) { - LLRect screen_sticky_rect; - LLMouseHandler *tooltip_source = NULL; + LLRect screen_sticky_rect = mRootView->getLocalRect(); S32 local_x, local_y; - if (mouse_captor) - { - mouse_captor->screenPointToLocal(x, y, &local_x, &local_y); - tooltip_source = mouse_captor; - } - else if (handled_by_top_ctrl) - { - top_ctrl->screenPointToLocal(x, y, &local_x, &local_y); - tooltip_source = top_ctrl; - } - else - { - local_x = x; local_y = y; - tooltip_source = mRootView; - } - - F32 tooltip_delay = gSavedSettings.getF32( "ToolTipDelay" ); - //HACK: hack for tool-based tooltips which need to pop up more quickly - //Also for show xui names as tooltips debug mode - if ((gFocusMgr.getMouseCapture() - && !gFocusMgr.getMouseCapture()->isView()) - || LLUI::sShowXUINames) - { - tooltip_delay = gSavedSettings.getF32( "DragAndDropToolTipDelay" ); - } - - BOOL tooltip_vis = FALSE; - if (shouldShowToolTipFor(tooltip_source)) + if (gSavedSettings.getBOOL("DebugShowXUINames")) { - tool_tip_handled = tooltip_source->handleToolTip(local_x, local_y, tool_tip_msg, &screen_sticky_rect ); - - // if we actually got a tooltip back... - if( tool_tip_handled && !tool_tip_msg.empty() ) + LLView* tooltip_view = mRootView; + LLView::tree_iterator_t end_it = mRootView->endTreeDFS(); + for (LLView::tree_iterator_t it = mRootView->beginTreeDFS(); it != end_it; ++it) { - if (mToolTip->getVisible() // already showing a tooltip - || gMouseIdleTimer.getElapsedTimeF32() > tooltip_delay) // mouse has been still long enough to show the tooltip + LLView* viewp = *it; + LLRect screen_rect; + viewp->localRectToScreen(viewp->getLocalRect(), &screen_rect); + if (!(viewp->getVisible() + && screen_rect.pointInRect(x, y))) + { + it.skipDescendants(); + } + else if (viewp->getMouseOpaque()) { - // if tooltip has changed or mouse has moved outside of "sticky" rectangle... - if (mLastToolTipMessage != tool_tip_msg - || !mToolTipStickyRect.pointInRect(x, y)) + if (!viewp->hasAncestor(tooltip_view)) { - //...update "sticky" rect and tooltip position - mToolTipStickyRect = screen_sticky_rect; - mToolTip->setOrigin( x, y ); + append_xui_tooltip(tooltip_view, tool_tip_msg); + screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); } - - // remember this tooltip so we know when it changes - mLastToolTipMessage = tool_tip_msg; - mToolTip->setWrappedText( tool_tip_msg, 200 ); - mToolTip->reshapeToFitText(); - LLRect virtual_window_rect(0, getWindowHeight(), getWindowWidth(), 0); - mToolTip->translateIntoRect( virtual_window_rect, FALSE ); - tooltip_vis = TRUE; + tooltip_view = viewp; } } - } - // HACK: assuming tooltip background is in ToolTipBGColor, perform fade out - LLColor4 bg_color = LLUIColorTable::instance().getColor( "ToolTipBgColor" ); - if (tooltip_vis) + append_xui_tooltip(tooltip_view, tool_tip_msg); + screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); + + LLToolTipMgr::instance().show(LLToolTipParams() + .message(tool_tip_msg) + .sticky_rect(screen_sticky_rect) + .width(400)); + } + // if there is a mouse captor, nothing else gets a tooltip + else if (mouse_captor) { - mToolTipFadeTimer.stop(); - mToolTip->setBackgroundColor(bg_color); + mouse_captor->screenPointToLocal(x, y, &local_x, &local_y); + tool_tip_handled = mouse_captor->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); } else { - if (!mToolTipFadeTimer.getStarted()) + // next is top_ctrl + if (!tool_tip_handled && top_ctrl) { - mToolTipFadeTimer.start(); + top_ctrl->screenPointToLocal(x, y, &local_x, &local_y); + tool_tip_handled = top_ctrl->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); + } + + if (!tool_tip_handled) + { + local_x = x; local_y = y; + tool_tip_handled = mRootView->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); } - F32 tool_tip_fade_time = gSavedSettings.getF32("ToolTipFadeTime"); - bg_color.mV[VALPHA] = clamp_rescale(mToolTipFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time, bg_color.mV[VALPHA], 0.f); - mToolTip->setBackgroundColor(bg_color); - } - // above interpolation of bg_color alpha is guaranteed to reach 0.f exactly - mToolTip->setVisible( bg_color.mV[VALPHA] != 0.f ); + LLTool* current_tool = LLToolMgr::getInstance()->getCurrentTool(); + if (!tool_tip_handled && current_tool) + { + current_tool->screenPointToLocal(x, y, &local_x, &local_y); + tool_tip_handled = current_tool->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); + } + } } updateLayout(); @@ -2779,67 +2650,8 @@ void LLViewerWindow::updateUI() { LLSelectMgr::getInstance()->deselectUnused(); } - - updatePicking(x, y, mask); } -void LLViewerWindow::updatePicking(S32 x, S32 y, MASK mask) -{ - // per frame picking - for tooltips and changing cursor over interactive objects - static S32 previous_x = -1; - static S32 previous_y = -1; - static BOOL mouse_moved_since_pick = FALSE; - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST)) - { - gDebugRaycastFaceHit = -1; - gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, - &gDebugRaycastFaceHit, - &gDebugRaycastIntersection, - &gDebugRaycastTexCoord, - &gDebugRaycastNormal, - &gDebugRaycastBinormal); - } - - - if ((previous_x != x) || (previous_y != y)) - mouse_moved_since_pick = TRUE; - - BOOL do_pick = FALSE; - - F32 picks_moving = gSavedSettings.getF32("PicksPerSecondMouseMoving"); - if ((mouse_moved_since_pick) && (picks_moving > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_moving)) - { - do_pick = TRUE; - } - - F32 picks_stationary = gSavedSettings.getF32("PicksPerSecondMouseStationary"); - if ((!mouse_moved_since_pick) && (picks_stationary > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_stationary)) - { - do_pick = TRUE; - } - - if (getCursorHidden()) - { - do_pick = FALSE; - } - - if(LLViewerMediaFocus::getInstance()->getFocus()) - { - // When in-world media is in focus, pick every frame so that browser mouse-overs, dragging scrollbars, etc. work properly. - do_pick = TRUE; - } - - if (do_pick) - { - mouse_moved_since_pick = FALSE; - mPickTimer.reset(); - pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE); - } - - previous_x = x; - previous_y = y; -} void LLViewerWindow::updateLayout() { @@ -2851,6 +2663,12 @@ void LLViewerWindow::updateLayout() && tool != LLToolDragAndDrop::getInstance() && !gSavedSettings.getBOOL("FreezeTime")) { + // Suppress the toolbox view if our source tool was the pie tool, + // and we've overridden to something else. + bool suppress_toolbox = + (LLToolMgr::getInstance()->getBaseTool() == LLToolPie::getInstance()) && + (LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance()); + LLMouseHandler *captor = gFocusMgr.getMouseCapture(); // With the null, inspect, or drag and drop tool, don't muck // with visibility. @@ -2858,7 +2676,7 @@ void LLViewerWindow::updateLayout() if (gFloaterTools->isMinimized() || (tool != LLToolPie::getInstance() // not default tool && tool != LLToolCompGun::getInstance() // not coming out of mouselook - && !mSuppressToolbox // not override in third person + && !suppress_toolbox // not override in third person && LLToolMgr::getInstance()->getCurrentToolset() != gFaceEditToolset // not special mode && LLToolMgr::getInstance()->getCurrentToolset() != gMouselookToolset && (!captor || captor->isView()))) // not dragging @@ -3043,13 +2861,6 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window) } } -/* static */ -void LLViewerWindow::hoverPickCallback(const LLPickInfo& pick_info) -{ - gViewerWindow->mHoverPick = pick_info; -} - - void LLViewerWindow::saveLastMouse(const LLCoordGL &point) { // Store last mouse location. @@ -3295,7 +3106,7 @@ BOOL LLViewerWindow::clickPointOnSurfaceGlobal(const S32 x, const S32 y, LLViewe return intersect; } -void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& info), BOOL pick_transparent, BOOL get_surface_info) +void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& info), BOOL pick_transparent) { if (gNoRender) { @@ -3329,7 +3140,7 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback LLRect screen_region = mPickScreenRegion; screen_region.translate(mPicks.size() * PICK_DIAMETER, 0); - LLPickInfo pick(LLCoordGL(x, y_from_bot), screen_region, mask, pick_transparent, get_surface_info, callback); + LLPickInfo pick(LLCoordGL(x, y_from_bot), screen_region, mask, pick_transparent, TRUE, callback); schedulePick(pick); } @@ -4900,11 +4711,6 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const } } -void LLViewerWindow::drawPickBuffer() const -{ - mHoverPick.drawPickBuffer(); -} - void LLViewerWindow::calcDisplayScale() { F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); @@ -5153,49 +4959,6 @@ void LLPickInfo::updateXYCoords() } } -void LLPickInfo::drawPickBuffer() const -{ - if (mPickBuffer) - { - gGL.pushMatrix(); - LLGLDisable no_blend(GL_BLEND); - LLGLDisable no_alpha_test(GL_ALPHA_TEST); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glPixelZoom(10.f, 10.f); - LLVector2 display_scale = gViewerWindow->getDisplayScale(); - glRasterPos2f(((F32)mMousePt.mX * display_scale.mV[VX] + 10.f), - ((F32)mMousePt.mY * display_scale.mV[VY] + 10.f)); - glDrawPixels(PICK_DIAMETER, PICK_DIAMETER, GL_RGBA, GL_UNSIGNED_BYTE, mPickBuffer); - glPixelZoom(1.f, 1.f); - gGL.color4fv(LLColor4::white.mV); - gl_rect_2d(llround((F32)mMousePt.mX * display_scale.mV[VX] - (F32)(PICK_HALF_WIDTH)), - llround((F32)mMousePt.mY * display_scale.mV[VY] + (F32)(PICK_HALF_WIDTH)), - llround((F32)mMousePt.mX * display_scale.mV[VX] + (F32)(PICK_HALF_WIDTH)), - llround((F32)mMousePt.mY * display_scale.mV[VY] - (F32)(PICK_HALF_WIDTH)), - FALSE); - gl_line_2d(llround((F32)mMousePt.mX * display_scale.mV[VX] - (F32)(PICK_HALF_WIDTH)), - llround((F32)mMousePt.mY * display_scale.mV[VY] + (F32)(PICK_HALF_WIDTH)), - llround((F32)mMousePt.mX * display_scale.mV[VX] + 10.f), - llround((F32)mMousePt.mY * display_scale.mV[VY] + (F32)(PICK_DIAMETER) * 10.f + 10.f)); - gl_line_2d(llround((F32)mMousePt.mX * display_scale.mV[VX] + (F32)(PICK_HALF_WIDTH)), - llround((F32)mMousePt.mY * display_scale.mV[VY] - (F32)(PICK_HALF_WIDTH)), - llround((F32)mMousePt.mX * display_scale.mV[VX] + (F32)(PICK_DIAMETER) * 10.f + 10.f), - llround((F32)mMousePt.mY * display_scale.mV[VY] + 10.f)); - gGL.translatef(10.f, 10.f, 0.f); - gl_rect_2d(llround((F32)mPickPt.mX * display_scale.mV[VX]), - llround((F32)mPickPt.mY * display_scale.mV[VY] + (F32)(PICK_DIAMETER) * 10.f), - llround((F32)mPickPt.mX * display_scale.mV[VX] + (F32)(PICK_DIAMETER) * 10.f), - llround((F32)mPickPt.mY * display_scale.mV[VY]), - FALSE); - gl_rect_2d(llround((F32)mPickPt.mX * display_scale.mV[VX]), - llround((F32)mPickPt.mY * display_scale.mV[VY] + 10.f), - llround((F32)mPickPt.mX * display_scale.mV[VX] + 10.f), - llround((F32)mPickPt.mY * display_scale.mV[VY]), - FALSE); - gGL.popMatrix(); - } -} - void LLPickInfo::getSurfaceInfo() { // set values to uninitialized - this is what we return if no intersection is found diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 7afb77bed8..c3c9d7021e 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -47,7 +47,6 @@ #include "llwindowcallbacks.h" #include "lltimer.h" #include "llstat.h" -#include "llnotifications.h" #include "llmousehandler.h" #include "llcursortypes.h" #include "llhandle.h" @@ -58,7 +57,7 @@ class LLUUID; class LLProgressView; class LLTool; class LLVelocityBar; -class LLTextBox; +class LLPanel; class LLImageRaw; class LLHUDIcon; class LLWindow; @@ -70,6 +69,17 @@ class LLRootView; class LLPickInfo { public: + typedef enum + { + PICK_OBJECT, + PICK_FLORA, + PICK_LAND, + PICK_ICON, + PICK_PARCEL_WALL, + PICK_INVALID + } EPickType; + +public: LLPickInfo(); LLPickInfo(const LLCoordGL& mouse_pos, const LLRect& screen_region, @@ -81,20 +91,10 @@ public: void fetchResults(); LLPointer<LLViewerObject> getObject() const; LLUUID getObjectID() const { return mObjectID; } - void drawPickBuffer() const; + bool isValid() const { return mPickType != PICK_INVALID; } static bool isFlora(LLViewerObject* object); - typedef enum - { - PICK_OBJECT, - PICK_FLORA, - PICK_LAND, - PICK_ICON, - PICK_PARCEL_WALL, - PICK_INVALID - } EPickType; - public: LLCoordGL mMousePt; MASK mKeyMask; @@ -147,6 +147,8 @@ public: void adjustControlRectanglesForFirstUse(const LLRect& window); void initWorldUI(); + BOOL handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down); + // // LLWindowCallback interface implementation // @@ -154,7 +156,6 @@ public: /*virtual*/ BOOL handleTranslatedKeyUp(KEY key, MASK mask); /*virtual*/ void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, MASK mask); // NOT going to handle extended - /*virtual*/ BOOL handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down); /*virtual*/ BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleCloseRequest(LLWindow *window); @@ -234,7 +235,6 @@ public: BOOL getRightMouseDown() const { return mRightMouseDown; } const LLPickInfo& getLastPick() const { return mLastPick; } - const LLPickInfo& getHoverPick() const { return mHoverPick; } void setup2DViewport(S32 x_offset = 0, S32 y_offset = 0); void setup3DViewport(S32 x_offset = 0, S32 y_offset = 0); @@ -281,7 +281,6 @@ public: void updateLayout(); void updateMouseDelta(); void updateKeyboardFocus(); - void updatePicking(S32 x, S32 y, MASK mask); void updateWorldViewRect(bool use_full_window=false); void updateBottomTrayRect(); @@ -332,11 +331,8 @@ public: void returnEmptyPicks(); - void pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& pick_info), - BOOL pick_transparent = FALSE, BOOL get_surface_info = FALSE); + void pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& pick_info), BOOL pick_transparent = FALSE); LLPickInfo pickImmediate(S32 x, S32 y, BOOL pick_transparent); - static void hoverPickCallback(const LLPickInfo& pick_info); - LLHUDIcon* cursorIntersectIcon(S32 mouse_x, S32 mouse_y, F32 depth, LLVector3* intersection); @@ -382,8 +378,6 @@ public: const LLVector2& getDisplayScale() const { return mDisplayScale; } void calcDisplayScale(); - void drawPickBuffer() const; - private: bool shouldShowToolTipFor(LLMouseHandler *mh); static bool onAlert(const LLSD& notify); @@ -422,9 +416,8 @@ protected: LLProgressView *mProgressView; LLFrameTimer mToolTipFadeTimer; - LLTextBox* mToolTip; + LLPanel* mToolTip; std::string mLastToolTipMessage; - BOOL mToolTipBlocked; // True after a key press or a mouse button event. False once the mouse moves again. LLRect mToolTipStickyRect; // Once a tool tip is shown, it will stay visible until the mouse leaves this rect. BOOL mMouseInWindow; // True if the mouse is over our window or if we have captured the mouse. @@ -435,12 +428,9 @@ protected: // Variables used for tool override switching based on modifier keys. JC MASK mLastMask; // used to detect changes in modifier mask LLTool* mToolStored; // the tool we're overriding - BOOL mSuppressToolbox; // sometimes hide the toolbox, despite - // having a camera tool selected BOOL mHideCursorPermanent; // true during drags, mouselook BOOL mCursorHidden; LLPickInfo mLastPick; - LLPickInfo mHoverPick; std::vector<LLPickInfo> mPicks; LLRect mPickScreenRegion; // area of frame buffer for rendering pick frames (generally follows mouse to avoid going offscreen) LLTimer mPickTimer; // timer for scheduling n picks per second @@ -477,13 +467,9 @@ void update_saved_window_size(const std::string& control,S32 delta_width, S32 de extern LLViewerWindow* gViewerWindow; -extern LLFrameTimer gMouseIdleTimer; // how long has it been since the mouse last moved? extern LLFrameTimer gAwayTimer; // tracks time before setting the avatar away state to true extern LLFrameTimer gAwayTriggerTimer; // how long the avatar has been away -extern BOOL gDebugSelect; - -extern BOOL gDebugFastUIRender; extern LLViewerObject* gDebugRaycastObject; extern LLVector3 gDebugRaycastIntersection; extern LLVector2 gDebugRaycastTexCoord; @@ -495,7 +481,6 @@ extern S32 CHAT_BAR_HEIGHT; extern BOOL gDisplayCameraPos; extern BOOL gDisplayWindInfo; -extern BOOL gDisplayNearestWater; extern BOOL gDisplayFOV; #endif diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index a2793accea..570a3334b9 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -38,7 +38,7 @@ #include "llviewercontrol.h" #include "llagent.h" -#include "llviewerwindow.h" +#include "llnotifications.h" #include "lldrawable.h" #include "llface.h" #include "llsky.h" diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 67bc205f62..4d7423eaae 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -41,6 +41,7 @@ #include "lleventflags.h" #include "llfloaterreg.h" #include "llrender.h" +#include "lltooltip.h" #include "llagent.h" #include "llcallingcard.h" @@ -50,6 +51,7 @@ #include "llfloatermap.h" #include "llfloaterworldmap.h" #include "llfocusmgr.h" +#include "lllocalcliprect.h" #include "lltextbox.h" #include "lltextureview.h" #include "lltracker.h" @@ -1179,10 +1181,12 @@ LLVector3d LLWorldMapView::viewPosToGlobal( S32 x, S32 y ) } -BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ) +BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ) { LLVector3d pos_global = viewPosToGlobal(x, y); + std::string tooltip_msg; + LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); if (info) { @@ -1217,22 +1221,26 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* stic } } } - msg.assign( message ); + tooltip_msg.assign( message ); // Optionally show region flags std::string region_flags = LLViewerRegion::regionFlagsToString(info->mRegionFlags); if (!region_flags.empty()) { - msg += '\n'; - msg += region_flags; + tooltip_msg += '\n'; + tooltip_msg += region_flags; } const S32 SLOP = 9; S32 screen_x, screen_y; localPointToScreen(x, y, &screen_x, &screen_y); - sticky_rect_screen->setCenterAndSize(screen_x, screen_y, SLOP, SLOP); + sticky_rect_screen.setCenterAndSize(screen_x, screen_y, SLOP, SLOP); + + LLToolTipMgr::instance().show(LLToolTipParams() + .message(tooltip_msg) + .sticky_rect(sticky_rect_screen)); } return TRUE; } @@ -1744,7 +1752,7 @@ BOOL LLWorldMapView::handleMouseUp( S32 x, S32 y, MASK mask ) LLRect clip_rect = getRect(); clip_rect.stretch(-8); clip_rect.clipPointToRect(mMouseDownX, mMouseDownY, local_x, local_y); - LLUI::setCursorPositionLocal(this, local_x, local_y); + LLUI::setMousePositionLocal(this, local_x, local_y); // finish the pan mPanning = FALSE; diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index 41c9772694..8349d5399f 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -72,7 +72,7 @@ public: virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); + virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ); bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track); void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id); diff --git a/indra/newview/skins/default/xui/en/floater_test_inspectors.xml b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml new file mode 100644 index 0000000000..b23bf49435 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="400" + layout="topleft" + name="floater_test_inspectors" + title="Test Inspectors" + width="400"> + <text + height="20" + left="10" + name="test_inspectors" + top="30" + width="300"> + Click to spawn an inspector: + </text> + <!-- James Tester, 4 years old --> + <button + name="avatar_2d_btn1" + label="Avatar 2D" + top="50" + left="10" + height="20" + width="100" + commit_callback.function="ShowAvatarInspector" + commit_callback.parameter="22df1dcb-810a-4975-aab9-0159958fe155" /> + <!-- DonkeyPuncher 2008-10-1 --> + <button + name="avatar_2d_btn5" + label="Avatar 2D" + top_pad="10" + left="10" + height="20" + width="100" + commit_callback.function="ShowAvatarInspector" + commit_callback.parameter="d5330e4e-391a-4f00-9352-b797ed2f9a97" /> + <!-- DonkeyPuncher 2009-01-15 --> + <button + name="avatar_2d_btn2" + label="Avatar 2D" + top_pad="10" + left="10" + height="20" + width="100" + commit_callback.function="ShowAvatarInspector" + commit_callback.parameter="05511655-a58a-48b6-b645-966f69fc17a7" /> + <!-- 2009-06-14 --> + <button + name="avatar_2d_btn3" + label="Avatar 2D" + top_pad="10" + left="10" + height="20" + width="100" + commit_callback.function="ShowAvatarInspector" + commit_callback.parameter="6a164b3d-7c2c-43eb-880a-0ebc0687b3ec" /> + <!-- jarvtest Bombastic 2009-10-3 --> + <button + name="avatar_2d_btn4" + label="Avatar 2D" + top_pad="10" + left="10" + height="20" + width="100" + commit_callback.function="ShowAvatarInspector" + commit_callback.parameter="e7dc3c83-1e11-4fa7-beeb-4b18adfb4efa" /> + <button + name="avatar_3d_btn" + label="Avatar 3D" + top="50" + left="150" + height="20" + width="100"/> + <button + name="object_2d_btn" + label="Object 2D" + top_pad="10" + left_delta="0" + height="20" + width="100"/> + <button + name="object_3d_btn" + label="Object 3D" + top_pad="10" + left_delta="0" + height="20" + width="100"/> + <button + name="group_btn" + label="Group" + top_pad="10" + left_delta="0" + height="20" + width="100"/> + <button + name="place_btn" + label="Place" + top_pad="10" + left_delta="0" + height="20" + width="100"/> + <button + name="event_btn" + label="Event" + top_pad="10" + left_delta="0" + height="20" + width="100"/> + +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index a126a932df..b53f4fb99c 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater follows="left|top|right" - height="615" + height="570" layout="topleft" name="toolbox floater" save_rect="true" @@ -27,7 +27,7 @@ </floater.string> <floater.string name="status_camera"> - Click and drag to change view + Click and drag to move camera </floater.string> <floater.string name="status_grab"> @@ -224,35 +224,27 @@ left="10" follows="left|top" control_name="EditLinkedParts" - label="Edit linked prims" + label="Edit linked" layout="topleft" name="checkbox edit linked parts" /> - <text - left="10" - type="string" - length="1" - follows="left|top" - layout="topleft" - name="text ruler mode"> - Ruler: - </text> <combo_box height="19" - left="30" + left="10" layout="topleft" follows="left|top" + top_pad="0" name="combobox grid mode" - width="90"> + width="120"> <combo_box.item - label="World" + label="World ruler" name="World" value="World" /> <combo_box.item - label="Local" + label="Local ruler" name="Local" value="Local" /> <combo_box.item - label="Reference" + label="Reference ruler" name="Reference" value="Reference" /> </combo_box> @@ -263,7 +255,7 @@ layout="topleft" left="143" name="checkbox uniform" - top="54" + top="50" width="134" /> <check_box control_name="ScaleStretchTextures" @@ -272,28 +264,27 @@ label="Stretch Textures" layout="topleft" name="checkbox stretch textures" - top_pad="1" + top_pad="0" width="134" /> <check_box control_name="SnapEnabled" height="19" initial_value="true" - label="Use Grid" + label="Snap to Grid" layout="topleft" name="checkbox snap to grid" - top_pad="1" + top_pad="0" width="134" /> <button - follows="left|top" - font="SansSerifSmall" - height="19" - left_delta="40" - top_delta="20" - label="Options..." - label_selected="Options..." + left="163" + top_pad="0" + image_overlay="Arrow_Right_Off" + picture_style="true" + label_selected="Options" layout="topleft" name="Options..." - width="78" /> + width="26" + height="22" /> <button follows="left|top" height="24" @@ -605,7 +596,7 @@ top_delta="15" width="114" /> </radio_group> - + <text type="string" length="1" @@ -680,7 +671,7 @@ type="string" text_color="LabelSelectedDisabledColor" length="1" - top_pad="7" + top_pad="4" height="12" follows="left|top" halign="right" @@ -722,7 +713,7 @@ top="16"> <panel.string name="text deed continued"> - Deed... + Deed </panel.string> <panel.string name="text deed"> @@ -776,7 +767,7 @@ layout="topleft" left="10" name="Name:" - top_pad="8" + top="0" width="90"> Name: </text> @@ -789,7 +780,7 @@ name="Object Name" select_on_focus="true" top_delta="0" - width="172" /> + width="165" /> <text type="string" length="1" @@ -811,8 +802,7 @@ name="Object Description" select_on_focus="true" top_delta="0" - width="172" /> - + width="165" /> <text type="string" left="10" @@ -833,21 +823,9 @@ height="19" layout="topleft" name="Creator Name" - width="150"> - Thrax Linden + width="175"> + Esbee Linden </text> -<!--TODO: Kill this--> -<!-- <button - follows="top|right" - font="SansSerifSmall" - height="19" - label="Profile..." - label_selected="Profile..." - layout="topleft" - left_pad="6" - name="button creator profile" - tool_tip="View creator profile" - width="78" />--> <text type="string" length="1" @@ -868,21 +846,9 @@ layout="topleft" name="Owner Name" left_pad="0" - width="150"> - Thrax Linden + width="175"> + Erica Linden </text> -<!--TODO: Kill this--> -<!--<button - follows="top|right" - font="SansSerifSmall" - height="19" - label="Profile..." - label_selected="Profile..." - layout="topleft" - left_pad="6" - name="button owner profile" - tool_tip="View owner profile" - width="78" />--> <text type="string" length="1" @@ -891,40 +857,39 @@ left="10" height="19" name="Group:" - width="90"> + width="70"> Group: </text> <name_box - follows="left|top|right" + follows="left|top" height="19" initial_value="Loading..." layout="topleft" left_pad="0" name="Group Name Proxy" - width="170" /> + width="159" /> + <button + follows="left|top" + left_pad="0" + image_overlay="Arrow_Right_Off" + picture_style="true" + layout="topleft" + name="button set group" + tool_tip="Choose a group to share this object's permissions" + width="26" + height="22" /> <button - follows="top|right" + follows="top|left" font="SansSerifSmall" height="19" - label="Deed..." - label_selected="Deed..." + label="Deed" + label_selected="Deed" layout="topleft" name="button deed" top_pad="0" - left="102" + left="80" tool_tip="Deeding gives this item away with Next Owner permissions. Group shared objects can be deeded by a group officer." - width="80" /> - <button - follows="left|top" - font="SansSerifSmall" - height="19" - label="Set..." - label_selected="Set..." - layout="topleft" - left_pad="7" - name="button set group" - tool_tip="Choose a group to share this object's permissions" - width="80" /> + width="90" /> <check_box height="19" follows="left|top" @@ -932,18 +897,18 @@ layout="topleft" name="checkbox share with group" tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions." - left="100" + left_pad="5" width="93" /> <text type="string" length="1" follows="left|top" - height="19" + height="16" layout="topleft" - top_pad="7" + top_pad="15" left="10" name="label click action" - width="90"> + width="100"> Click to: </text> <combo_box @@ -951,7 +916,7 @@ height="22" layout="topleft" name="clickaction" - width="170" + width="155" left_pad="0"> <combo_box.item label="Touch (default)" @@ -973,23 +938,15 @@ label="Open" name="Open" value="Open" /> -<!--TODO: Kill this--> -<!-- <combo_box.item - label="Play parcel media" - name="Play" - value="Play" /> - <combo_box.item - label="Open parcel media" - name="Opemmedia" - value="Open Media" />--> </combo_box> <check_box - height="20" + height="16" + top_pad="15" label="For Sale:" layout="topleft" name="checkbox for sale" left="10" - width="90" /> + width="100" /> <!-- NEW SALE TYPE COMBO BOX --> <combo_box left_pad="0" @@ -997,22 +954,22 @@ follows="left|top" allow_text_entry="false" height="22" - width="170" + width="155" max_chars="20" mouse_opaque="true" name="sale type" intial_value="2"> <combo_item name="Copy" - label="Copy" + label="Copy" value="2" /> <combo_item name="Contents" - label="Contents" + label="Contents" value="3" /> <combo_item name="Original" - label="Original" + label="Original" value="1" /> </combo_box> <!-- NEW PRICE SPINNER --> @@ -1020,118 +977,55 @@ follows="left|top" decimal_digits="0" increment="1" + top_pad="10" control_name="Edit Cost" name="Edit Cost" label="Price: L$" label_width="60" - width="170" + width="155" min_val="1" height="19" max_val="999999999" /> - <panel + <check_box + left="107" + height="15" + width="100" + label="Show in search" + layout="topleft" + name="search_check" + tool_tip="Let people see this object in search results" + /> +<panel border="false" - follows="left|top|right" + follows="left|top" layout="topleft" mouse_opaque="false" background_visible="true" bg_alpha_color="FloaterUnfocusBorderColor" name="perms_build" left="0" - height="140" + top="240" + height="120" width="280"> <text type="string" length="1" left="10" - top_pad="6" - height="19" + top_pad="10" + text_color="EmphasisColor" + height="16" follows="left|top|right" layout="topleft" name="perm_modify" - width="180"> + width="250"> You can modify this object </text> <text - type="string" - text_color="LabelSelectedDisabledColor" - length="1" - top_pad="0" - follows="left|top" - layout="topleft" - left="17" - name="B:" - width="30"> - B: - </text> - <text - type="string" - text_color="LabelSelectedDisabledColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="0" - name="O:" - width="30"> - O: - </text> - <text - type="string" - text_color="LabelSelectedDisabledColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="0" - name="G:" - width="30"> - G: - </text> - <text - type="string" - text_color="LabelSelectedDisabledColor" - length="1" - follows="left|top" - left_pad="0" - layout="topleft" - name="E:" - width="30"> - E: - </text> - <text - type="string" - text_color="LabelSelectedDisabledColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="0" - name="N:" - width="30"> - N: - </text> - <text - type="string" - text_color="LabelSelectedDisabledColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="0" - name="F:" - width="30"> - F: - </text> - <check_box - left="15" - height="19" - label="Show in search" - layout="topleft" - name="search_check" - tool_tip="Let people see this object in search results" - /> - <text type="string" follows="left|top" name="Anyone can:" width="250" - top_pad="7" + top_pad="5" left="10"> Anyone: </text> @@ -1148,13 +1042,20 @@ layout="topleft" left_pad="0" name="checkbox allow everyone copy" - width="260" /> + width="90" /> + <check_box + height="19" + label="Use" + layout="topleft" + left_pad="0" + name="allow everyone to use" + width="90" /> <text type="string" follows="left|top" height="19" name="Next owner can:" - width="270" + width="250" left="10"> Next owner: </text> @@ -1183,192 +1084,134 @@ top_delta="0" tool_tip="Next owner can give away or resell this object" width="90" /> - </panel> -<!--TODO: KILL THIS--> -<!--<text + <text type="string" + text_color="EmphasisColor_35" length="1" + top_pad="5" follows="left|top" - height="19" layout="topleft" - left_pad="12" - name="Cost" - top_delta="0" - width="78"> - Price: L$ + left="18" + name="B:" + height="10" + width="30"> + B: </text> - <line_editor - follows="left|top|right" - height="19" + <text + type="string" + text_color="EmphasisColor_35" + length="1" + follows="left|top" layout="topleft" left_pad="0" - max_length="25" - name="Edit Cost" - top_delta="0" - width="75" />--> -<!--TODO: KILL THIS--> -<!--<radio_group - follows="left|top|right" - height="19" - left="15" - layout="topleft" - name="sale type" - width="218"> - <radio_item - height="19" - label="Original" - layout="topleft" - left="0" - name="Original" - top="0" - width="70" /> - <radio_item - height="19" - label="Copy" - layout="topleft" - left_delta="70" - name="Copy" - top_delta="0" - width="70" /> - <radio_item - height="19" - label="Contents" - layout="topleft" - left_delta="70" - name="Contents" - top_delta="0" - width="76" /> - </radio_group>--> - </panel> - <panel - border="false" - follows="left|top|right|bottom" - height="367" - label="Object" - layout="topleft" - left_delta="0" - mouse_opaque="false" - name="Object" - top_delta="0" - width="280"> + name="O:" + height="10" + width="30"> + O: + </text> <text type="string" + text_color="EmphasisColor_35" length="1" follows="left|top" + layout="topleft" + left_pad="0" + name="G:" height="10" + width="30"> + G: + </text> + <text + type="string" + text_color="EmphasisColor_35" + length="1" + follows="left|top" + left_pad="0" layout="topleft" - left="10" - name="select_single" - top="10" - width="252"> - Select only one primitive to edit parameters. + name="E:" + height="10" + width="30"> + E: </text> <text type="string" + text_color="EmphasisColor_35" length="1" follows="left|top" + layout="topleft" + left_pad="0" + name="N:" height="10" + width="30"> + N: + </text> + <text + type="string" + text_color="EmphasisColor_35" + length="1" + follows="left|top" layout="topleft" - left_delta="0" - name="edit_object" - top_delta="0" - width="252"> - Edit object parameters: + left_pad="0" + name="F:" + height="10" + width="30"> + F: </text> + </panel> + </panel> + <panel + border="false" + follows="left|top|right|bottom" + height="367" + label="Object" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Object" + top="16" + width="280"> <check_box height="19" label="Locked" layout="topleft" - left_delta="-2" name="checkbox locked" tool_tip="Prevents object from being moved or deleted. Frequently useful during building to avoid unintended edits." - top_pad="10" + top_pad="5" + left="10" width="123" /> <check_box height="19" label="Physical" layout="topleft" - left_delta="0" name="Physical Checkbox Ctrl" tool_tip="Allows object to be pushed and affected by gravity" - top_pad="2" + top_pad="0" width="123" /> <check_box height="19" label="Temporary" layout="topleft" - left_delta="0" name="Temporary Checkbox Ctrl" tool_tip="Causes object to be deleted 1 minute after creation." - top_pad="2" + top_pad="0" width="123" /> <check_box height="19" label="Phantom" layout="topleft" - left_delta="0" name="Phantom Checkbox Ctrl" tool_tip="Causes object to not collide with other objects or avatars" - top_pad="2" + top_pad="0" width="123" /> - - <text - type="string" - length="1" - follows="left|top" - height="10" - layout="topleft" - left_delta="0" - name="label material" - top_pad="9" - width="121"> - Material - </text> - <combo_box - height="19" - layout="topleft" - left_delta="0" - name="material" - top_pad="4" - width="95"> - <combo_box.item - label="Stone" - name="Stone" - value="Stone" /> - <combo_box.item - label="Metal" - name="Metal" - value="Metal" /> - <combo_box.item - label="Glass" - name="Glass" - value="Glass" /> - <combo_box.item - label="Wood" - name="Wood" - value="Wood" /> - <combo_box.item - label="Flesh" - name="Flesh" - value="Flesh" /> - <combo_box.item - label="Plastic" - name="Plastic" - value="Plastic" /> - <combo_box.item - label="Rubber" - name="Rubber" - value="Rubber" /> - </combo_box> + <text type="string" length="1" follows="left|top" height="10" layout="topleft" - left_delta="2" name="label position" - top_pad="8" + top_pad="10" width="121"> Position (meters) </text> @@ -1384,7 +1227,7 @@ max_val="512" min_val="-256" name="Pos X" - text_enabled_color="0.43 0.06 0.06 1" + text_enabled_color="1 0 0.3 .7" top_pad="5" width="87" /> <spinner @@ -1399,7 +1242,7 @@ max_val="512" min_val="-256" name="Pos Y" - text_enabled_color="0 0.39 0.15 1" + text_enabled_color="EmphasisColor" top_pad="3" width="87" /> <spinner @@ -1413,7 +1256,7 @@ left_delta="0" max_val="4096" name="Pos Z" - text_enabled_color="0 0.26 0.51 1" + text_enabled_color="0 0.8 1 .65" top_pad="3" width="87" /> <text @@ -1533,8 +1376,8 @@ text_enabled_color="1 1 1 1" top_pad="3" width="87" /> - - <text + + <!-- <text type="string" length="1" follows="left|top" @@ -1542,16 +1385,16 @@ layout="topleft" left="125" name="label basetype" - top="26" + top="5" width="150"> - Building Block Type - </text> + Prim Type + </text>--> <combo_box height="19" layout="topleft" - left_delta="0" name="comboBaseType" - top_pad="4" + top="5" + left="125" width="150"> <combo_box.item label="Box" @@ -1586,6 +1429,41 @@ name="Sculpted" value="Sculpted" /> </combo_box> + <combo_box + height="19" + layout="topleft" + name="material" + top_pad="0" + width="150"> + <combo_box.item + label="Stone" + name="Stone" + value="Stone" /> + <combo_box.item + label="Metal" + name="Metal" + value="Metal" /> + <combo_box.item + label="Glass" + name="Glass" + value="Glass" /> + <combo_box.item + label="Wood" + name="Wood" + value="Wood" /> + <combo_box.item + label="Flesh" + name="Flesh" + value="Flesh" /> + <combo_box.item + label="Plastic" + name="Plastic" + value="Plastic" /> + <combo_box.item + label="Rubber" + name="Rubber" + value="Rubber" /> + </combo_box> <text type="string" length="1" @@ -1596,11 +1474,11 @@ name="text cut" top_pad="6" width="150"> - Path Cut Begin and End + Path Cut (begin/end) </text> <spinner follows="left|top" - height="19" + height="16" increment="0.025" initial_value="0" label="B" @@ -1613,7 +1491,7 @@ width="68" /> <spinner follows="left|top" - height="19" + height="16" increment="0.025" initial_value="1" label="E" @@ -1632,7 +1510,7 @@ layout="topleft" left="125" name="text hollow" - top_pad="6" + top_pad="5" width="68"> Hollow </text> @@ -1644,7 +1522,6 @@ layout="topleft" left_pad="10" name="text skew" - top_delta="0" width="63"> Skew </text> @@ -1681,7 +1558,7 @@ layout="topleft" left="125" name="Hollow Shape" - top_pad="6" + top_pad="0" width="150"> Hollow Shape </text> @@ -1717,9 +1594,9 @@ layout="topleft" left_delta="0" name="text twist" - top_pad="4" + top_pad="8" width="150"> - Twist Begin and End + Twist (begin/end) </text> <spinner decimal_digits="0" @@ -1811,7 +1688,7 @@ layout="topleft" left="125" name="text topshear" - top_pad="6" + top_pad="3" width="141"> Top Shear </text> @@ -1853,9 +1730,9 @@ layout="topleft" left="125" name="advanced_cut" - top_pad="6" + top_pad="3" width="150"> - Profile Cut Begin and End + Profile Cut (begin/end) </text> <text type="string" @@ -1867,7 +1744,7 @@ name="advanced_dimple" top_delta="0" width="150"> - Dimple Begin and End + Dimple (begin/end) </text> <text type="string" @@ -1879,7 +1756,7 @@ name="advanced_slice" top_delta="0" width="150"> - Slice Begin and End + Slice (begin/end) </text> <spinner follows="left|top" @@ -1892,7 +1769,7 @@ left_delta="0" max_val="0.95" name="Path Limit Begin" - top_pad="4" + top_pad="3" width="68" /> <spinner follows="left|top" @@ -1915,7 +1792,7 @@ layout="topleft" left="125" name="text taper2" - top_pad="6" + top_pad="3" width="150"> Taper </text> @@ -1931,7 +1808,7 @@ left_delta="0" min_val="-1" name="Taper X" - top_pad="4" + top_pad="3" width="68" /> <spinner decimal_digits="2" @@ -1955,7 +1832,7 @@ layout="topleft" left="125" name="text radius delta" - top_pad="6" + top_pad="0" width="78"> Radius </text> @@ -1967,7 +1844,6 @@ layout="topleft" left_delta="78" name="text revolutions" - top_delta="0" width="68"> Revolutions </text> @@ -2090,7 +1966,7 @@ layout="topleft" left="10" name="select_single" - top="10" + top="5" width="252"> Select only one primitive to edit features. </text> @@ -2100,9 +1976,9 @@ follows="left|top" height="10" layout="topleft" - left_delta="0" + left="10" name="edit_object" - top_delta="0" + top="5" width="252"> Edit object features: </text> @@ -2110,7 +1986,7 @@ height="19" label="Flexible Path" layout="topleft" - left_delta="0" + left="10" name="Flexible1D Checkbox Ctrl" tool_tip="Allows object to flex about the Z axis. (Client-side only)" top_pad="10" @@ -2224,60 +2100,50 @@ top_pad="4" width="128" /> <check_box - height="19" + height="16" label="Light" layout="topleft" - left_delta="0" + left="10" name="Light Checkbox Ctrl" tool_tip="Causes object to emit light" - top_pad="14" - width="121" /> - <text - type="string" - length="1" - follows="left|top" - height="10" - layout="topleft" - left_delta="0" - name="label color" top_pad="15" - width="58"> - Color - </text> + width="60" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" + bevel_style="none" + border_style="line" color="0.5 0.5 0.5 1" + border.border_thickness="0" follows="left|top" - height="48" + height="50" layout="topleft" - left_delta="67" + left_pad="10" + top_pad="-17" name="colorswatch" tool_tip="Click to open Color Picker" - top_delta="-10" - width="32" /> + width="40" /> <spinner follows="left|top" height="19" initial_value="0.5" label="Intensity" - label_width="65" + label_width="70" layout="topleft" - left="10" + left_pad="15" name="Light Intensity" - top_pad="4" + top_pad="-50" width="128" /> <spinner follows="left|top" height="19" initial_value="5" label="Radius" - label_width="65" + label_width="70" layout="topleft" left_delta="0" max_val="20" name="Light Radius" - top_pad="0" + top_pad="3" width="128" /> <spinner follows="left|top" @@ -2285,12 +2151,12 @@ increment="0.25" initial_value="1" label="Falloff" - label_width="65" + label_width="70" layout="topleft" left_delta="0" max_val="2" name="Light Falloff" - top_pad="0" + top_pad="3" width="128" /> </panel> <panel @@ -2399,16 +2265,16 @@ left="10" name="tex gen" top_pad="10" - width="90"> + width="87"> Mapping </text> <combo_box - height="19" + height="22" layout="topleft" left_delta="0" name="combobox texgen" top_pad="4" - width="80"> + width="87"> <combo_box.item label="Default" name="Default" @@ -2424,19 +2290,19 @@ follows="left|top" height="10" layout="topleft" - left="100" name="label shininess" - top_pad="-33" - width="70"> + left_pad="5" + top_pad="-36" + width="80"> Shininess </text> <combo_box - height="19" + height="22" layout="topleft" left_delta="0" name="combobox shininess" top_pad="4" - width="70"> + width="80"> <combo_box.item label="None" name="None" @@ -2460,19 +2326,19 @@ follows="left|top" height="10" layout="topleft" - left="180" + left_pad="5" name="label bumpiness" - top_pad="-33" - width="80"> + top_pad="-36" + width="87"> Bumpiness </text> <combo_box - height="19" + height="22" layout="topleft" left_delta="0" name="combobox bumpiness" top_pad="4" - width="80"> + width="87"> <combo_box.item label="None" name="None" @@ -2555,7 +2421,7 @@ left="10" name="tex scale" top_pad="15" - width="160"> + width="200"> Repeats per Face </text> <spinner @@ -2650,13 +2516,12 @@ <button follows="left|top" font="SansSerifSmall" - height="19" + height="22" label="Apply" label_selected="Apply" layout="topleft" left_pad="10" name="button apply" - top_delta="-4" width="75" /> <text type="string" @@ -2667,8 +2532,8 @@ left="10" name="tex offset" top_pad="20" - width="160"> - Offset + width="200"> + Texture Offset </text> <spinner follows="left|top" @@ -2720,10 +2585,9 @@ top="340" width="68" />--> </panel> - <panel + <panel border="false" follows="left|top|right|bottom" - height="367" label="Content" layout="topleft" left_delta="0" @@ -2733,34 +2597,33 @@ width="280"> <button follows="left|top" - height="19" + height="22" label="New Script" - label_selected="New Script..." + label_selected="New Script" layout="topleft" left="10" name="button new script" top="10" - width="100" /> + width="120" /> <button follows="left|top" - height="19" - label="Permissions..." + height="22" + label="Permissions" layout="topleft" - left_pad="10" + left_pad="8" name="button permissions" - top_delta="0" - width="100" /> + width="130" /> <panel_inventory follows="left|top" - height="300" + height="310" layout="topleft" left="10" name="contents_inventory" - top="35" + top="50" width="260" /> </panel> - </tab_container> - <panel + </tab_container> + <panel follows="left|top" height="384" layout="topleft" @@ -2768,7 +2631,7 @@ name="land info panel" top_delta="0" width="280"> - <text + <text type="string" length="1" font="SansSerifBig" @@ -2807,9 +2670,9 @@ </text> <button follows="left|top" - height="19" - label="About Land..." - label_selected="About Land..." + height="22" + label="Land profile" + label_selected="Land profile" layout="topleft" left_delta="0" name="button about land" @@ -2822,19 +2685,16 @@ layout="topleft" left_delta="0" name="checkbox show owners" - tool_tip="Colour parcels according to their ownership" + tool_tip="Color parcels by owner" top_pad="8" - width="140" /> - <button - follows="left|top" - height="19" - label="?" - label_selected="?" - layout="topleft" + width="205" /> + <button + image_overlay="Arrow_Right_Off" + picture_style="true" left_pad="5" name="button show owners help" - top_delta="-2" - width="18" /> + width="26" + height="22" /> <text type="string" length="1" @@ -2850,9 +2710,9 @@ </text> <button follows="left|top" - height="19" - label="Subdivide..." - label_selected="Subdivide..." + height="22" + label="Subdivide" + label_selected="Subdivide" layout="topleft" left="30" name="button subdivide land" @@ -2860,9 +2720,9 @@ width="112" /> <button follows="left|top" - height="19" - label="Join..." - label_selected="Join..." + height="22" + label="Join" + label_selected="Join" layout="topleft" left_delta="0" name="button join land" @@ -2883,9 +2743,9 @@ </text> <button follows="left|top" - height="19" - label="Buy Land..." - label_selected="Buy Land..." + height="22" + label="Buy Land" + label_selected="Buy Land" layout="topleft" left="30" name="button buy land" @@ -2894,8 +2754,8 @@ <button follows="left|top" height="19" - label="Abandon Land..." - label_selected="Abandon Land..." + label="Abandon Land" + label_selected="Abandon Land" layout="topleft" left_delta="0" name="button abandon land" diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml index cee789d435..f908e9d610 100644 --- a/indra/newview/skins/default/xui/en/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml @@ -1,14 +1,20 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- All our XML is utf-8 encoded. --> -<!-- No title to avoid window chrome --> +<!-- + Not can_close / no title to avoid window chrome + Single instance - only have one at a time, recycle it each spawn +--> <floater background_opaque="false" background_visible="true" bevel_style="in" - bg_alpha_color="black" + bg_alpha_color="PanelDefaultBackgroundColor" + can_close="false" can_minimize="false" name="inspect_avatar" + single_instance="true" + sound_flags="0" title="" visible="true" width="300" @@ -16,28 +22,39 @@ left="0" top="200" > + <!-- Allowed fields include: + [BORN_ON] ("12/3/2008") + [SL_PROFILE] (Second Life profile), + [RW_PROFILE] (real world profile), + [ACCTTYPE] ("Resident"), + [PAYMENTINFO] ("Payment Info on File"), + [AGE] ("1 year 2 months") --> + <string name="Subtitle"> +[AGE] + </string> + <string name="Details"> +[ACCTTYPE], [PAYMENTINFO] +Profile: [SL_PROFILE] + </string> <text - top="180" left="10" width="220" height="70" follows="left|top|right|bottom" + top="180" left="10" width="280" height="70" follows="left|top|right|bottom" use_ellipses="true" word_wrap="true" font="SansSerifHugeBold" text_color="white" mouse_opaque="true" name="user_name" > - Codex Linden + Test Name </text> + <!-- General purpose subtitle area, not sure yet what goes here --> <text top="155" left="10" width="150" height="20" follows="left|top|right|bottom" - font="SansSerifBig" font.style="UNDERLINE" + font="SansSerifBig" text_color="white" mouse_opaque="true" - name="active_group" > - The Guild - </text> + name="user_subtitle" /> + <!-- Leave text fields blank so it doesn't flash when data arrives off the network --> <text - top="110" left="10" width="290" height="50" follows="left|top|right|bottom" + top="115" left="10" width="290" height="50" follows="left|top|right|bottom" font="SansSerifSmall" text_color="white" word_wrap="true" - mouse_opaque="true" name="user_detail" > -3 year-old account, Payment info on file -Languages: English, Spanish; +5 Sexterity Vest - </text> + mouse_opaque="true" name="user_details" /> <avatar_icon top="185" left="230" width="60" height="60" follows="left|top|right|bottom" color="1 1 1 1" enabled="true" mouse_opaque="true" name="avatar_icon" diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 1e911c2664..8a2955654e 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -97,18 +97,20 @@ layout="topleft" name="Widget Test" shortcut="control|shift|T"> - <menu_item_call.on_click - function="ShowFloater" - parameter="test_widgets" /> - </menu_item_call> - <menu_item_call - label="Avatar Inspector" - name="Avatar Inspector" - shortcut="control|shift|I"> - <menu_item_call.on_click - function="ShowFloater" - parameter="inspect_avatar" /> - </menu_item_call> + <menu_item_call.on_click + function="ShowFloater" + parameter="test_widgets" /> + </menu_item_call> + <menu_item_call + label="Inspectors Test" + name="inspectors_test" + shortcut="control|shift|I" + > + <menu_item_call.on_click + function="ShowFloater" + parameter="test_inspectors" /> + </menu_item_call> + <menu_item_separator /> <menu_item_call label="Show TOS" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 6bc12368b7..9ad9a87f95 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2751,14 +2751,13 @@ <menu_item_call.on_click function="Advanced.SendTestIMs" /> </menu_item_call> - <!-- *HACK: Hard code James Tester's UUID --> <menu_item_call - label="Avatar Inspector" - name="Avatar Inspector" + label="Test Inspectors" + name="Test Inspectors" shortcut="control|shift|I"> <menu_item_call.on_click - function="Advanced.AvatarInspector" - parameter="22df1dcb-810a-4975-aab9-0159958fe155" /> + function="Floater.Show" + parameter="test_inspectors" /> </menu_item_call> </menu> <menu diff --git a/indra/newview/skins/default/xui/en/panel_activeim_row.xml b/indra/newview/skins/default/xui/en/panel_activeim_row.xml index f5af8e7b30..4dc4a9ff46 100644 --- a/indra/newview/skins/default/xui/en/panel_activeim_row.xml +++ b/indra/newview/skins/default/xui/en/panel_activeim_row.xml @@ -11,7 +11,7 @@ bevel_style="in" bg_alpha_color="0 0 0 0"> <chiclet_im_p2p - name="chiclet" + name="p2p_chiclet" layout="topleft" follows="left" top="5" @@ -19,6 +19,15 @@ height="25" width="45"> </chiclet_im_p2p> + <chiclet_im_group + name="group_chiclet" + layout="topleft" + follows="left" + top="5" + left="5" + height="25" + width="45"> + </chiclet_im_group> <text type="string" name="contact_name" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 79ca839f28..df91920721 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -33,12 +33,13 @@ top="0" width="5"/> <layout_panel + auto_resize="false" follows="left|right" height="28" layout="topleft" left="5" min_height="28" - width="500" + width="600" top="0" min_width="305" name="chat_bar" diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 794b69d7ed..d943b2ea23 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -55,6 +55,7 @@ max_length="31" name="first_name_edit" select_on_focus="true" + tool_tip="Enter first name here" top_pad="4" width="120" /> <text @@ -111,6 +112,25 @@ select_on_focus="true" top_pad="4" width="120" /> + <button + follows="left|bottom" + height="24" + label="Log In" + label_selected="Log In" + layout="topleft" + left="435" + name="connect_btn" + top="548" + width="120" /> + <combo_box + allow_text_entry="true" + follows="left|bottom" + height="18" + layout="topleft" + left_pad="15" + name="server_combo" + top_delta="2" + width="120" /> <text type="string" length="1" @@ -158,25 +178,7 @@ name="remember_check" top_delta="3" width="138" /> - <button - follows="left|bottom" - height="24" - label="Log In" - label_selected="Log In" - layout="topleft" - left="435" - name="connect_btn" - top="548" - width="120" /> - <combo_box - allow_text_entry="true" - follows="left|bottom" - height="18" - layout="topleft" - left_pad="15" - name="server_combo" - top_delta="2" - width="120" /> + <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 135dcb167b..41de34fbed 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -14,33 +14,6 @@ [ACCTTYPE] [PAYMENTINFO] [AGEVERIFICATION] </string> <string - name="AcctTypeResident" - value="Resident" /> - <string - name="AcctTypeTrial" - value="Trial" /> - <string - name="AcctTypeCharterMember" - value="Charter Member" /> - <string - name="AcctTypeEmployee" - value="Linden Lab Employee" /> - <string - name="PaymentInfoUsed" - value="Payment Info Used" /> - <string - name="PaymentInfoOnFile" - value="Payment Info On File" /> - <string - name="NoPaymentInfoOnFile" - value="No Payment Info On File" /> - <string - name="AgeVerified" - value="Age-verified" /> - <string - name="NotAgeVerified" - value="Not Age-verified" /> - <string name="payment_update_link_url"> http://www.secondlife.com/account/billing.php?lang=en </string> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b8152a4956..faed615bdd 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -46,7 +46,7 @@ <string name="AgentLostConnection">This region may be experiencing trouble. Please check your connection to the Internet.</string> - <!-- Tooltip, llhoverview.cpp --> + <!-- Tooltip, lltooltipview.cpp --> <string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar --> <string name="TooltipNoName">(no name)</string> <!-- No name on an object --> <string name="TooltipOwner">Owner:</string> <!-- Owner name follows --> @@ -1913,8 +1913,35 @@ this texture in your inventory <string name="Stomach">Stomach</string> <string name="Left Pec">Left Pec</string> <string name="Right Pec">Right Pec</string> - - <!-- HUD Position --> + + <!-- Avatar age computation, see LLAvatarPropertiesProcessor::ageFromDate --> + <string name="YearsMonthsOld">[AGEYEARS][AGEMONTHS]old</string> + <string name="WeeksOld">[AGEWEEKS]old</string> + <string name="DaysOld">[AGEDAYS]old</string> + <string name="TodayOld">Joined today</string> + + <!-- Use value="" because of trailing spaces --> + <string name="AgeYears" value="[YEARS] years " /> + <string name="Age1Year" value="1 year "/> + <string name="AgeMonths" value="[MONTHS] months "/> + <string name="Age1Month" value="1 month "/> + <string name="AgeWeeks" value="[WEEKS] weeks "/> + <string name="Age1Week" value="1 week "/> + <string name="AgeDays" value="[DAYS] days "/> + <string name="Age1Day" value="1 day "/> + + <!-- Account types, see LLAvatarPropertiesProcessor --> + <string name="AcctTypeResident">Resident</string> + <string name="AcctTypeTrial">Trial</string> + <string name="AcctTypeCharterMember">Charter Member</string> + <string name="AcctTypeEmployee">Linden Lab Employee</string> + <string name="PaymentInfoUsed">Payment Info Used</string> + <string name="PaymentInfoOnFile">Payment Info On File</string> + <string name="NoPaymentInfoOnFile">No Payment Info On File</string> + <string name="AgeVerified">Age-verified</string> + <string name="NotAgeVerified">Not Age-verified</string> + + <!-- HUD Position --> <string name="Center 2">Center 2</string> <string name="Top Right">Top Right</string> <string name="Top">Top</string> @@ -2425,4 +2452,48 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="UpdaterFailStartTitle"> Failed to start viewer </string> + + <!-- IM system messages --> + <string name="only_user_message"> + You are the only user in this session. + </string> + <string name="offline_message"> + [FIRST] [LAST] is offline. + </string> + <string name="invite_message"> + Click the [BUTTON NAME] button to accept/connect to this voice chat. + </string> + <string name="muted_message"> + You have blocked this resident. Sending a message will automatically unblock them. + </string> + <string name="generic_request_error"> + Error making request, please try again later. + </string> + <string name="insufficient_perms_error"> + You do not have sufficient permissions. + </string> + <string name="session_does_not_exist_error"> + The session no longer exists + </string> + <string name="no_ability_error"> + You do not have that ability. + </string> + <string name="not_a_mod_error"> + You are not a session moderator. + </string> + <string name="muted_error"> + A group moderator disabled your text chat. + </string> + <string name="add_session_event"> + Unable to add users to chat session with [RECIPIENT]. + </string> + <string name="message_session_event"> + Unable to send your message to the chat session with [RECIPIENT]. + </string> + <string name="removed_from_group"> + You have been removed from the group. + </string> + <string name="close_on_no_ability"> + You no longer have the ability to be in the chat session. + </string> </strings> diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml new file mode 100644 index 0000000000..4a866c2eb2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/floater.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater name="floater" + bg_opaque_color="FloaterFocusBackgroundColor" + bg_alpha_color="FloaterDefaultBackgroundColor" + background_visible="true" + background_opaque="false"/> diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 297a3762f6..a37ed76c51 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -17,6 +17,7 @@ show_text_as_tentative="false" max_chars="20" follows="left|top" + allow_new_values="true" > <info_button name="Place Information" label="" diff --git a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml index 1d43b25f1d..6e73e997e0 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml @@ -4,6 +4,8 @@ list_position="BELOW" show_text_as_tentative="false" dropdown_button_visible="false" + max_chars="256" + allow_new_values="true" background_image="TextField_Search_Off" background_image_disabled="TextField_Search_Disabled" background_image_focused="TextField_Search_Active"> |