From 107b1d00ed5d272cd87a6ca333cd719151208eaa Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 22 Apr 2023 00:31:42 +0300 Subject: SL-19636 Profile badges --- indra/newview/llpanelprofile.cpp | 60 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelprofile.cpp') diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 708ff26ced..34e1fd09d8 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -159,6 +159,7 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id) avatar_data->fl_about_text = result["fl_about_text"].asString(); avatar_data->born_on = result["member_since"].asDate(); avatar_data->profile_url = getProfileURL(agent_id.asString()); + avatar_data->customer_type = result["customer_type"].asString(); avatar_data->flags = 0; @@ -1051,6 +1052,8 @@ void LLPanelProfileSecondLife::resetData() mCantEditObjectsIcon->setEnabled(false); childSetVisible("partner_layout", FALSE); + childSetVisible("badge_layout", FALSE); + childSetVisible("partner_spacer_layout", TRUE); } void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avatar_data) @@ -1258,6 +1261,59 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data std::string caption_text = getString("CaptionTextAcctInfo", args); getChild("account_info")->setValue(caption_text); + + 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); + } } void LLPanelProfileSecondLife::fillRightsData() @@ -1412,7 +1468,7 @@ void LLPanelProfileSecondLife::updateOnlineStatus() } else { - childSetVisible("frind_layout", false); + childSetVisible("friend_layout", false); childSetVisible("online_layout", false); childSetVisible("offline_layout", false); } @@ -1420,7 +1476,7 @@ void LLPanelProfileSecondLife::updateOnlineStatus() void LLPanelProfileSecondLife::processOnlineStatus(bool is_friend, bool show_online, bool online) { - childSetVisible("frind_layout", is_friend); + childSetVisible("friend_layout", is_friend); childSetVisible("online_layout", online && show_online); childSetVisible("offline_layout", !online && show_online); } -- cgit v1.2.3 From d35ef7e5d8f3968479543819501bd201e6321355 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 27 Jun 2023 20:20:56 +0300 Subject: SL-19924 Update profile type names --- indra/newview/llpanelprofile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelprofile.cpp') diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 34e1fd09d8..8ac1efe8e7 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1295,14 +1295,14 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data childSetVisible("badge_layout", TRUE); childSetVisible("partner_spacer_layout", FALSE); } - else if (customer_lower == "premium_lifetime") + else if (customer_lower == "secondlifetime_premium") { - getChild("badge_icon")->setValue("Profile_Premium_Lifetime"); + getChild("badge_icon")->setValue("Profile_Badge_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") + else if (customer_lower == "secondlifetime_premium_plus") { getChild("badge_icon")->setValue("Profile_Badge_Pplus_Lifetime"); getChild("badge_text")->setValue(getString("BadgePremiumPlusLifetime")); -- cgit v1.2.3