From ffabef735cdfa42cf5eb5d22030ff18a70ae0b6e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 1 Nov 2024 00:48:07 +0100 Subject: [PATCH] Make it possible to show LL badges and FS team badge at the same time in profile --- indra/newview/llpanelprofile.cpp | 30 ++++----- indra/newview/llpanelprofile.h | 7 ++- .../xui/en/panel_profile_secondlife.xml | 57 ++++++++++++++--- .../xui/en/panel_profile_secondlife.xml | 61 +++++++++++++++---- 4 files changed, 120 insertions(+), 35 deletions(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index c154b30085..ffc292415c 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1457,14 +1457,8 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data //getChild("badge_text")->setValue(getString("BadgeLinden")); //childSetVisible("badge_layout", true); //childSetVisible("partner_spacer_layout", false); - setBadge("Profile_Badge_Linden", "BadgeLinden"); + setBadge("Profile_Badge_Linden", "BadgeLinden", BadgeLocation::bottom); } - // Add Firestorm team badge - else if (FSData::getInstance()->getAgentFlags(avatar_data->avatar_id) != -1) - { - setBadge("Profile_Badge_Team", "BadgeTeam"); - } - // else if (avatar_data->born_on < sl_release) { // Fix LL UI/UX design accident @@ -1472,7 +1466,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data //getChild("badge_text")->setValue(getString("BadgeBeta")); //childSetVisible("badge_layout", true); //childSetVisible("partner_spacer_layout", false); - setBadge("Profile_Badge_Beta", "BadgeBeta"); + setBadge("Profile_Badge_Beta", "BadgeBeta", BadgeLocation::bottom); } else if (customer_lower == "beta_lifetime") { @@ -1481,7 +1475,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data //getChild("badge_text")->setValue(getString("BadgeBetaLifetime")); //childSetVisible("badge_layout", true); //childSetVisible("partner_spacer_layout", false); - setBadge("Profile_Badge_Beta_Lifetime", "BadgeBetaLifetime"); + setBadge("Profile_Badge_Beta_Lifetime", "BadgeBetaLifetime", BadgeLocation::bottom); } else if (customer_lower == "lifetime") { @@ -1490,7 +1484,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data //getChild("badge_text")->setValue(getString("BadgeLifetime")); //childSetVisible("badge_layout", true); //childSetVisible("partner_spacer_layout", false); - setBadge("Profile_Badge_Lifetime", "BadgeLifetime"); + setBadge("Profile_Badge_Lifetime", "BadgeLifetime", BadgeLocation::bottom); } else if (customer_lower == "secondlifetime_premium") { @@ -1499,7 +1493,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data //getChild("badge_text")->setValue(getString("BadgePremiumLifetime")); //childSetVisible("badge_layout", true); //childSetVisible("partner_spacer_layout", false); - setBadge("Profile_Badge_Premium_Lifetime", "BadgePremiumLifetime"); + setBadge("Profile_Badge_Premium_Lifetime", "BadgePremiumLifetime", BadgeLocation::bottom); } else if (customer_lower == "secondlifetime_premium_plus") { @@ -1508,7 +1502,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data //getChild("badge_text")->setValue(getString("BadgePremiumPlusLifetime")); //childSetVisible("badge_layout", true); //childSetVisible("partner_spacer_layout", false); - setBadge("Profile_Badge_Pplus_Lifetime", "BadgePremiumPlusLifetime"); + setBadge("Profile_Badge_Pplus_Lifetime", "BadgePremiumPlusLifetime", BadgeLocation::bottom); } else { @@ -1516,14 +1510,22 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data // Fix LL UI/UX design accident //childSetVisible("partner_spacer_layout", true); } + + // Add Firestorm team badge + if (FSData::getInstance()->getAgentFlags(avatar_data->avatar_id) != -1) + { + setBadge("Profile_Badge_Team", "BadgeTeam", BadgeLocation::top); + } + // } // Fix LL UI/UX design accident -void LLPanelProfileSecondLife::setBadge(std::string_view icon_name, std::string_view tooltip) +void LLPanelProfileSecondLife::setBadge(std::string_view icon_name, std::string_view tooltip, BadgeLocation location) { - auto iconctrl = getChild("badge_icon"); + auto iconctrl = getChild(location == BadgeLocation::top ? "top_badge_icon" : "bottom_badge_icon"); iconctrl->setValue(icon_name.data()); iconctrl->setToolTip(getString(tooltip.data())); + childSetVisible(location == BadgeLocation::top ? "top_badge_layout" : "bottom_badge_layout", true); childSetVisible("badge_layout", true); } // diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index f71c0e3db3..d348da069a 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -215,8 +215,13 @@ private: void onCommitProfileImage(const LLUUID& id); // Fix LL UI/UX design accident + enum class BadgeLocation + { + top, + bottom + }; void updateButtons(); - void setBadge(std::string_view icon_name, std::string_view tooltip); + void setBadge(std::string_view icon_name, std::string_view tooltip, BadgeLocation location); 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 fb2320ccd8..0f494440d8 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -478,16 +478,55 @@ visible="false" auto_resize="false" user_resize="false"> - + orientation="vertical"> + + + + + + + - + + + + + + + +