Prevent warnings about missing ui from places it would never be

Layer interaction buttons for single layer wearable types
Buttons for subparts in types with only a single subpart
Take Off button for body parts
This commit is contained in:
Liru Færs
2019-10-14 22:05:53 -04:00
parent accd69386a
commit 453386a49a
2 changed files with 43 additions and 26 deletions

View File

@@ -712,19 +712,28 @@ BOOL LLPanelEditWearable::postBuild()
mCreateNew = getChild<LLUICtrl>("Create New");
mCreateNew->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnCreateNew, this));
mCreateNewLayer = getChild<LLUICtrl>("New Layer");
mCreateNewLayer->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnCreateNew, this));
if (mCreateNewLayer = findChild<LLUICtrl>("New Layer"))
{
mCreateNewLayer->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnCreateNew, this));
}
mTakeOff = getChild<LLUICtrl>("Take Off");
// If PG, can't take off underclothing or shirt
mCanTakeOff = !(gAgent.isTeen() && (mType == LLWearableType::WT_UNDERSHIRT || mType == LLWearableType::WT_UNDERPANTS) );
mTakeOff->setVisible(mCanTakeOff);
mTakeOff->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnTakeOff, this));
if (mTakeOff = findChild<LLUICtrl>("Take Off"))
{
// If PG, can't take off underclothing or shirt
mCanTakeOff = !(gAgent.isTeen() && (mType == LLWearableType::WT_UNDERSHIRT || mType == LLWearableType::WT_UNDERPANTS) );
mTakeOff->setVisible(mCanTakeOff);
mTakeOff->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnTakeOff, this));
}
mArrowLeft = getChild<LLUICtrl>("Arrow Left");
mArrowLeft->setCommitCallback(boost::bind(&LLPanelEditWearable::onMoveToLayer, this, true));
mArrowRight = getChild<LLUICtrl>("Arrow Right");
mArrowRight->setCommitCallback(boost::bind(&LLPanelEditWearable::onMoveToLayer, this, false));
if (mArrowLeft = findChild<LLUICtrl>("Arrow Left"))
{
mArrowLeft->setCommitCallback(boost::bind(&LLPanelEditWearable::onMoveToLayer, this, true));
}
if (mArrowRight = findChild<LLUICtrl>("Arrow Right"))
{
mArrowRight->setCommitCallback(boost::bind(&LLPanelEditWearable::onMoveToLayer, this, false));
}
if (mSexRadio = findChild<LLUICtrl>("sex radio"))
@@ -764,9 +773,9 @@ BOOL LLPanelEditWearable::postBuild()
{
LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << mType << LL_ENDL;
}
U8 num_subparts = (U8) wearable_entry->mSubparts.size();
const U8 num_subparts = (U8) wearable_entry->mSubparts.size();
for (U8 index = 0; index < num_subparts; ++index)
for (U8 index = 0; num_subparts > 1 && index < num_subparts; ++index)
{
// dive into data structures to get the panel we need
ESubpart subpart_e = wearable_entry->mSubparts[index];
@@ -870,9 +879,9 @@ void LLPanelEditWearable::draw()
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mType);
if (wearable_entry)
{
U8 num_subparts = (U8) wearable_entry->mSubparts.size();
const U8 num_subparts = (U8) wearable_entry->mSubparts.size();
for (U8 index = 0; index < num_subparts; ++index)
for (U8 index = 0; num_subparts > 1 && index < num_subparts; ++index)
{
// dive into data structures to get the panel we need
ESubpart subpart_e = wearable_entry->mSubparts[index];
@@ -1497,13 +1506,25 @@ void LLPanelEditWearable::updateScrollingPanelUI()
bool max_layers = gAgentWearables.getClothingLayerCount() == LLAgentWearables::MAX_CLOTHING_LAYERS;
bool show_create_new = !has_wearable && !max_layers;
mTakeOff->setEnabled(has_wearable);
if (mCanTakeOff) mTakeOff->setVisible(has_wearable);
mCreateNewLayer->setVisible(has_wearable && !max_layers);
mArrowLeft->setEnabled(has_wearable && gAgentWearables.getBottomWearable(mType) != wearable);
mArrowLeft->setVisible(has_wearable);
mArrowRight->setEnabled(has_wearable && gAgentWearables.getTopWearable(mType) != wearable);
mArrowRight->setVisible(has_wearable);
if (mTakeOff)
{
mTakeOff->setEnabled(has_wearable);
if (mCanTakeOff) mTakeOff->setVisible(has_wearable);
}
if (mCreateNewLayer)
{
mCreateNewLayer->setVisible(has_wearable && !max_layers);
}
if (mArrowLeft)
{
mArrowLeft->setEnabled(has_wearable && gAgentWearables.getBottomWearable(mType) != wearable);
mArrowLeft->setVisible(has_wearable);
}
if (mArrowRight)
{
mArrowRight->setEnabled(has_wearable && gAgentWearables.getTopWearable(mType) != wearable);
mArrowRight->setVisible(has_wearable);
}
mCreateNew->setVisible(show_create_new);
mNotWornI->setVisible(show_create_new);
mNotWornT->setVisible(show_create_new);

View File

@@ -131,7 +131,6 @@ new one from scratch and wear it.
<button bottom="-478" follows="right|bottom" font="SansSerif" halign="center"
height="20" label="Save As..." label_selected="Save As..." left="209"
mouse_opaque="true" name="Save As" scale_image="true" width="92" />
<button name="Take Off"/>
</panel>
<panel border="true" bottom="-482" follows="left|top|right|bottom" height="481"
label="Skin" left="102" mouse_opaque="true" name="Skin" width="389">
@@ -226,7 +225,6 @@ new one from scratch and wear it.
<button bottom="-478" follows="right|bottom" font="SansSerif" halign="center"
height="20" label="Revert" label_selected="Revert" left="305"
mouse_opaque="true" name="Revert" scale_image="true" width="82" />
<button name="Take Off"/>
</panel>
<panel border="true" bottom="-482" follows="left|top|right|bottom" height="481"
label="Hair" left="102" mouse_opaque="true" name="Hair" width="389">
@@ -313,7 +311,6 @@ new one from scratch and wear it.
<button bottom="-478" follows="right|bottom" font="SansSerif" halign="center"
height="20" label="Revert" label_selected="Revert" left="305"
mouse_opaque="true" name="Revert" scale_image="true" width="82" />
<button name="Take Off"/>
</panel>
<panel border="true" bottom="-482" follows="left|top|right|bottom" height="481"
label="Eyes" left="102" mouse_opaque="true" name="Eyes" width="389">
@@ -388,7 +385,6 @@ scratch and wear it.
<button bottom="-478" follows="right|bottom" font="SansSerif" halign="center"
height="20" label="Revert" label_selected="Revert" left="305"
mouse_opaque="true" name="Revert" scale_image="true" width="82" />
<button name="Take Off"/>
</panel>
<panel label="Clothes" placeholder="true" name="clothes_placeholder" />
<panel border="true" bottom="-482" follows="left|top|right|bottom" height="481"