Make it possible to show LL badges and FS team badge at the same time in profile

meow-7.2.2
Ansariel 2024-11-01 00:48:07 +01:00
parent f0e089e485
commit ffabef735c
4 changed files with 120 additions and 35 deletions

View File

@ -1457,14 +1457,8 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data
//getChild<LLUICtrl>("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);
}
// <FS:Ansariel> Add Firestorm team badge
else if (FSData::getInstance()->getAgentFlags(avatar_data->avatar_id) != -1)
{
setBadge("Profile_Badge_Team", "BadgeTeam");
}
// </FS:Ansariel>
else if (avatar_data->born_on < sl_release)
{
// <FS:Ansariel> Fix LL UI/UX design accident
@ -1472,7 +1466,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data
//getChild<LLUICtrl>("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<LLUICtrl>("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<LLUICtrl>("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<LLUICtrl>("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<LLUICtrl>("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
// <FS:Ansariel> Fix LL UI/UX design accident
//childSetVisible("partner_spacer_layout", true);
}
// <FS:Ansariel> Add Firestorm team badge
if (FSData::getInstance()->getAgentFlags(avatar_data->avatar_id) != -1)
{
setBadge("Profile_Badge_Team", "BadgeTeam", BadgeLocation::top);
}
// </FS:Ansariel>
}
// <FS:Ansariel> 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<LLIconCtrl>("badge_icon");
auto iconctrl = getChild<LLIconCtrl>(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);
}
// </FS:Ansariel>

View File

@ -215,8 +215,13 @@ private:
void onCommitProfileImage(const LLUUID& id);
// <FS:Ansariel> 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<std::string, LLUUID> group_map_t;

View File

@ -478,16 +478,55 @@
visible="false"
auto_resize="false"
user_resize="false">
<icon
name="badge_icon"
image_name="Profile_Badge_Linden"
tool_tip="Linden Lab Employee"
<layout_stack
name="badge_stacker"
animate="false"
top="0"
left="0"
width="22"
height="44"
follows="top|left|right"
layout="topleft"
follows="left|top"
top="4"
left="4"
height="18"
width="18"/>
orientation="vertical">
<layout_panel
name="top_badge_layout"
follows="all"
layout="topleft"
width="22"
visible="false"
auto_resize="true"
user_resize="false">
<icon
name="top_badge_icon"
image_name="Profile_Badge_Linden"
tool_tip="Linden Lab Employee"
layout="topleft"
follows="left|top"
top="2"
left="4"
height="18"
width="18"/>
</layout_panel>
<layout_panel
name="bottom_badge_layout"
follows="all"
layout="topleft"
width="22"
visible="false"
auto_resize="true"
user_resize="false">
<icon
name="bottom_badge_icon"
image_name="Profile_Badge_Linden"
tool_tip="Linden Lab Employee"
layout="topleft"
follows="left|top"
top="2"
left="4"
height="18"
width="18"/>
</layout_panel>
</layout_stack>
</layout_panel>
<layout_panel
name="accountinfo_layout"

View File

@ -434,21 +434,60 @@
follows="top|right"
layout="topleft"
width="24"
height="20"
height="44"
top_delta="0"
right="-1"
visible="false">
<icon
name="badge_icon"
image_name=""
tool_tip=""
layout="topleft"
follows="left|top"
top="2"
left="0"
height="18"
width="18"/>
<layout_stack
name="badge_stacker"
animate="false"
top="2"
left="0"
width="22"
height="44"
follows="top|left|right"
layout="topleft"
orientation="vertical">
<layout_panel
name="top_badge_layout"
follows="all"
layout="topleft"
width="22"
visible="false"
auto_resize="true"
user_resize="false">
<icon
name="top_badge_icon"
image_name="Profile_Badge_Linden"
tool_tip="Linden Lab Employee"
layout="topleft"
follows="left|top"
top="2"
left="0"
height="18"
width="18"/>
</layout_panel>
<layout_panel
name="bottom_badge_layout"
follows="all"
layout="topleft"
width="22"
visible="false"
auto_resize="true"
user_resize="false">
<icon
name="bottom_badge_icon"
image_name="Profile_Badge_Linden"
tool_tip="Linden Lab Employee"
layout="topleft"
follows="left|top"
top="2"
left="0"
height="18"
width="18"/>
</layout_panel>
</layout_stack>
</panel>