diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index eccdbc24b8..ccbf33df03 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1576,62 +1576,83 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data std::string caption_text = getString("CaptionTextAcctInfo", args); getChild("account_info")->setValue(caption_text); - // Leave this out for now until we figured out if/how to show badges - //const S32 LINDEN_EMPLOYEE_INDEX = 3; - //LLDate sl_release; - //sl_release.fromYMDHMS(2003, 6, 23, 0, 0, 0); - //std::string customer_lower = avatar_data->customer_type; - //LLStringUtil::toLower(customer_lower); - //if (avatar_data->caption_index == LINDEN_EMPLOYEE_INDEX) - //{ - // getChild("badge_icon")->setValue("Profile_Badge_Linden"); - // getChild("badge_text")->setValue(getString("BadgeLinden")); - // childSetVisible("badge_layout", TRUE); - // childSetVisible("partner_spacer_layout", FALSE); - //} - //else if (avatar_data->born_on < sl_release) - //{ - // getChild("badge_icon")->setValue("Profile_Badge_Beta"); - // getChild("badge_text")->setValue(getString("BadgeBeta")); - // childSetVisible("badge_layout", TRUE); - // childSetVisible("partner_spacer_layout", FALSE); - //} - //else if (customer_lower == "beta_lifetime") - //{ - // getChild("badge_icon")->setValue("Profile_Badge_Beta_Lifetime"); - // getChild("badge_text")->setValue(getString("BadgeBetaLifetime")); - // childSetVisible("badge_layout", TRUE); - // childSetVisible("partner_spacer_layout", FALSE); - //} - //else if (customer_lower == "lifetime") - //{ - // getChild("badge_icon")->setValue("Profile_Badge_Lifetime"); - // getChild("badge_text")->setValue(getString("BadgeLifetime")); - // childSetVisible("badge_layout", TRUE); - // childSetVisible("partner_spacer_layout", FALSE); - //} - //else if (customer_lower == "premium_lifetime") - //{ - // getChild("badge_icon")->setValue("Profile_Premium_Lifetime"); - // getChild("badge_text")->setValue(getString("BadgePremiumLifetime")); - // childSetVisible("badge_layout", TRUE); - // childSetVisible("partner_spacer_layout", FALSE); - //} - //else if (customer_lower == "pplus_lifetime" || customer_lower == "premium_plus_lifetime") - //{ - // getChild("badge_icon")->setValue("Profile_Badge_Pplus_Lifetime"); - // getChild("badge_text")->setValue(getString("BadgePremiumPlusLifetime")); - // childSetVisible("badge_layout", TRUE); - // childSetVisible("partner_spacer_layout", FALSE); - //} - //else - //{ - // childSetVisible("badge_layout", FALSE); - // childSetVisible("partner_spacer_layout", TRUE); - //} - // + const S32 LINDEN_EMPLOYEE_INDEX = 3; + LLDate sl_release; + sl_release.fromYMDHMS(2003, 6, 23, 0, 0, 0); + std::string customer_lower = avatar_data->customer_type; + LLStringUtil::toLower(customer_lower); + if (avatar_data->caption_index == LINDEN_EMPLOYEE_INDEX) + { + // Fix LL UI/UX design accident + //getChild("badge_icon")->setValue("Profile_Badge_Linden"); + //getChild("badge_text")->setValue(getString("BadgeLinden")); + //childSetVisible("badge_layout", TRUE); + //childSetVisible("partner_spacer_layout", FALSE); + setBadge("Profile_Badge_Linden", "BadgeLinden"); + } + else if (avatar_data->born_on < sl_release) + { + // Fix LL UI/UX design accident + //getChild("badge_icon")->setValue("Profile_Badge_Beta"); + //getChild("badge_text")->setValue(getString("BadgeBeta")); + //childSetVisible("badge_layout", TRUE); + //childSetVisible("partner_spacer_layout", FALSE); + setBadge("Profile_Badge_Beta", "BadgeBeta"); + } + else if (customer_lower == "beta_lifetime") + { + // Fix LL UI/UX design accident + //getChild("badge_icon")->setValue("Profile_Badge_Beta_Lifetime"); + //getChild("badge_text")->setValue(getString("BadgeBetaLifetime")); + //childSetVisible("badge_layout", TRUE); + //childSetVisible("partner_spacer_layout", FALSE); + setBadge("Profile_Badge_Beta_Lifetime", "BadgeBetaLifetime"); + } + else if (customer_lower == "lifetime") + { + // Fix LL UI/UX design accident + //getChild("badge_icon")->setValue("Profile_Badge_Lifetime"); + //getChild("badge_text")->setValue(getString("BadgeLifetime")); + //childSetVisible("badge_layout", TRUE); + //childSetVisible("partner_spacer_layout", FALSE); + setBadge("Profile_Badge_Lifetime", "BadgeLifetime"); + } + else if (customer_lower == "premium_lifetime") + { + // Fix LL UI/UX design accident + //getChild("badge_icon")->setValue("Profile_Premium_Lifetime"); + //getChild("badge_text")->setValue(getString("BadgePremiumLifetime")); + //childSetVisible("badge_layout", TRUE); + //childSetVisible("partner_spacer_layout", FALSE); + setBadge("Profile_Premium_Lifetime", "BadgePremiumLifetime"); + } + else if (customer_lower == "pplus_lifetime" || customer_lower == "premium_plus_lifetime") + { + // Fix LL UI/UX design accident + //getChild("badge_icon")->setValue("Profile_Badge_Pplus_Lifetime"); + //getChild("badge_text")->setValue(getString("BadgePremiumPlusLifetime")); + //childSetVisible("badge_layout", TRUE); + //childSetVisible("partner_spacer_layout", FALSE); + setBadge("Profile_Badge_Pplus_Lifetime", "BadgePremiumPlusLifetime"); + } + else + { + childSetVisible("badge_layout", FALSE); + // Fix LL UI/UX design accident + //childSetVisible("partner_spacer_layout", TRUE); + } } +// Fix LL UI/UX design accident +void LLPanelProfileSecondLife::setBadge(std::string_view icon_name, std::string_view tooltip) +{ + auto iconctrl = getChild("badge_icon"); + iconctrl->setValue(icon_name.data()); + iconctrl->setToolTip(getString(tooltip.data())); + childSetVisible("badge_layout", true); +} +// + void LLPanelProfileSecondLife::fillRightsData() { if (getSelfProfile()) diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 8b097ead19..82974b26d1 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -208,6 +208,7 @@ private: // Fix LL UI/UX design accident void updateButtons(); + void setBadge(std::string_view icon_name, std::string_view tooltip); private: typedef std::map group_map_t; diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index 2c305eead7..21ef1b141b 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -452,22 +452,59 @@ layout="topleft" follows="left|top|right" bevel_style="in"/> - + orientation="horizontal"> + + + + + + +