diff options
Diffstat (limited to 'indra')
154 files changed, 3969 insertions, 2019 deletions
diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index 91302618e9..2cc6e5c9bc 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -81,6 +81,7 @@ public: mFromName(), mFromID(), mNotifId(), + mOwnerID(), mSourceType(CHAT_SOURCE_AGENT), mChatType(CHAT_TYPE_NORMAL), mAudible(CHAT_AUDIBLE_FULLY), @@ -97,6 +98,7 @@ public: std::string mFromName; // agent or object name LLUUID mFromID; // agent id or object id LLUUID mNotifId; + LLUUID mOwnerID; EChatSourceType mSourceType; EChatType mChatType; EChatAudible mAudible; diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 6bd16c9ee6..2433c14315 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -1285,7 +1285,7 @@ void LLFlatListViewEx::filterItems() } } - rearrangeItems(); + sort(); notifyParentItemsRectChanged(); } diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 0c46edf300..5d26b904b5 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -182,6 +182,11 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask) break; } + notifyParent(LLSD().with("action", "resize") + .with("view_name", mResizingView->getName()) + .with("new_height", new_height) + .with("new_width", new_width)); + scaled_rect.mTop = scaled_rect.mBottom + new_height; scaled_rect.mRight = scaled_rect.mLeft + new_width; mResizingView->setRect(scaled_rect); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 78312eba73..9a07712757 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1582,11 +1582,8 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c start = match.getStart(); end = match.getEnd()+1; - LLStyle::Params link_params = style_params; - link_params.color = match.getColor(); - link_params.readonly_color = match.getColor(); - link_params.font.style("UNDERLINE"); - link_params.link_href = match.getUrl(); + LLStyle::Params link_params(style_params); + link_params.overwriteFrom(match.getStyle()); // output the text before the Url if (start > 0) @@ -1624,26 +1621,20 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c } } - // output the styled Url (unless we've been asked to suppress hyperlinking) - if (match.isLinkDisabled()) - { - appendAndHighlightText(match.getLabel(), prepend_newline, part, style_params); - } - else - { - appendAndHighlightText(match.getLabel(), prepend_newline, part, link_params); + // output the styled Url + appendAndHighlightText(match.getLabel(), prepend_newline, part, link_params); - // set the tooltip for the Url label - if (! match.getTooltip().empty()) - { - segment_set_t::iterator it = getSegIterContaining(getLength()-1); - if (it != mSegments.end()) - { - LLTextSegmentPtr segment = *it; - segment->setToolTip(match.getTooltip()); - } - } + // set the tooltip for the Url label + if (! match.getTooltip().empty()) + { + segment_set_t::iterator it = getSegIterContaining(getLength()-1); + if (it != mSegments.end()) + { + LLTextSegmentPtr segment = *it; + segment->setToolTip(match.getTooltip()); + } } + prepend_newline = false; // move on to the rest of the text after the Url diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 792e34f1e7..866c228a12 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -48,11 +48,8 @@ std::string localize_slapp_label(const std::string& url, const std::string& full_name); -LLUrlEntryBase::LLUrlEntryBase() : - mColor(LLUIColorTable::instance().getColor("HTMLLinkColor")), - mDisabledLink(false) -{ -} +LLUrlEntryBase::LLUrlEntryBase() +{} LLUrlEntryBase::~LLUrlEntryBase() { @@ -69,6 +66,16 @@ std::string LLUrlEntryBase::getIcon(const std::string &url) return mIcon; } +LLStyle::Params LLUrlEntryBase::getStyle() const +{ + LLStyle::Params style_params; + style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + style_params.font.style = "UNDERLINE"; + return style_params; +} + + std::string LLUrlEntryBase::getIDStringFromUrl(const std::string &url) const { // return the id from a SLURL in the format /app/{cmd}/{id}/about @@ -327,7 +334,6 @@ LLUrlEntryAgent::LLUrlEntryAgent() boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_agent.xml"; mIcon = "Generic_Person"; - mColor = LLUIColorTable::instance().getColor("AgentLinkColor"); } // virtual @@ -352,11 +358,8 @@ void LLUrlEntryAgent::callObservers(const std::string &id, void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name) { - std::string label = av_name.mDisplayName; - if (!av_name.mUsername.empty()) - { - label += " (" + av_name.mUsername + ")"; - } + std::string label = av_name.getCompleteName(); + // received the agent name from the server - tell our observers callObservers(id.asString(), label, mIcon); } @@ -421,11 +424,8 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa LLAvatarName av_name; if (LLAvatarNameCache::get(agent_id, &av_name)) { - std::string label = av_name.mDisplayName; - if (!av_name.mUsername.empty()) - { - label += " (" + av_name.mUsername + ")"; - } + std::string label = av_name.getCompleteName(); + // handle suffixes like /mute or /offerteleport label = localize_slapp_label(url, label); return label; @@ -440,6 +440,14 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa } } +LLStyle::Params LLUrlEntryAgent::getStyle() const +{ + LLStyle::Params style_params = LLUrlEntryBase::getStyle(); + style_params.color = LLUIColorTable::instance().getColor("AgentLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("AgentLinkColor"); + return style_params; +} + std::string localize_slapp_label(const std::string& url, const std::string& full_name) { // customize label string based on agent SLapp suffix @@ -479,6 +487,135 @@ std::string LLUrlEntryAgent::getIcon(const std::string &url) } // +// LLUrlEntryAgentName describes a Second Life agent name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) +// +LLUrlEntryAgentName::LLUrlEntryAgentName() +{ +} + +// virtual +void LLUrlEntryAgentName::callObservers(const std::string &id, + const std::string &label, + const std::string &icon) +{ + // notify all callbacks waiting on the given uuid + std::multimap<std::string, LLUrlEntryObserver>::iterator it; + for (it = mObservers.find(id); it != mObservers.end();) + { + // call the callback - give it the new label + LLUrlEntryObserver &observer = it->second; + (*observer.signal)(observer.url, label, icon); + // then remove the signal - we only need to call it once + delete observer.signal; + mObservers.erase(it++); + } +} + +void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id, + const LLAvatarName& av_name) +{ + std::string label = getName(av_name); + // received the agent name from the server - tell our observers + callObservers(id.asString(), label, mIcon); +} + +std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + if (!gCacheName) + { + // probably at the login screen, use short string for layout + return LLTrans::getString("LoadingData"); + } + + std::string agent_id_string = getIDStringFromUrl(url); + if (agent_id_string.empty()) + { + // something went wrong, just give raw url + return unescapeUrl(url); + } + + LLUUID agent_id(agent_id_string); + if (agent_id.isNull()) + { + return LLTrans::getString("AvatarNameNobody"); + } + + LLAvatarName av_name; + if (LLAvatarNameCache::get(agent_id, &av_name)) + { + return getName(av_name); + } + else + { + LLAvatarNameCache::get(agent_id, + boost::bind(&LLUrlEntryAgentCompleteName::onAvatarNameCache, + this, _1, _2)); + addObserver(agent_id_string, url, cb); + return LLTrans::getString("LoadingData"); + } +} + +std::string LLUrlEntryAgentName::getUrl(const std::string &url) const +{ + return LLStringUtil::null; +} + +LLStyle::Params LLUrlEntryAgentName::getStyle() const +{ + return LLStyle::Params(); +} + +// +// LLUrlEntryAgentCompleteName describes a Second Life agent complete name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename +// +LLUrlEntryAgentCompleteName::LLUrlEntryAgentCompleteName() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/completename", + boost::regex::perl|boost::regex::icase); +} + +std::string LLUrlEntryAgentCompleteName::getName(const LLAvatarName& avatar_name) +{ + return avatar_name.getCompleteName(); +} + +// +// LLUrlEntryAgentDisplayName describes a Second Life agent display name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname +// +LLUrlEntryAgentDisplayName::LLUrlEntryAgentDisplayName() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/displayname", + boost::regex::perl|boost::regex::icase); +} + +std::string LLUrlEntryAgentDisplayName::getName(const LLAvatarName& avatar_name) +{ + return avatar_name.mDisplayName; +} + +// +// LLUrlEntryAgentUserName describes a Second Life agent user name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username +// +LLUrlEntryAgentUserName::LLUrlEntryAgentUserName() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/username", + boost::regex::perl|boost::regex::icase); +} + +std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name) +{ + return avatar_name.mUsername.empty() ? avatar_name.getLegacyName() : avatar_name.mUsername; +} + +// // LLUrlEntryGroup Describes a Second Life group Url, e.g., // secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about // secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/inspect @@ -491,7 +628,6 @@ LLUrlEntryGroup::LLUrlEntryGroup() mMenuName = "menu_url_group.xml"; mIcon = "Generic_Group"; mTooltip = LLTrans::getString("TooltipGroupUrl"); - mColor = LLUIColorTable::instance().getColor("GroupLinkColor"); } void LLUrlEntryGroup::onGroupNameReceived(const LLUUID& id, @@ -537,6 +673,15 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa } } +LLStyle::Params LLUrlEntryGroup::getStyle() const +{ + LLStyle::Params style_params = LLUrlEntryBase::getStyle(); + style_params.color = LLUIColorTable::instance().getColor("GroupLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("GroupLinkColor"); + return style_params; +} + + // // LLUrlEntryInventory Describes a Second Life inventory Url, e.g., // secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select @@ -824,7 +969,6 @@ LLUrlEntryNoLink::LLUrlEntryNoLink() { mPattern = boost::regex("<nolink>[^<]*</nolink>", boost::regex::perl|boost::regex::icase); - mDisabledLink = true; } std::string LLUrlEntryNoLink::getUrl(const std::string &url) const @@ -838,6 +982,12 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC return getUrl(url); } +LLStyle::Params LLUrlEntryNoLink::getStyle() const +{ + return LLStyle::Params(); +} + + // // LLUrlEntryIcon describes an icon with <icon>...</icon> tags // @@ -845,7 +995,6 @@ LLUrlEntryIcon::LLUrlEntryIcon() { mPattern = boost::regex("<icon\\s*>\\s*([^<]*)?\\s*</icon\\s*>", boost::regex::perl|boost::regex::icase); - mDisabledLink = true; } std::string LLUrlEntryIcon::getUrl(const std::string &url) const diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 0abf7a603f..cd93d1ac41 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -36,6 +36,7 @@ #include "lluuid.h" #include "lluicolor.h" +#include "llstyle.h" #include <boost/signals2.hpp> #include <boost/regex.hpp> #include <string> @@ -82,8 +83,8 @@ public: /// Return an icon that can be displayed next to Urls of this type virtual std::string getIcon(const std::string &url); - /// Return the color to render the displayed text - LLUIColor getColor() const { return mColor; } + /// Return the style to render the displayed text + virtual LLStyle::Params getStyle() const; /// Given a matched Url, return a tooltip string for the hyperlink virtual std::string getTooltip(const std::string &string) const { return mTooltip; } @@ -94,9 +95,6 @@ public: /// Return the name of a SL location described by this Url, if any virtual std::string getLocation(const std::string &url) const { return ""; } - /// is this a match for a URL that should not be hyperlinked? - bool isLinkDisabled() const { return mDisabledLink; } - protected: std::string getIDStringFromUrl(const std::string &url) const; std::string escapeUrl(const std::string &url) const; @@ -115,9 +113,7 @@ protected: std::string mIcon; std::string mMenuName; std::string mTooltip; - LLUIColor mColor; std::multimap<std::string, LLUrlEntryObserver> mObservers; - bool mDisabledLink; }; /// @@ -173,12 +169,73 @@ public: /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getIcon(const std::string &url); /*virtual*/ std::string getTooltip(const std::string &string) const; + /*virtual*/ LLStyle::Params getStyle() const; +protected: + /*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon); +private: + void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); +}; + +/// +/// LLUrlEntryAgentName Describes a Second Life agent name Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) +/// that displays various forms of user name +/// This is a base class for the various implementations of name display +class LLUrlEntryAgentName : public LLUrlEntryBase +{ +public: + LLUrlEntryAgentName(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ LLStyle::Params getStyle() const; protected: /*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon); + // override this to pull out relevant name fields + virtual std::string getName(const LLAvatarName& avatar_name) = 0; private: void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); }; + +/// +/// LLUrlEntryAgentCompleteName Describes a Second Life agent name Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename +/// that displays the full display name + user name for an avatar +/// such as "James Linden (james.linden)" +class LLUrlEntryAgentCompleteName : public LLUrlEntryAgentName +{ +public: + LLUrlEntryAgentCompleteName(); +private: + /*virtual*/ std::string getName(const LLAvatarName& avatar_name); +}; + +/// +/// LLUrlEntryAgentDisplayName Describes a Second Life agent display name Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname +/// that displays the just the display name for an avatar +/// such as "James Linden" +class LLUrlEntryAgentDisplayName : public LLUrlEntryAgentName +{ +public: + LLUrlEntryAgentDisplayName(); +private: + /*virtual*/ std::string getName(const LLAvatarName& avatar_name); +}; + +/// +/// LLUrlEntryAgentUserName Describes a Second Life agent username Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username +/// that displays the just the display name for an avatar +/// such as "james.linden" +class LLUrlEntryAgentUserName : public LLUrlEntryAgentName +{ +public: + LLUrlEntryAgentUserName(); +private: + /*virtual*/ std::string getName(const LLAvatarName& avatar_name); +}; + /// /// LLUrlEntryGroup Describes a Second Life group Url, e.g., /// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about @@ -188,6 +245,7 @@ class LLUrlEntryGroup : public LLUrlEntryBase public: LLUrlEntryGroup(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ LLStyle::Params getStyle() const; private: void onGroupNameReceived(const LLUUID& id, const std::string& name, bool is_group); }; @@ -297,6 +355,7 @@ public: LLUrlEntryNoLink(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ LLStyle::Params getStyle() const; }; /// diff --git a/indra/llui/llurlmatch.cpp b/indra/llui/llurlmatch.cpp index 72a199c220..51fca6d7c0 100644 --- a/indra/llui/llurlmatch.cpp +++ b/indra/llui/llurlmatch.cpp @@ -42,16 +42,14 @@ LLUrlMatch::LLUrlMatch() : mTooltip(""), mIcon(""), mMenuName(""), - mLocation(""), - mDisabledLink(false) + mLocation("") { } void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std::string &label, const std::string &tooltip, - const std::string &icon, const LLUIColor& color, - const std::string &menu, const std::string &location, - bool disabled_link) + const std::string &icon, const LLStyle::Params& style, + const std::string &menu, const std::string &location) { mStart = start; mEnd = end; @@ -59,8 +57,8 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, mLabel = label; mTooltip = tooltip; mIcon = icon; - mColor = color; + mStyle = style; + mStyle.link_href = url; mMenuName = menu; mLocation = location; - mDisabledLink = disabled_link; } diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h index e86762548b..43bd9da14a 100644 --- a/indra/llui/llurlmatch.h +++ b/indra/llui/llurlmatch.h @@ -38,7 +38,7 @@ #include <string> #include <vector> -#include "lluicolor.h" +#include "llstyle.h" /// /// LLUrlMatch describes a single Url that was matched within a string by @@ -75,7 +75,7 @@ public: std::string getIcon() const { return mIcon; } /// Return the color to render the displayed text - LLUIColor getColor() const { return mColor; } + LLStyle::Params getStyle() const { return mStyle; } /// Return the name of a XUI file containing the context menu items std::string getMenuName() const { return mMenuName; } @@ -83,14 +83,11 @@ public: /// return the SL location that this Url describes, or "" if none. std::string getLocation() const { return mLocation; } - /// is this a match for a URL that should not be hyperlinked? - bool isLinkDisabled() const { return mDisabledLink; } - /// Change the contents of this match object (used by LLUrlRegistry) void setValues(U32 start, U32 end, const std::string &url, const std::string &label, const std::string &tooltip, const std::string &icon, - const LLUIColor& color, const std::string &menu, - const std::string &location, bool disabled_link); + const LLStyle::Params& style, const std::string &menu, + const std::string &location); private: U32 mStart; @@ -101,8 +98,7 @@ private: std::string mIcon; std::string mMenuName; std::string mLocation; - LLUIColor mColor; - bool mDisabledLink; + LLStyle::Params mStyle; }; #endif diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 7a866f44c2..f119233f8f 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -51,6 +51,11 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntrySLURL()); registerUrl(new LLUrlEntryHTTP()); registerUrl(new LLUrlEntryHTTPLabel()); + registerUrl(new LLUrlEntryAgentCompleteName()); + registerUrl(new LLUrlEntryAgentDisplayName()); + registerUrl(new LLUrlEntryAgentUserName()); + // LLUrlEntryAgent*Name must appear before LLUrlEntryAgent since + // LLUrlEntryAgent is a less specific (catchall for agent urls) registerUrl(new LLUrlEntryAgent()); registerUrl(new LLUrlEntryGroup()); registerUrl(new LLUrlEntryParcel()); @@ -185,10 +190,9 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL match_entry->getLabel(url, cb), match_entry->getTooltip(url), match_entry->getIcon(url), - match_entry->getColor(), + match_entry->getStyle(), match_entry->getMenuName(), - match_entry->getLocation(url), - match_entry->isLinkDisabled()); + match_entry->getLocation(url)); return true; } @@ -219,10 +223,9 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr match.getLabel(), match.getTooltip(), match.getIcon(), - match.getColor(), + match.getStyle(), match.getMenuName(), - match.getLocation(), - match.isLinkDisabled()); + match.getLocation()); return true; } return false; diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 7566fd1af7..bc0f5dc9c2 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -84,3 +84,106 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil:: { return std::string(); } + +// +// Stub implementation for LLStyle::Params::Params +// + +LLStyle::Params::Params() +{ +} + +// +// Stub implementations for various LLInitParam classes +// + +namespace LLInitParam +{ + BaseBlock::BaseBlock() {} + BaseBlock::~BaseBlock() {} + Param::Param(BaseBlock* enclosing_block) + : mIsProvided(false) + { + const U8* my_addr = reinterpret_cast<const U8*>(this); + const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); + mEnclosingBlockOffset = (U16)(my_addr - block_addr); + } + void BaseBlock::setLastChangedParam(const Param& last_param, bool user_provided) {} + + void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptor& in_param, const char* char_name){} + param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;} + + void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size) + { + mBlockDescriptor = &descriptor; + descriptor.mCurrentBlockPtr = this; + } + bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack){ return true; } + bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t name_stack, const LLInitParam::BaseBlock* diff_block) const { return true; } + bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack) const { return true; } + bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } + bool BaseBlock::validateBlock(bool emit_errors) const { return true; } + + TypedParam<LLUIColor >::TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, name, value, func, min_count, max_count) + {} + + void TypedParam<LLUIColor>::setValueFromBlock() const + {} + + void TypedParam<LLUIColor>::setBlockFromValue() + {} + + void TypeValues<LLUIColor>::declareValues() + {} + + bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b) + { + return false; + } + + TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const char* _name, const LLFontGL*const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, _name, value, func, min_count, max_count) + {} + + void TypedParam<const LLFontGL*>::setValueFromBlock() const + {} + + void TypedParam<const LLFontGL*>::setBlockFromValue() + {} + + void TypeValues<LLFontGL::HAlign>::declareValues() + {} + + void TypeValues<LLFontGL::VAlign>::declareValues() + {} + + void TypeValues<LLFontGL::ShadowType>::declareValues() + {} + + void TypedParam<LLUIImage*>::setValueFromBlock() const + {} + + void TypedParam<LLUIImage*>::setBlockFromValue() + {} + + + bool ParamCompare<LLUIImage*, false>::equals( + LLUIImage* const &a, + LLUIImage* const &b) + { + return false; + } + + bool ParamCompare<LLUIColor, false>::equals(const LLUIColor &a, const LLUIColor &b) + { + return false; + } + +} + +//static +LLFontGL* LLFontGL::getFontDefault() +{ + return NULL; +} diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index 24a32de268..85318196e0 100644 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -23,11 +23,111 @@ #include "../llurlmatch.h" #include "lltut.h" -// link seam +// link seams + LLUIColor::LLUIColor() : mColorPtr(NULL) {} +LLStyle::Params::Params() +{ +} + +namespace LLInitParam +{ + BaseBlock::BaseBlock() {} + BaseBlock::~BaseBlock() {} + + void BaseBlock::setLastChangedParam(const Param& last_param, bool user_provided) {} + + void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptor& in_param, const char* char_name){} + param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;} + + void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size) + { + mBlockDescriptor = &descriptor; + descriptor.mCurrentBlockPtr = this; + } + + Param::Param(BaseBlock* enclosing_block) + : mIsProvided(false) + { + const U8* my_addr = reinterpret_cast<const U8*>(this); + const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); + mEnclosingBlockOffset = (U16)(my_addr - block_addr); + } + + bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack){ return true; } + bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t name_stack, const LLInitParam::BaseBlock* diff_block) const { return true; } + bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack) const { return true; } + bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } + bool BaseBlock::validateBlock(bool emit_errors) const { return true; } + + TypedParam<LLUIColor >::TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, name, value, func, min_count, max_count) + {} + + void TypedParam<LLUIColor>::setValueFromBlock() const + {} + + void TypedParam<LLUIColor>::setBlockFromValue() + {} + + void TypeValues<LLUIColor>::declareValues() + {} + + bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b) + { + return false; + } + + TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const char* _name, const LLFontGL*const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, _name, value, func, min_count, max_count) + {} + + void TypedParam<const LLFontGL*>::setValueFromBlock() const + {} + + void TypedParam<const LLFontGL*>::setBlockFromValue() + {} + + void TypeValues<LLFontGL::HAlign>::declareValues() + {} + + void TypeValues<LLFontGL::VAlign>::declareValues() + {} + + void TypeValues<LLFontGL::ShadowType>::declareValues() + {} + + void TypedParam<LLUIImage*>::setValueFromBlock() const + {} + + void TypedParam<LLUIImage*>::setBlockFromValue() + {} + + + bool ParamCompare<LLUIImage*, false>::equals( + LLUIImage* const &a, + LLUIImage* const &b) + { + return false; + } + + bool ParamCompare<LLUIColor, false>::equals(const LLUIColor &a, const LLUIColor &b) + { + return false; + } + +} + +//static +LLFontGL* LLFontGL::getFontDefault() +{ + return NULL; +} + + namespace tut { struct LLUrlMatchData @@ -54,7 +154,7 @@ namespace tut LLUrlMatch match; ensure("empty()", match.empty()); - match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLUIColor(), "", "", false); + match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLStyle::Params(), "", ""); ensure("! empty()", ! match.empty()); } @@ -67,7 +167,7 @@ namespace tut LLUrlMatch match; ensure_equals("getStart() == 0", match.getStart(), 0); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure_equals("getStart() == 10", match.getStart(), 10); } @@ -80,7 +180,7 @@ namespace tut LLUrlMatch match; ensure_equals("getEnd() == 0", match.getEnd(), 0); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure_equals("getEnd() == 20", match.getEnd(), 20); } @@ -93,10 +193,10 @@ namespace tut LLUrlMatch match; ensure_equals("getUrl() == ''", match.getUrl(), ""); - match.setValues(10, 20, "http://slurl.com/", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "http://slurl.com/", "", "", "", LLStyle::Params(), "", ""); ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure_equals("getUrl() == '' (2)", match.getUrl(), ""); } @@ -109,10 +209,10 @@ namespace tut LLUrlMatch match; ensure_equals("getLabel() == ''", match.getLabel(), ""); - match.setValues(10, 20, "", "Label", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "Label", "", "", LLStyle::Params(), "", ""); ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure_equals("getLabel() == '' (2)", match.getLabel(), ""); } @@ -125,10 +225,10 @@ namespace tut LLUrlMatch match; ensure_equals("getTooltip() == ''", match.getTooltip(), ""); - match.setValues(10, 20, "", "", "Info", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "Info", "", LLStyle::Params(), "", ""); ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure_equals("getTooltip() == '' (2)", match.getTooltip(), ""); } @@ -141,10 +241,10 @@ namespace tut LLUrlMatch match; ensure_equals("getIcon() == ''", match.getIcon(), ""); - match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "", ""); ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure_equals("getIcon() == '' (2)", match.getIcon(), ""); } @@ -157,10 +257,10 @@ namespace tut LLUrlMatch match; ensure("getMenuName() empty", match.getMenuName().empty()); - match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "", false); + match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", ""); ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure("getMenuName() empty (2)", match.getMenuName().empty()); } @@ -173,10 +273,10 @@ namespace tut LLUrlMatch match; ensure("getLocation() empty", match.getLocation().empty()); - match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "Paris", false); + match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris"); ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", ""); ensure("getLocation() empty (2)", match.getLocation().empty()); } } diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index 2ead5a4a57..8d6aa405e2 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -139,7 +139,7 @@ namespace LLInitParam bool BaseBlock::validateBlock(bool emit_errors) const { - const BlockDescriptor& block_data = getBlockDescriptor(); + const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); for (BlockDescriptor::param_validation_list_t::const_iterator it = block_data.mValidationList.begin(); it != block_data.mValidationList.end(); ++it) { const Param* param = getParamFromHandle(it->first); @@ -159,7 +159,7 @@ namespace LLInitParam { // named param is one like LLView::Params::follows // unnamed param is like LLView::Params::rect - implicit - const BlockDescriptor& block_data = getBlockDescriptor(); + const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin(); it != block_data.mUnnamedParams.end(); @@ -230,7 +230,7 @@ namespace LLInitParam { // named param is one like LLView::Params::follows // unnamed param is like LLView::Params::rect - implicit - const BlockDescriptor& block_data = getBlockDescriptor(); + const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin(); it != block_data.mUnnamedParams.end(); @@ -301,7 +301,7 @@ namespace LLInitParam bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack) { - BlockDescriptor& block_data = getBlockDescriptor(); + BlockDescriptor& block_data = mostDerivedBlockDescriptor(); bool names_left = name_stack.first != name_stack.second; if (names_left) @@ -386,7 +386,7 @@ namespace LLInitParam void BaseBlock::addSynonym(Param& param, const std::string& synonym) { - BlockDescriptor& block_data = getBlockDescriptor(); + BlockDescriptor& block_data = mostDerivedBlockDescriptor(); if (block_data.mInitializationState == BlockDescriptor::INITIALIZING) { param_handle_t handle = getHandleFromParam(¶m); @@ -417,8 +417,8 @@ namespace LLInitParam { if (user_provided) { - mChangeVersion++; - } + mChangeVersion++; + } } const std::string& BaseBlock::getParamName(const BlockDescriptor& block_data, const Param* paramp) const @@ -445,7 +445,7 @@ namespace LLInitParam ParamDescriptor* BaseBlock::findParamDescriptor(param_handle_t handle) { - BlockDescriptor& descriptor = getBlockDescriptor(); + BlockDescriptor& descriptor = mostDerivedBlockDescriptor(); BlockDescriptor::all_params_list_t::iterator end_it = descriptor.mAllParams.end(); for (BlockDescriptor::all_params_list_t::iterator it = descriptor.mAllParams.begin(); it != end_it; @@ -460,7 +460,7 @@ namespace LLInitParam // NOTE: this requires that "other" is of the same derived type as this bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { - bool param_changed = false; + bool some_param_changed = false; BlockDescriptor::all_params_list_t::const_iterator end_it = block_data.mAllParams.end(); for (BlockDescriptor::all_params_list_t::const_iterator it = block_data.mAllParams.begin(); it != end_it; @@ -471,10 +471,10 @@ namespace LLInitParam if (merge_func) { Param* paramp = getParamFromHandle(it->mParamHandle); - param_changed |= merge_func(*paramp, *other_paramp, overwrite); + some_param_changed |= merge_func(*paramp, *other_paramp, overwrite); } } - return param_changed; + return some_param_changed; } bool ParamCompare<LLSD, false>::equals(const LLSD &a, const LLSD &b) diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index c9c1d4af90..3bddd50659 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -477,10 +477,10 @@ namespace LLInitParam bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack); bool serializeBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), const BaseBlock* diff_block = NULL) const; - virtual bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t()) const; + bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t()) const; - const BlockDescriptor& getBlockDescriptor() const { return *mBlockDescriptor; } - BlockDescriptor& getBlockDescriptor() { return *mBlockDescriptor; } + const BlockDescriptor& mostDerivedBlockDescriptor() const { return *mBlockDescriptor; } + BlockDescriptor& mostDerivedBlockDescriptor() { return *mBlockDescriptor; } // take all provided params from other and apply to self bool overwriteFrom(const BaseBlock& other) @@ -507,7 +507,7 @@ namespace LLInitParam BlockDescriptor* mBlockDescriptor; // most derived block descriptor - static BlockDescriptor& blockDescriptor() + static BlockDescriptor& selfBlockDescriptor() { static BlockDescriptor sBlockDescriptor; return sBlockDescriptor; @@ -559,7 +559,7 @@ namespace LLInitParam TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count) : Param(block_descriptor.mCurrentBlockPtr) { - if (block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING) + if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) { ParamDescriptor param_descriptor(block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, @@ -584,6 +584,7 @@ namespace LLInitParam { if (parser.readValue<T>(typed_param.mData.mValue)) { + typed_param.mData.clearKey(); typed_param.setProvided(true); typed_param.enclosingBlock().setLastChangedParam(param, true); return true; @@ -690,7 +691,7 @@ namespace LLInitParam && (overwrite || !dst_typed_param.isProvided())) { dst_typed_param.mData.clearKey(); - dst_typed_param = src_typed_param; + dst_typed_param.set(src_typed_param.get()); return true; } return false; @@ -722,7 +723,7 @@ namespace LLInitParam : Param(block_descriptor.mCurrentBlockPtr), T(value) { - if (block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING) + if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) { ParamDescriptor param_descriptor(block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, @@ -741,6 +742,7 @@ namespace LLInitParam // attempt to parse block... if(typed_param.deserializeBlock(parser, name_stack)) { + typed_param.mData.clearKey(); typed_param.enclosingBlock().setLastChangedParam(param, true); return true; } @@ -856,21 +858,10 @@ namespace LLInitParam { const self_t& src_typed_param = static_cast<const self_t&>(src); self_t& dst_typed_param = static_cast<self_t&>(dst); - if (overwrite) - { - if (dst_typed_param.T::overwriteFrom(src_typed_param)) - { - dst_typed_param.mData.clearKey(); - return true; - } - } - else + if (dst_typed_param.T::merge(selfBlockDescriptor(), src_typed_param, overwrite || !dst_typed_param.isProvided())) { - if (dst_typed_param.T::fillFrom(src_typed_param)) - { - dst_typed_param.mData.clearKey(); - return true; - } + dst_typed_param.mData.clearKey(); + return true; } return false; } @@ -911,7 +902,7 @@ namespace LLInitParam mValues(value) { mCachedKeys.resize(mValues.size()); - if (block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING) + if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) { ParamDescriptor param_descriptor(block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, @@ -1060,9 +1051,9 @@ namespace LLInitParam self_t& dst_typed_param = static_cast<self_t&>(dst); if (src_typed_param.isProvided() - && (overwrite || !isProvided())) + && (overwrite || !dst_typed_param.isProvided())) { - dst_typed_param = src_typed_param; + dst_typed_param.set(src_typed_param.get()); return true; } return false; @@ -1094,7 +1085,7 @@ namespace LLInitParam mLastParamGeneration(0) { mCachedKeys.resize(mValues.size()); - if (block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING) + if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) { ParamDescriptor param_descriptor(block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, @@ -1252,7 +1243,7 @@ namespace LLInitParam if (src_typed_param.isProvided() && (overwrite || !dst_typed_param.isProvided())) { - dst_typed_param = src_typed_param; + dst_typed_param.set(src_typed_param.get()); return true; } return false; @@ -1282,13 +1273,24 @@ namespace LLInitParam // take all provided params from other and apply to self bool overwriteFrom(const self_t& other) { - mCurChoice = other.mCurChoice; - return BaseBlock::merge(blockDescriptor(), other, true); + return merge(selfBlockDescriptor(), other, true); } // take all provided params that are not already provided, and apply to self bool fillFrom(const self_t& other) { + return merge(selfBlockDescriptor(), other, false); + } + + // merge with other block + bool merge(BlockDescriptor& block_data, const self_t& other, bool overwrite) + { + // only merge a choice if we are overwriting with other's contents + if (overwrite) + { + mCurChoice = other.mCurChoice; + return BaseBlock::merge(selfBlockDescriptor(), other, overwrite); + } return false; } @@ -1314,7 +1316,7 @@ namespace LLInitParam Choice() : mCurChoice(0) { - BaseBlock::init(blockDescriptor(), BaseBlock::blockDescriptor(), sizeof(DERIVED_BLOCK)); + BaseBlock::init(selfBlockDescriptor(), BaseBlock::selfBlockDescriptor(), sizeof(DERIVED_BLOCK)); } // Alternatives are mutually exclusive wrt other Alternatives in the same block. @@ -1331,13 +1333,14 @@ namespace LLInitParam typedef typename super_t::value_assignment_t value_assignment_t; explicit Alternative(const char* name, value_assignment_t val = DefaultInitializer<T>::get()) - : super_t(DERIVED_BLOCK::blockDescriptor(), name, val, NULL, 0, 1), + : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1), mOriginalValue(val) { // assign initial choice to first declared option - DERIVED_BLOCK* blockp = ((DERIVED_BLOCK*)DERIVED_BLOCK::blockDescriptor().mCurrentBlockPtr); - if (DERIVED_BLOCK::blockDescriptor().mInitializationState == BlockDescriptor::INITIALIZING - && blockp->mCurChoice == 0) + DERIVED_BLOCK* blockp = ((DERIVED_BLOCK*)DERIVED_BLOCK::selfBlockDescriptor().mCurrentBlockPtr); + if (LL_UNLIKELY( + DERIVED_BLOCK::selfBlockDescriptor().mInitializationState == BlockDescriptor::INITIALIZING + && blockp->mCurChoice == 0)) { blockp->mCurChoice = Param::enclosingBlock().getHandleFromParam(this); } @@ -1382,7 +1385,7 @@ namespace LLInitParam }; protected: - static BlockDescriptor& blockDescriptor() + static BlockDescriptor& selfBlockDescriptor() { static BlockDescriptor sBlockDescriptor; return sBlockDescriptor; @@ -1410,19 +1413,19 @@ namespace LLInitParam // take all provided params from other and apply to self bool overwriteFrom(const self_t& other) { - return BaseBlock::merge(blockDescriptor(), other, true); + return BaseBlock::merge(selfBlockDescriptor(), other, true); } // take all provided params that are not already provided, and apply to self bool fillFrom(const self_t& other) { - return BaseBlock::merge(blockDescriptor(), other, false); + return BaseBlock::merge(selfBlockDescriptor(), other, false); } protected: Block() { //#pragma message("Parsing LLInitParam::Block") - BaseBlock::init(blockDescriptor(), BASE_BLOCK::blockDescriptor(), sizeof(DERIVED_BLOCK)); + BaseBlock::init(selfBlockDescriptor(), BASE_BLOCK::selfBlockDescriptor(), sizeof(DERIVED_BLOCK)); } // @@ -1436,7 +1439,7 @@ namespace LLInitParam typedef typename super_t::value_assignment_t value_assignment_t; explicit Optional(const char* name = "", value_assignment_t val = DefaultInitializer<T>::get()) - : super_t(DERIVED_BLOCK::blockDescriptor(), name, val, NULL, 0, 1) + : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1) { //#pragma message("Parsing LLInitParam::Block::Optional") } @@ -1465,7 +1468,7 @@ namespace LLInitParam // mandatory parameters require a name to be parseable explicit Mandatory(const char* name = "", value_assignment_t val = DefaultInitializer<T>::get()) - : super_t(DERIVED_BLOCK::blockDescriptor(), name, val, &validate, 1, 1) + : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, &validate, 1, 1) {} Mandatory& operator=(value_assignment_t val) @@ -1501,7 +1504,7 @@ namespace LLInitParam typedef typename container_t::const_iterator const_iterator; explicit Multiple(const char* name = "", value_assignment_t val = DefaultInitializer<container_t>::get()) - : super_t(DERIVED_BLOCK::blockDescriptor(), name, val, &validate, RANGE::minCount(), RANGE::maxCount()) + : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, &validate, RANGE::minCount(), RANGE::maxCount()) {} using super_t::operator(); @@ -1529,10 +1532,10 @@ namespace LLInitParam { public: explicit Deprecated(const char* name) - : Param(DERIVED_BLOCK::blockDescriptor().mCurrentBlockPtr) + : Param(DERIVED_BLOCK::selfBlockDescriptor().mCurrentBlockPtr) { - BlockDescriptor& block_descriptor = DERIVED_BLOCK::blockDescriptor(); - if (block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING) + BlockDescriptor& block_descriptor = DERIVED_BLOCK::selfBlockDescriptor(); + if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) { ParamDescriptor param_descriptor(block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), NULL, @@ -1561,7 +1564,7 @@ namespace LLInitParam typedef Deprecated Ignored; protected: - static BlockDescriptor& blockDescriptor() + static BlockDescriptor& selfBlockDescriptor() { static BlockDescriptor sBlockDescriptor; return sBlockDescriptor; @@ -1574,6 +1577,13 @@ namespace LLInitParam public Param { public: + typedef enum e_value_age + { + OLDER_THAN_BLOCK, // mData.mValue needs to be refreshed from the block parameters + NEWER_THAN_BLOCK, // mData.mValue holds the authoritative value (which has been replicated to the block parameters via setBlockFromValue) + SAME_AS_BLOCK // mData.mValue is derived from the block parameters, which are authoritative + } EValueAge; + typedef BlockValue<T> self_t; typedef Block<TypedParam<T, TypeValues<T>, false> > block_t; typedef const T& value_const_ref_t; @@ -1582,9 +1592,9 @@ namespace LLInitParam BlockValue(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count) : Param(block_descriptor.mCurrentBlockPtr), - mData(value) + mData(value, NEWER_THAN_BLOCK) { - if (block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING) + if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) { ParamDescriptor param_descriptor(block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, @@ -1604,7 +1614,7 @@ namespace LLInitParam static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack, S32 generation) { - self_t& typed_param = static_cast<self_t&>(param); + DERIVED& typed_param = static_cast<DERIVED&>(param); // type to apply parse direct value T if (name_stack.first == name_stack.second) { @@ -1612,7 +1622,10 @@ namespace LLInitParam { typed_param.enclosingBlock().setLastChangedParam(param, true); typed_param.setProvided(true); - typed_param.mData.mLastParamVersion = typed_param.BaseBlock::getLastChangeVersion(); + typed_param.mData.clearKey(); + typed_param.mData.mValueAge = NEWER_THAN_BLOCK; + typed_param.setBlockFromValue(); + return true; } @@ -1628,7 +1641,9 @@ namespace LLInitParam typed_param.mData.setKey(name); typed_param.enclosingBlock().setLastChangedParam(param, true); typed_param.setProvided(true); - typed_param.mData.mLastParamVersion = typed_param.BaseBlock::getLastChangeVersion(); + typed_param.mData.mValueAge = NEWER_THAN_BLOCK; + typed_param.setBlockFromValue(); + return true; } } @@ -1703,16 +1718,18 @@ namespace LLInitParam bool isProvided() const { - // either param value provided directly or block is sufficiently filled in + if (!Param::getProvided()) return false; + + // block has an updated parameter // if cached value is stale, regenerate from params - if (Param::getProvided() && mData.mLastParamVersion < BaseBlock::getLastChangeVersion()) + if (mData.mValueAge == OLDER_THAN_BLOCK) { if (block_t::validateBlock(false)) { static_cast<const DERIVED*>(this)->setValueFromBlock(); // clear stale keyword associated with old value mData.clearKey(); - mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); + mData.mValueAge = SAME_AS_BLOCK; return true; } else @@ -1722,8 +1739,11 @@ namespace LLInitParam return false; } } - // either no data provided, or we have a valid value in hand - return Param::getProvided(); + else + { + // we have a valid value in hand + return true; + } } void set(value_assignment_t val, bool flag_as_provided = true) @@ -1731,7 +1751,7 @@ namespace LLInitParam Param::enclosingBlock().setLastChangedParam(*this, flag_as_provided); // set param version number to be up to date, so we ignore block contents - mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); + mData.mValueAge = NEWER_THAN_BLOCK; mData.mValue = val; mData.clearKey(); @@ -1756,6 +1776,8 @@ namespace LLInitParam if (user_provided) { setProvided(true); // some component provided + // a parameter changed, so our value is out of date + mData.mValueAge = OLDER_THAN_BLOCK; } } @@ -1763,54 +1785,54 @@ namespace LLInitParam value_assignment_t get() const { // if some parameters were provided, issue warnings on invalid blocks - if (Param::getProvided() && (mData.mLastParamVersion < BaseBlock::getLastChangeVersion())) + if (Param::getProvided() && (mData.mValueAge == OLDER_THAN_BLOCK)) { // go ahead and issue warnings at this point if any param is invalid if(block_t::validateBlock(true)) { static_cast<const DERIVED*>(this)->setValueFromBlock(); mData.clearKey(); - mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); + mData.mValueAge = SAME_AS_BLOCK; } } return mData.mValue; } - // mutable to allow lazy updates on get + struct Data : public key_cache_t { - Data(const T& value) + Data(const T& value, EValueAge age) : mValue(value), - mLastParamVersion(0) + mValueAge(age) {} - T mValue; - S32 mLastParamVersion; + T mValue; + EValueAge mValueAge; }; + // mutable to allow lazy updates on get mutable Data mData; private: static bool mergeWith(Param& dst, const Param& src, bool overwrite) { - const self_t& src_typed_param = static_cast<const self_t&>(src); - self_t& dst_typed_param = static_cast<self_t&>(dst); + const DERIVED& src_typed_param = static_cast<const DERIVED&>(src); + DERIVED& dst_typed_param = static_cast<DERIVED&>(dst); if (src_typed_param.isProvided() && (overwrite || !dst_typed_param.isProvided())) { - // assign individual parameters - dst_typed_param.BaseBlock::merge(block_t::blockDescriptor(), src_typed_param, overwrite); - - // then copy actual value - dst_typed_param.mData.mValue = src_typed_param.get(); - dst_typed_param.mData.clearKey(); - dst_typed_param.setProvided(true); - - // Propagate value back to block params since the value was updated during this merge. - // This will result in mData.mValue and the block params being in sync. - static_cast<DERIVED&>(dst_typed_param).setBlockFromValue(); + if (src_typed_param.mData.mValueAge == NEWER_THAN_BLOCK) + { + // copy value over + dst_typed_param.set(src_typed_param.get()); + } + else + { + // merge individual parameters into destination + dst_typed_param.merge(block_t::selfBlockDescriptor(), src_typed_param, overwrite); + } return true; } return false; diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 47766a24cb..0cd6e48d14 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -297,11 +297,17 @@ private: // append details to agent string LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent ); + // TODO: Remove this ifdef when the Linux version of llqtwebkit gets updated with the new WOB constant. +#if !LL_LINUX + // Set up window open behavior + LLQtWebKit::getInstance()->setWindowOpenBehavior(mBrowserWindowId, LLQtWebKit::WOB_SIMULATE_BLANK_HREF_CLICK); +#endif + #if !LL_QTWEBKIT_USES_PIXMAPS // don't flip bitmap LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true ); #endif // !LL_QTWEBKIT_USES_PIXMAPS - + // set background color // convert background color channels from [0.0, 1.0] to [0, 255]; LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, int(mBackgroundR * 255.0f), int(mBackgroundG * 255.0f), int(mBackgroundB * 255.0f) ); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6f95e33496..37b5eb24b7 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -91,6 +91,7 @@ set(viewer_SOURCE_FILES llbottomtray.cpp llbox.cpp llbreadcrumbview.cpp + llbuycurrencyhtml.cpp llcallbacklist.cpp llcallfloater.cpp llcallingcard.cpp @@ -159,6 +160,7 @@ set(viewer_SOURCE_FILES llfloaterbuy.cpp llfloaterbuycontents.cpp llfloaterbuycurrency.cpp + llfloaterbuycurrencyhtml.cpp llfloaterbuyland.cpp llfloatercamera.cpp llfloatercolorpicker.cpp @@ -224,6 +226,7 @@ set(viewer_SOURCE_FILES llfollowcam.cpp llfriendcard.cpp llgesturemgr.cpp + llgiveinventory.cpp llglsandbox.cpp llgroupactions.cpp llgroupiconctrl.cpp @@ -606,6 +609,7 @@ set(viewer_HEADER_FILES llbottomtray.h llbox.h llbreadcrumbview.h + llbuycurrencyhtml.h llcallbacklist.h llcallfloater.h llcallingcard.h @@ -676,6 +680,7 @@ set(viewer_HEADER_FILES llfloaterbuy.h llfloaterbuycontents.h llfloaterbuycurrency.h + llfloaterbuycurrencyhtml.h llfloaterbuyland.h llfloatercamera.h llfloatercolorpicker.h @@ -742,6 +747,7 @@ set(viewer_HEADER_FILES llfollowcam.h llfriendcard.h llgesturemgr.h + llgiveinventory.h llgroupactions.h llgroupiconctrl.h llgrouplist.h diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index 3f67a70d7a..d02a13a671 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -4,6 +4,8 @@ <RenderAvatarCloth value="FALSE"/> <!--Default for now--> <RenderAvatarLODFactor value="0.5"/> + <!--Default for now--> + <RenderAvatarMaxVisible value="3"/> <!--NO SHADERS--> <RenderAvatarVP value="FALSE"/> <!--Short Range--> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 02e47ffa40..f79693586a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4591,6 +4591,17 @@ <key>Value</key> <string /> </map> + <key>MarketplaceURL</key> + <map> + <key>Comment</key> + <string>URL to the Marketplace</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>https://www.xstreetsl.com/modules.php?name=Marketplace</string> + </map> <key>MaxDragDistance</key> <map> <key>Comment</key> @@ -6017,6 +6028,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>QuickBuyCurrency</key> + <map> + <key>Comment</key> + <string>Toggle between HTML based currency purchase floater and legacy XUI version</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>RegionTextureSize</key> <map> <key>Comment</key> @@ -8173,17 +8195,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowCameraButton</key> - <map> - <key>Comment</key> - <string>Show/Hide Camera button in the bottom tray</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>ShowScriptErrors</key> <map> <key>Comment</key> @@ -8206,39 +8217,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowSnapshotButton</key> - <map> - <key>Comment</key> - <string>Show/Hide Snapshot button button in the bottom tray</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>ShowMoveButton</key> - <map> - <key>Comment</key> - <string>Show/Hide Move button in the bottom tray</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>ShowGestureButton</key> - <map> - <key>Comment</key> - <string>Show/Hide Gesture button in the bottom tray</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>ShowObjectRenderingCost</key> <map> <key>Comment</key> @@ -8759,6 +8737,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>SidebarWithButtonsVisibility</key> + <map> + <key>Comment</key> + <string>Sets visibility of sidebar with its tabs' buttons</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>SkinCurrent</key> <map> <key>Comment</key> diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 448e20b382..5efd997ab7 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -6623,6 +6623,60 @@ render_pass="bump"> name="head_tattoo"> <texture local_texture="head_tattoo" /> + <param + id="1062" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_head_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1063" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_head_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1064" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_head_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + </layer> @@ -6745,6 +6799,61 @@ render_pass="bump"> name="upper_tattoo"> <texture local_texture="upper_tattoo" /> + + <param + id="1065" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_upper_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1066" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_upper_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1067" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_upper_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + </layer> @@ -7942,6 +8051,61 @@ render_pass="bump"> name="lower_tattoo"> <texture local_texture="lower_tattoo" /> + + <param + id="1068" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_lower_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1069" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_lower_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1070" + group="1" + edit_group="colorpicker_driven" + wearable="tattoo" + name="tattoo_lower_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + </layer> <layer @@ -11367,6 +11531,106 @@ render_pass="bump"> </param_driver> </param> + <param + id="1071" + group="0" + wearable="tattoo" + edit_group="colorpicker" + name="tattoo_red" + value_min="0" + value_max="1" + value_default="1"> + <param_driver> + <driven + id="1062" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1065" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1068" + min1="0" + max1="1" + max2="1" + min2="1" /> + </param_driver> + </param> + + <param + id="1072" + group="0" + wearable="tattoo" + edit_group="colorpicker" + name="tattoo_green" + value_min="0" + value_max="1" + value_default="1"> + <param_driver> + <driven + id="1063" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1066" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1069" + min1="0" + max1="1" + max2="1" + min2="1" /> + </param_driver> + </param> + + <param + id="1073" + group="0" + wearable="tattoo" + edit_group="colorpicker" + name="tattoo_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_driver> + <driven + id="1064" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1067" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1070" + min1="0" + max1="1" + max2="1" + min2="1" /> + + </param_driver> + </param> + </driver_parameters> diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 5f31ccbb19..f1c1a142ad 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -65,6 +65,7 @@ list Low RenderAnisotropic 1 0 RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0.5 +RenderAvatarMaxVisible 1 3 RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0.5 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index 61a8e51c50..d1d11ee173 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -63,6 +63,7 @@ list Low RenderAnisotropic 1 0 RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0.5 +RenderAvatarMaxVisible 1 3 RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0.5 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 12d47a904c..efd7ec7a91 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -65,6 +65,7 @@ list Low RenderAnisotropic 1 0 RenderAvatarCloth 1 0 RenderAvatarLODFactor 1 0.5 +RenderAvatarMaxVisible 1 3 RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0.5 diff --git a/indra/newview/featuretable_solaris.txt b/indra/newview/featuretable_solaris.txt index f24cbde5e2..6edd280686 100644 --- a/indra/newview/featuretable_solaris.txt +++ b/indra/newview/featuretable_solaris.txt @@ -117,6 +117,7 @@ UseOcclusion 0 0 list low RenderVBO 1 0 RenderAniso 1 0 +RenderAvatarMaxVisible 1 3 RenderLighting 1 0 list medium diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 529ce950e4..7d84f8d071 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3088,21 +3088,30 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void * mesgsys->getUUIDFast(_PREHASH_WearableData, _PREHASH_TextureID, texture_id, texture_block); mesgsys->getU8Fast(_PREHASH_WearableData, _PREHASH_TextureIndex, texture_index, texture_block); - if ((S32)texture_index < BAKED_NUM_INDICES - && gAgentQueryManager.mActiveCacheQueries[texture_index] == query_id) - { - if (texture_id.notNull()) - { - //llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl; - gAgentAvatarp->setCachedBakedTexture(LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)texture_index), texture_id); - //gAgentAvatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id ); - gAgentQueryManager.mActiveCacheQueries[texture_index] = 0; - num_results++; - } - else + + if ((S32)texture_index < TEX_NUM_INDICES ) + { + const LLVOAvatarDictionary::TextureEntry *texture_entry = LLVOAvatarDictionary::instance().getTexture((ETextureIndex)texture_index); + if (texture_entry) { - // no cache of this bake. request upload. - gAgentAvatarp->requestLayerSetUpload((EBakedTextureIndex)texture_index); + EBakedTextureIndex baked_index = texture_entry->mBakedTextureIndex; + + if (gAgentQueryManager.mActiveCacheQueries[baked_index] == query_id) + { + if (texture_id.notNull()) + { + //llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl; + gAgentAvatarp->setCachedBakedTexture((ETextureIndex)texture_index, texture_id); + //gAgentAvatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id ); + gAgentQueryManager.mActiveCacheQueries[baked_index] = 0; + num_results++; + } + else + { + // no cache of this bake. request upload. + gAgentAvatarp->requestLayerSetUpload(baked_index); + } + } } } } @@ -3526,7 +3535,6 @@ void LLAgent::sendAgentSetAppearance() return; } - llinfos << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << llendl; //dumpAvatarTEs( "sendAgentSetAppearance()" ); @@ -3577,29 +3585,15 @@ void LLAgent::sendAgentSetAppearance() llinfos << "TAT: Sending cached texture data" << llendl; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); - LLUUID hash; - for (U8 i=0; i < baked_dict->mWearables.size(); i++) - { - // LLWearableType::EType wearable_type = gBakedWearableMap[baked_index][wearable_num]; - const LLWearableType::EType wearable_type = baked_dict->mWearables[i]; - // MULTI-WEARABLE: fixed to 0th - extend to everything once messaging works. - const LLWearable* wearable = gAgentWearables.getWearable(wearable_type,0); - if (wearable) - { - hash ^= wearable->getAssetID(); - } - } + LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index); + if (hash.notNull()) { - hash ^= baked_dict->mWearablesHashID; + ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex) baked_index); + msg->nextBlockFast(_PREHASH_WearableData); + msg->addUUIDFast(_PREHASH_CacheID, hash); + msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); } - - const ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); - - msg->nextBlockFast(_PREHASH_WearableData); - msg->addUUIDFast(_PREHASH_CacheID, hash); - msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); } msg->nextBlockFast(_PREHASH_ObjectData); gAgentAvatarp->sendAppearanceMessage( gMessageSystem ); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 3e73bbef15..6b5e43973e 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -125,7 +125,6 @@ void LLAgentWearables::dump() } } -// MULTI-WEARABLE: debugging struct LLAgentDumper { LLAgentDumper(std::string name): @@ -191,7 +190,7 @@ LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCal * @param todo Bitmask of actions to take on completion. */ LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInventoryCallback( - LLPointer<LLRefCount> cb, S32 type, U32 index, LLWearable* wearable, U32 todo) : + LLPointer<LLRefCount> cb, LLWearableType::EType type, U32 index, LLWearable* wearable, U32 todo) : mType(type), mIndex(index), mWearable(wearable), @@ -240,7 +239,7 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i } } -void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, +void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::EType type, const U32 index, const LLUUID& item_id, LLWearable* wearable) @@ -250,7 +249,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, if (item_id.isNull()) return; - LLUUID old_item_id = getWearableItemID((LLWearableType::EType)type,index); + LLUUID old_item_id = getWearableItemID(type,index); if (wearable) { @@ -259,11 +258,11 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, if (old_item_id.notNull()) { gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); - setWearable((LLWearableType::EType)type,index,wearable); + setWearable(type,index,wearable); } else { - pushWearable((LLWearableType::EType)type,wearable); + pushWearable(type,wearable); } } @@ -285,13 +284,12 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, void LLAgentWearables::sendAgentWearablesUpdate() { - // MULTI-WEARABLE: call i "type" or something. // First make sure that we have inventory items for each wearable for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) { - for (U32 j=0; j < getWearableCount((LLWearableType::EType)type); ++j) + for (U32 index=0; index < getWearableCount((LLWearableType::EType)type); ++index) { - LLWearable* wearable = getWearable((LLWearableType::EType)type,j); + LLWearable* wearable = getWearable((LLWearableType::EType)type,index); if (wearable) { if (wearable->getItemID().isNull()) @@ -299,8 +297,8 @@ void LLAgentWearables::sendAgentWearablesUpdate() LLPointer<LLInventoryCallback> cb = new addWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), - type, - j, + (LLWearableType::EType)type, + index, wearable, addWearableToAgentInventoryCallback::CALL_NONE); addWearableToAgentInventory(cb, wearable); @@ -325,7 +323,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); lldebugs << "sendAgentWearablesUpdate()" << llendl; - // MULTI-WEARABLE: update for multi-wearables after server-side support is in. + // MULTI-WEARABLE: DEPRECATED: HACK: index to 0- server database tables don't support concept of multiwearables. for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) { gMessageSystem->nextBlockFast(_PREHASH_WearableData); @@ -333,7 +331,6 @@ void LLAgentWearables::sendAgentWearablesUpdate() U8 type_u8 = (U8)type; gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8); - // MULTI-WEARABLE: TODO: hacked index to 0, needs to loop over all once messages support this. LLWearable* wearable = getWearable((LLWearableType::EType)type, 0); if (wearable) { @@ -405,7 +402,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 LLPointer<LLInventoryCallback> cb = new addWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), - (S32)type, + type, index, new_wearable, todo); @@ -871,7 +868,7 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return FALSE; } -// MULTI-WEARABLE: update for multiple +// MULTI-WEARABLE: DEPRECATED (see backwards compatibility) // static // ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume // that viewers have a Current Outfit Folder and won't need this message, and thus @@ -909,7 +906,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs //lldebugs << "processAgentInitialWearablesUpdate()" << llendl; // Add wearables - // MULTI-WEARABLE: TODO: update once messages change. Currently use results to populate the zeroth element. + // MULTI-WEARABLE: DEPRECATED: Message only supports one wearable per type, will be ignored in future. gAgentWearables.mItemsAwaitingWearableUpdate.clear(); for (S32 i=0; i < num_wearables; i++) { @@ -939,10 +936,10 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs continue; } - // MULTI-WEARABLE: TODO: update once messages change. Currently use results to populate the zeroth element. + // MULTI-WEARABLE: DEPRECATED: this message only supports one wearable per type. Should be ignored in future versions // Store initial wearables data until we know whether we have the current outfit folder or need to use the data. - LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id); // MULTI-WEARABLE: update + LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id); outfit->add(wearable_data); } @@ -977,7 +974,6 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; LLWearable* new_wearable = LLWearableList::instance().createNewWearable(type); - S32 type_s32 = (S32) type; setWearable(type,index,new_wearable); //new_wearable->writeToAvatar(TRUE); @@ -988,7 +984,7 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, LLPointer<LLInventoryCallback> cb = new addWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), - type_s32, + type, index, new_wearable, addWearableToAgentInventoryCallback::CALL_RECOVERDONE); @@ -1172,158 +1168,6 @@ void LLAgentWearables::createStandardWearablesAllDone() gAgentAvatarp->onFirstTEMessageReceived(); } -// MULTI-WEARABLE: Properly handle multiwearables later. -void LLAgentWearables::getAllWearablesArray(LLDynamicArray<S32>& wearables) -{ - for( S32 i = 0; i < LLWearableType::WT_COUNT; ++i ) - { - if (getWearableCount((LLWearableType::EType) i) != 0) - { - wearables.push_back(i); - } - } -} - -// Note: wearables_to_include should be a list of LLWearableType::EType types -// attachments_to_include should be a list of attachment points -void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, - const LLDynamicArray<S32>& wearables_to_include, - const LLDynamicArray<S32>& attachments_to_include, - BOOL rename_clothing) -{ - if (!isAgentAvatarValid()) return; - - // First, make a folder in the Clothes directory. - LLUUID folder_id = gInventory.createNewCategory( - gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING), - LLFolderType::FT_NONE, - new_folder_name); - - bool found_first_item = false; - - /////////////////// - // Wearables - - if (wearables_to_include.count()) - { - // Then, iterate though each of the wearables and save copies of them in the folder. - S32 i; - S32 count = wearables_to_include.count(); - LLDynamicArray<LLUUID> delete_items; - LLPointer<LLRefCount> cbdone = NULL; - for (i = 0; i < count; ++i) - { - const S32 type = wearables_to_include[i]; - for (U32 j=0; j<getWearableCount((LLWearableType::EType)i); j++) - { - LLWearable* old_wearable = getWearable((LLWearableType::EType)type, j); - if (old_wearable) - { - std::string new_name; - LLWearable* new_wearable; - new_wearable = LLWearableList::instance().createCopy(old_wearable); - if (rename_clothing) - { - new_name = new_folder_name; - new_name.append(" "); - new_name.append(old_wearable->getTypeLabel()); - LLStringUtil::truncate(new_name, DB_INV_ITEM_NAME_STR_LEN); - new_wearable->setName(new_name); - } - - LLViewerInventoryItem* item = gInventory.getItem(getWearableItemID((LLWearableType::EType)type,j)); - S32 todo = addWearableToAgentInventoryCallback::CALL_NONE; - if (!found_first_item) - { - found_first_item = true; - /* set the focus to the first item */ - todo |= addWearableToAgentInventoryCallback::CALL_MAKENEWOUTFITDONE; - /* send the agent wearables update when done */ - cbdone = new sendAgentWearablesUpdateCallback; - } - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - cbdone, - type, - j, - new_wearable, - todo); - llassert(item); - if (item) - { - if (isWearableCopyable((LLWearableType::EType)type, j)) - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - folder_id, - new_name, - cb); - } - else - { - move_inventory_item( - gAgent.getID(), - gAgent.getSessionID(), - item->getUUID(), - folder_id, - new_name, - cb); - } - } - } - } - } - gInventory.notifyObservers(); - } - - - /////////////////// - // Attachments - - if (attachments_to_include.count()) - { - BOOL msg_started = FALSE; - LLMessageSystem* msg = gMessageSystem; - for (S32 i = 0; i < attachments_to_include.count(); i++) - { - S32 attachment_pt = attachments_to_include[i]; - LLViewerJointAttachment* attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, attachment_pt, (LLViewerJointAttachment*)NULL); - if (!attachment) continue; - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { - LLViewerObject *attached_object = (*attachment_iter); - if(!attached_object) continue; - const LLUUID& item_id = (*attachment_iter)->getItemID(); - if(item_id.isNull()) continue; - LLInventoryItem* item = gInventory.getItem(item_id); - if(!item) continue; - if(!msg_started) - { - msg_started = TRUE; - msg->newMessage("CreateNewOutfitAttachments"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("HeaderData"); - msg->addUUID("NewFolderID", folder_id); - } - msg->nextBlock("ObjectData"); - msg->addUUID("OldItemID", item_id); - msg->addUUID("OldFolderID", item->getParentUUID()); - } - } - - if (msg_started) - { - gAgent.sendReliableMessage(); - } - - } -} class LLShowCreatedOutfit: public LLInventoryCallback { @@ -1721,37 +1565,18 @@ void LLAgentWearables::queryWearableCache() S32 num_queries = 0; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); - LLMD5 hash; - bool hash_computed = false; - for (U8 i=0; i < baked_dict->mWearables.size(); i++) + LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index); + if (hash_id.notNull()) { - const LLWearableType::EType baked_type = baked_dict->mWearables[i]; - const U32 num_wearables = getWearableCount(baked_type); - for (U32 index = 0; index < num_wearables; ++index) - { - const LLWearable* wearable = getWearable(baked_type,index); - if (wearable) - { - LLUUID asset_id = wearable->getAssetID(); - hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); - hash_computed = true; - } - } - } - hash.finalize(); - if (hash_computed) - { - LLUUID hash_id; - hash.raw_digest(hash_id.mData); - hash_id ^= baked_dict->mWearablesHashID; num_queries++; // *NOTE: make sure at least one request gets packed + ETextureIndex te_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); + //llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl; gMessageSystem->nextBlockFast(_PREHASH_WearableData); gMessageSystem->addUUIDFast(_PREHASH_ID, hash_id); - gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)baked_index); + gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)te_index); } gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID; @@ -1763,6 +1588,39 @@ void LLAgentWearables::queryWearableCache() gAgentQueryManager.mWearablesCacheQueryID++; } +LLUUID LLAgentWearables::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextureIndex index) +{ + LLUUID hash_id; + bool hash_computed = false; + LLMD5 hash; + + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(index); + + for (U8 i=0; i < baked_dict->mWearables.size(); i++) + { + const LLWearableType::EType baked_type = baked_dict->mWearables[i]; + const U32 num_wearables = getWearableCount(baked_type); + for (U32 index = 0; index < num_wearables; ++index) + { + const LLWearable* wearable = getWearable(baked_type,index); + if (wearable) + { + LLUUID asset_id = wearable->getAssetID(); + hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); + hash_computed = true; + } + } + } + if (hash_computed) + { + hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES); + hash.finalize(); + hash.raw_digest(hash_id.mData); + } + + return hash_id; +} + // User has picked "remove from avatar" from a menu. // static void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) @@ -2010,7 +1868,7 @@ BOOL LLAgentWearables::areWearablesLoaded() const return mWearablesLoaded; } -// MULTI-WEARABLE: update for multiple indices. +// MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate void LLAgentWearables::updateWearablesLoaded() { mWearablesLoaded = (itemUpdatePendingCount()==0); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index def16e4e85..734bd9fd47 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -62,7 +62,6 @@ public: void cleanup(); void dump(); protected: - // MULTI-WEARABLE: assuming one per type. Type is called index - rename. void createStandardWearablesDone(S32 type, U32 index/* = 0*/); void createStandardWearablesAllDone(); @@ -93,7 +92,6 @@ public: const LLWearable* getWearableFromItemID(const LLUUID& item_id) const; LLWearable* getWearableFromAssetID(const LLUUID& asset_id); LLInventoryItem* getWearableInventoryItem(LLWearableType::EType type, U32 index /*= 0*/); - // MULTI-WEARABLE: assuming one per type. static BOOL selfHasWearable(LLWearableType::EType type); LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/); const LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) const; @@ -128,7 +126,7 @@ protected: LLWearable* wearable, const LLUUID& category_id = LLUUID::null, BOOL notify = TRUE); - void addWearabletoAgentInventoryDone(const S32 type, + void addWearabletoAgentInventoryDone(const LLWearableType::EType type, const U32 index, const LLUUID& item_id, LLWearable* wearable); @@ -152,6 +150,8 @@ protected: public: // Processes the initial wearables update message (if necessary, since the outfit folder makes it redundant) static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data); + LLUUID computeBakedTextureHash(LLVOAvatarDefines::EBakedTextureIndex index); + protected: void sendAgentWearablesUpdate(); void sendAgentWearablesRequest(); @@ -163,15 +163,6 @@ protected: // Outfits //-------------------------------------------------------------------- public: - void getAllWearablesArray(LLDynamicArray<S32>& wearables); - - // Note: wearables_to_include should be a list of LLWearableType::EType types - // attachments_to_include should be a list of attachment points - void makeNewOutfit(const std::string& new_folder_name, - const LLDynamicArray<S32>& wearables_to_include, - const LLDynamicArray<S32>& attachments_to_include, - BOOL rename_clothing); - // Should only be called if we *know* we've never done so before, since users may // not want the Library outfits to stay in their quick outfit selector and can delete them. @@ -184,7 +175,6 @@ private: // Save Wearables //-------------------------------------------------------------------- public: - // MULTI-WEARABLE: assumes one per type. void saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, BOOL save_in_lost_and_found); void saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update = TRUE); void saveAllWearables(); @@ -249,7 +239,7 @@ private: class addWearableToAgentInventoryCallback : public LLInventoryCallback { public: - enum EType + enum ETodo { CALL_NONE = 0, CALL_UPDATE = 1, @@ -259,16 +249,14 @@ private: CALL_WEARITEM = 16 }; - // MULTI-WEARABLE: index is an LLWearableType::EType - more confusing usage. - // MULTI-WEARABLE: need to have type and index args both? addWearableToAgentInventoryCallback(LLPointer<LLRefCount> cb, - S32 type, + LLWearableType::EType type, U32 index, LLWearable* wearable, U32 todo = CALL_NONE); virtual void fire(const LLUUID& inv_item); private: - S32 mType; + LLWearableType::EType mType; U32 mIndex; LLWearable* mWearable; U32 mTodo; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4aef72ab0b..dcef86a5fc 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -190,7 +190,9 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item) { - llinfos << "callback fired" << llendl; + LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item); + const std::string item_name = item ? item->getName() : "ITEM NOT FOUND"; + llinfos << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << llendl; mFireCount++; } @@ -890,7 +892,7 @@ void LLAppearanceMgr::filterWearableItems( } // Create links to all listed items. -void LLAppearanceMgr::linkAll(const LLUUID& category, +void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, LLInventoryModel::item_array_t& items, LLPointer<LLInventoryCallback> cb) { @@ -899,11 +901,16 @@ void LLAppearanceMgr::linkAll(const LLUUID& category, const LLInventoryItem* item = items.get(i).get(); link_inventory_item(gAgent.getID(), item->getLinkedUUID(), - category, + cat_uuid, item->getName(), item->LLInventoryItem::getDescription(), LLAssetType::AT_LINK, cb); + + const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid); + const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; + + llinfos << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << llendl; // Seraph remove for 2.1 } } @@ -972,9 +979,13 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) llinfos << "creating LLUpdateAppearanceOnDestroy" << llendl; LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; + llinfos << "Linking body items" << llendl; // Seraph remove for 2.1 linkAll(cof, body_items, link_waiter); + llinfos << "Linking wear items" << llendl; // Seraph remove for 2.1 linkAll(cof, wear_items, link_waiter); + llinfos << "Linking obj items" << llendl; // Seraph remove for 2.1 linkAll(cof, obj_items, link_waiter); + llinfos << "Linking gesture items" << llendl; // Seraph remove for 2.1 linkAll(cof, gest_items, link_waiter); // Add link to outfit if category is an outfit. @@ -1030,8 +1041,7 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo LLWearable* wearable = data.mWearable; if( wearable && ((S32)wearable->getType() == i) ) { - LLViewerInventoryItem* item; - item = (LLViewerInventoryItem*)gInventory.getItem(data.mItemID); + LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(data.mItemID); if( item && (item->getAssetUUID() == wearable->getAssetID()) ) { items.put(item); @@ -1469,16 +1479,23 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update { // Are these links to the same object? const LLViewerInventoryItem* inv_item = item_array.get(i).get(); + const LLWearableType::EType wearable_type = inv_item->getWearableType(); + + const bool is_body_part = (wearable_type == LLWearableType::WT_SHAPE) + || (wearable_type == LLWearableType::WT_HAIR) + || (wearable_type == LLWearableType::WT_EYES) + || (wearable_type == LLWearableType::WT_SKIN); + if (inv_item->getLinkedUUID() == vitem->getLinkedUUID()) { linked_already = true; } - // Are these links to different items of the same wearable + // Are these links to different items of the same body part // type? If so, new item will replace old. - // MULTI-WEARABLES: revisit if more than one per type is allowed. - else if (FALSE/*areMatchingWearables(vitem,inv_item)*/) + // TODO: MULTI-WEARABLE: check for wearable limit for clothing types + else if (is_body_part && (vitem->isWearableType()) && (vitem->getWearableType() == wearable_type)) { - if (inv_item->getIsLinkType()) + if (inv_item->getIsLinkType() && (vitem->getWearableType() == wearable_type)) { gInventory.purgeObject(inv_item->getUUID()); } diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 2f90d652e4..27dcb9f1c7 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -37,7 +37,7 @@ // viewer includes #include "llagent.h" #include "llcompilequeue.h" -#include "llfloaterbuycurrency.h" +#include "llbuycurrencyhtml.h" #include "llfilepicker.h" #include "llinventorydefines.h" #include "llinventoryobserver.h" @@ -186,7 +186,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) S32 price = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); LLStringUtil::format_map_t args; args["AMOUNT"] = llformat("%d", price); - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs", args), price); + LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("uploading_costs", args), price ); } else { diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1d1a127dae..6cef0b5119 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -54,7 +54,9 @@ #include "llfloaterreg.h" #include "llfloaterpay.h" #include "llfloaterworldmap.h" +#include "llgiveinventory.h" #include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType +#include "llinventorypanel.h" #include "llimview.h" // for gIMMgr #include "llmutelist.h" #include "llnotificationsutil.h" // for LLNotificationsUtil @@ -435,13 +437,107 @@ void LLAvatarActions::share(const LLUUID& id) } } +namespace action_give_inventory +{ + typedef std::set<LLUUID> uuid_set_t; + + /** + * Checks My Inventory visibility. + */ + static bool is_give_inventory_acceptable() + { + LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (NULL == active_panel) return false; + + // check selection in the panel + const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + if (inventory_selected_uuids.empty()) return false; // nothing selected + + bool acceptable = false; + uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); + const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + for (; it != it_end; ++it) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + // any category can be offered. + if (inv_cat) + { + acceptable = true; + continue; + } + + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + // check if inventory item can be given + if (LLGiveInventory::isInventoryGiveAcceptable(inv_item)) + { + acceptable = true; + continue; + } + + // there are neither item nor category in inventory + acceptable = false; + break; + } + return acceptable; + } + + /** + * Performs "give inventory" operations for provided avatars. + * + * Sends one requests to give all selected inventory items for each passed avatar. + * Avatars are represent by two vectors: names and UUIDs which must be sychronized with each other. + * + * @param avatar_names - avatar names request to be sent. + * @param avatar_uuids - avatar names request to be sent. + */ + static void give_inventory(const std::vector<std::string>& avatar_names, const uuid_vec_t& avatar_uuids) + { + llassert(avatar_names.size() == avatar_uuids.size()); + + LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (NULL == active_panel) return; + + const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + if (inventory_selected_uuids.empty()) return; + + S32 count = llmin(avatar_names.size(), avatar_uuids.size()); + + // iterate through avatars + for(S32 i = 0; i < count; ++i) + { + const std::string& avatar_name = avatar_names[i]; + const LLUUID& avatar_uuid = avatar_uuids[i]; + + // Start up IM before give the item + const LLUUID session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, avatar_uuid); + + uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); + const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + + // iterate through selected inventory objects + for (; it != it_end; ++it) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + if (inv_cat) + { + LLGiveInventory::doGiveInventoryCategory(avatar_uuid, inv_cat, session_id); + break; + } + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + LLGiveInventory::doGiveInventoryItem(avatar_uuid, inv_item, session_id); + } + } + } +} + //static void LLAvatarActions::shareWithAvatars() { - LLFloaterAvatarPicker* picker = - LLFloaterAvatarPicker::show(NULL, FALSE, TRUE); - picker->setOkBtnEnableCb(boost::lambda::constant(false)); + using namespace action_give_inventory; + LLFloaterAvatarPicker* picker = + LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE); + picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable)); LLNotificationsUtil::add("ShareNotification"); } diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 7f528c88b2..caf43f5ddc 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -35,20 +35,32 @@ #define LLBOTTOMTRAY_CPP #include "llbottomtray.h" -#include "llagentcamera.h" -#include "llchiclet.h" +// library includes #include "llfloaterreg.h" #include "llflyoutbutton.h" -#include "llimfloater.h" // for LLIMFloater #include "lllayoutstack.h" -#include "llnearbychatbar.h" +#include "llnotifications.h" #include "llnotificationsutil.h" +#include "lltexteditor.h" + +// newview includes +#include "llagentcamera.h" +#include "llchiclet.h" +#include "llfloatercamera.h" +#include "llimfloater.h" // for LLIMFloater +#include "llnearbychatbar.h" #include "llspeakbutton.h" #include "llsplitbutton.h" #include "llsyswellwindow.h" -#include "llfloatercamera.h" -#include "lltexteditor.h" -#include "llnotifications.h" +#include "lltoolmgr.h" +#include "llviewerparcelmgr.h" + +static void update_build_button_enable_state() +{ + bool can_edit = LLToolMgr::getInstance()->canEdit(); + + LLBottomTray::getInstance()->childSetEnabled("build_btn", can_edit); +} // Build time optimization, generate extern template once in .cpp file template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance(); @@ -61,7 +73,7 @@ namespace const std::string& PANEL_CAMERA_NAME = "cam_panel"; const std::string& PANEL_GESTURE_NAME = "gesture_panel"; - S32 get_panel_min_width(LLLayoutStack* stack, LLPanel* panel) + S32 get_panel_min_width(LLLayoutStack* stack, LLView* panel) { S32 minimal_width = 0; llassert(stack); @@ -183,6 +195,13 @@ LLBottomTray::~LLBottomTray() { LLIMMgr::getInstance()->removeSessionObserver(this); } + + if (mNearbyChatBar) + { + // store custom width of chatbar panel. + S32 custom_width = mNearbyChatBar->getRect().getWidth(); + gSavedSettings.setS32("ChatBarCustomWidth", custom_width); + } } // *TODO Vadim: why void* ? @@ -361,6 +380,20 @@ S32 LLBottomTray::notifyParent(const LLSD& info) showWellButton("im_well" == chiclet_name ? RS_IM_WELL : RS_NOTIFICATION_WELL, should_be_visible); return 1; } + + if (info.has("action") && info["action"] == "resize") + { + const std::string& name = info["view_name"]; + + // expected only resize of nearby chatbar + if (mNearbyChatBar->getName() != name) return LLPanel::notifyParent(info); + + const S32 new_width = info["new_width"]; + + processChatbarCustomization(new_width); + + return 2; + } return LLPanel::notifyParent(info); } @@ -487,6 +520,8 @@ BOOL LLBottomTray::postBuild() showWellButton(RS_IM_WELL, !LLIMWellWindow::getInstance()->isWindowEmpty()); showWellButton(RS_NOTIFICATION_WELL, !LLNotificationWellWindow::getInstance()->isWindowEmpty()); + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&update_build_button_enable_state)); + return TRUE; } @@ -648,6 +683,24 @@ void LLBottomTray::reshape(S32 width, S32 height, BOOL called_from_parent) if (mNearbyChatBar) log(mNearbyChatBar, "after"); if (mChicletPanel) log(mChicletPanel, "after"); + + + // Restore width of the chatbar on first reshape. + // we can not to do this from postBuild because reshape is called from parent view on startup + // creation after it and reset width according to resize logic. + static bool needs_restore_custom_state = true; + if (mNearbyChatBar && needs_restore_custom_state) + { + // restore custom width of chatbar panel. + S32 new_width = gSavedSettings.getS32("ChatBarCustomWidth"); + if (new_width > 0) + { + processChatbarCustomization(new_width); + mNearbyChatBar->reshape(new_width, mNearbyChatBar->getRect().getHeight()); + } + needs_restore_custom_state = false; + } + } S32 LLBottomTray::processWidthDecreased(S32 delta_width) @@ -1130,6 +1183,7 @@ void LLBottomTray::initResizeStateContainers() mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_MOVEMENT, mMovementPanel)); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_CAMERA, mCamPanel)); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SNAPSHOT, mSnapshotPanel)); + mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SIDEBAR, getChild<LLPanel>("sidebar_btn_panel"))); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_BUILD, getChild<LLPanel>("build_btn_panel"))); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SEARCH, getChild<LLPanel>("search_btn_panel"))); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_WORLD_MAP, getChild<LLPanel>("world_map_btn_panel"))); @@ -1140,6 +1194,7 @@ void LLBottomTray::initResizeStateContainers() mButtonsProcessOrder.push_back(RS_BUTTON_MOVEMENT); mButtonsProcessOrder.push_back(RS_BUTTON_CAMERA); mButtonsProcessOrder.push_back(RS_BUTTON_SNAPSHOT); + mButtonsProcessOrder.push_back(RS_BUTTON_SIDEBAR); mButtonsProcessOrder.push_back(RS_BUTTON_BUILD); mButtonsProcessOrder.push_back(RS_BUTTON_SEARCH); mButtonsProcessOrder.push_back(RS_BUTTON_WORLD_MAP); @@ -1155,6 +1210,7 @@ void LLBottomTray::initResizeStateContainers() { const EResizeState button_type = *it; // is there an appropriate object? + llassert(mStateProcessedObjectMap.count(button_type) > 0); if (0 == mStateProcessedObjectMap.count(button_type)) continue; // set default width for it. @@ -1166,28 +1222,51 @@ void LLBottomTray::initResizeStateContainers() } +// this method must be called before restoring of the chat entry field on startup +// because it resets chatbar's width according to resize logic. void LLBottomTray::initButtonsVisibility() { - // *TODO: move control settings of other buttons here - setTrayButtonVisibleIfPossible(RS_BUTTON_BUILD, gSavedSettings.getBOOL("ShowBuildButton")); - setTrayButtonVisibleIfPossible(RS_BUTTON_SEARCH, gSavedSettings.getBOOL("ShowSearchButton")); - setTrayButtonVisibleIfPossible(RS_BUTTON_WORLD_MAP, gSavedSettings.getBOOL("ShowWorldMapButton")); - setTrayButtonVisibleIfPossible(RS_BUTTON_MINI_MAP, gSavedSettings.getBOOL("ShowMiniMapButton")); + setVisibleAndFitWidths(RS_BUTTON_GESTURES, gSavedSettings.getBOOL("ShowGestureButton")); + setVisibleAndFitWidths(RS_BUTTON_MOVEMENT, gSavedSettings.getBOOL("ShowMoveButton")); + setVisibleAndFitWidths(RS_BUTTON_CAMERA, gSavedSettings.getBOOL("ShowCameraButton")); + setVisibleAndFitWidths(RS_BUTTON_SNAPSHOT, gSavedSettings.getBOOL("ShowSnapshotButton")); + setVisibleAndFitWidths(RS_BUTTON_SIDEBAR, gSavedSettings.getBOOL("ShowSidebarButton")); + setVisibleAndFitWidths(RS_BUTTON_BUILD, gSavedSettings.getBOOL("ShowBuildButton")); + setVisibleAndFitWidths(RS_BUTTON_SEARCH, gSavedSettings.getBOOL("ShowSearchButton")); + setVisibleAndFitWidths(RS_BUTTON_WORLD_MAP, gSavedSettings.getBOOL("ShowWorldMapButton")); + setVisibleAndFitWidths(RS_BUTTON_MINI_MAP, gSavedSettings.getBOOL("ShowMiniMapButton")); } void LLBottomTray::setButtonsControlsAndListeners() { - // *TODO: move control settings of other buttons here + gSavedSettings.declareBOOL("ShowGestureButton", TRUE, "Shows/Hides Gesture button in the bottom tray. (Declared in code)"); + gSavedSettings.declareBOOL("ShowMoveButton", TRUE, "Shows/Hides Move button in the bottom tray. (Declared in code)"); + gSavedSettings.declareBOOL("ShowSnapshotButton", TRUE, "Shows/Hides Snapshot button button in the bottom tray. (Declared in code)"); + gSavedSettings.declareBOOL("ShowCameraButton", TRUE, "Show/Hide View button in the bottom tray. (Declared in code)"); + gSavedSettings.declareBOOL("ShowSidebarButton", TRUE, "Shows/hides Sidebar button in the bottom tray. (Declared in code)"); gSavedSettings.declareBOOL("ShowBuildButton", TRUE, "Shows/Hides Build button in the bottom tray. (Declared in code)"); gSavedSettings.declareBOOL("ShowSearchButton", TRUE, "Shows/Hides Search button in the bottom tray. (Declared in code)"); gSavedSettings.declareBOOL("ShowWorldMapButton", TRUE, "Shows/Hides Map button in the bottom tray. (Declared in code)"); gSavedSettings.declareBOOL("ShowMiniMapButton", TRUE, "Shows/Hides Mini-Map button in the bottom tray. (Declared in code)"); + gSavedSettings.declareS32("ChatBarCustomWidth", 0, "Stores customized width of chat bar. (Declared in code)"); + gSavedSettings.getControl("ShowGestureButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_GESTURES, _2)); + gSavedSettings.getControl("ShowMoveButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_MOVEMENT, _2)); + gSavedSettings.getControl("ShowCameraButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_CAMERA, _2)); + gSavedSettings.getControl("ShowSnapshotButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SNAPSHOT, _2)); + gSavedSettings.getControl("ShowSidebarButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SIDEBAR, _2)); gSavedSettings.getControl("ShowBuildButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_BUILD, _2)); gSavedSettings.getControl("ShowSearchButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SEARCH, _2)); gSavedSettings.getControl("ShowWorldMapButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_WORLD_MAP, _2)); gSavedSettings.getControl("ShowMiniMapButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_MINI_MAP, _2)); + + + LLButton* build_btn = getChild<LLButton>("build_btn"); + // set control name for Build button. It is not enough to link it with Button.SetFloaterToggle in xml + std::string vis_control_name = LLFloaterReg::declareVisibilityControl("build"); + // Set the button control value (toggle state) to the floater visibility control (Sets the value as well) + build_btn->setControlVariable(LLUI::sSettingGroups["floater"]->getControl(vis_control_name)); } bool LLBottomTray::toggleShowButton(LLBottomTray::EResizeState button_type, const LLSD& new_visibility) @@ -1262,17 +1341,18 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible const S32 chatbar_shrunk_width = mNearbyChatBar->getRect().getWidth() - get_panel_min_width(mToolbarStack, mNearbyChatBar); - const S32 sum_of_min_widths = - get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_CAMERA]) + - get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + - get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + - get_panel_min_width(mToolbarStack, mSpeakPanel); + S32 sum_of_min_widths = get_panel_min_width(mToolbarStack, mSpeakPanel); + S32 sum_of_curr_widths = get_curr_width(mSpeakPanel); + + resize_state_vec_t::const_iterator it = mButtonsProcessOrder.begin(); + const resize_state_vec_t::const_iterator it_end = mButtonsProcessOrder.end(); - const S32 sum_of_curr_widths = - get_curr_width(mStateProcessedObjectMap[RS_BUTTON_CAMERA]) + - get_curr_width(mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + - get_curr_width(mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + - get_curr_width(mSpeakPanel); + for (; it != it_end; ++it) + { + LLPanel * cur_panel = mStateProcessedObjectMap[*it]; + sum_of_min_widths += get_panel_min_width(mToolbarStack, cur_panel); + sum_of_curr_widths += get_curr_width(cur_panel); + } const S32 possible_shrunk_width = chatbar_shrunk_width + (sum_of_curr_widths - sum_of_min_widths); @@ -1352,4 +1432,34 @@ void LLBottomTray::showWellButton(EResizeState object_type, bool visible) } } +void LLBottomTray::processChatbarCustomization(S32 new_width) +{ + if (NULL == mNearbyChatBar) return; + + const S32 delta_width = mNearbyChatBar->getRect().getWidth() - new_width; + + if (delta_width == 0) return; + + LLView * chiclet_layout_panel = mChicletPanel->getParent(); + const S32 chiclet_min_width = get_panel_min_width(mToolbarStack, chiclet_layout_panel); + const S32 chiclet_panel_width = chiclet_layout_panel->getRect().getWidth(); + const S32 available_chiclet_shrink_width = chiclet_panel_width - chiclet_min_width; + llassert(available_chiclet_shrink_width >= 0); + + if (delta_width > 0) // panel gets narrowly + { + S32 total_possible_width = delta_width + available_chiclet_shrink_width; + processShowButtons(total_possible_width); + processExtendButtons(total_possible_width); + } + // here (delta_width < 0) // panel gets wider + else //if (-delta_width > available_chiclet_shrink_width) + { + S32 required_width = delta_width + available_chiclet_shrink_width; + S32 buttons_freed_width = 0; + processShrinkButtons(required_width, buttons_freed_width); + processHideButtons(required_width, buttons_freed_width); + } +} + //EOF diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 5588aefb42..889dc42097 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -124,6 +124,7 @@ private: , RS_BUTTON_SEARCH = 0x0400 , RS_BUTTON_WORLD_MAP = 0x0800 , RS_BUTTON_MINI_MAP = 0x1000 + , RS_BUTTON_SIDEBAR = 0x2000 /* Once new button that can be hidden on resize is added don't forget to update related places: @@ -138,6 +139,7 @@ private: */ , RS_BUTTONS_CAN_BE_HIDDEN = RS_BUTTON_SNAPSHOT | RS_BUTTON_CAMERA | RS_BUTTON_MOVEMENT | RS_BUTTON_GESTURES | RS_BUTTON_BUILD | RS_BUTTON_SEARCH | RS_BUTTON_WORLD_MAP | RS_BUTTON_MINI_MAP + | RS_BUTTON_SIDEBAR }EResizeState; /** @@ -341,6 +343,17 @@ private: */ void showWellButton(EResizeState object_type, bool visible); + /** + * Handles a customization of chatbar width. + * + * When chatbar gets wider layout stack will reduce chiclet panel (it is auto-resizable) + * But once chiclet panel reaches its minimal width Stack will force to reduce buttons width. + * including Speak button. The similar behavior is when chatbar gets narrowly. + * This methods force resize behavior to resize buttons properly in these cases. + */ + void processChatbarCustomization(S32 new_width); + + MASK mResizeState; typedef std::map<EResizeState, LLPanel*> state_object_map_t; diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp new file mode 100644 index 0000000000..163829a1ea --- /dev/null +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -0,0 +1,165 @@ +/** + * @file llbuycurrencyhtml.cpp + * @brief Manages Buy Currency HTML floater + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2006-2010, 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 "llfloaterbuycurrency.h" +#include "llbuycurrencyhtml.h" +#include "llfloaterbuycurrencyhtml.h" + +#include "llfloaterreg.h" +#include "llcommandhandler.h" +#include "llviewercontrol.h" + +// support for secondlife:///app/buycurrencyhtml/{ACTION}/{NEXT_ACTION}/{RETURN_CODE} SLapps +class LLBuyCurrencyHTMLHandler : + public LLCommandHandler +{ +public: + // requests will be throttled from a non-trusted browser + LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_ALLOW ) {} + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + std::string action( "" ); + if ( params.size() >= 1 ) + { + action = params[ 0 ].asString(); + }; + + std::string next_action( "" ); + if ( params.size() >= 2 ) + { + next_action = params[ 1 ].asString(); + }; + + int result_code = 0; + if ( params.size() >= 3 ) + { + result_code = params[ 2 ].asInteger(); + }; + + // open the legacy XUI based currency floater + if ( "open_legacy" == next_action ) + { + LLFloaterBuyCurrency::buyCurrency(); + }; + + // ask the Buy Currency floater to close + // note: this is the last thing we can do so make + // sure any other actions are processed before this. + if ( "close" == action ) + { + LLBuyCurrencyHTML::closeDialog(); + }; + + return true; + }; +}; +LLBuyCurrencyHTMLHandler gBuyCurrencyHTMLHandler; + +//////////////////////////////////////////////////////////////////////////////// +// static +// Opens the legacy XUI based floater or new HTML based one based on +// the QuickBuyCurrency value in settings.xml - this overload is for +// the case where the amount is not requested. +void LLBuyCurrencyHTML::openCurrencyFloater() +{ + if ( gSavedSettings.getBOOL( "QuickBuyCurrency" ) ) + { + // HTML version + LLBuyCurrencyHTML::showDialog( false, "", 0 ); + } + else + { + // legacy version + LLFloaterBuyCurrency::buyCurrency(); + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// static +// Opens the legacy XUI based floater or new HTML based one based on +// the QuickBuyCurrency value in settings.xml - this overload is for +// the case where the amount and a string to display are requested. +void LLBuyCurrencyHTML::openCurrencyFloater( const std::string& message, S32 sum ) +{ + if ( gSavedSettings.getBOOL( "QuickBuyCurrency" ) ) + { + // HTML version + LLBuyCurrencyHTML::showDialog( true, message, sum ); + } + else + { + // legacy version + LLFloaterBuyCurrency::buyCurrency( message, sum ); + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// static +void LLBuyCurrencyHTML::showDialog( bool specific_sum_requested, const std::string& message, S32 sum ) +{ + LLFloaterBuyCurrencyHTML* buy_currency_floater = dynamic_cast< LLFloaterBuyCurrencyHTML* >( LLFloaterReg::getInstance( "buy_currency_html" ) ); + if ( buy_currency_floater ) + { + // pass on flag indicating if we want to buy specific amount and if so, how much + buy_currency_floater->setParams( specific_sum_requested, message, sum ); + + // force navigate to new URL + buy_currency_floater->navigateToFinalURL(); + + // make it visible and raise to front + BOOL visible = TRUE; + buy_currency_floater->setVisible( visible ); + BOOL take_focus = TRUE; + buy_currency_floater->setFrontmost( take_focus ); + + // spec calls for floater to be centered on client window + buy_currency_floater->center(); + } + else + { + llwarns << "Buy Currency (HTML) Floater not found" << llendl; + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// +void LLBuyCurrencyHTML::closeDialog() +{ + LLFloaterBuyCurrencyHTML* buy_currency_floater = dynamic_cast< LLFloaterBuyCurrencyHTML* >(LLFloaterReg::getInstance( "buy_currency_html" ) ); + if ( buy_currency_floater ) + { + buy_currency_floater->closeFloater(); + }; +} diff --git a/indra/newview/llbuycurrencyhtml.h b/indra/newview/llbuycurrencyhtml.h new file mode 100644 index 0000000000..3435bb0451 --- /dev/null +++ b/indra/newview/llbuycurrencyhtml.h @@ -0,0 +1,57 @@ +/** + * @file llbuycurrencyhtml.h + * @brief Manages Buy Currency HTML floater + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2006-2010, 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 LL_LLBUYCURRENCYHTML_H +#define LL_LLBUYCURRENCYHTML_H + +#include "llsingleton.h" + +class LLFloaterBuyCurrencyHTML; + +class LLBuyCurrencyHTML +{ + public: + // choke point for opening a legacy or new currency floater - this overload is when the L$ sum is not required + static void openCurrencyFloater(); + + // choke point for opening a legacy or new currency floater - this overload is when the L$ sum is required + static void openCurrencyFloater( const std::string& message, S32 sum ); + + // show and give focus to actual currency floater - this is used for both cases + // where the sum is required and where it is not + static void showDialog( bool specific_sum_requested, const std::string& message, S32 sum ); + + // close (and destroy) the currency floater + static void closeDialog(); +}; + +#endif // LL_LLBUYCURRENCYHTML_H diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a196b4c750..d3686ab99c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -686,7 +686,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // for object IMs, create a secondlife:///app/objectim SLapp std::string url = LLSLURL("objectim", chat.mFromID, "").getSLURLString(); url += "?name=" + chat.mFromName; - url += "&owner=" + args["owner_id"].asString(); + url += "&owner=" + chat.mOwnerID.asString(); std::string slurl = args["slurl"].asString(); if (slurl.empty()) diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 8d4430a9ea..7c4ceb3458 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -49,18 +49,6 @@ const LLSD REARRANGE = LLSD().with("rearrange", LLSD()); static const LLWearableItemNameComparator WEARABLE_NAME_COMPARATOR; -bool LLWearableItemNameComparator::doCompare(const LLPanelWearableListItem* wearable_item1, const LLPanelWearableListItem* wearable_item2) const -{ - std::string name1 = wearable_item1->getItemName(); - std::string name2 = wearable_item2->getItemName(); - - LLStringUtil::toUpper(name1); - LLStringUtil::toUpper(name2); - - return name1 < name2; -} - - LLCOFWearables::LLCOFWearables() : LLPanel(), mAttachments(NULL), mClothing(NULL), diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 612bb103d2..583ee96247 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -33,59 +33,16 @@ #ifndef LL_LLCOFWEARABLES_H #define LL_LLCOFWEARABLES_H +// llui +#include "llflatlistview.h" #include "llpanel.h" -#include "llinventorymodel.h" -#include "llappearancemgr.h" -#include "llwearableitemslist.h" - -class LLFlatListView; - - -/** Abstract comparator of wearable list items */ -class LLWearableListItemComparator : public LLFlatListView::ItemComparator -{ - LOG_CLASS(LLWearableListItemComparator); - -public: - LLWearableListItemComparator() {}; - virtual ~LLWearableListItemComparator() {}; - - virtual bool compare(const LLPanel* item1, const LLPanel* item2) const - { - const LLPanelWearableListItem* wearable_item1 = dynamic_cast<const LLPanelWearableListItem*>(item1); - const LLPanelWearableListItem* wearable_item2 = dynamic_cast<const LLPanelWearableListItem*>(item2); - - if (!wearable_item1 || !wearable_item2) - { - llwarning("item1 and item2 cannot be null", 0); - return true; - } - - return doCompare(wearable_item1, wearable_item2); - } -protected: - - /** - * Returns true if wearable_item1 < wearable_item2, false otherwise - * Implement this method in your particular comparator. - */ - virtual bool doCompare(const LLPanelWearableListItem* wearable_item1, const LLPanelWearableListItem* wearable_item2) const = 0; -}; - - -class LLWearableItemNameComparator : public LLWearableListItemComparator -{ - LOG_CLASS(LLWearableItemNameComparator); - -public: - LLWearableItemNameComparator() {}; - virtual ~LLWearableItemNameComparator() {}; - -protected: - virtual bool doCompare(const LLPanelWearableListItem* wearable_item1, const LLPanelWearableListItem* wearable_item2) const; -}; +#include "llappearancemgr.h" +#include "llinventorymodel.h" +class LLPanelClothingListItem; +class LLPanelBodyPartsListItem; +class LLPanelDeletableWearableListItem; /** * Adaptor between LLAccordionCtrlTab and LLFlatListView to facilitate communication between them diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 1a5d55d793..1571415e63 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -113,9 +113,12 @@ void LLDrawPoolTree::render(S32 pass) iter != mDrawFace.end(); iter++) { LLFace *face = *iter; - face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); - face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0); - gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices()); + if(face->mVertexBuffer.notNull()) + { + face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); + face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0); + gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices()); + } } } } @@ -333,7 +336,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting) S32 stop_depth = 0; F32 app_angle = treep->getAppAngle()*LLVOTree::sTreeFactor; F32 alpha = 1.0; - S32 trunk_LOD = 0; + S32 trunk_LOD = LLVOTree::sMAX_NUM_TREE_LOD_LEVELS; for (S32 j = 0; j < 4; j++) { @@ -344,6 +347,10 @@ void LLDrawPoolTree::renderTree(BOOL selecting) break; } } + if(trunk_LOD >= LLVOTree::sMAX_NUM_TREE_LOD_LEVELS) + { + continue ; //do not render. + } if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD)) { diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index a1336815f7..e0e5b32299 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1376,9 +1376,18 @@ F32 LLFace::getTextureVirtualSize() texel_area = 1.f; } - //apply texel area to face area to get accurate ratio - //face_area /= llclamp(texel_area, 1.f/64.f, 16.f); - F32 face_area = mPixelArea / llclamp(texel_area, 0.015625f, 128.f); + F32 face_area; + if (mVObjp->isSculpted() && texel_area > 1.f) + { + //sculpts can break assumptions about texel area + face_area = mPixelArea; + } + else + { + //apply texel area to face area to get accurate ratio + //face_area /= llclamp(texel_area, 1.f/64.f, 16.f); + face_area = mPixelArea / llclamp(texel_area, 0.015625f, 128.f); + } if(face_area > LLViewerTexture::sMaxSmallImageSize) { diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp index 01d3c3f22e..fd99f673e0 100644 --- a/indra/newview/llfilteredwearablelist.cpp +++ b/indra/newview/llfilteredwearablelist.cpp @@ -37,23 +37,21 @@ #include "llinventoryitemslist.h" #include "llinventorymodel.h" -class LLFindItemsByMask : public LLInventoryCollectFunctor +class LLFindNonLinksByMask : public LLInventoryCollectFunctor { public: - LLFindItemsByMask(U64 mask) + LLFindNonLinksByMask(U64 mask) : mFilterMask(mask) {} virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) { - if(item) + if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) ) { - if( mFilterMask & (1LL << item->getInventoryType()) ) - { - return TRUE; - } + return true; } - return FALSE; + + return false; } private: @@ -96,7 +94,7 @@ void LLFilteredWearableListManager::populateList() { LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; - LLFindItemsByMask collector(mFilterMask); + LLFindNonLinksByMask collector(mFilterMask); gInventory.collectDescendentsIf( gInventory.getRootFolderID(), diff --git a/indra/newview/llfilteredwearablelist.h b/indra/newview/llfilteredwearablelist.h index 3f42833bb4..0780c02442 100644 --- a/indra/newview/llfilteredwearablelist.h +++ b/indra/newview/llfilteredwearablelist.h @@ -36,7 +36,7 @@ class LLInventoryItemsList; -// Class that fills LLInventoryItemsList with filtered data. +// Class that fills LLInventoryItemsList with filtered data (original items only (non-links)). class LLFilteredWearableListManager : public LLInventoryObserver { LOG_CLASS(LLFilteredWearableListManager); diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index e0346222c0..16a8f244ee 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -322,6 +322,18 @@ void LLFloaterAvatarPicker::populateFriend() void LLFloaterAvatarPicker::draw() { + // sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars). + // lets check this via mOkButtonValidateSignal callback periodically. + static LLFrameTimer timer; + if (timer.hasExpired()) + { + timer.setTimerExpirySec(0.33f); // three times per second should be enough. + + // simulate list changes. + onList(); + timer.start(); + } + LLFloater::draw(); if (!mNearMeListComplete && childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("NearMePanel")) { diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp new file mode 100644 index 0000000000..5815df36d1 --- /dev/null +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -0,0 +1,119 @@ +/** + * @file llfloaterbuycurrencyhtml.cpp + * @brief buy currency implemented in HTML floater - uses embedded media browser control + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2006-2010, 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 "llfloaterbuycurrencyhtml.h" +#include "llstatusbar.h" + +//////////////////////////////////////////////////////////////////////////////// +// +LLFloaterBuyCurrencyHTML::LLFloaterBuyCurrencyHTML( const LLSD& key ): + LLFloater( key ), + mSpecificSumRequested( false ), + mMessage( "" ), + mSum( 0 ) +{ +} + +//////////////////////////////////////////////////////////////////////////////// +// +BOOL LLFloaterBuyCurrencyHTML::postBuild() +{ + // observer media events + mBrowser = getChild<LLMediaCtrl>( "browser" ); + mBrowser->addObserver( this ); + + return TRUE; +} + +//////////////////////////////////////////////////////////////////////////////// +// +void LLFloaterBuyCurrencyHTML::navigateToFinalURL() +{ + // URL for actual currency buy contents is in XUI file + std::string buy_currency_url = getString( "buy_currency_url" ); + + // replace [LANGUAGE] meta-tag with view language + LLStringUtil::format_map_t replace; + + // viewer language + replace[ "[LANGUAGE]" ] = LLUI::getLanguage(); + + // flag that specific amount requested + replace[ "[SPECIFIC_AMOUNT]" ] = ( mSpecificSumRequested ? "y":"n" ); + + // amount requested + std::ostringstream codec( "" ); + codec << mSum; + replace[ "[SUM]" ] = codec.str(); + + // users' current balance + codec.clear(); + codec.str( "" ); + codec << gStatusBar->getBalance(); + replace[ "[BAL]" ] = codec.str(); + + // message - "This cost L$x,xxx for example + replace[ "[MSG]" ] = LLURI::escape( mMessage ); + LLStringUtil::format( buy_currency_url, replace ); + + // kick off the navigation + mBrowser->navigateTo( buy_currency_url ); +} + +//////////////////////////////////////////////////////////////////////////////// +// +void LLFloaterBuyCurrencyHTML::handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event ) +{ + // placeholder for now - just in case we want to catch media events + if ( LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE == event ) + { + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// +void LLFloaterBuyCurrencyHTML::onClose( bool app_quitting ) +{ + destroy(); +} + +//////////////////////////////////////////////////////////////////////////////// +// +void LLFloaterBuyCurrencyHTML::setParams( bool specific_sum_requested, const std::string& message, S32 sum ) +{ + // save these away - used to construct URL later + mSpecificSumRequested = specific_sum_requested; + mMessage = message; + mSum = sum; +} diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h new file mode 100644 index 0000000000..be7a4d3dd6 --- /dev/null +++ b/indra/newview/llfloaterbuycurrencyhtml.h @@ -0,0 +1,65 @@ +/** + * @file llfloaterbuycurrencyhtml.h + * @brief buy currency implemented in HTML floater - uses embedded media browser control + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2006-2010, 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 LL_LLFLOATERBUYCURRENCYHTML_H +#define LL_LLFLOATERBUYCURRENCYHTML_H + +#include "llfloater.h" +#include "llmediactrl.h" + +class LLFloaterBuyCurrencyHTML : + public LLFloater, + public LLViewerMediaObserver +{ + public: + LLFloaterBuyCurrencyHTML( const LLSD& key ); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onClose( bool app_quitting ); + + // inherited from LLViewerMediaObserver + /*virtual*/ void handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event ); + + // allow our controlling parent to tell us paramters + void setParams( bool specific_sum_requested, const std::string& message, S32 sum ); + + // parse and construct URL and set browser to navigate there. + void navigateToFinalURL(); + + private: + LLMediaCtrl* mBrowser; + bool mSpecificSumRequested; + std::string mMessage; + S32 mSum; +}; + +#endif // LL_LLFLOATERBUYCURRENCYHTML_H diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp index d2ee3e44c5..930bbe9e6b 100644 --- a/indra/newview/llfloaterhud.cpp +++ b/indra/newview/llfloaterhud.cpp @@ -79,9 +79,6 @@ BOOL LLFloaterHUD::postBuild() mWebBrowser = getChild<LLMediaCtrl>("floater_hud_browser" ); if (mWebBrowser) { - // Open links in internal browser - mWebBrowser->setOpenInExternalBrowser(false); - // This is a "chrome" floater, so we don't want anything to // take focus (as the user needs to be able to walk with // arrow keys during tutorial). diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d0a15450a0..81dea58607 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -648,9 +648,12 @@ void LLPanelLandGeneral::refresh() } // Display claim date - // *TODO:Localize (Time format may need Translating) time_t claim_date = parcel->getClaimDate(); - mTextClaimDate->setText(formatted_time(claim_date)); + std::string claim_date_str = getString("time_stamp_template"); + LLSD substitution; + substitution["datetime"] = (S32) claim_date; + LLStringUtil::format (claim_date_str, substitution); + mTextClaimDate->setText(claim_date_str); mTextClaimDate->setEnabled(is_leased); BOOL enable_auction = (gAgent.getGodLevel() >= GOD_LIAISON) diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index b744bff084..105d7f9201 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -184,7 +184,7 @@ BOOL LLFloaterNotificationConsole::postBuild() addChannel("Ignore"); addChannel("Visible", true); // all the ones below attach to the Visible channel - addChannel("History"); + addChannel("Persistent"); addChannel("Alerts"); addChannel("AlertModal"); addChannel("Group Notifications"); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index d8d7057c4e..a42f6ee00f 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -237,6 +237,7 @@ BOOL LLFloaterTools::postBuild() childSetValue("checkbox stretch textures",(BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); mTextGridMode = getChild<LLTextBox>("text ruler mode"); mComboGridMode = getChild<LLComboBox>("combobox grid mode"); + mCheckStretchUniformLabel = getChild<LLTextBox>("checkbox uniform label"); // // Create Buttons @@ -316,6 +317,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mComboGridMode(NULL), mCheckStretchUniform(NULL), mCheckStretchTexture(NULL), + mCheckStretchUniformLabel(NULL), mBtnRotateLeft(NULL), mBtnRotateReset(NULL), @@ -632,6 +634,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) //mCheckSelectLinked ->setVisible( edit_visible ); if (mCheckStretchUniform) mCheckStretchUniform->setVisible( edit_visible ); if (mCheckStretchTexture) mCheckStretchTexture->setVisible( edit_visible ); + if (mCheckStretchUniformLabel) mCheckStretchUniformLabel->setVisible( edit_visible ); // Create buttons BOOL create_visible = (tool == LLToolCompCreate::getInstance()); diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index e1f3c9b78c..91431969bb 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -149,6 +149,10 @@ public: LLCheckBoxCtrl* mCheckStretchUniform; LLCheckBoxCtrl* mCheckStretchTexture; + // !HACK! Replacement of mCheckStretchUniform label because LLCheckBoxCtrl + // doesn't support word_wrap of its label. Need to fix truncation bug EXT-6658 + LLTextBox* mCheckStretchUniformLabel; + LLButton *mBtnRotateLeft; LLButton *mBtnRotateReset; LLButton *mBtnRotateRight; diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp new file mode 100644 index 0000000000..d83d895dd0 --- /dev/null +++ b/indra/newview/llgiveinventory.cpp @@ -0,0 +1,541 @@ +/** + * @file llgiveinventory.cpp + * @brief LLGiveInventory class implementation + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, 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 "llgiveinventory.h" + +// library includes +#include "llnotificationsutil.h" +#include "lltrans.h" + +// newview includes +#include "llagent.h" +#include "llagentdata.h" +#include "llagentui.h" +#include "llagentwearables.h" +#include "llfloatertools.h" // for gFloaterTool +#include "llhudeffecttrail.h" +#include "llhudmanager.h" +#include "llimview.h" +#include "llinventory.h" +#include "llinventoryfunctions.h" +#include "llmutelist.h" +#include "llrecentpeople.h" +#include "llviewerobjectlist.h" +#include "llvoavatarself.h" + +// MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES +// or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a +// bit from there to give some pad. +const S32 MAX_ITEMS = 42; + +class LLGiveable : public LLInventoryCollectFunctor +{ +public: + LLGiveable() : mCountLosing(0) {} + virtual ~LLGiveable() {} + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + + S32 countNoCopy() const { return mCountLosing; } +protected: + S32 mCountLosing; +}; + +bool LLGiveable::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ + // All categories can be given. + if (cat) + return true; + + bool allowed = false; + if (item) + { + allowed = itemTransferCommonlyAllowed(item); + if (allowed && + !item->getPermissions().allowOperationBy(PERM_TRANSFER, + gAgent.getID())) + { + allowed = FALSE; + } + if (allowed && + !item->getPermissions().allowCopyBy(gAgent.getID())) + { + ++mCountLosing; + } + } + return allowed; +} + +class LLUncopyableItems : public LLInventoryCollectFunctor +{ +public: + LLUncopyableItems() {} + virtual ~LLUncopyableItems() {} + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); +}; + +bool LLUncopyableItems::operator()(LLInventoryCategory* cat, + LLInventoryItem* item) +{ + bool uncopyable = false; + if (item) + { + if (itemTransferCommonlyAllowed(item) && + !item->getPermissions().allowCopyBy(gAgent.getID())) + { + uncopyable = true; + } + } + return uncopyable; +} + +// static +bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) +{ + if (!item) return false; + + if (!isAgentAvatarValid()) return false; + + if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID)) + { + return false; + } + + bool acceptable = true; + switch(item->getType()) + { + case LLAssetType::AT_OBJECT: + if (gAgentAvatarp->isWearingAttachment(item->getUUID())) + { + acceptable = false; + } + break; + case LLAssetType::AT_BODYPART: + case LLAssetType::AT_CLOTHING: + { + BOOL copyable = false; + if (item->getPermissions().allowCopyBy(gAgentID)) copyable = true; + + if (!copyable && gAgentWearables.isWearingItem(item->getUUID())) + { + acceptable = false; + } + } + break; + default: + break; + } + return acceptable; +} + +// static +bool LLGiveInventory::isInventoryGroupGiveAcceptable(const LLInventoryItem* item) +{ + if (!item) return false; + + if (!isAgentAvatarValid()) return false; + + // These permissions are double checked in the simulator in + // LLGroupNoticeInventoryItemFetch::result(). + if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID)) + { + return false; + } + if (!item->getPermissions().allowCopyBy(gAgent.getID())) + { + return false; + } + + + bool acceptable = true; + switch(item->getType()) + { + case LLAssetType::AT_OBJECT: + if (gAgentAvatarp->isWearingAttachment(item->getUUID())) + { + acceptable = false; + } + break; + default: + break; + } + return acceptable; +} + +// static +void LLGiveInventory::doGiveInventoryItem(const LLUUID& to_agent, + const LLInventoryItem* item, + const LLUUID& im_session_id/* = LLUUID::null*/) + +{ + llinfos << "LLGiveInventory::giveInventory()" << llendl; + if (!isInventoryGiveAcceptable(item)) + { + return; + } + if (item->getPermissions().allowCopyBy(gAgentID)) + { + // just give it away. + LLGiveInventory::commitGiveInventoryItem(to_agent, item, im_session_id); + } + else + { + // ask if the agent is sure. + LLSD payload; + payload["agent_id"] = to_agent; + payload["item_id"] = item->getUUID(); + LLNotificationsUtil::add("CannotCopyWarning", LLSD(), payload, + &LLGiveInventory::handleCopyProtectedItem); + } +} + +void LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, + const LLInventoryCategory* cat, + const LLUUID& im_session_id) + +{ + if (!cat) return; + llinfos << "LLGiveInventory::giveInventoryCategory() - " + << cat->getUUID() << llendl; + + if (!isAgentAvatarValid()) return; + + // Test out how many items are being given. + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLGiveable giveable; + gInventory.collectDescendentsIf (cat->getUUID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + giveable); + S32 count = cats.count(); + bool complete = true; + for(S32 i = 0; i < count; ++i) + { + if (!gInventory.isCategoryComplete(cats.get(i)->getUUID())) + { + complete = false; + break; + } + } + if (!complete) + { + LLNotificationsUtil::add("IncompleteInventory"); + return; + } + count = items.count() + cats.count(); + if (count > MAX_ITEMS) + { + LLNotificationsUtil::add("TooManyItems"); + return; + } + else if (count == 0) + { + LLNotificationsUtil::add("NoItems"); + return; + } + else + { + if (0 == giveable.countNoCopy()) + { + LLGiveInventory::commitGiveInventoryCategory(to_agent, cat, im_session_id); + } + else + { + LLSD args; + args["COUNT"] = llformat("%d",giveable.countNoCopy()); + LLSD payload; + payload["agent_id"] = to_agent; + payload["folder_id"] = cat->getUUID(); + LLNotificationsUtil::add("CannotCopyCountItems", args, payload, &LLGiveInventory::handleCopyProtectedCategory); + } + } +} + +////////////////////////////////////////////////////////////////////////// +// PRIVATE METHODS +////////////////////////////////////////////////////////////////////////// + +//static +void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im_session_id) +{ + // compute id of possible IM session with agent that has "to_agent" id + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, to_agent); + // If this item was given by drag-and-drop into an IM panel, log this action in the IM panel chat. + if (im_session_id.notNull()) + { + LLSD args; + gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); + } + // If this item was given by drag-and-drop on avatar while IM panel was open, log this action in the IM panel chat. + else if (LLIMModel::getInstance()->findIMSession(session_id)) + { + LLSD args; + gIMMgr->addSystemMessage(session_id, "inventory_item_offered", args); + } + // If this item was given by drag-and-drop on avatar while IM panel wasn't open, log this action to IM history. + else + { + std::string full_name; + if (gCacheName->getFullName(to_agent, full_name)) + { + LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im")); + } + } +} + +// static +bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + LLInventoryItem* item = NULL; + switch(option) + { + case 0: // "Yes" + item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + if (item) + { + LLGiveInventory::commitGiveInventoryItem(notification["payload"]["agent_id"].asUUID(), + item); + // delete it for now - it will be deleted on the server + // quickly enough. + gInventory.deleteObject(notification["payload"]["item_id"].asUUID()); + gInventory.notifyObservers(); + } + else + { + LLNotificationsUtil::add("CannotGiveItem"); + } + break; + + default: // no, cancel, whatever, who cares, not yes. + LLNotificationsUtil::add("TransactionCancelled"); + break; + } + return false; +} + +// static +void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, + const LLInventoryItem* item, + const LLUUID& im_session_id) +{ + if (!item) return; + std::string name; + LLAgentUI::buildFullname(name); + LLUUID transaction_id; + transaction_id.generate(); + const S32 BUCKET_SIZE = sizeof(U8) + UUID_BYTES; + U8 bucket[BUCKET_SIZE]; + bucket[0] = (U8)item->getType(); + memcpy(&bucket[1], &(item->getUUID().mData), UUID_BYTES); /* Flawfinder: ignore */ + pack_instant_message( + gMessageSystem, + gAgentID, + FALSE, + gAgentSessionID, + to_agent, + name, + item->getName(), + IM_ONLINE, + IM_INVENTORY_OFFERED, + transaction_id, + 0, + LLUUID::null, + gAgent.getPositionAgent(), + NO_TIMESTAMP, + bucket, + BUCKET_SIZE); + gAgent.sendReliableMessage(); + + // VEFFECT: giveInventory + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject(gObjectList.findObject(to_agent)); + effectp->setDuration(LL_HUD_DUR_SHORT); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + gFloaterTools->dirty(); + + LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); + + logInventoryOffer(to_agent, im_session_id); + + // add buddy to recent people list + LLRecentPeople::instance().add(to_agent); +} + +// static +bool LLGiveInventory::handleCopyProtectedCategory(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + LLInventoryCategory* cat = NULL; + switch(option) + { + case 0: // "Yes" + cat = gInventory.getCategory(notification["payload"]["folder_id"].asUUID()); + if (cat) + { + LLGiveInventory::commitGiveInventoryCategory(notification["payload"]["agent_id"].asUUID(), + cat); + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLUncopyableItems remove; + gInventory.collectDescendentsIf (cat->getUUID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + remove); + S32 count = items.count(); + for(S32 i = 0; i < count; ++i) + { + gInventory.deleteObject(items.get(i)->getUUID()); + } + gInventory.notifyObservers(); + } + else + { + LLNotificationsUtil::add("CannotGiveCategory"); + } + break; + + default: // no, cancel, whatever, who cares, not yes. + LLNotificationsUtil::add("TransactionCancelled"); + break; + } + return false; +} + +// static +void LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, + const LLInventoryCategory* cat, + const LLUUID& im_session_id) + +{ + if (!cat) return; + llinfos << "LLGiveInventory::commitGiveInventoryCategory() - " + << cat->getUUID() << llendl; + + // add buddy to recent people list + LLRecentPeople::instance().add(to_agent); + + // Test out how many items are being given. + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLGiveable giveable; + gInventory.collectDescendentsIf (cat->getUUID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + giveable); + + // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < + // MTUBYTES or 18 * count < 1200 => count < 1200/18 => + // 66. I've cut it down a bit from there to give some pad. + S32 count = items.count() + cats.count(); + if (count > MAX_ITEMS) + { + LLNotificationsUtil::add("TooManyItems"); + return; + } + else if (count == 0) + { + LLNotificationsUtil::add("NoItems"); + return; + } + else + { + std::string name; + LLAgentUI::buildFullname(name); + LLUUID transaction_id; + transaction_id.generate(); + S32 bucket_size = (sizeof(U8) + UUID_BYTES) * (count + 1); + U8* bucket = new U8[bucket_size]; + U8* pos = bucket; + U8 type = (U8)cat->getType(); + memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ + pos += sizeof(U8); + memcpy(pos, &(cat->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ + pos += UUID_BYTES; + S32 i; + count = cats.count(); + for(i = 0; i < count; ++i) + { + memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ + pos += sizeof(U8); + memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ + pos += UUID_BYTES; + } + count = items.count(); + for(i = 0; i < count; ++i) + { + type = (U8)items.get(i)->getType(); + memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ + pos += sizeof(U8); + memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ + pos += UUID_BYTES; + } + pack_instant_message( + gMessageSystem, + gAgent.getID(), + FALSE, + gAgent.getSessionID(), + to_agent, + name, + cat->getName(), + IM_ONLINE, + IM_INVENTORY_OFFERED, + transaction_id, + 0, + LLUUID::null, + gAgent.getPositionAgent(), + NO_TIMESTAMP, + bucket, + bucket_size); + gAgent.sendReliableMessage(); + delete[] bucket; + + // VEFFECT: giveInventoryCategory + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject(gObjectList.findObject(to_agent)); + effectp->setDuration(LL_HUD_DUR_SHORT); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + gFloaterTools->dirty(); + + LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); + + logInventoryOffer(to_agent, im_session_id); + } +} + +// EOF diff --git a/indra/newview/llgiveinventory.h b/indra/newview/llgiveinventory.h new file mode 100644 index 0000000000..e589a0cc69 --- /dev/null +++ b/indra/newview/llgiveinventory.h @@ -0,0 +1,99 @@ +/** + * @file llgiveinventory.cpp + * @brief LLGiveInventory class declaration + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, 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 LL_LLGIVEINVENTORY_H +#define LL_LLGIVEINVENTORY_H + +class LLInventoryItem; +class LLInventoryCategory; + +/** + * Class represented give inventory related actions. + * + * It has only static methods and is not intended to be instantiated for now. + */ +class LLGiveInventory +{ +public: + /** + * Checks if inventory item you are attempting to transfer to a resident can be given. + * + * @return true if you can give, otherwise false. + */ + static bool isInventoryGiveAcceptable(const LLInventoryItem* item); + + /** + * Checks if inventory item you are attempting to transfer to a group can be given. + * + * @return true if you can give, otherwise false. + */ + static bool isInventoryGroupGiveAcceptable(const LLInventoryItem* item); + + /** + * Gives passed inventory item to specified avatar in specified session. + */ + static void doGiveInventoryItem(const LLUUID& to_agent, + const LLInventoryItem* item, + const LLUUID& im_session_id = LLUUID::null); + + /** + * Gives passed inventory category to specified avatar in specified session. + */ + static void doGiveInventoryCategory(const LLUUID& to_agent, + const LLInventoryCategory* item, + const LLUUID &session_id = LLUUID::null); + +private: + // this class is not intended to be instantiated. + LLGiveInventory(); + + /** + * logs "Inventory item offered" to IM + */ + static void logInventoryOffer(const LLUUID& to_agent, + const LLUUID &im_session_id = LLUUID::null); + + // give inventory item functionality + static bool handleCopyProtectedItem(const LLSD& notification, const LLSD& response); + static void commitGiveInventoryItem(const LLUUID& to_agent, + const LLInventoryItem* item, + const LLUUID &im_session_id = LLUUID::null); + + // give inventory category functionality + static bool handleCopyProtectedCategory(const LLSD& notification, const LLSD& response); + static void commitGiveInventoryCategory(const LLUUID& to_agent, + const LLInventoryCategory* cat, + const LLUUID &im_session_id = LLUUID::null); + +}; + +#endif // LL_LLGIVEINVENTORY_H diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e394284c92..181a9fa7eb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -48,6 +48,7 @@ #include "llfloaterworldmap.h" #include "llfriendcard.h" #include "llgesturemgr.h" +#include "llgiveinventory.h" #include "llimfloater.h" #include "llimview.h" #include "llinventoryclipboard.h" @@ -1017,11 +1018,7 @@ BOOL LLInvFVBridge::canShare() const { if (!LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item)) return FALSE; - if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) - return FALSE; - if (!item->getPermissions().allowCopyBy(gAgent.getID())) - return FALSE; - return TRUE; + return (BOOL)LLGiveInventory::isInventoryGiveAcceptable(item); } // All categories can be given. @@ -3763,7 +3760,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, rv = TRUE; if(drop) { - LLToolDragAndDrop::giveInventory(item->getCreatorUUID(), + LLGiveInventory::doGiveInventoryItem(item->getCreatorUUID(), (LLInventoryItem*)cargo_data); } } @@ -3784,7 +3781,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, rv = TRUE; if(drop) { - LLToolDragAndDrop::giveInventoryCategory( + LLGiveInventory::doGiveInventoryCategory( item->getCreatorUUID(), inv_cat); } @@ -4988,18 +4985,20 @@ void LLWearableBridge::removeAllClothesFromAvatar() if (itype == LLWearableType::WT_SHAPE || itype == LLWearableType::WT_SKIN || itype == LLWearableType::WT_HAIR || itype == LLWearableType::WT_EYES) continue; - // MULTI-WEARABLES: fixed to index 0 - LLViewerInventoryItem *item = dynamic_cast<LLViewerInventoryItem*>( - gAgentWearables.getWearableInventoryItem((LLWearableType::EType)itype, 0)); - if (!item) - continue; - const LLUUID &item_id = gInventory.getLinkedItemID(item->getUUID()); - const LLWearable *wearable = gAgentWearables.getWearableFromItemID(item_id); - if (!wearable) - continue; - - // Find and remove this item from the COF. - LLAppearanceMgr::instance().removeCOFItemLinks(item_id,false); + for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index) + { + LLViewerInventoryItem *item = dynamic_cast<LLViewerInventoryItem*>( + gAgentWearables.getWearableInventoryItem((LLWearableType::EType)itype, index)); + if (!item) + continue; + const LLUUID &item_id = gInventory.getLinkedItemID(item->getUUID()); + const LLWearable *wearable = gAgentWearables.getWearableFromItemID(item_id); + if (!wearable) + continue; + + // Find and remove this item from the COF. + LLAppearanceMgr::instance().removeCOFItemLinks(item_id,false); + } } gInventory.notifyObservers(); diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index f94515d242..1c3eb547bb 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -336,7 +336,9 @@ LLInventoryItemsList::LLInventoryItemsList(const LLInventoryItemsList::Params& p // virtual LLInventoryItemsList::~LLInventoryItemsList() -{} +{ + gIdleCallbacks.deleteFunction(idle, this); +} void LLInventoryItemsList::refreshList(const LLInventoryModel::item_array_t item_array) { diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index a3863b511c..807952948b 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -124,6 +124,15 @@ public: /** Get the name of a corresponding inventory item */ const std::string& getItemName() const { return mItem->getName(); } + /** Get the asset type of a corresponding inventory item */ + LLAssetType::EType getType() const { return mItem->getType(); } + + /** Get the wearable type of a corresponding inventory item */ + LLWearableType::EType getWearableType() const { return mItem->getWearableType(); } + + /** Get the description of a corresponding inventory item */ + const std::string& getDescription() const { return mItem->getDescription(); } + virtual ~LLPanelInventoryListItemBase(){} protected: diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 448cc318c2..098ee22280 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1245,7 +1245,9 @@ void LLInventoryModel::addCategory(LLViewerInventoryCategory* category) void LLInventoryModel::addItem(LLViewerInventoryItem* item) { - //llinfos << "LLInventoryModel::addItem()" << llendl; + const LLViewerInventoryCategory* cat = gInventory.getCategory(item->getParentUUID()); // Seraph remove for 2.1 + const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; // Seraph remove for 2.1 + llinfos << "Added item [ name:" << item->getName() << " UUID:" << item->getUUID() << " type:" << item->getActualType() << " ] to folder [ name:" << cat_name << " uuid:" << item->getParentUUID() << " ]" << llendl; // Seraph remove for 2.1 llassert(item); if(item) diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 05cb6ddc4a..7a4ed74c4c 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -78,8 +78,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mBorder(NULL), mFrequentUpdates( true ), mForceUpdate( false ), - mOpenLinksInExternalBrowser( false ), - mOpenLinksInInternalBrowser( false ), mHomePageUrl( "" ), mTrusted(false), mIgnoreUIScale( true ), @@ -167,20 +165,6 @@ void LLMediaCtrl::setTakeFocusOnClick( bool take_focus ) } //////////////////////////////////////////////////////////////////////////////// -// set flag that forces the embedded browser to open links in the external system browser -void LLMediaCtrl::setOpenInExternalBrowser( bool valIn ) -{ - mOpenLinksInExternalBrowser = valIn; -}; - -//////////////////////////////////////////////////////////////////////////////// -// set flag that forces the embedded browser to open links in the internal browser floater -void LLMediaCtrl::setOpenInInternalBrowser( bool valIn ) -{ - mOpenLinksInInternalBrowser = valIn; -}; - -//////////////////////////////////////////////////////////////////////////////// void LLMediaCtrl::setTrusted( bool valIn ) { if(mMediaSource) @@ -944,7 +928,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) case MEDIA_EVENT_CLICK_LINK_HREF: { LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL; - onClickLinkHref(self); }; break; @@ -979,95 +962,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) //////////////////////////////////////////////////////////////////////////////// // -void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) -{ - // retrieve the event parameters - std::string url = self->getClickURL(); - U32 target_type = self->getClickTargetType(); - - // is there is a target specified for the link? - if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || - target_type == LLPluginClassMedia::TARGET_BLANK ) - { - if (gSavedSettings.getBOOL("UseExternalBrowser")) - { - LLSD payload; - payload["url"] = url; - payload["target_type"] = LLSD::Integer(target_type); - LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); - } - else - { - clickLinkWithTarget(url, target_type); - } - } - else { - const std::string protocol1( "http://" ); - const std::string protocol2( "https://" ); - if( mOpenLinksInExternalBrowser ) - { - if ( !url.empty() ) - { - if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 || - LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 ) - { - LLWeb::loadURLExternal( url ); - } - } - } - else - if( mOpenLinksInInternalBrowser ) - { - if ( !url.empty() ) - { - if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 || - LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 ) - { - llwarns << "Dead, unimplemented path that we used to send to the built-in browser long ago." << llendl; - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -// static -bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response ) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if ( 0 == option ) - { - LLSD payload = notification["payload"]; - std::string url = payload["url"].asString(); - S32 target_type = payload["target_type"].asInteger(); - clickLinkWithTarget(url, target_type); - } - return false; -} - - -//////////////////////////////////////////////////////////////////////////////// -// static -void LLMediaCtrl::clickLinkWithTarget(const std::string& url, const S32& target_type ) -{ - if (target_type == LLPluginClassMedia::TARGET_EXTERNAL) - { - // load target in an external browser - LLWeb::loadURLExternal(url); - } - else if (target_type == LLPluginClassMedia::TARGET_BLANK) - { - // load target in the user's preferred browser - LLWeb::loadURL(url); - } - else { - // unsupported link target - shouldn't happen - LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL; - } -} - -//////////////////////////////////////////////////////////////////////////////// -// std::string LLMediaCtrl::getCurrentNavUrl() { return mCurrentNavUrl; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index e55d2f7cd0..310492fe02 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -99,8 +99,6 @@ public: void navigateToLocalPage( const std::string& subdir, const std::string& filename_in ); bool canNavigateBack(); bool canNavigateForward(); - void setOpenInExternalBrowser( bool valIn ); - void setOpenInInternalBrowser( bool valIn ); std::string getCurrentNavUrl(); // By default, we do not handle "secondlife:///app/" SLURLs, because @@ -162,24 +160,17 @@ public: // Incoming media event dispatcher virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); - // handlers for individual events (could be done inside the switch in handleMediaEvent, they're just individual functions for clarity) - void onClickLinkHref( LLPluginClassMedia* self ); - protected: void convertInputCoords(S32& x, S32& y); private: void onVisibilityChange ( const LLSD& new_visibility ); - static bool onClickLinkExternalTarget( const LLSD&, const LLSD& ); - static void clickLinkWithTarget(const std::string& url, const S32& target_type ); const S32 mTextureDepthBytes; LLUUID mMediaTextureID; LLViewBorder* mBorder; bool mFrequentUpdates; bool mForceUpdate; - bool mOpenLinksInExternalBrowser; - bool mOpenLinksInInternalBrowser; bool mTrusted; std::string mHomePageUrl; std::string mCurrentNavUrl; diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index d670eb6ffd..27a27fb65a 100644 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -131,14 +131,7 @@ void LLMorphView::setVisible(BOOL visible) if (visible) { - llassert( !gFloaterCustomize ); - gFloaterCustomize = new LLFloaterCustomize(); - gFloaterCustomize->fetchInventory(); - gFloaterCustomize->openFloater(); - - // Must do this _after_ gFloaterView is initialized. - gFloaterCustomize->switchToDefaultSubpart(); - + // TODO: verify some user action has already opened outfit editor? - Nyx initialize(); // First run dialog @@ -146,13 +139,7 @@ void LLMorphView::setVisible(BOOL visible) } else { - if( gFloaterCustomize ) - { - gFloaterView->removeChild( gFloaterCustomize ); - delete gFloaterCustomize; - gFloaterCustomize = NULL; - } - + // TODO: verify some user action has already closed outfit editor ? - Nyx shutdown(); } } diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index bd504906d5..680ed35fa2 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -69,6 +69,33 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { { "/shout" , CHAT_TYPE_SHOUT} }; +//ext-7367 +//Problem: gesture list control (actually LLScrollListCtrl) didn't actually process mouse wheel message. +// introduce new gesture list subclass to "eat" mouse wheel messages (and probably some other messages) +class LLGestureScrollListCtrl: public LLScrollListCtrl +{ +protected: + friend class LLUICtrlFactory; + LLGestureScrollListCtrl(const LLScrollListCtrl::Params& params) + :LLScrollListCtrl(params) + { + } +public: + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) + { + LLScrollListCtrl::handleScrollWheel( x, y, clicks ); + return TRUE; + } + //See EXT-6598 + //Mouse hover over separator will result in not processing tooltip message + //So eat this message + BOOL handleToolTip(S32 x, S32 y, MASK mask) + { + LLScrollListCtrl::handleToolTip( x, y, mask ); + return TRUE; + } +}; + LLGestureComboList::Params::Params() : combo_button("combo_button"), combo_list("combo_list") @@ -90,13 +117,14 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) addChild(mButton); - LLScrollListCtrl::Params params = p.combo_list; + LLGestureScrollListCtrl::Params params(p.combo_list); + params.name("GestureComboList"); params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2)); params.visible(false); params.commit_on_keyboard_movement(false); - mList = LLUICtrlFactory::create<LLScrollListCtrl>(params); + mList = LLUICtrlFactory::create<LLGestureScrollListCtrl>(params); addChild(mList); //****************************Gesture Part********************************/ diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 5ad68ea4db..8e9b164c09 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -57,6 +57,8 @@ #include "lltextureentry.h" #include "llviewercontrol.h" // gSavedSettings #include "llviewertexturelist.h" +#include "llagentcamera.h" +#include "llmorphview.h" // register panel with appropriate XML static LLRegisterPanelClassWrapper<LLPanelEditWearable> t_edit_wearable("panel_edit_wearable"); @@ -227,7 +229,7 @@ LLEditWearableDictionary::Wearables::Wearables() addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(LLWearableType::WT_UNDERPANTS,"edit_underpants_title","underpants_desc_text",1,1,1, TEX_LOWER_UNDERPANTS, TEX_LOWER_UNDERPANTS, SUBPART_UNDERPANTS)); addEntry(LLWearableType::WT_SKIRT, new WearableEntry(LLWearableType::WT_SKIRT,"edit_skirt_title","skirt_desc_text",1,1,1, TEX_SKIRT, TEX_SKIRT, SUBPART_SKIRT)); addEntry(LLWearableType::WT_ALPHA, new WearableEntry(LLWearableType::WT_ALPHA,"edit_alpha_title","alpha_desc_text",0,5,1, TEX_LOWER_ALPHA, TEX_UPPER_ALPHA, TEX_HEAD_ALPHA, TEX_EYES_ALPHA, TEX_HAIR_ALPHA, SUBPART_ALPHA)); - addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title","tattoo_desc_text",0,3,1, TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO, SUBPART_TATTOO)); + addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title","tattoo_desc_text",1,3,1, TEX_HEAD_TATTOO, TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO, SUBPART_TATTOO)); } LLEditWearableDictionary::WearableEntry::WearableEntry(LLWearableType::EType type, @@ -331,6 +333,7 @@ LLEditWearableDictionary::ColorSwatchCtrls::ColorSwatchCtrls() addEntry ( TEX_UPPER_GLOVES, new PickerControlEntry (TEX_UPPER_GLOVES, "Color/Tint" )); addEntry ( TEX_UPPER_UNDERSHIRT, new PickerControlEntry (TEX_UPPER_UNDERSHIRT, "Color/Tint" )); addEntry ( TEX_LOWER_UNDERPANTS, new PickerControlEntry (TEX_LOWER_UNDERPANTS, "Color/Tint" )); + addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry(TEX_HEAD_TATTOO, "Color/Tint" )); } LLEditWearableDictionary::TextureCtrls::TextureCtrls() @@ -950,6 +953,9 @@ void LLPanelEditWearable::initializePanel() // what edit group do we want to extract params for? const std::string edit_group = subpart_entry->mEditGroup; + // initialize callback to ensure camera view changes appropriately. + tab->setDropDownStateChangedCallback(boost::bind(&LLPanelEditWearable::onTabExpandedCollapsed,this,_2,index)); + // storage for ordered list of visual params value_map_t sorted_params; getSortedParams(sorted_params, edit_group); @@ -988,6 +994,52 @@ void LLPanelEditWearable::updateTypeSpecificControls(LLWearableType::EType type) } } +void LLPanelEditWearable::onTabExpandedCollapsed(const LLSD& param, U8 index) +{ + bool expanded = param.asBoolean(); + + if (!mWearablePtr || !gAgentCamera.cameraCustomizeAvatar()) + { + // we don't have a valid wearable we're editing, or we've left the wearable editor + return; + } + + if (expanded) + { + const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType()); + if (!wearable_entry) + { + llinfos << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << llendl; + return; + } + + if (index >= wearable_entry->mSubparts.size()) + { + llinfos << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << index << llendl; + return; + } + + ESubpart subpart_e = wearable_entry->mSubparts[index]; + const LLEditWearableDictionary::SubpartEntry *subpart_entry = LLEditWearableDictionary::getInstance()->getSubpart(subpart_e); + + if (!subpart_entry) + { + llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl; + return; + } + + // Update the camera + gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) ); + gMorphView->setCameraTargetOffset( subpart_entry->mTargetOffset ); + gMorphView->setCameraOffset( subpart_entry->mCameraOffset ); + gMorphView->setCameraDistToDefault(); + if (gSavedSettings.getBOOL("AppearanceCameraMovement")) + { + gMorphView->updateCamera(); + } + } +} + void LLPanelEditWearable::updateScrollingPanelUI() { // do nothing if we don't have a valid wearable we're editing diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 04839ca451..6f9ac82407 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -66,6 +66,8 @@ public: static void onRevertButtonClicked(void* userdata); void onCommitSexChange(); + void onTabExpandedCollapsed(const LLSD& param, U8 index); + private: typedef std::map<F32, LLViewerVisualParam*> value_map_t; diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 1e106f44a7..2a955004e9 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -45,7 +45,6 @@ #include "llfloaterinventory.h" #include "llagent.h" #include "llagentui.h" -#include "lltooldraganddrop.h" #include "lllineeditor.h" #include "lltexteditor.h" @@ -61,6 +60,7 @@ #include "llviewerwindow.h" #include "llviewermessage.h" #include "llnotificationsutil.h" +#include "llgiveinventory.h" static LLRegisterPanelClassWrapper<LLPanelGroupNotices> t_panel_group_notices("panel_group_notices"); @@ -163,7 +163,7 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if(gInventory.getItem(inv_item->getUUID()) - && LLToolDragAndDrop::isInventoryGroupGiveAcceptable(inv_item)) + && LLGiveInventory::isInventoryGroupGiveAcceptable(inv_item)) { // *TODO: get multiple object transfers working *accept = ACCEPT_YES_COPY_SINGLE; diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 95ec8170f2..7dec2251e8 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -797,8 +797,37 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) void LLPanelGroupMembersSubTab::setGroupID(const LLUUID& id) { + //clear members list + if(mMembersList) mMembersList->deleteAllItems(); + if(mAssignedRolesList) mAssignedRolesList->deleteAllItems(); + if(mAllowedActionsList) mAllowedActionsList->deleteAllItems(); + LLPanelGroupSubTab::setGroupID(id); +} + +void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id) +{ + if(mRolesList) mRolesList->deleteAllItems(); + if(mAssignedMembersList) mAssignedMembersList->deleteAllItems(); + if(mAllowedActionsList) mAllowedActionsList->deleteAllItems(); + + if(mRoleName) mRoleName->clear(); + if(mRoleDescription) mRoleDescription->clear(); + if(mRoleTitle) mRoleTitle->clear(); + + setFooterEnabled(FALSE); + LLPanelGroupSubTab::setGroupID(id); +} +void LLPanelGroupActionsSubTab::setGroupID(const LLUUID& id) +{ + if(mActionList) mActionList->deleteAllItems(); + if(mActionRoles) mActionRoles->deleteAllItems(); + if(mActionMembers) mActionMembers->deleteAllItems(); + + if(mActionDescription) mActionDescription->clear(); + + LLPanelGroupSubTab::setGroupID(id); } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index a877402041..44aa7cea38 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -257,6 +257,8 @@ public: void handleDeleteRole(); void saveRoleChanges(); + + virtual void setGroupID(const LLUUID& id); protected: void handleActionCheck(LLUICtrl* ctrl, bool force); LLSD createRoleItem(const LLUUID& role_id, std::string name, std::string title, S32 members); @@ -294,6 +296,8 @@ public: virtual void update(LLGroupChange gc); void handleActionSelect(); + + virtual void setGroupID(const LLUUID& id); protected: LLScrollListCtrl* mActionList; LLScrollListCtrl* mActionRoles; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index feb36cf7dd..5fbe198f6f 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -269,20 +269,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, web_browser->setTabStop(FALSE); // web_browser->navigateToLocalPage( "loading", "loading.html" ); - if (gSavedSettings.getBOOL("RegInClient")) - { - // need to follow links in the internal browser - web_browser->setOpenInExternalBrowser( false ); - - getChild<LLView>("login_widgets")->setVisible(false); - } - else - { - // make links open in external browser - web_browser->setOpenInExternalBrowser( true ); - - reshapeBrowser(); - } + reshapeBrowser(); // kick off a request to grab the url manually gResponsePtr = LLIamHereLogin::build( this ); @@ -486,7 +473,6 @@ void LLPanelLogin::showLoginWidgets() { sInstance->childSetVisible("login_widgets", true); LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html"); - web_browser->setOpenInExternalBrowser( true ); sInstance->reshapeBrowser(); // *TODO: Append all the usual login parameters, like first_login=Y etc. std::string splash_screen_url = sInstance->getString("real_url"); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index de16f9d343..39ade40967 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -48,7 +48,7 @@ #include "llagent.h" #include "llavataractions.h" #include "llcallbacklist.h" -#include "llfloaterbuycurrency.h" +#include "llbuycurrencyhtml.h" #include "llfloaterreg.h" #include "llinventorybridge.h" #include "llinventorydefines.h" @@ -616,7 +616,7 @@ void LLTaskInvFVBridge::performAction(LLInventoryModel* model, std::string actio { LLStringUtil::format_map_t args; args["AMOUNT"] = llformat("%d", price); - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_costs", args), price); + LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("this_costs", args), price ); } else { diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 44832ac496..ceb720908a 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -148,6 +148,8 @@ protected: else { mBaseOutfitId = baseoutfit_id; + mPanel->updateCurrentOutfitName(); + if (baseoutfit_id.isNull()) return; mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId); @@ -210,7 +212,8 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mCOFWearables(NULL), mInventoryItemsPanel(NULL), mCOFObserver(NULL), - mCOFDragAndDropObserver(NULL) + mCOFDragAndDropObserver(NULL), + mInitialized(false) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -307,6 +310,16 @@ BOOL LLPanelOutfitEdit::postBuild() return TRUE; } +// virtual +void LLPanelOutfitEdit::onOpen(const LLSD& key) +{ + if (!mInitialized) + { + displayCurrentOutfit(); + mInitialized = true; + } +} + void LLPanelOutfitEdit::moveWearable(bool closer_to_body) { LLUUID item_id = mCOFWearables->getSelectedUUID(); @@ -339,6 +352,8 @@ void LLPanelOutfitEdit::showFilteredWearablesPanel() if(switchPanels(mInventoryItemsPanel, mWearableItemsPanel)) { mFolderViewBtn->setToggleState(FALSE); + mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); + mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); } mListViewBtn->setToggleState(TRUE); } @@ -348,6 +363,8 @@ void LLPanelOutfitEdit::showFilteredFolderWearablesPanel() if(switchPanels(mWearableItemsPanel, mInventoryItemsPanel)) { mListViewBtn->setToggleState(FALSE); + mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); + mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); } mFolderViewBtn->setToggleState(TRUE); } @@ -446,13 +463,25 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string) void LLPanelOutfitEdit::onAddToOutfitClicked(void) { - LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem(); - if (!curr_item) return; + LLUUID selected_id; + if (mInventoryItemsPanel->getVisible()) + { + LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem(); + if (!curr_item) return; - LLFolderViewEventListener* listenerp = curr_item->getListener(); - if (!listenerp) return; + LLFolderViewEventListener* listenerp = curr_item->getListener(); + if (!listenerp) return; - LLAppearanceMgr::getInstance()->wearItemOnAvatar(listenerp->getUUID()); + selected_id = listenerp->getUUID(); + } + else if (mWearableItemsPanel->getVisible()) + { + selected_id = mWearableItemsList->getSelectedUUID(); + } + + if (selected_id.isNull()) return; + + LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id); } @@ -616,6 +645,13 @@ void LLPanelOutfitEdit::displayCurrentOutfit() setVisible(TRUE); } + updateCurrentOutfitName(); + + update(); +} + +void LLPanelOutfitEdit::updateCurrentOutfitName() +{ std::string current_outfit_name; if (LLAppearanceMgr::getInstance()->getBaseOutfitName(current_outfit_name)) { @@ -625,8 +661,6 @@ void LLPanelOutfitEdit::displayCurrentOutfit() { mCurrentOutfitName->setText(getString("No Outfit")); } - - update(); } //private diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 953a70785c..5ebe1e0406 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -61,6 +61,7 @@ class LLFilteredWearableListManager; class LLPanelOutfitEdit : public LLPanel { + LOG_CLASS(LLPanelOutfitEdit); public: // NOTE: initialize mLookItemTypes at the index of any new enum you add in the LLPanelOutfitEdit() constructor @@ -83,6 +84,7 @@ public: /*virtual*/ ~LLPanelOutfitEdit(); /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); void moveWearable(bool closer_to_body); @@ -102,7 +104,8 @@ public: void onEditWearableClicked(void); void displayCurrentOutfit(); - + void updateCurrentOutfitName(); + void update(); void updateVerbs(); @@ -146,6 +149,7 @@ private: std::vector<LLLookItemType> mLookItemTypes; LLCOFWearables* mCOFWearables; + bool mInitialized; }; #endif // LL_LLPANELOUTFITEDIT_H diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index ea75c16c56..0760c57f8e 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -73,7 +73,8 @@ static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_o LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), - mParent(NULL) + mParent(NULL), + mInitialized(false) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -106,6 +107,18 @@ BOOL LLPanelOutfitsInventory::postBuild() // virtual void LLPanelOutfitsInventory::onOpen(const LLSD& key) { + if (!mInitialized) + { + LLSidepanelAppearance* panel_appearance = getAppearanceSP(); + if (panel_appearance) + { + // *TODO: move these methods to LLPanelOutfitsInventory? + panel_appearance->fetchInventory(); + panel_appearance->refreshCurrentOutfitName(); + } + mInitialized = true; + } + // Make sure we know which tab is selected, update the filter, // and update verbs. onTabChange(); @@ -249,8 +262,7 @@ bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& { LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name); - LLSidepanelAppearance* panel_appearance = - dynamic_cast<LLSidepanelAppearance *>(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + LLSidepanelAppearance* panel_appearance = getAppearanceSP(); if (panel_appearance) { panel_appearance->showOutfitsInventoryPanel(); @@ -661,3 +673,11 @@ void LLPanelOutfitsInventory::onWearablesLoaded() { setWearablesLoading(false); } + +LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() +{ + static LLSidepanelAppearance* panel_appearance = + dynamic_cast<LLSidepanelAppearance*> + (LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + return panel_appearance; +} diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 6b4d1dbd84..a0fe91cd80 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -49,6 +49,7 @@ class LLTabContainer; class LLPanelOutfitsInventory : public LLPanel { + LOG_CLASS(LLPanelOutfitsInventory); public: LLPanelOutfitsInventory(); virtual ~LLPanelOutfitsInventory(); @@ -72,6 +73,7 @@ public: void setParent(LLSidepanelAppearance *parent); LLFolderView* getRootFolder(); + LLSidepanelAppearance* getAppearanceSP(); static LLPanelOutfitsInventory* findInstance(); @@ -132,6 +134,8 @@ private: // List Commands // //////////////////////////////////////////////////////////////////////////////// /// + + bool mInitialized; }; #endif //LL_LLPANELOUTFITSINVENTORY_H diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 52a46a45b6..23171d5ff2 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -50,8 +50,8 @@ #include "llagentui.h" #include "llappviewer.h" #include "llcallbacklist.h" -#include "llfloaterbuycurrency.h" -#include "llslurl.h" // IDEVO +#include "llbuycurrencyhtml.h" +#include "llslurl.h" #include "llstatusbar.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" @@ -578,7 +578,7 @@ void LLPanelPlaceProfile::onForSaleBannerClick() { LLStringUtil::format_map_t args; args["AMOUNT"] = llformat("%d", price); - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("buying_selected_land", args), price); + LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("buying_selected_land", args), price ); } else { diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index a5518d87d4..242af6981c 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -73,9 +73,9 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param F32 min_weight = param->getMinWeight(); F32 max_weight = param->getMaxWeight(); - mHintMin = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), min_weight); + mHintMin = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), wearable, min_weight); pos_x = getChild<LLViewBorder>("right_border")->getRect().mLeft + left_border->getBorderWidth(); - mHintMax = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), max_weight ); + mHintMax = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), wearable, max_weight ); mHintMin->setAllowsUpdates( FALSE ); mHintMax->setAllowsUpdates( FALSE ); diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index 89b799f297..1caeec5b04 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -121,7 +121,10 @@ int secapiSSLCertVerifyCallback(X509_STORE_CTX *ctx, void *param) validation_params[CERT_HOSTNAME] = uri.hostName(); try { - chain->validate(VALIDATION_POLICY_SSL, store, validation_params); + // we rely on libcurl to validate the hostname, as libcurl does more extensive validation + // leaving our hostname validation call mechanism for future additions with respect to + // OS native (Mac keyring, windows CAPI) validation. + chain->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), store, validation_params); } catch (LLCertValidationTrustException& cert_exception) { diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 658a7b52e3..010d593b27 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -47,6 +47,7 @@ #include "llsidetray.h" #include "lltextbox.h" #include "lluictrlfactory.h" +#include "llviewercontrol.h" #include "llviewerregion.h" #include "llvoavatarself.h" #include "llwearable.h" @@ -97,7 +98,8 @@ LLSidepanelAppearance::LLSidepanelAppearance() : mFilterSubString(LLStringUtil::null), mFilterEditor(NULL), mOutfitEdit(NULL), - mCurrOutfitPanel(NULL) + mCurrOutfitPanel(NULL), + mOpened(false) { } @@ -116,7 +118,7 @@ BOOL LLSidepanelAppearance::postBuild() mEditAppearanceBtn = getChild<LLButton>("editappearance_btn"); mEditAppearanceBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditAppearanceButtonClicked, this)); - childSetAction("edit_outfit_btn", boost::bind(&LLSidepanelAppearance::onEditOutfitButtonClicked, this)); + childSetAction("edit_outfit_btn", boost::bind(&LLSidepanelAppearance::showOutfitEditPanel, this)); mNewOutfitBtn = getChild<LLButton>("newlook_btn"); mNewOutfitBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onNewOutfitButtonClicked, this)); @@ -148,7 +150,7 @@ BOOL LLSidepanelAppearance::postBuild() LLButton* edit_wearable_back_btn = mEditWearable->getChild<LLButton>("back_btn"); if (edit_wearable_back_btn) { - edit_wearable_back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditWearBackClicked, this)); + edit_wearable_back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::showOutfitEditPanel, this)); } } @@ -167,27 +169,36 @@ BOOL LLSidepanelAppearance::postBuild() // virtual void LLSidepanelAppearance::onOpen(const LLSD& key) { - fetchInventory(); - refreshCurrentOutfitName(); - - if (mPanelOutfitsInventory) - { - mPanelOutfitsInventory->onOpen(key); - } - if (!key.has("type")) - return; - - // Switch to the requested panel. - std::string type = key["type"].asString(); - if (type == "my_outfits") { - showOutfitsInventoryPanel(); + // No specific panel requested. + // If we're opened for the first time then show My Outfits. + // Else do nothing. + if (!mOpened) + { + showOutfitsInventoryPanel(); + } } - else if (type == "edit_outfit") + else { - showOutfitEditPanel(/*update = */ true); + // Switch to the requested panel. + // *TODO: replace this crap with LLSideTrayPanelContainer + std::string type = key["type"].asString(); + if (type == "my_outfits") + { + showOutfitsInventoryPanel(); + } + else if (type == "edit_outfit") + { + showOutfitEditPanel(); + } + else if (type == "edit_shape") + { + showWearableEditPanel(); + } } + + mOpened = true; } void LLSidepanelAppearance::onFilterEdit(const std::string& search_string) @@ -239,13 +250,6 @@ void LLSidepanelAppearance::onEditAppearanceButtonClicked() } } -void LLSidepanelAppearance::onEditOutfitButtonClicked() -{ - LLSD key; - key["type"] = "edit_outfit"; - LLSideTray::getInstance()->showPanel("sidepanel_appearance", key); -} - void LLSidepanelAppearance::onNewOutfitButtonClicked() { if (!mOutfitEdit->getVisible()) @@ -254,52 +258,76 @@ void LLSidepanelAppearance::onNewOutfitButtonClicked() } } -void LLSidepanelAppearance::onEditWearBackClicked() -{ - showOutfitEditPanel(/* update = */ false); -} - void LLSidepanelAppearance::showOutfitsInventoryPanel() { toggleWearableEditPanel(FALSE); toggleOutfitEditPanel(FALSE); + togglMyOutfitsPanel(TRUE); +} + +void LLSidepanelAppearance::showOutfitEditPanel() +{ + togglMyOutfitsPanel(FALSE); + toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode + toggleOutfitEditPanel(TRUE); +} + +void LLSidepanelAppearance::showWearableEditPanel(LLWearable *wearable /* = NULL*/) +{ + togglMyOutfitsPanel(FALSE); + toggleOutfitEditPanel(FALSE, TRUE); // don't switch out of edit appearance mode + toggleWearableEditPanel(TRUE, wearable); } -void LLSidepanelAppearance::showOutfitEditPanel(bool update) +void LLSidepanelAppearance::togglMyOutfitsPanel(BOOL visible) { - if (!mOutfitEdit) + if (!mPanelOutfitsInventory || mPanelOutfitsInventory->getVisible() == visible) + { + // visibility isn't changing, hence nothing to do return; + } - toggleWearableEditPanel(FALSE); - toggleOutfitEditPanel(TRUE); + mPanelOutfitsInventory->setVisible(visible); - if (update) + // *TODO: Move these controls to panel_outfits_inventory.xml + // so that we don't need to toggle them explicitly. + mFilterEditor->setVisible(visible); + mNewOutfitBtn->setVisible(visible); + mCurrOutfitPanel->setVisible(visible); + + if (visible) { - mOutfitEdit->displayCurrentOutfit(); + mPanelOutfitsInventory->onOpen(LLSD()); } } -void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible) +void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch) { - if (!mOutfitEdit) - return; - - if (mOutfitEdit->getVisible() == visible) + if (!mOutfitEdit || mOutfitEdit->getVisible() == visible) { // visibility isn't changing, hence nothing to do return; } mOutfitEdit->setVisible(visible); - if (mPanelOutfitsInventory) mPanelOutfitsInventory->setVisible(!visible); - mFilterEditor->setVisible(!visible); - mNewOutfitBtn->setVisible(!visible); - mCurrOutfitPanel->setVisible(!visible); + + if (visible) + { + mOutfitEdit->onOpen(LLSD()); + if (!disable_camera_switch && gSavedSettings.getBOOL("AppearanceCameraMovement") ) + { + gAgentCamera.changeCameraToCustomizeAvatar(); + } + } + else if (!disable_camera_switch && gSavedSettings.getBOOL("AppearanceCameraMovement") ) + { + gAgentCamera.changeCameraToDefault(); + } } -void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *wearable) +void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *wearable, BOOL disable_camera_switch) { - if (mEditWearable->getVisible() == visible) + if (!mEditWearable || mEditWearable->getVisible() == visible) { // visibility isn't changing, hence nothing to do return; @@ -309,24 +337,32 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we { wearable = gAgentWearables.getWearable(LLWearableType::WT_SHAPE, 0); } - if (!mEditWearable || !wearable) + if (!wearable) { return; } - // Save changes if closing. - if (!visible) - { - mEditWearable->saveChanges(); - } - // Toggle panel visibility. - mCurrOutfitPanel->setVisible(!visible); - mEditWearable->setVisible(visible); mEditWearable->setWearable(wearable); - mFilterEditor->setVisible(!visible); - mPanelOutfitsInventory->setVisible(!visible); + + if (visible) + { + mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency + if (!disable_camera_switch && gSavedSettings.getBOOL("AppearanceCameraMovement") ) + { + gAgentCamera.changeCameraToCustomizeAvatar(); + } + } + else + { + // Save changes if closing. + mEditWearable->saveChanges(); + if (!disable_camera_switch && gSavedSettings.getBOOL("AppearanceCameraMovement") ) + { + gAgentCamera.changeCameraToDefault(); + } + } } void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) @@ -356,11 +392,13 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) } //static -void LLSidepanelAppearance::editWearable(LLWearable *wearable, void *data) +void LLSidepanelAppearance::editWearable(LLWearable *wearable, LLView *data) { - LLSidepanelAppearance *panel = (LLSidepanelAppearance*) data; - panel->toggleOutfitEditPanel(FALSE); - panel->toggleWearableEditPanel(TRUE, wearable); + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data); + if (panel) + { + panel->showWearableEditPanel(wearable); + } } // Fetch currently worn items and only enable the New Look button after everything's been diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index a919b07ed6..12303b6e96 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -47,6 +47,7 @@ class LLPanelOutfitsInventory; class LLSidepanelAppearance : public LLPanel { + LOG_CLASS(LLSidepanelAppearance); public: LLSidepanelAppearance(); virtual ~LLSidepanelAppearance(); @@ -56,14 +57,15 @@ public: void refreshCurrentOutfitName(const std::string& name = ""); - static void editWearable(LLWearable *wearable, void *data); + static void editWearable(LLWearable *wearable, LLView *data); void fetchInventory(); void inventoryFetched(); void onNewOutfitButtonClicked(); void showOutfitsInventoryPanel(); - void showOutfitEditPanel(bool update); + void showOutfitEditPanel(); + void showWearableEditPanel(LLWearable *wearable = NULL); void setWearablesLoading(bool val); private: @@ -71,12 +73,10 @@ private: void onOpenOutfitButtonClicked(); void onEditAppearanceButtonClicked(); - void onEditOutfitButtonClicked(); - void onEditWearBackClicked(); - //@deprecated use showXXX() methods instead - void toggleOutfitEditPanel(BOOL visible); - void toggleWearableEditPanel(BOOL visible, LLWearable* wearable = NULL); + void togglMyOutfitsPanel(BOOL visible); + void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE); + void toggleWearableEditPanel(BOOL visible, LLWearable* wearable = NULL, BOOL disable_camera_switch = FALSE); LLFilterEditor* mFilterEditor; LLPanelOutfitsInventory* mPanelOutfitsInventory; @@ -100,6 +100,9 @@ private: // Search string for filtering landmarks and teleport // history locations std::string mFilterSubString; + + // Gets set to true when we're opened for the first time. + bool mOpened; }; #endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 65b9184fe5..fc5143d33b 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -42,6 +42,7 @@ #include "llsidepaneltaskinfo.h" #include "lltabcontainer.h" #include "llselectmgr.h" +#include "llweb.h" static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory"); @@ -70,6 +71,9 @@ BOOL LLSidepanelInventory::postBuild() mShareBtn = mInventoryPanel->getChild<LLButton>("share_btn"); mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); + LLButton* shop_btn = mInventoryPanel->getChild<LLButton>("shop_btn"); + shop_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShopButtonClicked, this)); + mWearBtn = mInventoryPanel->getChild<LLButton>("wear_btn"); mWearBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onWearButtonClicked, this)); @@ -155,6 +159,11 @@ void LLSidepanelInventory::onShareButtonClicked() LLAvatarActions::shareWithAvatars(); } +void LLSidepanelInventory::onShopButtonClicked() +{ + LLWeb::loadURLExternal(gSavedSettings.getString("MarketplaceURL")); +} + void LLSidepanelInventory::performActionOnSelection(const std::string &action) { LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 95eab3571c..2dc17e741d 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -79,6 +79,7 @@ private: protected: void onInfoButtonClicked(); void onShareButtonClicked(); + void onShopButtonClicked(); void onWearButtonClicked(); void onPlayButtonClicked(); void onTeleportButtonClicked(); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3ec1855484..9159f42968 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -66,6 +66,21 @@ static const std::string TAB_PANEL_CAPTION_TITLE_BOX = "sidetray_tab_title"; LLSideTray* LLSideTray::sInstance = 0; +/** + * Updates visibility of sidetray tabs buttons according to "SidebarWithButtonsVisibility" setting + * + * @param force_set_visible if true method ignores setting value and set buttons visible. + */ +static void update_tabs_buttons_visibility(bool force_set_visible = false) +{ + LLView* side_bar_tabs = gViewerWindow->getRootView()->getChildView("side_bar_tabs"); + if (side_bar_tabs) + { + BOOL visible = LLUI::sSettingGroups["config"]->getBOOL("SidebarWithButtonsVisibility"); + side_bar_tabs->setVisible(force_set_visible || visible); + } +} + LLSideTray* LLSideTray::getInstance() { if (!sInstance) @@ -258,6 +273,8 @@ LLSideTray::LLSideTray(Params& params) p.name = "buttons_panel"; p.mouse_opaque = false; mButtonsPanel = LLUICtrlFactory::create<LLPanel>(p); + + initControlSettings(); } @@ -547,6 +564,7 @@ void LLSideTray::collapseSideBar() reflectCollapseChange(); setFocus( FALSE ); + update_tabs_buttons_visibility(); } void LLSideTray::expandSideBar() @@ -572,6 +590,7 @@ void LLSideTray::expandSideBar() btn->setImageOverlay( mActiveTab->mImageSelected ); } + update_tabs_buttons_visibility(true); } void LLSideTray::highlightFocused() @@ -638,6 +657,9 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para { panel->onOpen(params); } + + update_tabs_buttons_visibility(true); + return panel; } } @@ -720,11 +742,6 @@ bool LLSideTray::isPanelActive(const std::string& panel_name) return (panel->getName() == panel_name); } - -// *TODO: Eliminate magic constants. -static const S32 fake_offset = 132; -static const S32 fake_top_offset = 18; - void LLSideTray::updateSidetrayVisibility() { // set visibility of parent container based on collapsed state @@ -734,3 +751,35 @@ void LLSideTray::updateSidetrayVisibility() } } +void LLSideTray::initControlSettings() +{ + // set listeners to process runtime setting changes + LLUI::sSettingGroups["config"]->getControl("SidebarWithButtonsVisibility")->getSignal()->connect(boost::bind(&LLSideTray::toggleSidetrayAndTabButtonsVisibility, this, _2)); + + // update visibility according to current value + toggleSidetrayAndTabButtonsVisibility(LLUI::sSettingGroups["config"]->getBOOL("SidebarWithButtonsVisibility")); +} + +// sidebar visibility is implemented via its expanding/collapsing +void LLSideTray::toggleSidetrayAndTabButtonsVisibility(const LLSD::Boolean& new_visibility) +{ + // If new_visibility==FALSE it gets invisible but still can be expanded in other ways (Ctrl+I to see My Inventory) + + // store collapsed state to restore it properly on next call + static bool was_collapsed = false; + + if (!new_visibility && !mCollapsed) + { + collapseSideBar(); + was_collapsed = true; + } + // should be visible: expand only if it was expanded when has been collapsed on previous call + else if (new_visibility && was_collapsed) + { + if (mCollapsed) expandSideBar(); + was_collapsed = false; + } + + update_tabs_buttons_visibility(new_visibility); +} + diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index e8fdee9430..ed6b376d5c 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -179,6 +179,16 @@ private: LLSideTray::getInstance()->setEnabled(FALSE); } + /** + * Initializes listener of SidebarWithButtonsVisibility setting and updates state according to it. + */ + void initControlSettings(); + + /** + * Updates Sidebar and its Tab Buttons visibility according to passed value. + */ + void toggleSidetrayAndTabButtonsVisibility(const LLSD::Boolean& new_visibility); + private: LLPanel* mButtonsPanel; diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h index 28c23561cf..1210c398f1 100644 --- a/indra/newview/llslurl.h +++ b/indra/newview/llslurl.h @@ -65,7 +65,7 @@ public: }; - LLSLURL(): mType(LAST_LOCATION) { } + LLSLURL(): mType(INVALID) { } LLSLURL(const std::string& slurl); LLSLURL(const std::string& grid, const std::string& region); LLSLURL(const std::string& region, const LLVector3& position); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b98aec1f6c..eb265e60b0 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3058,7 +3058,7 @@ bool process_login_success_response() // Default male and female avatars allowing the user to choose their avatar on first login. // These may be passed up by SLE to allow choice of enterprise avatars instead of the standard // "new ruth." Not to be confused with 'initial-outfit' below - LLSD newuser_config = response["newuser-config"]; + LLSD newuser_config = response["newuser-config"][0]; if(newuser_config.has("DefaultFemaleAvatar")) { gSavedSettings.setString("DefaultFemaleAvatar", newuser_config["DefaultFemaleAvatar"].asString()); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index b660a2b8ea..5628205dd4 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -41,6 +41,7 @@ #include "llcommandhandler.h" #include "llviewercontrol.h" #include "llfloaterbuycurrency.h" +#include "llbuycurrencyhtml.h" #include "llfloaterlagmeter.h" #include "llpanelnearbymedia.h" #include "llpanelvolumepulldown.h" @@ -509,7 +510,9 @@ S32 LLStatusBar::getSquareMetersLeft() const void LLStatusBar::onClickBuyCurrency() { - LLFloaterBuyCurrency::buyCurrency(); + // open a currency floater - actual one open depends on + // value specified in settings.xml + LLBuyCurrencyHTML::openCurrencyFloater(); } static void onClickHealth(void* ) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 9aebc264a2..efdddd947b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1304,7 +1304,7 @@ void LLTextureCtrl::draw() LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); v_offset += 12; - tdesc = llformat(" ID : %s...", (mImageAssetID.asString().substr(0,10)).c_str()); + tdesc = llformat(" ID : %s...", (mImageAssetID.asString().substr(0,7)).c_str()); font->renderUTF8(tdesc, 0, llfloor(interior.mLeft+3), llfloor(interior.mTop-v_offset), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); } diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 9275ca4f42..38f67720b7 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -495,12 +495,6 @@ void LLToastNotifyPanel::onClickButton(void* data) if(is_reusable) { sButtonClickSignal(self->mNotification->getID(), button_name); - - if(new_info && !self->mNotification->isPersistent()) - { - self->mNotification->setResponseFunctor( - boost::bind(&LLOfferInfo::inventory_offer_callback, new_info, _1, _2)); - } } else { diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 774626f19d..8a8bdd2dba 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -38,7 +38,6 @@ // project headers #include "llagent.h" #include "llagentcamera.h" -#include "llagentui.h" #include "llagentwearables.h" #include "llappearancemgr.h" #include "lldictionary.h" @@ -46,31 +45,26 @@ #include "llfloaterreg.h" #include "llfloatertools.h" #include "llgesturemgr.h" +#include "llgiveinventory.h" #include "llhudmanager.h" #include "llhudeffecttrail.h" -#include "llimview.h" +//#include "llimview.h" #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfunctions.h" -#include "llmutelist.h" #include "llpreviewnotecard.h" -#include "llrecentpeople.h" #include "llrootview.h" #include "llselectmgr.h" #include "lltoolmgr.h" #include "lltooltip.h" #include "lltrans.h" #include "llviewerobjectlist.h" +#include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" -// MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES -// or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a -// bit from there to give some pad. -const S32 MAX_ITEMS = 42; - // syntactic sugar #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) @@ -145,29 +139,6 @@ bool LLDroppableItem::operator()(LLInventoryCategory* cat, return allowed; } -class LLUncopyableItems : public LLInventoryCollectFunctor -{ -public: - LLUncopyableItems() {} - virtual ~LLUncopyableItems() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); -}; - -bool LLUncopyableItems::operator()(LLInventoryCategory* cat, - LLInventoryItem* item) -{ - bool uncopyable = false; - if (item) - { - if (itemTransferCommonlyAllowed(item) && - !item->getPermissions().allowCopyBy(gAgent.getID())) - { - uncopyable = true; - } - } - return uncopyable; -} - class LLDropCopyableItems : public LLInventoryCollectFunctor { public: @@ -195,43 +166,6 @@ bool LLDropCopyableItems::operator()( return allowed; } -class LLGiveable : public LLInventoryCollectFunctor -{ -public: - LLGiveable() : mCountLosing(0) {} - virtual ~LLGiveable() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); - - S32 countNoCopy() const { return mCountLosing; } -protected: - S32 mCountLosing; -}; - -bool LLGiveable::operator()(LLInventoryCategory* cat, LLInventoryItem* item) -{ - // All categories can be given. - if (cat) - return true; - - bool allowed = false; - if (item) - { - allowed = itemTransferCommonlyAllowed(item); - if (allowed && - !item->getPermissions().allowOperationBy(PERM_TRANSFER, - gAgent.getID())) - { - allowed = FALSE; - } - if (allowed && - !item->getPermissions().allowCopyBy(gAgent.getID())) - { - ++mCountLosing; - } - } - return allowed; -} - // Starts a fetch on folders and items. This is really not used // as an observer in the traditional sense; we're just using it to // request a fetch and we don't care about when/if the response arrives. @@ -1419,422 +1353,6 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, gFloaterTools->dirty(); } -void LLToolDragAndDrop::giveInventory(const LLUUID& to_agent, - LLInventoryItem* item, - const LLUUID& im_session_id) - -{ - llinfos << "LLToolDragAndDrop::giveInventory()" << llendl; - if (!isInventoryGiveAcceptable(item)) - { - return; - } - if (item->getPermissions().allowCopyBy(gAgent.getID())) - { - // just give it away. - LLToolDragAndDrop::commitGiveInventoryItem(to_agent, item, im_session_id); - } - else - { - // ask if the agent is sure. - LLSD payload; - payload["agent_id"] = to_agent; - payload["item_id"] = item->getUUID(); - LLNotificationsUtil::add("CannotCopyWarning", LLSD(), payload, - &LLToolDragAndDrop::handleCopyProtectedItem); - } -} -// static -bool LLToolDragAndDrop::handleCopyProtectedItem(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - LLInventoryItem* item = NULL; - switch(option) - { - case 0: // "Yes" - item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); - if (item) - { - LLToolDragAndDrop::commitGiveInventoryItem(notification["payload"]["agent_id"].asUUID(), - item); - // delete it for now - it will be deleted on the server - // quickly enough. - gInventory.deleteObject(notification["payload"]["item_id"].asUUID()); - gInventory.notifyObservers(); - } - else - { - LLNotificationsUtil::add("CannotGiveItem"); - } - break; - - default: // no, cancel, whatever, who cares, not yes. - LLNotificationsUtil::add("TransactionCancelled"); - break; - } - return false; -} - -// static -void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, - LLInventoryItem* item, - const LLUUID& im_session_id) -{ - if (!item) return; - std::string name; - LLAgentUI::buildFullname(name); - LLUUID transaction_id; - transaction_id.generate(); - const S32 BUCKET_SIZE = sizeof(U8) + UUID_BYTES; - U8 bucket[BUCKET_SIZE]; - bucket[0] = (U8)item->getType(); - memcpy(&bucket[1], &(item->getUUID().mData), UUID_BYTES); /* Flawfinder: ignore */ - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - to_agent, - name, - item->getName(), - IM_ONLINE, - IM_INVENTORY_OFFERED, - transaction_id, - 0, - LLUUID::null, - gAgent.getPositionAgent(), - NO_TIMESTAMP, - bucket, - BUCKET_SIZE); - gAgent.sendReliableMessage(); - - // VEFFECT: giveInventory - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); - effectp->setSourceObject(gAgentAvatarp); - effectp->setTargetObject(gObjectList.findObject(to_agent)); - effectp->setDuration(LL_HUD_DUR_SHORT); - effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gFloaterTools->dirty(); - - LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); - - logInventoryOffer(to_agent, im_session_id); - - // add buddy to recent people list - LLRecentPeople::instance().add(to_agent); -} - -//static -void LLToolDragAndDrop::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im_session_id) -{ - // compute id of possible IM session with agent that has "to_agent" id - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, to_agent); - // If this item was given by drag-and-drop into an IM panel, log this action in the IM panel chat. - if (im_session_id.notNull()) - { - LLSD args; - gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); - } - // If this item was given by drag-and-drop on avatar while IM panel was open, log this action in the IM panel chat. - else if (LLIMModel::getInstance()->findIMSession(session_id)) - { - LLSD args; - gIMMgr->addSystemMessage(session_id, "inventory_item_offered", args); - } - // If this item was given by drag-and-drop on avatar while IM panel wasn't open, log this action to IM history. - else - { - std::string full_name; - if (gCacheName->getFullName(to_agent, full_name)) - { - LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im")); - } - } -} - -void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* cat, - const LLUUID& im_session_id) - -{ - if (!cat) return; - llinfos << "LLToolDragAndDrop::giveInventoryCategory() - " - << cat->getUUID() << llendl; - - if (!isAgentAvatarValid()) return; - - // Test out how many items are being given. - LLViewerInventoryCategory::cat_array_t cats; - LLViewerInventoryItem::item_array_t items; - LLGiveable giveable; - gInventory.collectDescendentsIf (cat->getUUID(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - giveable); - S32 count = cats.count(); - bool complete = true; - for(S32 i = 0; i < count; ++i) - { - if (!gInventory.isCategoryComplete(cats.get(i)->getUUID())) - { - complete = false; - break; - } - } - if (!complete) - { - LLNotificationsUtil::add("IncompleteInventory"); - return; - } - count = items.count() + cats.count(); - if (count > MAX_ITEMS) - { - LLNotificationsUtil::add("TooManyItems"); - return; - } - else if (count == 0) - { - LLNotificationsUtil::add("NoItems"); - return; - } - else - { - if (0 == giveable.countNoCopy()) - { - LLToolDragAndDrop::commitGiveInventoryCategory(to_agent, cat, im_session_id); - } - else - { - LLSD args; - args["COUNT"] = llformat("%d",giveable.countNoCopy()); - LLSD payload; - payload["agent_id"] = to_agent; - payload["folder_id"] = cat->getUUID(); - LLNotificationsUtil::add("CannotCopyCountItems", args, payload, &LLToolDragAndDrop::handleCopyProtectedCategory); - } - } -} - - -// static -bool LLToolDragAndDrop::handleCopyProtectedCategory(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - LLInventoryCategory* cat = NULL; - switch(option) - { - case 0: // "Yes" - cat = gInventory.getCategory(notification["payload"]["folder_id"].asUUID()); - if (cat) - { - LLToolDragAndDrop::commitGiveInventoryCategory(notification["payload"]["agent_id"].asUUID(), - cat); - LLViewerInventoryCategory::cat_array_t cats; - LLViewerInventoryItem::item_array_t items; - LLUncopyableItems remove; - gInventory.collectDescendentsIf (cat->getUUID(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - remove); - S32 count = items.count(); - for(S32 i = 0; i < count; ++i) - { - gInventory.deleteObject(items.get(i)->getUUID()); - } - gInventory.notifyObservers(); - } - else - { - LLNotificationsUtil::add("CannotGiveCategory"); - } - break; - - default: // no, cancel, whatever, who cares, not yes. - LLNotificationsUtil::add("TransactionCancelled"); - break; - } - return false; -} - -// static -void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* cat, - const LLUUID& im_session_id) - -{ - if (!cat) return; - llinfos << "LLToolDragAndDrop::commitGiveInventoryCategory() - " - << cat->getUUID() << llendl; - - // add buddy to recent people list - LLRecentPeople::instance().add(to_agent); - - // Test out how many items are being given. - LLViewerInventoryCategory::cat_array_t cats; - LLViewerInventoryItem::item_array_t items; - LLGiveable giveable; - gInventory.collectDescendentsIf (cat->getUUID(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - giveable); - - // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < - // MTUBYTES or 18 * count < 1200 => count < 1200/18 => - // 66. I've cut it down a bit from there to give some pad. - S32 count = items.count() + cats.count(); - if (count > MAX_ITEMS) - { - LLNotificationsUtil::add("TooManyItems"); - return; - } - else if (count == 0) - { - LLNotificationsUtil::add("NoItems"); - return; - } - else - { - std::string name; - LLAgentUI::buildFullname(name); - LLUUID transaction_id; - transaction_id.generate(); - S32 bucket_size = (sizeof(U8) + UUID_BYTES) * (count + 1); - U8* bucket = new U8[bucket_size]; - U8* pos = bucket; - U8 type = (U8)cat->getType(); - memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ - pos += sizeof(U8); - memcpy(pos, &(cat->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ - pos += UUID_BYTES; - S32 i; - count = cats.count(); - for(i = 0; i < count; ++i) - { - memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ - pos += sizeof(U8); - memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ - pos += UUID_BYTES; - } - count = items.count(); - for(i = 0; i < count; ++i) - { - type = (U8)items.get(i)->getType(); - memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ - pos += sizeof(U8); - memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ - pos += UUID_BYTES; - } - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - to_agent, - name, - cat->getName(), - IM_ONLINE, - IM_INVENTORY_OFFERED, - transaction_id, - 0, - LLUUID::null, - gAgent.getPositionAgent(), - NO_TIMESTAMP, - bucket, - bucket_size); - gAgent.sendReliableMessage(); - delete[] bucket; - - // VEFFECT: giveInventoryCategory - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); - effectp->setSourceObject(gAgentAvatarp); - effectp->setTargetObject(gObjectList.findObject(to_agent)); - effectp->setDuration(LL_HUD_DUR_SHORT); - effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gFloaterTools->dirty(); - - LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); - - logInventoryOffer(to_agent, im_session_id); - } -} - -// static -BOOL LLToolDragAndDrop::isInventoryGiveAcceptable(LLInventoryItem* item) -{ - if (!item) - { - return FALSE; - } - if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) - { - return FALSE; - } - BOOL copyable = FALSE; - if (item->getPermissions().allowCopyBy(gAgent.getID())) copyable = TRUE; - - if (!isAgentAvatarValid()) return FALSE; - - BOOL acceptable = TRUE; - switch(item->getType()) - { - case LLAssetType::AT_OBJECT: - if (gAgentAvatarp->isWearingAttachment(item->getUUID())) - { - acceptable = FALSE; - } - break; - case LLAssetType::AT_BODYPART: - case LLAssetType::AT_CLOTHING: - if (!copyable && gAgentWearables.isWearingItem(item->getUUID())) - { - acceptable = FALSE; - } - break; - default: - break; - } - return acceptable; -} - -// Static -BOOL LLToolDragAndDrop::isInventoryGroupGiveAcceptable(LLInventoryItem* item) -{ - if (!item) - { - return FALSE; - } - - // These permissions are double checked in the simulator in - // LLGroupNoticeInventoryItemFetch::result(). - if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) - { - return FALSE; - } - if (!item->getPermissions().allowCopyBy(gAgent.getID())) - { - return FALSE; - } - - if (!isAgentAvatarValid()) return FALSE; - - BOOL acceptable = TRUE; - switch(item->getType()) - { - case LLAssetType::AT_OBJECT: - if (gAgentAvatarp->isWearingAttachment(item->getUUID())) - { - acceptable = FALSE; - } - break; - default: - break; - } - return acceptable; -} - // accessor that looks at permissions, copyability, and names of // inventory items to determine if a drop would be ok. EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LLInventoryItem* item) @@ -1928,13 +1446,13 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if (gInventory.getItem(inv_item->getUUID()) - && LLToolDragAndDrop::isInventoryGiveAcceptable(inv_item)) + && LLGiveInventory::isInventoryGiveAcceptable(inv_item)) { // *TODO: get multiple object transfers working *accept = ACCEPT_YES_COPY_SINGLE; if (drop) { - LLToolDragAndDrop::giveInventory(dest_agent, inv_item, session_id); + LLGiveInventory::doGiveInventoryItem(dest_agent, inv_item, session_id); } } else @@ -1956,7 +1474,7 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ *accept = ACCEPT_YES_COPY_SINGLE; if (drop) { - LLToolDragAndDrop::giveInventoryCategory(dest_agent, inv_cat, session_id); + LLGiveInventory::doGiveInventoryCategory(dest_agent, inv_cat, session_id); } } else @@ -2633,7 +2151,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject( { if (drop) { - giveInventory(obj->getID(), item ); + LLGiveInventory::doGiveInventoryItem(obj->getID(), item ); } // *TODO: deal with all the issues surrounding multi-object // inventory transfers. @@ -2653,13 +2171,13 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventory( LLViewerInventoryCategory* cat; locateInventory(item, cat); if (!item || !item->isFinished()) return ACCEPT_NO; - if (!isInventoryGiveAcceptable(item)) + if (!LLGiveInventory::isInventoryGiveAcceptable(item)) { return ACCEPT_NO; } if (drop && obj) { - giveInventory(obj->getID(), item); + LLGiveInventory::doGiveInventoryItem(obj->getID(), item); } // *TODO: deal with all the issues surrounding multi-object // inventory transfers. @@ -2676,7 +2194,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory( LLViewerInventoryCategory* cat; locateInventory(item, cat); if (!cat) return ACCEPT_NO; - giveInventoryCategory(obj->getID(), cat); + LLGiveInventory::doGiveInventoryCategory(obj->getID(), cat); } // *TODO: deal with all the issues surrounding multi-object // inventory transfers. diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 85d003e5fc..18334b5ee1 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -214,32 +214,10 @@ protected: LLToolDragAndDrop::ESource source, const LLUUID& src_id); - - // give inventory item functionality - static bool handleCopyProtectedItem(const LLSD& notification, const LLSD& response); - static void commitGiveInventoryItem(const LLUUID& to_agent, - LLInventoryItem* item, - const LLUUID &im_session_id = LLUUID::null); - - // give inventory category functionality - static bool handleCopyProtectedCategory(const LLSD& notification, const LLSD& response); - static void commitGiveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* cat, - const LLUUID &im_session_id = LLUUID::null); - - // log "Inventory item offered" to IM - static void logInventoryOffer(const LLUUID& to_agent, - const LLUUID &im_session_id = LLUUID::null); - public: // helper functions static BOOL isInventoryDropAcceptable(LLViewerObject* obj, LLInventoryItem* item) { return (ACCEPT_YES_COPY_SINGLE <= willObjectAcceptInventory(obj, item)); } - // This simple helper function assumes you are attempting to - // transfer item. returns true if you can give, otherwise false. - static BOOL isInventoryGiveAcceptable(LLInventoryItem* item); - static BOOL isInventoryGroupGiveAcceptable(LLInventoryItem* item); - BOOL dadUpdateInventory(LLViewerObject* obj, BOOL drop); BOOL dadUpdateInventoryCategory(LLViewerObject* obj, BOOL drop); @@ -265,13 +243,6 @@ public: ESource source, const LLUUID& src_id); - static void giveInventory(const LLUUID& to_agent, - LLInventoryItem* item, - const LLUUID &session_id = LLUUID::null); - static void giveInventoryCategory(const LLUUID& to_agent, - LLInventoryCategory* item, - const LLUUID &session_id = LLUUID::null); - static bool handleGiveDragAndDrop(LLUUID agent, LLUUID session, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 22176c037f..22e15dcff2 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -79,6 +79,7 @@ LLVisualParamHint::LLVisualParamHint( S32 width, S32 height, LLViewerJointMesh *mesh, LLViewerVisualParam *param, + LLWearable *wearable, F32 param_weight) : LLViewerDynamicTexture(width, height, 3, LLViewerDynamicTexture::ORDER_MIDDLE, TRUE ), @@ -86,6 +87,7 @@ LLVisualParamHint::LLVisualParamHint( mIsVisible( FALSE ), mJointMesh( mesh ), mVisualParam( param ), + mWearablePtr( wearable ), mVisualParamWeight( param_weight ), mAllowsUpdates( TRUE ), mDelayFrames( 0 ), @@ -151,7 +153,7 @@ BOOL LLVisualParamHint::needsRender() void LLVisualParamHint::preRender(BOOL clear_depth) { mLastParamWeight = mVisualParam->getWeight(); - mVisualParam->setWeight(mVisualParamWeight, FALSE); + mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); gAgentAvatarp->setVisualParamWeight("Blink_Left", 0.f); gAgentAvatarp->setVisualParamWeight("Blink_Right", 0.f); @@ -250,10 +252,12 @@ BOOL LLVisualParamHint::render() gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight); - mVisualParam->setWeight(mLastParamWeight, FALSE); + mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight, FALSE); + gAgentAvatarp->updateVisualParams(); gGL.color4f(1,1,1,1); mGLTexturep->setGLTextureCreated(true); gGL.popUIMatrix(); + return TRUE; } diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h index c332c296bd..3bffefaa55 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -62,6 +62,7 @@ public: S32 width, S32 height, LLViewerJointMesh *mesh, LLViewerVisualParam *param, + LLWearable *wearable, F32 param_weight); /*virtual*/ S8 getType() const ; @@ -89,6 +90,7 @@ protected: BOOL mIsVisible; // is this distortion hint visible? LLViewerJointMesh* mJointMesh; // mesh that this distortion applies to LLViewerVisualParam* mVisualParam; // visual param applied by this hint + LLWearable* mWearablePtr; // wearable we're editing F32 mVisualParamWeight; // weight for this visual parameter BOOL mAllowsUpdates; // updates are blocked unless this is true S32 mDelayFrames; // updates are blocked for this many frames diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 514f72c334..f02e15706d 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -70,7 +70,6 @@ #include "llvosurfacepatch.h" #include "llvowlsky.h" #include "llrender.h" -#include "llbottomtray.h" #include "llnavigationbar.h" #include "llfloatertools.h" #include "llpaneloutfitsinventory.h" @@ -460,30 +459,6 @@ bool toggle_agent_pause(const LLSD& newvalue) return true; } -bool toggle_show_gesture_button(const LLSD& newvalue) -{ - LLBottomTray::getInstance()->showGestureButton(newvalue.asBoolean()); - return true; -} - -bool toggle_show_move_button(const LLSD& newvalue) -{ - LLBottomTray::getInstance()->showMoveButton(newvalue.asBoolean()); - return true; -} - -bool toggle_show_camera_button(const LLSD& newvalue) -{ - LLBottomTray::getInstance()->showCameraButton(newvalue.asBoolean()); - return true; -} - -bool toggle_show_snapshot_button(const LLSD& newvalue) -{ - LLBottomTray::getInstance()->showSnapshotButton(newvalue.asBoolean()); - return true; -} - bool toggle_show_navigation_panel(const LLSD& newvalue) { LLNavigationBar::getInstance()->showNavigationPanel(newvalue.asBoolean()); @@ -638,10 +613,6 @@ void settings_setup_listeners() gSavedSettings.getControl("QAMode")->getSignal()->connect(boost::bind(&show_debug_menus)); gSavedSettings.getControl("UseDebugMenus")->getSignal()->connect(boost::bind(&show_debug_menus)); gSavedSettings.getControl("AgentPause")->getSignal()->connect(boost::bind(&toggle_agent_pause, _2)); - gSavedSettings.getControl("ShowGestureButton")->getSignal()->connect(boost::bind(&toggle_show_gesture_button, _2)); - gSavedSettings.getControl("ShowMoveButton")->getSignal()->connect(boost::bind(&toggle_show_move_button, _2)); - gSavedSettings.getControl("ShowCameraButton")->getSignal()->connect(boost::bind(&toggle_show_camera_button, _2)); - gSavedSettings.getControl("ShowSnapshotButton")->getSignal()->connect(boost::bind(&toggle_show_snapshot_button, _2)); gSavedSettings.getControl("ShowNavbarNavigationPanel")->getSignal()->connect(boost::bind(&toggle_show_navigation_panel, _2)); gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2)); gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2)); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 506cebfe73..49ea0348f9 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -49,6 +49,7 @@ #include "llfloaterbuy.h" #include "llfloaterbuycontents.h" #include "llfloaterbuycurrency.h" +#include "llfloaterbuycurrencyhtml.h" #include "llfloaterbuyland.h" #include "llfloaterbulkpermission.h" #include "llfloaterbump.h" @@ -141,6 +142,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("beacons", "floater_beacons.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBeacons>); LLFloaterReg::add("bulk_perms", "floater_bulk_perms.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBulkPermission>); LLFloaterReg::add("buy_currency", "floater_buy_currency.xml", &LLFloaterBuyCurrency::buildFloater); + LLFloaterReg::add("buy_currency_html", "floater_buy_currency_html.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuyCurrencyHTML>); LLFloaterReg::add("buy_land", "floater_buy_land.xml", &LLFloaterBuyLand::buildFloater); LLFloaterReg::add("buy_object", "floater_buy_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuy>); LLFloaterReg::add("buy_object_contents", "floater_buy_contents.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuyContents>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 23b49e51e8..94dc2911f5 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -101,6 +101,7 @@ public: mInventoryItemsDict["Female Gestures"] = LLTrans::getString("Female Gestures"); mInventoryItemsDict["Other Gestures"] = LLTrans::getString("Other Gestures"); mInventoryItemsDict["Speech Gestures"] = LLTrans::getString("Speech Gestures"); + mInventoryItemsDict["Common Gestures"] = LLTrans::getString("Common Gestures"); //predefined gestures diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 4db05e8a98..7429a49ccf 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2795,6 +2795,42 @@ bool LLViewerMediaImpl::isPlayable() const return false; } +//////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMediaImpl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response ) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( 0 == option ) + { + LLSD payload = notification["payload"]; + std::string url = payload["url"].asString(); + S32 target_type = payload["target_type"].asInteger(); + clickLinkWithTarget(url, target_type); + } + return false; +} + + +//////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMediaImpl::clickLinkWithTarget(const std::string& url, const S32& target_type ) +{ + if (target_type == LLPluginClassMedia::TARGET_EXTERNAL) + { + // load target in an external browser + LLWeb::loadURLExternal(url); + } + else if (target_type == LLPluginClassMedia::TARGET_BLANK) + { + // load target in the user's preferred browser + LLWeb::loadURL(url); + } + else { + // unsupported link target - shouldn't happen + LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL; + } +} + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent event) { @@ -2808,6 +2844,31 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla } break; + case MEDIA_EVENT_CLICK_LINK_HREF: + { + LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << plugin->getClickTarget() << "\", uri is " << plugin->getClickURL() << LL_ENDL; + // retrieve the event parameters + std::string url = plugin->getClickURL(); + U32 target_type = plugin->getClickTargetType(); + + // is there is a target specified for the link? + if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || + target_type == LLPluginClassMedia::TARGET_BLANK ) + { + if (gSavedSettings.getBOOL("UseExternalBrowser")) + { + LLSD payload; + payload["url"] = url; + payload["target_type"] = LLSD::Integer(target_type); + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); + } + else + { + clickLinkWithTarget(url, target_type); + } + } + }; + break; case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH: { // The plugin failed to load properly. Make sure the timer doesn't retry. diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 8626f4469e..754d0851c3 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -391,6 +391,8 @@ private: bool shouldShowBasedOnClass() const; static bool isObjectAttachedToAnotherAvatar(LLVOVolume *obj); static bool isObjectInAgentParcel(LLVOVolume *obj); + static bool onClickLinkExternalTarget( const LLSD&, const LLSD& ); + static void clickLinkWithTarget(const std::string& url, const S32& target_type ); private: // a single media url with some data and an impl. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f31f1e80e1..bcd3a79a8a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -54,7 +54,7 @@ //#include "llfirstuse.h" #include "llfloaterbuy.h" #include "llfloaterbuycontents.h" -#include "llfloaterbuycurrency.h" +#include "llbuycurrencyhtml.h" #include "llfloatercustomize.h" #include "llfloatergodtools.h" #include "llfloaterinventory.h" @@ -292,8 +292,8 @@ void handle_toggle_pg(void*); void handle_dump_attachments(void *); void handle_dump_avatar_local_textures(void*); void handle_debug_avatar_textures(void*); -void handle_grab_texture(void*); -BOOL enable_grab_texture(void*); +void handle_grab_baked_texture(void*); +BOOL enable_grab_baked_texture(void*); void handle_dump_region_object_cache(void*); BOOL enable_save_into_inventory(void*); @@ -1460,28 +1460,28 @@ class LLAdvancedGrabBakedTexture : public view_listener_t std::string texture_type = userdata.asString(); if ("iris" == texture_type) { - handle_grab_texture( (void*)TEX_EYES_BAKED ); + handle_grab_baked_texture( (void*)BAKED_EYES ); } else if ("head" == texture_type) { - handle_grab_texture( (void*)TEX_HEAD_BAKED ); + handle_grab_baked_texture( (void*)BAKED_HEAD ); } else if ("upper" == texture_type) { - handle_grab_texture( (void*)TEX_UPPER_BAKED ); + handle_grab_baked_texture( (void*)BAKED_UPPER ); } else if ("lower" == texture_type) { - handle_grab_texture( (void*)TEX_SKIRT_BAKED ); + handle_grab_baked_texture( (void*)BAKED_LOWER ); } else if ("skirt" == texture_type) { - handle_grab_texture( (void*)TEX_SKIRT_BAKED ); + handle_grab_baked_texture( (void*)BAKED_SKIRT ); } else if ("hair" == texture_type) { - handle_grab_texture( (void*)TEX_HAIR_BAKED ); -} + handle_grab_baked_texture( (void*)BAKED_HAIR ); + } return true; } @@ -1496,23 +1496,27 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t if ("iris" == texture_type) { - new_value = enable_grab_texture( (void*)TEX_EYES_BAKED ); + new_value = enable_grab_baked_texture( (void*)BAKED_EYES ); } else if ("head" == texture_type) { - new_value = enable_grab_texture( (void*)TEX_HEAD_BAKED ); + new_value = enable_grab_baked_texture( (void*)BAKED_HEAD ); } else if ("upper" == texture_type) { - new_value = enable_grab_texture( (void*)TEX_UPPER_BAKED ); + new_value = enable_grab_baked_texture( (void*)BAKED_UPPER ); } else if ("lower" == texture_type) { - new_value = enable_grab_texture( (void*)TEX_LOWER_BAKED ); + new_value = enable_grab_baked_texture( (void*)BAKED_LOWER ); } else if ("skirt" == texture_type) { - new_value = enable_grab_texture( (void*)TEX_SKIRT_BAKED ); + new_value = enable_grab_baked_texture( (void*)BAKED_SKIRT ); + } + else if ("hair" == texture_type) + { + new_value = enable_grab_baked_texture( (void*)BAKED_HAIR ); } return new_value; @@ -3231,7 +3235,7 @@ void handle_buy_object(LLSaleInfo sale_info) { LLStringUtil::format_map_t args; args["AMOUNT"] = llformat("%d", price); - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_object_costs", args), price); + LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("this_object_costs", args), price ); return; } @@ -3572,6 +3576,14 @@ class LLEditEnableCustomizeAvatar : public view_listener_t } }; +class LLEnableEditShape : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return gAgentWearables.isWearableModifiable(LLWearableType::WT_SHAPE, 0); + } +}; + bool enable_sit_object() { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -4361,8 +4373,7 @@ void handle_buy_or_take() { LLStringUtil::format_map_t args; args["AMOUNT"] = llformat("%d", total_price); - LLFloaterBuyCurrency::buyCurrency( - LLTrans::getString("BuyingCosts", args), total_price); + LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString( "BuyingCosts", args ), total_price ); } } else @@ -5543,6 +5554,16 @@ void handle_customize_avatar() LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "my_outfits")); } +void handle_edit_outfit() +{ + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); +} + +void handle_edit_shape() +{ + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_shape")); +} + void handle_report_abuse() { // Prevent menu from appearing in screen shot. @@ -5552,7 +5573,7 @@ void handle_report_abuse() void handle_buy_currency() { - LLFloaterBuyCurrency::buyCurrency(); + LLBuyCurrencyHTML::openCurrencyFloater(); } class LLFloaterVisible : public view_listener_t @@ -6876,27 +6897,20 @@ void handle_debug_avatar_textures(void*) } } -void handle_grab_texture(void* data) +void handle_grab_baked_texture(void* data) { - ETextureIndex tex_index = (ETextureIndex)((intptr_t)data); + EBakedTextureIndex baked_tex_index = (EBakedTextureIndex)((intptr_t)data); if (!isAgentAvatarValid()) return; - // MULTI-WEARABLE: change to support an index - const LLUUID& asset_id = gAgentAvatarp->grabLocalTexture(tex_index, 0); + const LLUUID& asset_id = gAgentAvatarp->grabBakedTexture(baked_tex_index); LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl; LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE; LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE; const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type)); if(folder_id.notNull()) { - std::string name = "Unknown"; - const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(tex_index); - if (texture_dict->mIsBakedTexture) - { - EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - name = "Baked " + LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index)->mNameCapitalized; - } - name += " Texture"; + std::string name; + name = "Baked " + LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_tex_index)->mNameCapitalized + " Texture"; LLUUID item_id; item_id.generate(); @@ -6949,13 +6963,12 @@ void handle_grab_texture(void* data) } } -BOOL enable_grab_texture(void* data) +BOOL enable_grab_baked_texture(void* data) { - ETextureIndex index = (ETextureIndex)((intptr_t)data); + EBakedTextureIndex index = (EBakedTextureIndex)((intptr_t)data); if (isAgentAvatarValid()) { - // MULTI-WEARABLE: - return gAgentAvatarp->canGrabLocalTexture(index,0); + return gAgentAvatarp->canGrabBakedTexture(index); } return FALSE; } @@ -7659,7 +7672,10 @@ void initialize_menus() view_listener_t::addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate"); view_listener_t::addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff"); view_listener_t::addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar"); + view_listener_t::addMenu(new LLEnableEditShape(), "Edit.EnableEditShape"); commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar)); + commit.add("EditOutfit", boost::bind(&handle_edit_outfit)); + commit.add("EditShape", boost::bind(&handle_edit_shape)); // View menu view_listener_t::addMenu(new LLViewMouselook(), "View.Mouselook"); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index c415d89e9c..5570fe5fec 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -39,7 +39,7 @@ #include "llagentcamera.h" #include "llfilepicker.h" #include "llfloaterreg.h" -#include "llfloaterbuycurrency.h" +#include "llbuycurrencyhtml.h" #include "llfloatersnapshot.h" #include "llimage.h" #include "llimagebmp.h" @@ -811,7 +811,7 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt LLStringUtil::format_map_t args; args["NAME"] = data->mAssetInfo.getName(); args["AMOUNT"] = llformat("%d", expected_upload_cost); - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("UploadingCosts", args), expected_upload_cost); + LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("UploadingCosts", args), expected_upload_cost ); is_balance_sufficient = FALSE; } else if(region) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3d486d3889..21ba38ecfc 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -57,8 +57,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llcallingcard.h" -//#include "llfirstuse.h" -#include "llfloaterbuycurrency.h" +#include "llbuycurrencyhtml.h" #include "llfloaterbuyland.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" @@ -287,7 +286,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ { LLStringUtil::format_map_t args; args["AMOUNT"] = llformat("%d", amount); - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("giving", args), amount); + LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("giving", args), amount ); } } @@ -2613,8 +2612,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); if(SYSTEM_FROM != name && nearby_chat) { + chat.mOwnerID = from_id; LLSD args; - args["owner_id"] = from_id; args["slurl"] = location; args["type"] = LLNotificationsUI::NT_NEARBYCHAT; LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args); @@ -3162,7 +3161,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // object inspect for an object that is chatting with you LLSD args; args["type"] = LLNotificationsUI::NT_NEARBYCHAT; - args["owner_id"] = owner_id; + chat.mOwnerID = owner_id; LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args); } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 7812867667..c76eee80f7 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -257,7 +257,11 @@ void LLGridManager::initialize(const std::string& grid_file) // load a grid from the command line. // if the actual grid name is specified from the command line, // set it as the 'selected' grid. - mGrid = gSavedSettings.getString("CmdLineGridChoice"); + std::string cmd_line_grid = gSavedSettings.getString("CmdLineGridChoice"); + if(!cmd_line_grid.empty()) + { + mGrid = getGridByLabel(cmd_line_grid); + } LL_INFOS("GridManager") << "Grid Name: " << mGrid << LL_ENDL; // If a command line login URI was passed in, so we should add the command diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ca3369a55a..25bed6c0be 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -622,107 +622,112 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK x = llround((F32)x / mDisplayScale.mV[VX]); y = llround((F32)y / mDisplayScale.mV[VY]); - if (down) - { - buttonstatestr = "down" ; - } - else - { - buttonstatestr = "up" ; - } - - switch (clicktype) - { - case LLMouseHandler::CLICK_LEFT: - mLeftMouseDown = down; - buttonname = "Left"; - break; - case LLMouseHandler::CLICK_RIGHT: - mRightMouseDown = down; - buttonname = "Right"; - break; - case LLMouseHandler::CLICK_MIDDLE: - mMiddleMouseDown = down; - buttonname = "Middle"; - break; - case LLMouseHandler::CLICK_DOUBLELEFT: - mLeftMouseDown = down; - buttonname = "Left Double Click"; - break; - } - - LLView::sMouseHandlerMessage.clear(); + // only send mouse clicks to UI if UI is visible + if(gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { - if (gMenuBarView) - { - // stop ALT-key access to menu - gMenuBarView->resetMenuTrigger(); - } + if (down) + { + buttonstatestr = "down" ; + } + else + { + buttonstatestr = "up" ; + } + + switch (clicktype) + { + case LLMouseHandler::CLICK_LEFT: + mLeftMouseDown = down; + buttonname = "Left"; + break; + case LLMouseHandler::CLICK_RIGHT: + mRightMouseDown = down; + buttonname = "Right"; + break; + case LLMouseHandler::CLICK_MIDDLE: + mMiddleMouseDown = down; + buttonname = "Middle"; + break; + case LLMouseHandler::CLICK_DOUBLELEFT: + mLeftMouseDown = down; + buttonname = "Left Double Click"; + break; + } + + LLView::sMouseHandlerMessage.clear(); - if (gDebugClicks) - { - llinfos << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << llendl; - } + if (gMenuBarView) + { + // stop ALT-key access to menu + gMenuBarView->resetMenuTrigger(); + } - // Make sure we get a corresponding mouseup event, even if the mouse leaves the window - if (down) - mWindow->captureMouse(); - else - mWindow->releaseMouse(); + if (gDebugClicks) + { + llinfos << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << llendl; + } - // Indicate mouse was active - LLUI::resetMouseIdleTimer(); + // Make sure we get a corresponding mouseup event, even if the mouse leaves the window + if (down) + mWindow->captureMouse(); + else + mWindow->releaseMouse(); - // Don't let the user move the mouse out of the window until mouse up. - if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(down); - } + // Indicate mouse was active + LLUI::resetMouseIdleTimer(); - LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); - if( mouse_captor ) - { - S32 local_x; - S32 local_y; - mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); - if (LLView::sDebugMouseHandling) + // Don't let the user move the mouse out of the window until mouse up. + if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) { - llinfos << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << llendl; + mWindow->setMouseClipping(down); } - return mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down); - } - - // Topmost view gets a chance before the hierarchy - //LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - //if (top_ctrl) - //{ - // S32 local_x, local_y; - // top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); - // if (top_ctrl->pointInView(local_x, local_y)) - // { - // return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ; - // } - // else - // { - // if (down) - // { - // gFocusMgr.setTopCtrl(NULL); - // } - // } - //} - - // Give the UI views a chance to process the click - if( mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) ) - { - if (LLView::sDebugMouseHandling) + + LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); + if( mouse_captor ) { - llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLView::sMouseHandlerMessage << llendl; + S32 local_x; + S32 local_y; + mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); + if (LLView::sDebugMouseHandling) + { + llinfos << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << llendl; + } + return mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down); + } + + // Topmost view gets a chance before the hierarchy + //LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + //if (top_ctrl) + //{ + // S32 local_x, local_y; + // top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); + // if (top_ctrl->pointInView(local_x, local_y)) + // { + // return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ; + // } + // else + // { + // if (down) + // { + // gFocusMgr.setTopCtrl(NULL); + // } + // } + //} + + // Give the UI views a chance to process the click + if( mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) ) + { + if (LLView::sDebugMouseHandling) + { + llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLView::sMouseHandlerMessage << llendl; + } + return TRUE; + } + else if (LLView::sDebugMouseHandling) + { + llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; } - return TRUE; - } - else if (LLView::sDebugMouseHandling) - { - llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; } // Do not allow tool manager to handle mouseclicks if we have disconnected @@ -1661,26 +1666,6 @@ void LLViewerWindow::initWorldUI() navbar->showFavoritesPanel(FALSE); } - if (!gSavedSettings.getBOOL("ShowCameraButton")) - { - LLBottomTray::getInstance()->showCameraButton(FALSE); - } - - if (!gSavedSettings.getBOOL("ShowSnapshotButton")) - { - LLBottomTray::getInstance()->showSnapshotButton(FALSE); - } - - if (!gSavedSettings.getBOOL("ShowMoveButton")) - { - LLBottomTray::getInstance()->showMoveButton(FALSE); - } - - if (!gSavedSettings.getBOOL("ShowGestureButton")) - { - LLBottomTray::getInstance()->showGestureButton(FALSE); - } - if ( gHUDView == NULL ) { LLRect hud_rect = full_window; @@ -2455,7 +2440,9 @@ void LLViewerWindow::updateUI() // animate layout stacks so we have up to date rect for world view LLLayoutStack::updateClass(); - updateWorldViewRect(); + // use full window for world view when not rendering UI + bool world_view_uses_full_window = !gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI); + updateWorldViewRect(world_view_uses_full_window); LLView::sMouseHandlerMessage.clear(); @@ -2505,28 +2492,55 @@ void LLViewerWindow::updateUI() root_view = mRootView; } - // include all ancestors of captor_view as automatically having mouse - if (captor_view) + // only update mouse hover set when UI is visible (since we shouldn't send hover events to invisible UI + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - LLView* captor_parent_view = captor_view->getParent(); - while(captor_parent_view) + // include all ancestors of captor_view as automatically having mouse + if (captor_view) { - mouse_hover_set.insert(captor_parent_view->getHandle()); - captor_parent_view = captor_parent_view->getParent(); + LLView* captor_parent_view = captor_view->getParent(); + while(captor_parent_view) + { + mouse_hover_set.insert(captor_parent_view->getHandle()); + captor_parent_view = captor_parent_view->getParent(); + } } - } - // aggregate visible views that contain mouse cursor in display order - LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups(); + // aggregate visible views that contain mouse cursor in display order + LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups(); - for(LLPopupView::popup_list_t::iterator popup_it = popups.begin(); popup_it != popups.end(); ++popup_it) - { - LLView* popup = popup_it->get(); - if (popup && popup->calcScreenBoundingRect().pointInRect(x, y)) + for(LLPopupView::popup_list_t::iterator popup_it = popups.begin(); popup_it != popups.end(); ++popup_it) + { + LLView* popup = popup_it->get(); + if (popup && popup->calcScreenBoundingRect().pointInRect(x, y)) + { + // iterator over contents of top_ctrl, and throw into mouse_hover_set + for (LLView::tree_iterator_t it = popup->beginTreeDFS(); + it != popup->endTreeDFS(); + ++it) + { + LLView* viewp = *it; + if (viewp->getVisible() + && viewp->calcScreenBoundingRect().pointInRect(x, y)) + { + // we have a view that contains the mouse, add it to the set + mouse_hover_set.insert(viewp->getHandle()); + } + else + { + // skip this view and all of its children + it.skipDescendants(); + } + } + } + } + + // while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events + 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 = popup->beginTreeDFS(); - it != popup->endTreeDFS(); + for (LLView::tree_iterator_t it = top_ctrl->beginTreeDFS(); + it != top_ctrl->endTreeDFS(); ++it) { LLView* viewp = *it; @@ -2543,57 +2557,34 @@ void LLViewerWindow::updateUI() } } } - } - - // while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events - 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->beginTreeDFS(); - it != top_ctrl->endTreeDFS(); - ++it) - { - LLView* viewp = *it; - if (viewp->getVisible() - && viewp->calcScreenBoundingRect().pointInRect(x, y)) - { - // we have a view that contains the mouse, add it to the set - mouse_hover_set.insert(viewp->getHandle()); - } - else - { - // skip this view and all of its children - it.skipDescendants(); - } - } - } - else - { - // walk UI tree in depth-first order - for (LLView::tree_iterator_t it = root_view->beginTreeDFS(); - it != root_view->endTreeDFS(); - ++it) + else { - LLView* viewp = *it; - // calculating the screen rect involves traversing the parent, so this is less than optimal - if (viewp->getVisible() - && viewp->calcScreenBoundingRect().pointInRect(x, y)) + // walk UI tree in depth-first order + for (LLView::tree_iterator_t it = root_view->beginTreeDFS(); + it != root_view->endTreeDFS(); + ++it) { + LLView* viewp = *it; + // calculating the screen rect involves traversing the parent, so this is less than optimal + if (viewp->getVisible() + && viewp->calcScreenBoundingRect().pointInRect(x, y)) + { - // if this view is mouse opaque, nothing behind it should be in mouse_hover_set - if (viewp->getMouseOpaque()) + // if this view is mouse opaque, nothing behind it should be in mouse_hover_set + if (viewp->getMouseOpaque()) + { + // constrain further iteration to children of this widget + it = viewp->beginTreeDFS(); + } + + // we have a view that contains the mouse, add it to the set + mouse_hover_set.insert(viewp->getHandle()); + } + else { - // constrain further iteration to children of this widget - it = viewp->beginTreeDFS(); + // skip this view and all of its children + it.skipDescendants(); } - - // we have a view that contains the mouse, add it to the set - mouse_hover_set.insert(viewp->getHandle()); - } - else - { - // skip this view and all of its children - it.skipDescendants(); } } } @@ -2637,156 +2628,170 @@ void LLViewerWindow::updateUI() // store resulting hover set for next frame swap(mMouseHoverViews, mouse_hover_set); - if( mouse_captor ) - { - // Pass hover events to object capturing mouse events. - S32 local_x; - S32 local_y; - mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); - handled = mouse_captor->handleHover(local_x, local_y, mask); - if (LLView::sDebugMouseHandling) - { - llinfos << "Hover handled by captor " << mouse_captor->getName() << llendl; - } + // only handle hover events when UI is enabled + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { - if( !handled ) + if( mouse_captor ) { - lldebugst(LLERR_USER_INPUT) << "hover not handled by mouse captor" << llendl; + // Pass hover events to object capturing mouse events. + S32 local_x; + S32 local_y; + mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); + handled = mouse_captor->handleHover(local_x, local_y, mask); + if (LLView::sDebugMouseHandling) + { + llinfos << "Hover handled by captor " << mouse_captor->getName() << llendl; + } + + if( !handled ) + { + lldebugst(LLERR_USER_INPUT) << "hover not handled by mouse captor" << llendl; + } } - } - else - { - if (top_ctrl) + else { - S32 local_x, local_y; - top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); - handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleHover(local_x, local_y, mask); - handled_by_top_ctrl = TRUE; - } + if (top_ctrl) + { + S32 local_x, local_y; + top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); + handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleHover(local_x, local_y, mask); + handled_by_top_ctrl = TRUE; + } - if ( !handled ) - { - // x and y are from last time mouse was in window - // mMouseInWindow tracks *actual* mouse location - if (mMouseInWindow && mRootView->handleHover(x, y, mask) ) + if ( !handled ) { - if (LLView::sDebugMouseHandling && LLView::sMouseHandlerMessage != last_handle_msg) + // x and y are from last time mouse was in window + // mMouseInWindow tracks *actual* mouse location + if (mMouseInWindow && mRootView->handleHover(x, y, mask) ) { - last_handle_msg = LLView::sMouseHandlerMessage; - llinfos << "Hover" << LLView::sMouseHandlerMessage << llendl; + if (LLView::sDebugMouseHandling && LLView::sMouseHandlerMessage != last_handle_msg) + { + last_handle_msg = LLView::sMouseHandlerMessage; + llinfos << "Hover" << LLView::sMouseHandlerMessage << llendl; + } + handled = TRUE; + } + else if (LLView::sDebugMouseHandling) + { + if (last_handle_msg != LLStringUtil::null) + { + last_handle_msg.clear(); + llinfos << "Hover not handled by view" << llendl; + } } - handled = TRUE; } - else if (LLView::sDebugMouseHandling) + + if (!handled) { - if (last_handle_msg != LLStringUtil::null) + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); + + if(mMouseInWindow && tool) { - last_handle_msg.clear(); - llinfos << "Hover not handled by view" << llendl; + handled = tool->handleHover(x, y, mask); } } } - if (!handled) + // 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()) { - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); + LLRect screen_sticky_rect = mRootView->getLocalRect(); + S32 local_x, local_y; - if(mMouseInWindow && tool) + if (gSavedSettings.getBOOL("DebugShowXUINames")) { - handled = tool->handleHover(x, y, mask); - } - } - } - - // 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()) - { - LLRect screen_sticky_rect = mRootView->getLocalRect(); - S32 local_x, local_y; + LLToolTip::Params params; - if (gSavedSettings.getBOOL("DebugShowXUINames")) - { - LLToolTip::Params params; - - LLView* tooltip_view = mRootView; - LLView::tree_iterator_t end_it = mRootView->endTreeDFS(); - for (LLView::tree_iterator_t it = mRootView->beginTreeDFS(); it != end_it; ++it) - { - LLView* viewp = *it; - LLRect screen_rect; - viewp->localRectToScreen(viewp->getLocalRect(), &screen_rect); - if (!(viewp->getVisible() - && screen_rect.pointInRect(x, y))) - { - it.skipDescendants(); - } - // only report xui names for LLUICtrls, - // and blacklist the various containers we don't care about - else if (dynamic_cast<LLUICtrl*>(viewp) - && viewp != gMenuHolder - && viewp != gFloaterView - && viewp != gConsole) + 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 (dynamic_cast<LLFloater*>(viewp)) + LLView* viewp = *it; + LLRect screen_rect; + viewp->localRectToScreen(viewp->getLocalRect(), &screen_rect); + if (!(viewp->getVisible() + && screen_rect.pointInRect(x, y))) { - // constrain search to descendants of this (frontmost) floater - // by resetting iterator - it = viewp->beginTreeDFS(); + it.skipDescendants(); } - - // if we are in a new part of the tree (not a descendent of current tooltip_view) - // then push the results for tooltip_view and start with a new potential view - // NOTE: this emulates visiting only the leaf nodes that meet our criteria - if (!viewp->hasAncestor(tooltip_view)) + // only report xui names for LLUICtrls, + // and blacklist the various containers we don't care about + else if (dynamic_cast<LLUICtrl*>(viewp) + && viewp != gMenuHolder + && viewp != gFloaterView + && viewp != gConsole) { - append_xui_tooltip(tooltip_view, params); - screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); + if (dynamic_cast<LLFloater*>(viewp)) + { + // constrain search to descendants of this (frontmost) floater + // by resetting iterator + it = viewp->beginTreeDFS(); + } + + // if we are in a new part of the tree (not a descendent of current tooltip_view) + // then push the results for tooltip_view and start with a new potential view + // NOTE: this emulates visiting only the leaf nodes that meet our criteria + if (!viewp->hasAncestor(tooltip_view)) + { + append_xui_tooltip(tooltip_view, params); + screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); + } + tooltip_view = viewp; } - tooltip_view = viewp; } - } - append_xui_tooltip(tooltip_view, params); - screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); - - params.sticky_rect = screen_sticky_rect; - params.max_width = 400; + append_xui_tooltip(tooltip_view, params); + screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); + + params.sticky_rect = screen_sticky_rect; + params.max_width = 400; - LLToolTipMgr::instance().show(params); - } - // if there is a mouse captor, nothing else gets a tooltip - else if (mouse_captor) - { - mouse_captor->screenPointToLocal(x, y, &local_x, &local_y); - tool_tip_handled = mouse_captor->handleToolTip(local_x, local_y, mask); - } - else - { - // next is top_ctrl - if (!tool_tip_handled && top_ctrl) - { - top_ctrl->screenPointToLocal(x, y, &local_x, &local_y); - tool_tip_handled = top_ctrl->handleToolTip(local_x, local_y, mask ); + LLToolTipMgr::instance().show(params); } - - if (!tool_tip_handled) + // if there is a mouse captor, nothing else gets a tooltip + else if (mouse_captor) { - local_x = x; local_y = y; - tool_tip_handled = mRootView->handleToolTip(local_x, local_y, mask ); + mouse_captor->screenPointToLocal(x, y, &local_x, &local_y); + tool_tip_handled = mouse_captor->handleToolTip(local_x, local_y, mask); } - - LLTool* current_tool = LLToolMgr::getInstance()->getCurrentTool(); - if (!tool_tip_handled && current_tool) + else { - current_tool->screenPointToLocal(x, y, &local_x, &local_y); - tool_tip_handled = current_tool->handleToolTip(local_x, local_y, mask ); + // next is top_ctrl + if (!tool_tip_handled && top_ctrl) + { + top_ctrl->screenPointToLocal(x, y, &local_x, &local_y); + tool_tip_handled = top_ctrl->handleToolTip(local_x, local_y, mask ); + } + + if (!tool_tip_handled) + { + local_x = x; local_y = y; + tool_tip_handled = mRootView->handleToolTip(local_x, local_y, mask ); + } + + 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, mask ); + } } + } + } + else + { // just have tools handle hover when UI is turned off + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); + + if(mMouseInWindow && tool) + { + handled = tool->handleHover(x, y, mask); } - } - + } + updateLayout(); mLastMousePoint = mCurrentMousePoint; @@ -2902,6 +2907,11 @@ void LLViewerWindow::updateMouseDelta() void LLViewerWindow::updateKeyboardFocus() { + if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + gFocusMgr.setKeyboardFocus(NULL); + } + // clean up current focus LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); if (cur_focus) @@ -3974,9 +3984,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei // PRE SNAPSHOT gDisplaySwapBuffers = FALSE; - // if not showing ui, use full window to render world view - updateWorldViewRect(!show_ui); - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); setCursor(UI_CURSOR_WAIT); @@ -4049,6 +4056,9 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei //else: keep the current scene scale, re-scale it if necessary after reading out. } + // if not showing ui, use full window to render world view + updateWorldViewRect(!show_ui); + S32 buffer_x_offset = llfloor(((window_width - snapshot_width) * scale_factor) / 2.f); S32 buffer_y_offset = llfloor(((window_height - snapshot_height) * scale_factor) / 2.f); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cc38616cb8..edafd268c1 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5027,7 +5027,7 @@ BOOL LLVOAvatar::loadAvatar() } // Uncomment to enable avatar_lad.xml debugging. -/* std::ofstream file; + std::ofstream file; file.open("avatar_lad.log"); for( LLViewerVisualParam* param = (LLViewerVisualParam*) getFirstVisualParam(); param; @@ -5037,7 +5037,7 @@ BOOL LLVOAvatar::loadAvatar() file << std::endl; } - file.close();*/ + file.close(); return TRUE; } @@ -6496,6 +6496,14 @@ BOOL LLVOAvatar::teToColorParams( ETextureIndex te, U32 *param_name ) param_name[2] = 923; //"skirt_blue"; break; + case TEX_HEAD_TATTOO: + case TEX_LOWER_TATTOO: + case TEX_UPPER_TATTOO: + param_name[0] = 1071; //"tattoo_red"; + param_name[1] = 1072; //"tattoo_green"; + param_name[2] = 1073; //"tattoo_blue"; + break; + default: llassert(0); return FALSE; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index da99b212f0..c82de73f25 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1801,21 +1801,31 @@ void LLVOAvatarSelf::bakedTextureUpload(EBakedTextureIndex index, BOOL finished) mBakedTextureTimes[index][done] = mDebugSelfLoadTimer.getElapsedTimeF32(); } -const LLUUID& LLVOAvatarSelf::grabLocalTexture(ETextureIndex type, U32 index) const +const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const { - if (canGrabLocalTexture(type, index)) + if (canGrabBakedTexture(baked_index)) { - return getTEImage( type )->getID(); + ETextureIndex tex_index = LLVOAvatarDictionary::bakedToLocalTextureIndex(baked_index); + if (tex_index == TEX_NUM_INDICES) + { + return LLUUID::null; + } + return getTEImage( tex_index )->getID(); } return LLUUID::null; } -BOOL LLVOAvatarSelf::canGrabLocalTexture(ETextureIndex type, U32 index) const +BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const { + ETextureIndex tex_index = LLVOAvatarDictionary::bakedToLocalTextureIndex(baked_index); + if (tex_index == TEX_NUM_INDICES) + { + return FALSE; + } // Check if the texture hasn't been baked yet. - if (!isTextureDefined(type, index)) + if (!isTextureDefined(tex_index, 0)) { - lldebugs << "getTEImage( " << (U32) type << ", " << index << " )->getID() == IMG_DEFAULT_AVATAR" << llendl; + lldebugs << "getTEImage( " << (U32) tex_index << " )->getID() == IMG_DEFAULT_AVATAR" << llendl; return FALSE; } @@ -1825,13 +1835,7 @@ BOOL LLVOAvatarSelf::canGrabLocalTexture(ETextureIndex type, U32 index) const // Check permissions of textures that show up in the // baked texture. We don't want people copying people's // work via baked textures. - /* switch(type) - case TEX_EYES_BAKED: - textures.push_back(TEX_EYES_IRIS); */ - const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(type); - if (!texture_dict->mIsUsedByBakedTexture) return FALSE; - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index); for (texture_vec_t::const_iterator iter = baked_dict->mLocalTextures.begin(); iter != baked_dict->mLocalTextures.end(); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 32a180be5d..666219f3aa 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -190,8 +190,6 @@ public: LLViewerFetchedTexture* getLocalTextureGL(LLVOAvatarDefines::ETextureIndex type, U32 index) const; const LLUUID& getLocalTextureID(LLVOAvatarDefines::ETextureIndex type, U32 index) const; void setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index); - const LLUUID& grabLocalTexture(LLVOAvatarDefines::ETextureIndex type, U32 index) const; - BOOL canGrabLocalTexture(LLVOAvatarDefines::ETextureIndex type, U32 index) const; /*virtual*/ void setLocalTexture(LLVOAvatarDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index); protected: /*virtual*/ void setBakedReady(LLVOAvatarDefines::ETextureIndex type, BOOL baked_version_exists, U32 index); @@ -241,6 +239,10 @@ public: void setupComposites(); void updateComposites(); + const LLUUID& grabBakedTexture(LLVOAvatarDefines::EBakedTextureIndex baked_index) const; + BOOL canGrabBakedTexture(LLVOAvatarDefines::EBakedTextureIndex baked_index) const; + + //-------------------------------------------------------------------- // Scratch textures (used for compositing) //-------------------------------------------------------------------- diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 25b46f8e55..1b4471a9fe 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -791,6 +791,12 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) } mIgnoreNextSessionLeave = FALSE; return; + case STATUS_JOINING: + // because we join session we expect to process session leave event in the future. EXT-7371 + // may be this should be done in the LLVoiceChannel::handleStatusChange. + mIgnoreNextSessionLeave = FALSE; + break; + default: break; } diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index b89c0cd638..eb5b6c6618 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -66,12 +66,14 @@ const F32 LEAF_TOP = 1.0f; const F32 LEAF_BOTTOM = 0.52f; const F32 LEAF_WIDTH = 1.f; -S32 LLVOTree::sLODVertexOffset[4]; -S32 LLVOTree::sLODVertexCount[4]; -S32 LLVOTree::sLODIndexOffset[4]; -S32 LLVOTree::sLODIndexCount[4]; -S32 LLVOTree::sLODSlices[4] = {10, 5, 4, 3}; -F32 LLVOTree::sLODAngles[4] = {30.f, 20.f, 15.f, 0.f}; +const S32 LLVOTree::sMAX_NUM_TREE_LOD_LEVELS = 4 ; + +S32 LLVOTree::sLODVertexOffset[sMAX_NUM_TREE_LOD_LEVELS]; +S32 LLVOTree::sLODVertexCount[sMAX_NUM_TREE_LOD_LEVELS]; +S32 LLVOTree::sLODIndexOffset[sMAX_NUM_TREE_LOD_LEVELS]; +S32 LLVOTree::sLODIndexCount[sMAX_NUM_TREE_LOD_LEVELS]; +S32 LLVOTree::sLODSlices[sMAX_NUM_TREE_LOD_LEVELS] = {10, 5, 4, 3}; +F32 LLVOTree::sLODAngles[sMAX_NUM_TREE_LOD_LEVELS] = {30.f, 20.f, 15.f, 0.00001f}; F32 LLVOTree::sTreeFactor = 1.f; @@ -373,12 +375,11 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } } - S32 trunk_LOD = 0; + S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ; F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor; - for (S32 j = 0; j < 4; j++) + for (S32 j = 0; j < sMAX_NUM_TREE_LOD_LEVELS; j++) { - if (app_angle > LLVOTree::sLODAngles[j]) { trunk_LOD = j; @@ -445,16 +446,15 @@ void LLVOTree::setPixelAreaAndAngle(LLAgent &agent) // This should be the camera's center, as soon as we move to all region-local. LLVector3 relative_position = getPositionAgent() - gAgentCamera.getCameraPositionAgent(); - F32 range = relative_position.length(); // ugh, square root + F32 range_squared = relative_position.lengthSquared() ; F32 max_scale = mBillboardScale * getMaxScale(); F32 area = max_scale * (max_scale*mBillboardRatio); // Compute pixels per meter at the given range - F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / - (tan(LLViewerCamera::getInstance()->getView()) * range); + F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / tan(LLViewerCamera::getInstance()->getView()); - mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area; + mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area / range_squared; #if 0 // mAppAngle is a bit of voodoo; // use the one calculated LLViewerObject::setPixelAreaAndAngle above @@ -506,6 +506,13 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) { LLFastTimer ftm(FTM_UPDATE_TREE); + if(mTrunkLOD >= sMAX_NUM_TREE_LOD_LEVELS) //do not display the tree. + { + mReferenceBuffer = NULL ; + mDrawable->getFace(0)->mVertexBuffer = NULL ; + return TRUE ; + } + if (mReferenceBuffer.isNull() || mDrawable->getFace(0)->mVertexBuffer.isNull()) { const F32 SRR3 = 0.577350269f; // sqrt(1/3) @@ -523,7 +530,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) face->mCenterAgent = getPositionAgent(); face->mCenterLocal = face->mCenterAgent; - for (lod = 0; lod < 4; lod++) + for (lod = 0; lod < sMAX_NUM_TREE_LOD_LEVELS; lod++) { slices = sLODSlices[lod]; sLODVertexOffset[lod] = max_vertices; @@ -700,7 +707,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) // Generate the vertices // Generate the indices - for (lod = 0; lod < 4; lod++) + for (lod = 0; lod < sMAX_NUM_TREE_LOD_LEVELS; lod++) { slices = sLODSlices[lod]; F32 base_radius = 0.65f; @@ -892,7 +899,6 @@ void LLVOTree::updateMesh() S32 stop_depth = 0; F32 alpha = 1.0; - U32 vert_count = 0; U32 index_count = 0; diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index feac9e0675..036ad692b1 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -152,6 +152,7 @@ public: }; static F32 sTreeFactor; // Tree level of detail factor + static const S32 sMAX_NUM_TREE_LOD_LEVELS ; friend class LLDrawPoolTree; protected: diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 28613c8bcf..6c27aefebb 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -759,12 +759,12 @@ void LLWearable::copyDataFrom(const LLWearable* src) LLViewerFetchedTexture *image = NULL; if(iter != src->mTEMap.end()) { - image = src->getConstLocalTextureObject(te)->getImage(); - image_id = src->getConstLocalTextureObject(te)->getID(); + image = src->getLocalTextureObject(te)->getImage(); + image_id = src->getLocalTextureObject(te)->getID(); mTEMap[te] = new LLLocalTextureObject(image, image_id); mSavedTEMap[te] = new LLLocalTextureObject(image, image_id); - mTEMap[te]->setBakedReady(src->getConstLocalTextureObject(te)->getBakedReady()); - mTEMap[te]->setDiscard(src->getConstLocalTextureObject(te)->getDiscard()); + mTEMap[te]->setBakedReady(src->getLocalTextureObject(te)->getBakedReady()); + mTEMap[te]->setDiscard(src->getLocalTextureObject(te)->getDiscard()); } else { @@ -809,7 +809,7 @@ LLLocalTextureObject* LLWearable::getLocalTextureObject(S32 index) return NULL; } -const LLLocalTextureObject* LLWearable::getConstLocalTextureObject(S32 index) const +const LLLocalTextureObject* LLWearable::getLocalTextureObject(S32 index) const { te_map_t::const_iterator iter = mTEMap.find(index); if( iter != mTEMap.end() ) diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h index 458415228f..6b6067fd27 100644 --- a/indra/newview/llwearable.h +++ b/indra/newview/llwearable.h @@ -81,7 +81,6 @@ public: const std::string& getTypeLabel() const; const std::string& getTypeName() const; LLAssetType::EType getAssetType() const; - LLLocalTextureObject* getLocalTextureObject(S32 index) const; S32 getDefinitionVersion() const { return mDefinitionVersion; } void setDefinitionVersion( S32 new_version ) { mDefinitionVersion = new_version; } @@ -112,7 +111,7 @@ public: void setItemID(const LLUUID& item_id); LLLocalTextureObject* getLocalTextureObject(S32 index); - const LLLocalTextureObject* getConstLocalTextureObject(S32 index) const; + const LLLocalTextureObject* getLocalTextureObject(S32 index) const; void setLocalTextureObject(S32 index, LLLocalTextureObject <o); void addVisualParam(LLVisualParam *param); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index bac66d966a..b209dfecce 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -296,6 +296,84 @@ std::string LLPanelDummyClothingListItem::wearableTypeToString(LLWearableType::E ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// +/*virtual*/ +bool LLWearableItemNameComparator::doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const +{ + std::string name1 = wearable_item1->getItemName(); + std::string name2 = wearable_item2->getItemName(); + + LLStringUtil::toUpper(name1); + LLStringUtil::toUpper(name2); + + return name1 < name2; +} + +/*virtual*/ +bool LLWearableItemTypeNameComparator::doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const +{ + const LLAssetType::EType item_type1 = wearable_item1->getType(); + const LLAssetType::EType item_type2 = wearable_item2->getType(); + + LLWearableItemTypeNameComparator::ETypeListOrder item_type_order1 = getTypeListOrder(item_type1); + LLWearableItemTypeNameComparator::ETypeListOrder item_type_order2 = getTypeListOrder(item_type2); + + if (item_type_order1 != item_type_order2) + { + // If items are of different asset types we can compare them + // by types order in the list. + return item_type_order1 < item_type_order2; + } + + if (item_type_order1 & TLO_NOT_CLOTHING) + { + // If both items are of the same asset type except AT_CLOTHING + // we can compare them by name. + return LLWearableItemNameComparator::doCompare(wearable_item1, wearable_item2); + } + + const LLWearableType::EType item_wearable_type1 = wearable_item1->getWearableType(); + const LLWearableType::EType item_wearable_type2 = wearable_item2->getWearableType(); + + if (item_wearable_type1 != item_wearable_type2) + { + // If items are of different clothing types they are compared + // by clothing types order determined in LLWearableType::EType. + return item_wearable_type1 < item_wearable_type2; + } + else + { + // If both items are of the same clothing type they are compared + // by description and place in reverse order i.e. outer layer item + // on top. + return wearable_item1->getDescription() > wearable_item2->getDescription(); + } +} + +// static +LLWearableItemTypeNameComparator::ETypeListOrder LLWearableItemTypeNameComparator::getTypeListOrder(LLAssetType::EType item_type) +{ + switch (item_type) + { + case LLAssetType::AT_OBJECT: + return TLO_ATTACHMENT; + + case LLAssetType::AT_CLOTHING: + return TLO_CLOTHING; + + case LLAssetType::AT_BODYPART: + return TLO_BODYPART; + + default: + return TLO_UNKNOWN; + } +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +static const LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; + static const LLDefaultChildRegistry::Register<LLWearableItemsList> r("wearable_items_list"); LLWearableItemsList::Params::Params() @@ -303,7 +381,9 @@ LLWearableItemsList::Params::Params() LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) : LLInventoryItemsList(p) -{} +{ + setComparator(&WEARABLE_TYPE_NAME_COMPARATOR); +} // virtual LLWearableItemsList::~LLWearableItemsList() diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 5e3202c687..2cab5a07a2 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -172,6 +172,98 @@ private: }; /** + * @class LLWearableListItemComparator + * + * Abstract comparator of wearable list items. + */ +class LLWearableListItemComparator : public LLFlatListView::ItemComparator +{ + LOG_CLASS(LLWearableListItemComparator); + +public: + LLWearableListItemComparator() {}; + virtual ~LLWearableListItemComparator() {}; + + virtual bool compare(const LLPanel* item1, const LLPanel* item2) const + { + const LLPanelInventoryListItemBase* wearable_item1 = dynamic_cast<const LLPanelInventoryListItemBase*>(item1); + const LLPanelInventoryListItemBase* wearable_item2 = dynamic_cast<const LLPanelInventoryListItemBase*>(item2); + + if (!wearable_item1 || !wearable_item2) + { + llwarning("item1 and item2 cannot be null", 0); + return true; + } + + return doCompare(wearable_item1, wearable_item2); + } + +protected: + + /** + * Returns true if wearable_item1 < wearable_item2, false otherwise + * Implement this method in your particular comparator. + */ + virtual bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const = 0; +}; + +/** + * @class LLWearableItemNameComparator + * + * Comparator for sorting wearable list items by name. + */ +class LLWearableItemNameComparator : public LLWearableListItemComparator +{ + LOG_CLASS(LLWearableItemNameComparator); + +public: + LLWearableItemNameComparator() {}; + virtual ~LLWearableItemNameComparator() {}; + +protected: + /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const; +}; + +/** + * @class LLWearableItemTypeNameComparator + * + * Comparator for sorting wearable list items by type and name. + */ +class LLWearableItemTypeNameComparator : public LLWearableItemNameComparator +{ + LOG_CLASS(LLWearableItemTypeNameComparator); + +public: + LLWearableItemTypeNameComparator() {}; + virtual ~LLWearableItemTypeNameComparator() {}; + +protected: + /** + * Returns "true" if wearable_item1 is placed before wearable_item2 sorted by the following: + * - Attachments (abc order) + * - Clothing + * - by type (types order determined in LLWearableType::EType) + * - outer layer on top + * - Body Parts (abc order), + * "false" otherwise. + */ + /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const; + +private: + enum ETypeListOrder + { + TLO_ATTACHMENT = 0x01, + TLO_CLOTHING = 0x02, + TLO_BODYPART = 0x04, + TLO_UNKNOWN = 0x08, + + TLO_NOT_CLOTHING = TLO_ATTACHMENT | TLO_BODYPART | TLO_UNKNOWN + }; + + static LLWearableItemTypeNameComparator::ETypeListOrder getTypeListOrder(LLAssetType::EType item_type); +}; + +/** * @class LLWearableItemsList * * A flat list of wearable inventory items. diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index e26f07c77b..592bda63d2 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -356,7 +356,7 @@ reference="White"/> <color name="GroupNotifyDimmedTextColor" - reference="DkGray" /> + reference="LtGray" /> <color name="GroupOverTierColor" value="0.43 0.06 0.06 1" /> diff --git a/indra/newview/skins/default/textures/icons/DownArrow_Off.png b/indra/newview/skins/default/textures/icons/DownArrow_Off.png Binary files differnew file mode 100644 index 0000000000..60f62eed4a --- /dev/null +++ b/indra/newview/skins/default/textures/icons/DownArrow_Off.png diff --git a/indra/newview/skins/default/textures/icons/Edit_Wrench.png b/indra/newview/skins/default/textures/icons/Edit_Wrench.png Binary files differnew file mode 100644 index 0000000000..1c43960d02 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Edit_Wrench.png diff --git a/indra/newview/skins/default/textures/icons/Hierarchy_View_Disabled.png b/indra/newview/skins/default/textures/icons/Hierarchy_View_Disabled.png Binary files differnew file mode 100644 index 0000000000..fb370f98d5 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Hierarchy_View_Disabled.png diff --git a/indra/newview/skins/default/textures/icons/Hierarchy_View_On.png b/indra/newview/skins/default/textures/icons/Hierarchy_View_On.png Binary files differnew file mode 100644 index 0000000000..c590a5a5d3 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Hierarchy_View_On.png diff --git a/indra/newview/skins/default/textures/icons/List_View_Disabled.png b/indra/newview/skins/default/textures/icons/List_View_Disabled.png Binary files differnew file mode 100644 index 0000000000..155dee5047 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/List_View_Disabled.png diff --git a/indra/newview/skins/default/textures/icons/List_View_On.png b/indra/newview/skins/default/textures/icons/List_View_On.png Binary files differnew file mode 100644 index 0000000000..9127c92c3b --- /dev/null +++ b/indra/newview/skins/default/textures/icons/List_View_On.png diff --git a/indra/newview/skins/default/textures/icons/Locked_Icon.png b/indra/newview/skins/default/textures/icons/Locked_Icon.png Binary files differnew file mode 100644 index 0000000000..8ead280794 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Locked_Icon.png diff --git a/indra/newview/skins/default/textures/icons/Search_Icon.png b/indra/newview/skins/default/textures/icons/Search_Icon.png Binary files differnew file mode 100644 index 0000000000..541aa8f52a --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Search_Icon.png diff --git a/indra/newview/skins/default/textures/icons/Shirt_Large.png b/indra/newview/skins/default/textures/icons/Shirt_Large.png Binary files differnew file mode 100644 index 0000000000..0f3846bccc --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Shirt_Large.png diff --git a/indra/newview/skins/default/textures/icons/UpArrow_Off.png b/indra/newview/skins/default/textures/icons/UpArrow_Off.png Binary files differnew file mode 100644 index 0000000000..00015bce20 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/UpArrow_Off.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index b71e0142b0..4638c32886 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -110,6 +110,8 @@ with the same filename but different name <texture name="DisclosureArrow_Opened_Off" file_name="widgets/DisclosureArrow_Opened_Off.png" preload="true" /> <texture name="DownArrow" file_name="bottomtray/DownArrow.png" preload="false" /> + <texture name="DownArrow_Off" file_name="icons/DownArrow_off.png" preload="false" /> + <texture name="Dragbar" file_name="icons/Dragbar.png" preload="false" /> <texture name="DropDown_Disabled" file_name="widgets/DropDown_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> <texture name="DropDown_Press" file_name="widgets/DropDown_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> @@ -119,6 +121,7 @@ with the same filename but different name <texture name="DropTarget" file_name="widgets/DropTarget.png" preload="false" /> <texture name="ExternalBrowser_Off" file_name="icons/ExternalBrowser_Off.png" preload="false" /> + <texture name="Edit_Wrench" file_name="icons/Edit_Wrench.png" preload="false" /> <texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" /> <texture name="Favorite_Star_Off" file_name="navbar/Favorite_Star_Off.png" preload="false" /> @@ -145,6 +148,9 @@ with the same filename but different name <texture name="Help_Press" file_name="navbar/Help_Press.png" preload="false" /> + <texture name="Hierarchy_View_Disabled" file_name="icons/Hierarchy_View_Disabled.png" preload="false" /> + <texture name="Hierarchy_View_On" file_name="icons/Hierarchy_View_On.png" preload="false" /> + <texture name="Home_Off" file_name="navbar/Home_Off.png" preload="false" /> @@ -255,9 +261,14 @@ with the same filename but different name <texture name="ListItem_Select" file_name="widgets/ListItem_Select.png" preload="true" scale.left="2" scale.bottom="2" scale.top="22" scale.right="278" /> <texture name="ListItem_Over" file_name="widgets/ListItem_Over.png" preload="true" scale.left="2" scale.bottom="2" scale.top="22" scale.right="278" /> + <texture name="List_View_Disabled" file_name="icons/List_View_Disabled.png" preload="false" /> + <texture name="List_View_On" file_name="icons/List_View_On.png" preload="false" /> + <texture name="Lock" file_name="icons/Lock.png" preload="false" /> <texture name="Lock2" file_name="navbar/Lock.png" preload="false" /> + <texture name="Locked_Icon" file_name="icons/Locked_Icon.png" preload="false" /> + <texture name="Microphone_On" file_name="icons/Microphone_On.png" preload="false" /> @@ -413,6 +424,8 @@ with the same filename but different name <texture name="Search" file_name="navbar/Search.png" preload="false" /> + <texture name="Search_Icon" file_name="icons/Search_Icon.png" preload="false" /> + <texture name="SegmentedBtn_Left_Off" file_name="widgets/SegmentedBtn_Left_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> <texture name="SegmentedBtn_Left_Over" file_name="widgets/SegmentedBtn_Left_Over.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> <texture name="SegmentedBtn_Left_Press" file_name="widgets/SegmentedBtn_Left_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> @@ -435,6 +448,8 @@ with the same filename but different name <texture name="SegmentedBtn_Right_Selected_Press" file_name="widgets/SegmentedBtn_Right_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> <texture name="SegmentedBtn_Right_Selected_Disabled" file_name="widgets/SegmentedBtn_Right_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="Shirt_Large" file_name="icons/Shirt_Large.png" preload="false" /> + <texture name="SkipBackward_Off" file_name="icons/SkipBackward_Off.png" preload="false" /> <texture name="SkipForward_Off" file_name="icons/SkipForward_Off.png" preload="false" /> @@ -526,6 +541,8 @@ with the same filename but different name <texture name="Unread_Chiclet" file_name="bottomtray/Unread_Chiclet.png" preload="false" /> <texture name="Unread_IM" file_name="bottomtray/Unread_IM.png" preload="false" /> + <texture name="UpArrow_Off" file_name="icons/UpArrow_Off.png" preload="false" /> + <texture name="Volume_Background" file_name="windows/Volume_Background.png" preload="false" scale.left="6" scale.top="33" scale.right="63" scale.bottom="10" /> diff --git a/indra/newview/skins/default/textures/windows/Dragbar.png b/indra/newview/skins/default/textures/windows/Dragbar.png Binary files differnew file mode 100644 index 0000000000..d94dda1aae --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Dragbar.png diff --git a/indra/newview/skins/default/xui/da/floater_tools.xml b/indra/newview/skins/default/xui/da/floater_tools.xml index a39a7e8698..b501722e92 100644 --- a/indra/newview/skins/default/xui/da/floater_tools.xml +++ b/indra/newview/skins/default/xui/da/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="Hvis beregnede rendering omkostninger for dette objekt"> þ: [COUNT] </text> - <check_box label="Stræk begge sider" name="checkbox uniform"/> + <check_box name="checkbox uniform"/> + <text name="checkbox uniform label"> + Stræk begge sider + </text> <check_box initial_value="true" label="Stræk teksturer" name="checkbox stretch textures"/> <check_box initial_value="true" label="Benyt gitter" name="checkbox snap to grid"/> <combo_box name="combobox grid mode" tool_tip="Vælg hvilken type lineal der skal bruges til positionering af objekt"> diff --git a/indra/newview/skins/default/xui/de/floater_tools.xml b/indra/newview/skins/default/xui/de/floater_tools.xml index bb28f1b33f..c5c11faf93 100644 --- a/indra/newview/skins/default/xui/de/floater_tools.xml +++ b/indra/newview/skins/default/xui/de/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="Zeigt die errechneten Wiedergabekosten für dieses Objekt"> þ: [COUNT] </text> - <check_box label="Beide Seiten dehnen" name="checkbox uniform"/> + <check_box name="checkbox uniform"/> + <text name="checkbox uniform label"> + Beide Seiten dehnen + </text> <check_box initial_value="true" label="Texturen dehnen" name="checkbox stretch textures"/> <check_box initial_value="true" label="An Raster ausrichten" name="checkbox snap to grid" top_pad="10"/> <combo_box name="combobox grid mode" tool_tip="Wählen Sie ein Rasterlineal zum Positionieren des Objekts aus."> diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 233db347e4..29fc58245f 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -108,6 +108,9 @@ name="no_selection_text"> No parcel selected. </panel.string> + <panel.string name="time_stamp_template"> + [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] + </panel.string> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/floater_avatar_textures.xml b/indra/newview/skins/default/xui/en/floater_avatar_textures.xml index 119dd63a17..bac3ea86f1 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_textures.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_textures.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater legacy_header_height="18" - height="990" + height="700" layout="topleft" name="avatar_texture_debug" help_topic="avatar_texture_debug" title="AVATAR TEXTURES" - width="1240" + width="940" can_resize="true"> <floater.string name="InvalidAvatar"> @@ -17,13 +17,13 @@ color="DkGray2" opaque="true" follows="all" - height="970" + height="680" layout="topleft" left="5" top_pad="15" name="profile_scroll" reserve_scroll_corner="false" - width="1235"> + width="930"> <panel name="scroll_content_panel" follows="left|top" @@ -31,39 +31,40 @@ layout="topleft" top="0" background_visible="false" - height="950" left="0" - width="1230"> + height="680"> <text type="string" length="1" height="16" layout="topleft" - left="30" + left="15" name="label" top="20" - width="80"> - Baked Textures + width="90"> + Baked +Textures </text> <text type="string" length="1" height="16" layout="topleft" - left_pad="50" + left_pad="22" name="composite_label" top_delta="0" width="120"> - Composite Textures + Composite +Textures </text> <button - height="20" + height="40" label="Dump IDs to Console" label_selected="Dump" layout="topleft" - left_pad="530" name="Dump" top_delta="0" + right="-10" width="150" /> <panel @@ -78,242 +79,242 @@ width="1230"> <texture_picker - height="143" + height="103" label="Hair" layout="topleft" left="10" name="hair-baked" top="17" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Hair" layout="topleft" - left_pad="7" + left_pad="21" name="hair_grain" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Hair Alpha" layout="topleft" left_pad="7" name="hair_alpha" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Head" layout="topleft" left="10" name="head-baked" - top="167" - width="128" /> + top_delta="100" + width="92" /> <texture_picker - height="143" + height="103" label="Makeup" layout="topleft" - left_pad="7" + left_pad="21" name="head_bodypaint" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Head Alpha" layout="topleft" left_pad="7" name="head_alpha" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Head Tattoo" layout="topleft" left_pad="7" name="head_tattoo" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Eyes" layout="topleft" left="10" name="eyes-baked" - top="317" - width="128" /> + top_delta="100" + width="92" /> <texture_picker - height="143" + height="103" label="Eye" layout="topleft" - left_pad="7" + left_pad="21" name="eyes_iris" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Eyes Alpha" layout="topleft" left_pad="7" name="eyes_alpha" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Upper Body" layout="topleft" left="10" name="upper-baked" - top="467" - width="128" /> + top_delta="100" + width="92" /> <texture_picker - height="143" - label="Upper Body Bodypaint" + height="103" + label="Upper BodyPaint" layout="topleft" - left_pad="7" + left_pad="21" name="upper_bodypaint" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Undershirt" layout="topleft" left_pad="7" name="upper_undershirt" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Gloves" layout="topleft" left_pad="7" name="upper_gloves" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Shirt" layout="topleft" left_pad="7" name="upper_shirt" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Upper Jacket" layout="topleft" left_pad="7" name="upper_jacket" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Upper Alpha" layout="topleft" left_pad="7" name="upper_alpha" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Upper Tattoo" layout="topleft" left_pad="7" name="upper_tattoo" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Lower Body" layout="topleft" left="10" name="lower-baked" - top="617" - width="128" /> + top_delta="100" + width="92" /> <texture_picker - height="143" - label="Lower Body Bodypaint" + height="103" + label="Lower BodyPaint" layout="topleft" - left_pad="7" + left_pad="21" name="lower_bodypaint" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Underpants" layout="topleft" left_pad="7" name="lower_underpants" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Socks" layout="topleft" left_pad="7" name="lower_socks" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Shoes" layout="topleft" left_pad="7" name="lower_shoes" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Pants" layout="topleft" left_pad="7" name="lower_pants" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Jacket" layout="topleft" left_pad="7" name="lower_jacket" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Lower Alpha" layout="topleft" left_pad="7" name="lower_alpha" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Lower Tattoo" layout="topleft" left_pad="7" name="lower_tattoo" top_delta="0" - width="128" /> + width="92" /> <texture_picker - height="143" + height="103" label="Skirt" layout="topleft" left="10" name="skirt-baked" - top="767" - width="128" /> + top_delta="100" + width="92" /> <texture_picker - height="143" + height="103" label="Skirt" layout="topleft" - left_pad="7" + left_pad="21" name="skirt" top_delta="0" - width="128" /> + width="92" /> </panel> </panel> </scroll_container> diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml new file mode 100644 index 0000000000..ab44082070 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_resize="false" + height="240" + layout="topleft" + min_height="240" + min_width="420" + name="floater_buy_currency_html" + help_topic="floater_buy_currency_html" + save_rect="true" + single_instance="true" + title="BUY CURRENCY" + width="422"> + <floater.string + name="buy_currency_url" translate="false"> + http://user.lindenlab.com/~callum/ez/index.php?lang=[LANGUAGE]&sa=[SPECIFIC_AMOUNT]&sum=[SUM]&msg=[MSG]&bal=[BAL] +</floater.string> + <web_browser + bottom="238" + follows="left|right|top|bottom" + layout="topleft" + left="2" + name="browser" + top="18" + width="420" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml index 7d9a17548e..b690986e6b 100644 --- a/indra/newview/skins/default/xui/en/floater_moveview.xml +++ b/indra/newview/skins/default/xui/en/floater_moveview.xml @@ -165,7 +165,7 @@ right="-13" name="turn right btn" scale_image="false" - tool_tip="Turn left (press Right Arrow or D)" + tool_tip="Turn right (press Right Arrow or D)" top_pad="-3" width="24" /> <joystick_slide diff --git a/indra/newview/skins/default/xui/en/floater_region_info.xml b/indra/newview/skins/default/xui/en/floater_region_info.xml index 262bcd07a0..32fb6f97e7 100644 --- a/indra/newview/skins/default/xui/en/floater_region_info.xml +++ b/indra/newview/skins/default/xui/en/floater_region_info.xml @@ -7,7 +7,7 @@ name="regioninfo" save_rect="true" title="REGION/ESTATE" - width="480"> + width="530"> <tab_container bottom="555" follows="left|right|top|bottom" diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 32eef812e8..f06f3e431d 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -11,6 +11,7 @@ save_rect="true" short_title="BUILD TOOLS" single_instance="true" + save_visibility="true" sound_flags="0" width="295"> <floater.string @@ -219,8 +220,8 @@ </radio_group> <radio_group follows="left|top" - left="10" - top="54" + left="5" + top="59" height="70" layout="topleft" name="edit_radio_group"> @@ -253,7 +254,8 @@ control_name="EditLinkedParts" label="Edit linked" layout="topleft" - name="checkbox edit linked parts" > + name="checkbox edit linked parts" + top_pad="0"> <check_box.commit_callback function="BuildTool.selectComponent"/> </check_box> @@ -273,20 +275,31 @@ <check_box control_name="ScaleUniform" height="19" - label="Stretch Both Sides" + label="" layout="topleft" left="143" name="checkbox uniform" top="50" - width="134" /> + width="20" /> + <text + height="19" + label="Stretch Both Sides" + left="163" + name="checkbox uniform label" + top="55" + width="120" + wrap="true"> + Stretch Both Sides + </text> <check_box control_name="ScaleStretchTextures" height="19" initial_value="true" label="Stretch Textures" layout="topleft" + left="143" name="checkbox stretch textures" - top_pad="0" + top_pad="7" width="134" /> <check_box control_name="SnapEnabled" @@ -294,7 +307,7 @@ initial_value="true" label="Snap to grid" layout="topleft" - top_pad="7" + top_pad="0" name="checkbox snap to grid" width="134" /> <combo_box @@ -303,6 +316,7 @@ follows="left|top" name="combobox grid mode" tool_tip="Choose the type of grid ruler for positioning the object" + top_pad="0" width="108"> <combo_box.item label="World grid" @@ -2329,7 +2343,7 @@ even though the user gets a free copy. height="19" label="Full Bright" layout="topleft" - left_delta="0" + left_delta="-5" name="checkbox fullbright" top_pad="4" width="81" /> diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml index 0efe598243..d5b993152a 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml @@ -191,6 +191,22 @@ <menu_item_call.on_enable function="Edit.EnableCustomizeAvatar" /> </menu_item_call> + <menu_item_call label="Edit My Outfit" + layout="topleft" + name="Edit Outfit"> + <menu_item_call.on_click + function="EditOutfit" /> + <menu_item_call.on_enable + function="Edit.EnableCustomizeAvatar" /> + </menu_item_call> + <menu_item_call label="Edit My Shape" + layout="topleft" + name="Edit My Shape"> + <menu_item_call.on_click + function="EditShape" /> + <menu_item_call.on_enable + function="Edit.EnableEditShape" /> + </menu_item_call> <menu_item_call label="My Friends" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_bottomtray.xml b/indra/newview/skins/default/xui/en/menu_bottomtray.xml index 5beafef4e4..ccd5388621 100644 --- a/indra/newview/skins/default/xui/en/menu_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/menu_bottomtray.xml @@ -53,6 +53,17 @@ parameter="ShowSnapshotButton" /> </menu_item_check> <menu_item_check + label="Sidebar button" + layout="topleft" + name="ShowSidebarButton"> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowSidebarButton" /> + <menu_item_check.on_check + function="CheckControl" + parameter="ShowSidebarButton" /> + </menu_item_check> + <menu_item_check label="Build button" layout="topleft" name="ShowBuildButton"> diff --git a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml index 115964e5f2..e3f6045e27 100644 --- a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml @@ -52,18 +52,17 @@ name="btn_lock" layout="topleft" follows="top|right" - image_name="Lock2" - top="0" + image_name="Locked_Icon" + top="2" left="0" - height="20" - width="20" + height="13" + width="9" tab_stop="false" /> <button name="btn_edit" layout="topleft" follows="top|right" - image_unselected="Icon_Gear_Background" - image_selected="Icon_Gear_Background" + image_overlay="Edit_Wrench" top="0" left_pad="3" height="20" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 2cb91fe1f0..bfc40a8638 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -48,29 +48,32 @@ left="0" max_width="320" min_height="23" - min_width="216" + min_width="214" mouse_opaque="false" name="chat_bar" top="4" - user_resize="false" - width="310" /> + user_resize="true" + width="308" /> + <!-- + There is resize bar between chatbar and Speak button. It has 2px width (is is set as 2*UIResizeBarOverlap) + --> <layout_panel auto_resize="false" follows="right" height="28" layout="topleft" min_height="28" - min_width="57" + min_width="59" mouse_opaque="false" name="speak_panel" top_delta="0" user_resize="false" - width="108"> + width="110"> <talk_button follows="left|right" height="23" layout="topleft" - left="0" + left="2" name="talk" top="5" width="105"> @@ -190,7 +193,7 @@ min_width="40" mouse_opaque="false" name="snapshot_panel" - width="40"> + width="39"> <button follows="left|right" height="23" @@ -218,6 +221,38 @@ min_height="28" min_width="52" mouse_opaque="false" + name="sidebar_btn_panel" + user_resize="false" + width="83"> +<!--*TODO: Implement toggle of sidebar with buttons +Disabled for now. +--> + <button + control_name="SidebarWithButtonsVisibility" + follows="left|right" + height="23" + image_pressed="PushButton_Press" + image_pressed_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" + is_toggle="true" + label="Sidebar" + layout="topleft" + left="0" + name="sidebar_btn" + tool_tip="Shows/hides Sidebar" + top="5" + use_ellipses="true" + width="80"> + </button> + </layout_panel> + <layout_panel + auto_resize="false" + follows="left|right" + height="28" + layout="topleft" + min_height="28" + min_width="52" + mouse_opaque="false" name="build_btn_panel" user_resize="false" width="83"> @@ -225,7 +260,6 @@ Disabled for now. --> <button -enabled="false" follows="left|right" height="23" image_pressed="PushButton_Press" @@ -240,8 +274,8 @@ enabled="false" top="5" use_ellipses="true" width="80"> - <init_callback - function="Button.SetFloaterToggle" + <commit_callback + function="Build.Toggle" parameter="build" /> </button> </layout_panel> diff --git a/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml b/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml index 7cc9c46c08..b1782f405e 100644 --- a/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml @@ -63,8 +63,7 @@ name="btn_move_up" layout="topleft" follows="top|right" - image_unselected="Movement_Up_Off" - image_selected="Movement_Up_Off" + image_overlay="UpArrow_Off" top="0" left="0" height="20" @@ -74,8 +73,7 @@ name="btn_move_down" layout="topleft" follows="top|right" - image_unselected="Movement_Down_Off" - image_selected="Movement_Down_Off" + image_overlay="DownArrow_Off" top="0" left_pad="3" height="20" @@ -85,17 +83,16 @@ name="btn_lock" layout="topleft" follows="top|right" - image_name="Lock2" - top="0" - left_pad="3" - height="20" - width="20" /> + image_name="Locked_Icon" + top="2" + left_pad="1" + height="13" + width="9" /> <button name="btn_edit" layout="topleft" follows="top|right" - image_unselected="Icon_Gear_Background" - image_selected="Icon_Gear_Background" + image_overlay="Edit_Wrench" top="0" left_pad="3" height="20" diff --git a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml index c5a60ced88..c5fbd1cae6 100644 --- a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml @@ -53,7 +53,7 @@ name="btn_add" layout="topleft" follows="top|right" - label="+" + image_overlay="AddItem_Off" top="0" left="0" height="20" diff --git a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml index ed990eb095..6d02dd41de 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml @@ -57,6 +57,20 @@ tool_tip="Click to choose a picture" top_pad="10" width="94" /> + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_pad="20" + name="Color/Tint" + tool_tip="Click to open color picker" + top="10" + width="64" > + <color_swatch.commit_callback + function="ColorSwatch.Commit" /> + </color_swatch> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index 40fcc1d76c..71f740590b 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -233,7 +233,7 @@ left="0" </panel> <panel follows="all" - height="400" + height="408" layout="topleft" left="0" name="edit_subpanel_container" @@ -244,7 +244,7 @@ left="0" <panel filename="panel_edit_shape.xml" follows="all" - height="400" + height="408" layout="topleft" left="0" name="edit_shape_panel" @@ -254,7 +254,7 @@ left="0" <panel filename="panel_edit_skin.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_skin_panel" @@ -264,7 +264,7 @@ left="0" <panel filename="panel_edit_hair.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_hair_panel" @@ -274,7 +274,7 @@ left="0" <panel filename="panel_edit_eyes.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_eyes_panel" @@ -284,7 +284,7 @@ left="0" <panel filename="panel_edit_shirt.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_shirt_panel" @@ -294,7 +294,7 @@ left="0" <panel filename="panel_edit_pants.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_pants_panel" @@ -304,7 +304,7 @@ left="0" <panel filename="panel_edit_shoes.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_shoes_panel" @@ -314,7 +314,7 @@ left="0" <panel filename="panel_edit_socks.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_socks_panel" @@ -324,7 +324,7 @@ left="0" <panel filename="panel_edit_jacket.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_jacket_panel" @@ -334,7 +334,7 @@ left="0" <panel filename="panel_edit_skirt.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_skirt_panel" @@ -344,7 +344,7 @@ left="0" <panel filename="panel_edit_gloves.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_gloves_panel" @@ -354,7 +354,7 @@ left="0" <panel filename="panel_edit_undershirt.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_undershirt_panel" @@ -364,7 +364,7 @@ left="0" <panel filename="panel_edit_underpants.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_underpants_panel" @@ -374,7 +374,7 @@ left="0" <panel filename="panel_edit_alpha.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_alpha_panel" @@ -384,7 +384,7 @@ left="0" <panel filename="panel_edit_tattoo.xml" follows="all" - height="392" + height="400" layout="topleft" left="0" name="edit_tattoo_panel" @@ -393,58 +393,71 @@ left="0" width="333" /> </panel> <panel - follows="left|right|bottom" - height="38" + follows="bottom|left|right" + height="25" label="gear_buttom_panel" - layout="bottom|left|right" + layout="topleft" left="0" - bottom="25" name="gear_buttom_panel" + top_pad="0" width="333"> <button follows="bottom|left" tool_tip="Options" - height="18" + height="25" + image_hover_unselected="Toolbar_Left_Over" image_disabled="OptionsMenu_Disabled" - image_selected="OptionsMenu_Press" - image_unselected="OptionsMenu_Off" + image_overlay="OptionsMenu_Off" + image_selected="Toolbar_Left_Selected" + image_unselected="Toolbar_Left_Off" layout="topleft" left="10" name="friends_viewsort_btn" - top="10" - width="18" /> + top="0" + width="31" /> <button follows="bottom|left" - height="18" - image_selected="AddItem_Press" - image_unselected="AddItem_Off" + height="25" + image_hover_unselected="Toolbar_Middle_Over" + image_overlay="AddItem_Off" + image_selected="Toolbar_Middle_Selected" + image_unselected="Toolbar_Middle_Off" image_disabled="AddItem_Disabled" layout="topleft" - left_pad="10" + left_pad="1" name="add_btn" tool_tip="TODO" - width="18" /> + width="31" /> + <icon + follows="bottom|left|right" + height="25" + image_name="Toolbar_Middle_Off" + layout="topleft" + left_pad="1" + name="dummy_right_icon" + width="218" > + </icon> <button - follows="bottom|left" - height="18" - image_selected="TrashItem_Press" - image_unselected="TrashItem_Off" + follows="bottom|right" + height="25" + image_hover_unselected="Toolbar_Right_Over" + image_overlay="TrashItem_Off" + image_selected="Toolbar_Right_Selected" + image_unselected="Toolbar_Right_Off" image_disabled="TrashItem_Disabled" layout="topleft" - left_pad="10" - right="-10" + left_pad="1" name="del_btn" tool_tip="TODO" - top_delta="0" - width="18" /> + width="31" /> </panel> <panel follows="bottom|left|right" - height="25" - layout="bottom|left|right" - left="0" + height="23" + layout="topleft" + left="2" name="button_panel" - bottom="5" + top_pad="6" width="333" > <button follows="bottomleft" @@ -462,6 +475,6 @@ left="0" label="Revert" left_pad="7" name="revert_button" - width="153" /> + width="152" /> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 5dbd8bfe6a..55df70eb71 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -7,7 +7,7 @@ left="0" name="chat_bar" top="21" - width="310"> + width="308"> <line_editor border_style="line" border_thickness="1" diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 9072418329..b473a7a282 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -21,6 +21,22 @@ <string name="now_editing" value="Now Editing"/> + <string + name="folder_view_off" + value="Hierarchy_View_Disabled" + translate="false"/> + <string + name="folder_view_on" + value="Hierarchy_View_On" + translate="false"/> + <string + name="list_view_off" + value="List_View_Disabled" + translate="false"/> + <string + name="list_view_on" + value="List_View_On" + translate="false"/> <panel.string name="not_available"> @@ -88,15 +104,15 @@ width="311"> <icon follows="left|top" - height="40" - image_name="TabIcon_Appearance_Off" + height="31" + image_name="Shirt_Large" left="2" mouse_opaque="false" name="outfit_icon" - top="1" + top="2" scale_image="true" visible="true" - width="35" /> + width="31" /> <panel bevel_style="none" follows="top|right" @@ -231,11 +247,10 @@ follows="top|left|right" height="20" image_hover_unselected="Toolbar_Middle_Over" - image_overlay="" + image_overlay="Search_Icon" image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" is_toggle="true" - label="O" layout="topleft" left_pad="5" name="filter_button" @@ -295,13 +310,13 @@ allow_multi_select="true" border="false" follows="left|top|right|bottom" - height="130" + height="140" layout="topleft" left="0" mouse_opaque="false" name="inventory_items" top_pad="5" - width="311" + width="310" visible="false"/> <panel name="filtered_wearables_panel" @@ -310,7 +325,7 @@ layout="topleft" follows="left|top|right|bottom" border="false" - height="130" + height="140" left="0" mouse_opaque="false" width="311" @@ -321,8 +336,8 @@ allow_select="true" layout="topleft" follows="all" - width="311" - height="130" + width="310" + height="140" left="0" top="0"/> </panel> @@ -339,7 +354,7 @@ left="0" name="add_wearables_button_bar" top_pad="0" - width="300"> + width="313"> <button follows="bottom|left" height="25" @@ -356,11 +371,10 @@ follows="bottom|left" height="25" image_hover_unselected="Toolbar_Middle_Over" - image_overlay="" + image_overlay="Hierarchy_View_Disabled" image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" is_toggle="true" - label="F" layout="topleft" left_pad="1" name="folder_view_btn" @@ -370,11 +384,10 @@ follows="bottom|left" height="25" image_hover_unselected="Toolbar_Middle_Over" - image_overlay="" + image_overlay="List_View_On" image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" is_toggle="true" - label="L" layout="topleft" left_pad="1" name="list_view_btn" @@ -393,6 +406,15 @@ name="add_to_outfit_btn" top="1" width="31" /> + <icon + follows="bottom|left|right" + height="25" + image_name="Toolbar_Right_Off" + layout="topleft" + left_pad="1" + name="dummy_right_icon" + width="184" > + </icon> </panel> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 88b60ea3c8..73882fea4d 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -175,9 +175,10 @@ Automatic position for: label="Opacity" layout="topleft" left="80" - label_width="60" + label_width="156" name="bubble_chat_opacity" - width="200" /> + top_pad = "10" + width="347" /> <color_swatch can_apply_immediately="true" color="0 0 0 1" @@ -185,7 +186,7 @@ Automatic position for: follows="left|top" height="50" layout="topleft" - left_pad="10" + left_pad="30" top="190" name="background" tool_tip="Choose color for bubble chat" @@ -203,9 +204,9 @@ Automatic position for: follows="left|top" height="12" layout="topleft" - left="30" + left="80" name="UI Size:" - top_pad="15" + top_pad="25" width="300"> UI size </text> @@ -217,7 +218,7 @@ Automatic position for: increment="0.025" initial_value="1" layout="topleft" - left_delta="52" + left_pad="0" max_val="1.4" min_val="0.75" name="ui_scale_slider" @@ -316,7 +317,7 @@ Automatic position for: label="Other Devices" left="30" name="joystick_setup_button" - top_pad="10" + top_pad="27" width="155"> <button.commit_callback function="Floater.Show" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 0a56f711dd..266fd6cb5e 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -160,7 +160,7 @@ layout="topleft" left="5" name="CustomGraphics Panel" - top="124" + top="76" width="485"> <text type="string" @@ -351,7 +351,7 @@ top_delta="0" width="128"> m - </text> + </text> <slider control_name="RenderMaxPartCount" decimal_digits="0" @@ -367,6 +367,34 @@ name="MaxParticleCount" top_pad="7" width="303" /> + <slider + control_name="RenderAvatarMaxVisible" + decimal_digits="0" + follows="left|top" + height="16" + increment="2" + initial_value="35" + label="Max. avatar draw distance:" + label_width="185" + layout="topleft" + left_delta="0" + max_val="65" + min_val="1" + name="MaxAvatarDrawDistance" + top_pad="4" + width="290" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="291" + name="DrawDistanceMeterText3" + top_delta="0" + width="128"> + m + </text> <slider control_name="RenderGlowResolutionPow" decimal_digits="0" @@ -377,7 +405,7 @@ label="Post process quality:" label_width="185" layout="topleft" - left_delta="0" + left="200" max_val="9" min_val="8" name="RenderPostProcess" @@ -522,7 +550,7 @@ layout="topleft" left="469" name="PostProcessText" - top="305" + top="60" width="128"> Low </text> @@ -607,7 +635,7 @@ layout="topleft" left="200" name="LightingDetailText" - top_pad="8" + top_pad="18" width="140"> Lighting detail: </text> @@ -644,7 +672,7 @@ layout="topleft" left_pad="-30" name="TerrainDetailText" - top="465" + top="226" width="155"> Terrain detail: </text> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index e03ecd8f04..65c78ad333 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -14,7 +14,7 @@ follows="left|top" font.style="BOLD" height="15" - increment="0.05" + increment="0.025" initial_value="0.5" label="Master volume" label_width="120" @@ -57,7 +57,7 @@ disabled_control="MuteAudio" follows="left|top" height="15" - increment="0.05" + increment="0.025" initial_value="0.5" label="Buttons" label_width="120" @@ -91,7 +91,7 @@ disabled_control="MuteAudio" follows="left|top" height="15" - increment="0.05" + increment="0.025" initial_value="0.5" label="Ambient" label_width="120" @@ -125,7 +125,7 @@ disabled_control="MuteAudio" follows="left|top" height="15" - increment="0.05" + increment="0.025" initial_value="0.5" label="Sound Effects" label_width="120" @@ -159,7 +159,7 @@ disabled_control="MuteAudio" follows="left|top" height="15" - increment="0.05" + increment="0.025" initial_value="0.5" label="Streaming music" label_width="120" @@ -202,7 +202,7 @@ disabled_control="MuteAudio" follows="left|top" height="16" - increment="0.05" + increment="0.025" initial_value="0.5" label="Media" label_width="120" @@ -247,7 +247,7 @@ disabled_control="MuteAudio" follows="left|top" height="16" - increment="0.05" + increment="0.025" initial_value="0.5" label="Voice Chat" label_width="120" @@ -454,7 +454,7 @@ control_name="AudioLevelMic" follows="left|top" height="17" - increment="0.05" + increment="0.025" initial_value="1.0" layout="topleft" left="160" diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml index 6a3c148456..5a6b3ec096 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml @@ -87,7 +87,7 @@ width="333"> <button follows="left|top" height="20" - image_overlay="windows/Icon_Gear_Over.png" + image_overlay="Edit_Wrench" label="" layout="topleft" left="265" @@ -120,6 +120,7 @@ width="333"> height="493" min_height="410" width="320" + visible="false" left="0" tab_group="1" top_pad="6" diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 812d94c55f..4c42d1f750 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -58,6 +58,16 @@ top="0" width="102" /> <button + enabled="true" + follows="bottom|left" + height="23" + label="Shop" + layout="topleft" + left="210" + name="shop_btn" + top="0" + width="102" /> + <button enabled="false" follows="bottom|left" height="23" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 423e3a89c5..b46fb6f890 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3145,7 +3145,7 @@ Abuse Report</string> <string name="Female Gestures">Female Gestures</string> <string name="Other Gestures">Other Gestures</string> <string name="Speech Gestures">Speech Gestures</string> - + <string name="Common Gestures">Common Gestures</string> <!-- gestures --> <string name="Male - Excuse me">Male - Excuse me</string> <string name="Male - Get lost">Male - Get lost</string> diff --git a/indra/newview/skins/default/xui/es/floater_tools.xml b/indra/newview/skins/default/xui/es/floater_tools.xml index 59f953c239..5dc527c29a 100644 --- a/indra/newview/skins/default/xui/es/floater_tools.xml +++ b/indra/newview/skins/default/xui/es/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="Muestra cuánto se calcula que cuesta renderizar este objeto"> þ: [COUNT] </text> - <check_box label="Estirar ambos lados" name="checkbox uniform"/> + <check_box name="checkbox uniform"/> + <text name="checkbox uniform label"> + Estirar ambos lados + </text> <check_box initial_value="true" label="Estirar las texturas" name="checkbox stretch textures"/> <check_box initial_value="true" label="Usar la cuadrícula" name="checkbox snap to grid"/> <combo_box name="combobox grid mode" tool_tip="Elige qué cuadricula usar para posicionar el objeto" width="82"> diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml index 16d276f8c2..cd86e77eb5 100644 --- a/indra/newview/skins/default/xui/fr/floater_tools.xml +++ b/indra/newview/skins/default/xui/fr/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="Affiche le coût du rendu calculé pour cet objet"> þ : [COUNT] </text> - <check_box label="Étirer les deux côtés" name="checkbox uniform"/> + <check_box name="checkbox uniform"/> + <text name="checkbox uniform label"> + Étirer les deux côtés + </text> <check_box initial_value="true" label="Étirer les textures" name="checkbox stretch textures"/> <check_box initial_value="true" label="Fixer sur la grille" name="checkbox snap to grid"/> <combo_box name="combobox grid mode" tool_tip="Choisissez le type d'axe de grille pour le positionnement de l'objet"> diff --git a/indra/newview/skins/default/xui/it/floater_about_land.xml b/indra/newview/skins/default/xui/it/floater_about_land.xml index 4c3398de87..8e1beb263c 100644 --- a/indra/newview/skins/default/xui/it/floater_about_land.xml +++ b/indra/newview/skins/default/xui/it/floater_about_land.xml @@ -198,13 +198,13 @@ o suddivisa. <text name="resellable_lbl"> Rivendita: </text> - <text left="125" name="resellable_clause"> + <text name="resellable_clause"> La terra in questa regione non può essere rivenduta. </text> <text name="changeable_lbl"> Suddividi: </text> - <text left="125" name="changeable_clause"> + <text name="changeable_clause"> La terra in questa regione non può essere unita/suddivisa. </text> </panel> @@ -340,7 +340,7 @@ Solamente terreni più grandi possono essere abilitati nella ricerca. <check_box label="Sicuro (senza danno)" name="check safe" tool_tip="Se spuntato, imposta il terreno su 'sicuro', disabilitando i danni da combattimento. Se non spuntato, viene abilitato il combattimento a morte."/> <check_box label="Nessuna spinta" name="PushRestrictCheck" tool_tip="Previeni i colpi. Selezionare questa opzione può essere utile per prevenire comportamenti dannosi sul tuo terreno."/> <check_box label="Mostra luogo nella ricerca (30 L$/settimana)" name="ShowDirectoryCheck" tool_tip="Lascia che questa terra sia vista dagli altri nei risultati di ricerca"/> - <combo_box left="282" name="land category with adult" width="140"> + <combo_box name="land category with adult"> <combo_box.item label="Tutte le categorie" name="item0"/> <combo_box.item label="Luogo dei Linden" name="item1"/> <combo_box.item label="Adulti" name="item2"/> @@ -355,7 +355,7 @@ Solamente terreni più grandi possono essere abilitati nella ricerca. <combo_box.item label="Shopping" name="item11"/> <combo_box.item label="Altro" name="item12"/> </combo_box> - <combo_box left="282" name="land category" width="140"> + <combo_box name="land category"> <combo_box.item label="Tutte le categorie" name="item0"/> <combo_box.item label="Luogo dei Linden" name="item1"/> <combo_box.item label="Arte & Cultura" name="item3"/> diff --git a/indra/newview/skins/default/xui/it/floater_tools.xml b/indra/newview/skins/default/xui/it/floater_tools.xml index cd16246f0f..04d61b97ff 100644 --- a/indra/newview/skins/default/xui/it/floater_tools.xml +++ b/indra/newview/skins/default/xui/it/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="Mostra il costo di rendering calcolato per questo oggetto"> þ: [COUNT] </text> - <check_box label="Ridimens. simmetricamente" name="checkbox uniform"/> + <check_box name="checkbox uniform"/> + <text name="checkbox uniform label"> + Ridimens. simmetricamente + </text> <check_box initial_value="true" label="Ridimensiona le texture" name="checkbox stretch textures"/> <check_box initial_value="true" label="Posiziona nella griglia" name="checkbox snap to grid"/> <combo_box name="combobox grid mode" tool_tip="Scegli il tipo di righello per posizionare l'oggetto"> diff --git a/indra/newview/skins/default/xui/it/panel_nearby_media.xml b/indra/newview/skins/default/xui/it/panel_nearby_media.xml index 649b772424..01e21d520a 100644 --- a/indra/newview/skins/default/xui/it/panel_nearby_media.xml +++ b/indra/newview/skins/default/xui/it/panel_nearby_media.xml @@ -16,7 +16,7 @@ (riproduzione) </string> <panel name="minimized_controls"> - <button label="Interrompi tutto" name="all_nearby_media_disable_btn" tool_tip="Spegni tutti i media nei dintorni"/> + <button label="Spegni" name="all_nearby_media_disable_btn" tool_tip="Spegni tutti i media nei dintorni"/> <button label="Accendi tutto" name="all_nearby_media_enable_btn" tool_tip="Accendi tutti i media nei dintorni"/> <button name="open_prefs_btn" tool_tip="Accedi alle preferenze del media"/> <button label="Più >>" label_selected="Meno <<" name="more_btn" tool_tip="Opzioni avanzate"/> diff --git a/indra/newview/skins/default/xui/it/panel_stand_stop_flying.xml b/indra/newview/skins/default/xui/it/panel_stand_stop_flying.xml index 198ebf4b2a..e4ff7019ec 100644 --- a/indra/newview/skins/default/xui/it/panel_stand_stop_flying.xml +++ b/indra/newview/skins/default/xui/it/panel_stand_stop_flying.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- Width and height of this panel should be synchronized with "panel_modes" in the floater_moveview.xml--> <panel name="panel_stand_stop_flying"> - <button label="Stai in piedi" name="stand_btn" tool_tip="Clicca qui per alzarti."/> + <button label="Alzati" name="stand_btn" tool_tip="Clicca qui per alzarti."/> <button label="Ferma il volo" name="stop_fly_btn" tool_tip="Ferma il volo"/> </panel> diff --git a/indra/newview/skins/default/xui/ja/floater_joystick.xml b/indra/newview/skins/default/xui/ja/floater_joystick.xml index 65eeebe4ed..daa480ef5a 100644 --- a/indra/newview/skins/default/xui/ja/floater_joystick.xml +++ b/indra/newview/skins/default/xui/ja/floater_joystick.xml @@ -89,7 +89,7 @@ <spinner left="205" name="BuildAxisDeadZone3" width="50"/> <spinner left="275" name="FlycamAxisDeadZone3" width="50"/> <text name="Feathering"> - 羽毛 + 感度調整 </text> <slider label="" left="126" name="AvatarFeathering" width="67"/> <slider label="" left="196" name="BuildFeathering" width="67"/> diff --git a/indra/newview/skins/default/xui/ja/floater_tools.xml b/indra/newview/skins/default/xui/ja/floater_tools.xml index a8261a7493..a7e687abeb 100644 --- a/indra/newview/skins/default/xui/ja/floater_tools.xml +++ b/indra/newview/skins/default/xui/ja/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="このオブジェクトにかかるレンダリングコストを表示"> þ: [COUNT] </text> - <check_box label="両側を引伸ばす" left="116" name="checkbox uniform"/> + <check_box left="116" name="checkbox uniform"/> + <text name="checkbox uniform label"> + 両側を引伸ばす + </text> <check_box initial_value="true" label="テクスチャを引伸ばす" name="checkbox stretch textures"/> <check_box initial_value="true" label="グリッドにスナップ" left_delta="27" name="checkbox snap to grid"/> <combo_box left_delta="60" name="combobox grid mode" tool_tip="オブジェクトの配置に使うグリッドルーラを選択します" width="76"> diff --git a/indra/newview/skins/default/xui/nl/floater_tools.xml b/indra/newview/skins/default/xui/nl/floater_tools.xml index 0f8392428f..212cac0a5b 100644 --- a/indra/newview/skins/default/xui/nl/floater_tools.xml +++ b/indra/newview/skins/default/xui/nl/floater_tools.xml @@ -33,7 +33,10 @@ <combo_box.item name="Reference" label="Referentie" /> </combo_box> - <check_box left="136" label="Beide zijden uitrekken" name="checkbox uniform"/> + <check_box left="136" name="checkbox uniform"/> + <text name="checkbox uniform label"> + Beide zijden uitrekken + </text> <check_box left="136" label="Texturen uitrekken" name="checkbox stretch textures"/> <check_box left="136" label="Gebruik grid" name="checkbox snap to grid"/> <button label="Opties..." label_selected="Opties..." name="Options..." height="18" bottom_delta="-15"/> diff --git a/indra/newview/skins/default/xui/pl/floater_tools.xml b/indra/newview/skins/default/xui/pl/floater_tools.xml index 5bc3811ef6..5b4f99e9d1 100644 --- a/indra/newview/skins/default/xui/pl/floater_tools.xml +++ b/indra/newview/skins/default/xui/pl/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="Pokazuje koszt renderowania tego obiektu"> þ: [COUNT] </text> - <check_box label="Rozciągnij 2 Strony" name="checkbox uniform"/> + <check_box name="checkbox uniform"/> + <text name="checkbox uniform label"> + Rozciągnij 2 Strony + </text> <check_box initial_value="true" label="Rozciągnij Teksturę" name="checkbox stretch textures"/> <check_box initial_value="true" label="Użyj siatki" name="checkbox snap to grid"/> <combo_box name="combobox grid mode" tool_tip="Wybierz rodzaj linijki siatki dla pozycjonowania obiektu"> diff --git a/indra/newview/skins/default/xui/pt/floater_tools.xml b/indra/newview/skins/default/xui/pt/floater_tools.xml index 3068880599..74b45f1d1e 100644 --- a/indra/newview/skins/default/xui/pt/floater_tools.xml +++ b/indra/newview/skins/default/xui/pt/floater_tools.xml @@ -67,7 +67,10 @@ <text name="RenderingCost" tool_tip="Mostra o cálculo do custo de renderização do objeto"> þ: [COUNT] </text> - <check_box label="Esticar ambos os lados" name="checkbox uniform"/> + <check_box name="checkbox uniform"/> + <text name="checkbox uniform label"> + Esticar ambos os lados + </text> <check_box initial_value="true" label="Esticar texturas" name="checkbox stretch textures"/> <check_box initial_value="true" label="Mostrar na grade" name="checkbox snap to grid"/> <combo_box name="combobox grid mode" tool_tip="Selecione o tipo de régua da grade onde o objeto será colocado"> |