SL-15034 Revisions to dedicated Avatar menus

master
Andrey Kleshchev 2021-03-29 23:36:55 +03:00
parent 569ad2d248
commit 309fb9e892
9 changed files with 139 additions and 82 deletions

View File

@ -249,6 +249,12 @@ LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance()
return dynamic_cast<LLPanelOutfitsInventory*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfits_inventory"));
}
void LLPanelOutfitsInventory::openApearanceTab(const std::string& tab_name)
{
if (!mAppearanceTabs) return;
mAppearanceTabs->selectTabByName(tab_name);
}
//////////////////////////////////////////////////////////////////////////////////
// List Commands //

View File

@ -59,6 +59,8 @@ public:
static LLPanelOutfitsInventory* findInstance();
void openApearanceTab(const std::string& tab_name);
protected:
void updateVerbs();

View File

@ -164,8 +164,12 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
std::string type = key["type"].asString();
if (type == "my_outfits")
{
showOutfitsInventoryPanel();
showOutfitsInventoryPanel("outfitslist_tab");
}
else if (type == "now_wearing")
{
showOutfitsInventoryPanel("cof_tab");
}
else if (type == "edit_outfit")
{
showOutfitEditPanel();
@ -287,7 +291,14 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel()
{
toggleWearableEditPanel(FALSE);
toggleOutfitEditPanel(FALSE);
toggleMyOutfitsPanel(TRUE);
toggleMyOutfitsPanel(TRUE, "");
}
void LLSidepanelAppearance::showOutfitsInventoryPanel(const std::string &tab_name)
{
toggleWearableEditPanel(FALSE);
toggleOutfitEditPanel(FALSE);
toggleMyOutfitsPanel(TRUE, tab_name);
}
void LLSidepanelAppearance::showOutfitEditPanel()
@ -312,37 +323,42 @@ void LLSidepanelAppearance::showOutfitEditPanel()
return;
}
toggleMyOutfitsPanel(FALSE);
toggleMyOutfitsPanel(FALSE, "");
toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode
toggleOutfitEditPanel(TRUE);
}
void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = NULL*/, BOOL disable_camera_switch)
{
toggleMyOutfitsPanel(FALSE);
toggleMyOutfitsPanel(FALSE, "");
toggleOutfitEditPanel(FALSE, TRUE); // don't switch out of edit appearance mode
toggleWearableEditPanel(TRUE, wearable, disable_camera_switch);
}
void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible)
void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name)
{
if (!mPanelOutfitsInventory || mPanelOutfitsInventory->getVisible() == visible)
{
// visibility isn't changing, hence nothing to do
return;
}
if (!mPanelOutfitsInventory
|| (mPanelOutfitsInventory->getVisible() == visible && tab_name.empty()))
{
// visibility isn't changing, hence nothing to do
return;
}
mPanelOutfitsInventory->setVisible(visible);
mPanelOutfitsInventory->setVisible(visible);
// *TODO: Move these controls to panel_outfits_inventory.xml
// so that we don't need to toggle them explicitly.
mFilterEditor->setVisible(visible);
mCurrOutfitPanel->setVisible(visible);
// *TODO: Move these controls to panel_outfits_inventory.xml
// so that we don't need to toggle them explicitly.
mFilterEditor->setVisible(visible);
mCurrOutfitPanel->setVisible(visible);
if (visible)
{
mPanelOutfitsInventory->onOpen(LLSD());
}
if (visible)
{
mPanelOutfitsInventory->onOpen(LLSD());
if (!tab_name.empty())
{
mPanelOutfitsInventory->openApearanceTab(tab_name);
}
}
}
void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch)

View File

@ -56,7 +56,8 @@ public:
void fetchInventory();
void inventoryFetched();
void showOutfitsInventoryPanel();
void showOutfitsInventoryPanel(); // last selected
void showOutfitsInventoryPanel(const std::string& tab_name);
void showOutfitEditPanel();
void showWearableEditPanel(LLViewerWearable *wearable = NULL, BOOL disable_camera_switch = FALSE);
void setWearablesLoading(bool val);
@ -72,7 +73,7 @@ private:
void onOpenOutfitButtonClicked();
void onEditAppearanceButtonClicked();
void toggleMyOutfitsPanel(BOOL visible);
void toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name);
void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE);
void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE);

View File

@ -6373,6 +6373,11 @@ void handle_edit_outfit()
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_outfit"));
}
void handle_now_wearing()
{
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing"));
}
void handle_edit_shape()
{
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_shape"));
@ -8985,6 +8990,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLEnableHoverHeight(), "Edit.EnableHoverHeight");
view_listener_t::addMenu(new LLEnableEditPhysics(), "Edit.EnableEditPhysics");
commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar));
commit.add("NowWearing", boost::bind(&handle_now_wearing));
commit.add("EditOutfit", boost::bind(&handle_edit_outfit));
commit.add("EditShape", boost::bind(&handle_edit_shape));
commit.add("HoverHeight", boost::bind(&handle_hover_height));

View File

@ -37,39 +37,47 @@
layout="topleft" />
<menu_item_call
label="Outfits..."
label="Now wearing..."
name="NowWearing">
<menu_item_call.on_click
function="NowWearing" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<menu_item_call
label="My Outfits..."
name="Change Outfit">
<menu_item_call.on_click
function="CustomizeAvatar" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<menu_item_call label="Current outfit..."
layout="topleft"
name="Edit Outfit">
<menu_item_call label="Hover height..."
layout="topleft"
name="Hover Height">
<menu_item_call.on_click
function="EditOutfit" />
function="HoverHeight" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
function="Edit.EnableHoverHeight" />
</menu_item_call>
<menu_item_call label="Shape..."
layout="topleft"
name="Edit My Shape">
name="Edit Shape">
<menu_item_call.on_click
function="EditShape" />
<menu_item_call.on_enable
function="Edit.EnableEditShape" />
</menu_item_call>
<menu_item_call label="Hover height..."
layout="topleft"
name="Hover Height">
<menu_item_call.on_click
function="HoverHeight" />
<menu_item_call.on_enable
function="Edit.EnableHoverHeight" />
<menu_item_call label="Edit outfit parts..."
layout="topleft"
name="Edit Outfit">
<menu_item_call.on_click
function="EditOutfit" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<context_menu
label="Take Off"
label="Take off"
layout="topleft"
name="Take Off &gt;">
<context_menu

View File

@ -3,7 +3,16 @@
layout="topleft"
name="Self Pie">
<menu_item_call
label="Outfits..."
label="Now wearing..."
layout="topleft"
name="NowWearing">
<menu_item_call.on_click
function="NowWearing" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<menu_item_call
label="My Outfits..."
layout="topleft"
name="Chenge Outfit">
<menu_item_call.on_click
@ -11,22 +20,6 @@
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<menu_item_call label="Current 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="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="Hover height..."
layout="topleft"
name="Hover Height">
@ -35,8 +28,25 @@
<menu_item_call.on_enable
function="Edit.EnableHoverHeight" />
</menu_item_call>
<menu_item_call label="Shape..."
layout="topleft"
name="Edit Shape">
<menu_item_call.on_click
function="EditShape" />
<menu_item_call.on_enable
function="Edit.EnableEditShape" />
</menu_item_call>
<menu_item_call
label="Edit outfit parts..."
layout="topleft"
name="Edit Outfit">
<menu_item_call.on_click
function="EditOutfit" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<context_menu
label="Take Off"
label="Take off"
layout="topleft"
name="Take Off &gt;">
<context_menu

View File

@ -165,40 +165,22 @@
name="Avatar"
tear_off="true">
<menu_item_call
label="Complete avatars..."
name="Avatar Picker">
<menu_item_call.on_click
function="Floater.ToggleOrBringToFront"
parameter="avatar" />
</menu_item_call>
<menu_item_call
label="Outfits..."
name="ChangeOutfit"
label="Now wearing..."
name="NowWearing"
shortcut="control|O">
<menu_item_call.on_click
function="Floater.ToggleOrBringToFront"
parameter="appearance" />
function="NowWearing" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<menu_item_call
label="Current outfit..."
layout="topleft"
name="Edit Outfit">
<menu_item_call
label="My outfits..."
name="ChangeOutfit">
<menu_item_call.on_click
function="EditOutfit" />
function="CustomizeAvatar" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<menu_item_call
label="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="Hover height..."
layout="topleft"
name="Hover Height">
@ -207,8 +189,26 @@
<menu_item_call.on_enable
function="Edit.EnableHoverHeight" />
</menu_item_call>
<menu_item_call
label="Edit 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="Edit outfit parts..."
layout="topleft"
name="Edit Outfit">
<menu_item_call.on_click
function="EditOutfit" />
<menu_item_call.on_enable
function="Edit.EnableCustomizeAvatar" />
</menu_item_call>
<menu
label="Take Off"
label="Take off"
layout="topleft"
name="Take Off &gt;">
<menu
@ -390,8 +390,16 @@
</menu_item_call>
</menu>
<menu_item_separator/>
<menu_item_call
label="Complete avatars..."
name="Avatar Picker">
<menu_item_call.on_click
function="Floater.ToggleOrBringToFront"
parameter="avatar" />
</menu_item_call>
<menu_item_separator/>
<menu_item_call
<menu_item_call
label="Sit / stand"
layout="topleft"
shortcut="alt|shift|S"

View File

@ -81,7 +81,7 @@
name="title"
text_color="LtGray"
top="0"
value="Current Outfit"
value="Edit outfit parts"
use_ellipses="true"
width="275" />