Mass fixup to appearance mode ui overhead!
Should contain no functional changes, ust that all ui in appearance mode is now cached instead of calling getChild per frame. Switches from hiding min/max param text every frame to force-drawing in draw call and setting invisible (llscrollingpanelparam.cpp/the corresponding xml) Cleans up some old commented out code. Moves some simple, one-call functions into their calling bodies. Also, for some reason I had to adjust the alpha checkboxes, totally confused why they were out of line... maybe they had been already? I don't see a changed line that did positioning. Contains spaces to tabs fixes, please view without space changes (You have been warned!)
This commit is contained in:
@@ -90,20 +90,6 @@ BOOL edit_wearable_for_teens(LLWearableType::EType type)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void updateAvatarHeightDisplay()
|
||||
{
|
||||
if (LLFloaterCustomize::instanceExists() && isAgentAvatarValid())
|
||||
{
|
||||
F32 avatar_size = (gAgentAvatarp->mBodySize.mV[VZ]) + (F32)0.17; //mBodySize is actually quite a bit off.
|
||||
LLFloaterCustomize::getInstance()->getChild<LLTextBox>("HeightTextM")->setValue(llformat("%.2f", avatar_size) + "m");
|
||||
F32 feet = avatar_size / 0.3048;
|
||||
F32 inches = (feet - (F32)((U32)feet)) * 12.0;
|
||||
LLFloaterCustomize::getInstance()->getChild<LLTextBox>("HeightTextI")->setValue(llformat("%d'%d\"", (U32)feet, (U32)inches));
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// LLFloaterCustomize
|
||||
|
||||
@@ -117,7 +103,7 @@ struct WearablePanelData
|
||||
|
||||
LLFloaterCustomize::LLFloaterCustomize()
|
||||
: LLFloater(std::string("customize")),
|
||||
mScrollingPanelList( NULL ),
|
||||
mScrollingPanelList(new LLScrollingPanelList(std::string("panel_list"), LLRect())),
|
||||
mInventoryObserver(NULL),
|
||||
mCurrentWearableType(LLWearableType::WT_INVALID)
|
||||
{
|
||||
@@ -168,8 +154,10 @@ LLFloaterCustomize::~LLFloaterCustomize()
|
||||
// virtual
|
||||
BOOL LLFloaterCustomize::postBuild()
|
||||
{
|
||||
mMakeOutfitBtn = getChild<LLUICtrl>("Make Outfit");
|
||||
getChild<LLUICtrl>("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this));
|
||||
getChild<LLUICtrl>("Save Outfit")->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance()));
|
||||
mSaveOutfitBtn = getChild<LLUICtrl>("Save Outfit");
|
||||
mSaveOutfitBtn->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance()));
|
||||
refreshCurrentOutfitName(); // Initialize tooltip for save outfit button
|
||||
getChild<LLUICtrl>("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this));
|
||||
getChild<LLUICtrl>("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this));
|
||||
@@ -179,41 +167,46 @@ BOOL LLFloaterCustomize::postBuild()
|
||||
getChild<LLUICtrl>("Export")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnExport, this));
|
||||
|
||||
// Tab container
|
||||
LLTabContainer* tab_container = getChild<LLTabContainer>("customize tab container");
|
||||
if(tab_container)
|
||||
if (mTabContainer = getChild<LLTabContainer>("customize tab container"))
|
||||
{
|
||||
tab_container->setCommitCallback(boost::bind(&LLFloaterCustomize::onTabChanged, this, _2));
|
||||
tab_container->setValidateCallback(boost::bind(&LLFloaterCustomize::onTabPrecommit, this, _1, _2));
|
||||
mTabContainer->setCommitCallback(boost::bind(&LLFloaterCustomize::onTabChanged, this, _2));
|
||||
mTabContainer->setValidateCallback(boost::bind(&LLFloaterCustomize::onTabPrecommit, this, _1, _2));
|
||||
}
|
||||
|
||||
// Remove underwear panels for teens
|
||||
if (gAgent.isTeen())
|
||||
{
|
||||
if (tab_container)
|
||||
if (mTabContainer)
|
||||
{
|
||||
LLPanel* panel = tab_container->getPanelByName("Undershirt");
|
||||
if (panel) tab_container->removeTabPanel(panel);
|
||||
panel = tab_container->getPanelByName("Underpants");
|
||||
if (panel) tab_container->removeTabPanel(panel);
|
||||
LLPanel* panel = mTabContainer->getPanelByName("Undershirt");
|
||||
if (panel) mTabContainer->removeTabPanel(panel);
|
||||
panel = mTabContainer->getPanelByName("Underpants");
|
||||
if (panel) mTabContainer->removeTabPanel(panel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Scrolling Panel
|
||||
initScrollingPanelList();
|
||||
|
||||
if (LLScrollContainer* scroll_container = getChild<LLScrollContainer>("panel_container"))
|
||||
{
|
||||
scroll_container->setScrolledView(mScrollingPanelList);
|
||||
scroll_container->addChild(mScrollingPanelList);
|
||||
}
|
||||
|
||||
mMetricHeight = getChildView("HeightTextM");
|
||||
mImperialHeight = getChildView("HeightTextI");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name)
|
||||
{
|
||||
LLUICtrl* save_outfit_btn = getChild<LLUICtrl>("Save Outfit");
|
||||
// Set current outfit status (wearing/unsaved).
|
||||
bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty();
|
||||
//std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing");
|
||||
//mOutfitStatus->setText(cof_status_str);
|
||||
save_outfit_btn->setEnabled(dirty); // No use saving unless dirty
|
||||
mSaveOutfitBtn->setEnabled(dirty); // No use saving unless dirty
|
||||
|
||||
if (name == "")
|
||||
if (name.empty())
|
||||
{
|
||||
std::string outfit_name;
|
||||
if (LLAppearanceMgr::getInstance()->getBaseOutfitName(outfit_name))
|
||||
@@ -221,22 +214,22 @@ void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name)
|
||||
//mCurrentLookName->setText(outfit_name);
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[OUTFIT]"] = outfit_name;
|
||||
save_outfit_btn->setToolTip(getString("Save changes to", args));
|
||||
mSaveOutfitBtn->setToolTip(getString("Save changes to", args));
|
||||
return;
|
||||
}
|
||||
|
||||
std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit";
|
||||
//mCurrentLookName->setText(getString(string_name));
|
||||
save_outfit_btn->setToolTip(getString(string_name));
|
||||
mSaveOutfitBtn->setToolTip(getString(string_name));
|
||||
//mOpenOutfitBtn->setEnabled(FALSE);
|
||||
save_outfit_btn->setEnabled(false); // Can't save right now
|
||||
mSaveOutfitBtn->setEnabled(false); // Can't save right now
|
||||
}
|
||||
else
|
||||
{
|
||||
//mCurrentLookName->setText(name);
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[OUTFIT]"] = name;
|
||||
save_outfit_btn->setToolTip(getString("Save changes to", args));
|
||||
mSaveOutfitBtn->setToolTip(getString("Save changes to", args));
|
||||
// Can't just call update verbs since the folder link may not have been created yet.
|
||||
//mOpenOutfitBtn->setEnabled(TRUE);
|
||||
}
|
||||
@@ -305,7 +298,7 @@ void LLFloaterCustomize::setCurrentWearableType( LLWearableType::EType type, boo
|
||||
if(mWearablePanelList[type_int])
|
||||
{
|
||||
std::string panelname = mWearablePanelList[type_int]->getName();
|
||||
childShowTab("customize tab container", panelname);
|
||||
mTabContainer->selectTabByName(panelname);
|
||||
switchToDefaultSubpart();
|
||||
}
|
||||
|
||||
@@ -589,7 +582,14 @@ void LLFloaterCustomize::draw()
|
||||
// arrives. Figure out some way to avoid this if possible.
|
||||
updateInventoryUI();
|
||||
|
||||
updateAvatarHeightDisplay();
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
F32 avatar_size = (gAgentAvatarp->mBodySize.mV[VZ]) + (F32)0.17; //mBodySize is actually quite a bit off.
|
||||
mMetricHeight->setValue(llformat("%.2f", avatar_size) + "m");
|
||||
F32 feet = avatar_size / 0.3048;
|
||||
F32 inches = (feet - (F32)((U32)feet)) * 12.0;
|
||||
mImperialHeight->setValue(llformat("%d'%d\"", (U32)feet, (U32)inches));
|
||||
}
|
||||
|
||||
LLScrollingPanelParam::sUpdateDelayFrames = 0;
|
||||
|
||||
@@ -670,20 +670,6 @@ const S32 LINE_HEIGHT = 16;
|
||||
const S32 HEADER_PAD = 8;
|
||||
const S32 HEADER_HEIGHT = 3 * (LINE_HEIGHT + LLFLOATER_VPAD) + (2 * LLPANEL_BORDER_WIDTH) + HEADER_PAD;
|
||||
|
||||
void LLFloaterCustomize::initScrollingPanelList()
|
||||
{
|
||||
LLScrollContainer* scroll_container =
|
||||
getChild<LLScrollContainer>("panel_container");
|
||||
// LLScrollingPanelList's do not import correctly
|
||||
// mScrollingPanelList = LLUICtrlFactory::getScrollingPanelList(this, "panel_list");
|
||||
mScrollingPanelList = new LLScrollingPanelList(std::string("panel_list"), LLRect());
|
||||
if (scroll_container)
|
||||
{
|
||||
scroll_container->setScrolledView(mScrollingPanelList);
|
||||
scroll_container->addChild(mScrollingPanelList);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterCustomize::wearablesChanged(LLWearableType::EType type)
|
||||
{
|
||||
llassert( type < LLWearableType::WT_COUNT );
|
||||
@@ -878,11 +864,9 @@ void LLFloaterCustomize::updateInventoryUI()
|
||||
{
|
||||
panel->setUIPermissions(perm_mask, is_complete);
|
||||
}
|
||||
//BOOL is_vis = panel && item && is_complete && (perm_mask & PERM_MODIFY);
|
||||
//childSetVisible("panel_container", is_vis);
|
||||
}
|
||||
}
|
||||
|
||||
childSetEnabled("Make Outfit", all_complete);
|
||||
mMakeOutfitBtn->setEnabled(all_complete);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,10 +69,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
// Initialization
|
||||
void initWearablePanels();
|
||||
void initScrollingPanelList();
|
||||
|
||||
// Destruction
|
||||
void delayedClose(bool proceed, bool app_quitting);
|
||||
|
||||
@@ -123,6 +119,9 @@ private:
|
||||
|
||||
LLScrollingPanelList* mScrollingPanelList;
|
||||
LLScrollContainer* mScrollContainer;
|
||||
LLView *mMetricHeight, *mImperialHeight;
|
||||
LLUICtrl *mMakeOutfitBtn, *mSaveOutfitBtn;
|
||||
LLTabContainer* mTabContainer;
|
||||
LLPointer<LLVisualParamReset> mResetParams;
|
||||
|
||||
LLInventoryObserver* mInventoryObserver;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@
|
||||
#include "llwearabletype.h"
|
||||
|
||||
class LLAccordionCtrl;
|
||||
class LLCheckBoxCtrl;
|
||||
class LLButton;
|
||||
class LLViewerWearable;
|
||||
class LLTextBox;
|
||||
class LLViewerInventoryItem;
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
|
||||
//alpha mask checkboxes
|
||||
void configureAlphaCheckbox(LLAvatarAppearanceDefines::ETextureIndex te, const std::string& name);
|
||||
void onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LLAvatarAppearanceDefines::ETextureIndex te);
|
||||
void onInvisibilityCommit(LLUICtrl* checkbox_ctrl, LLAvatarAppearanceDefines::ETextureIndex te);
|
||||
void updateAlphaCheckboxes();
|
||||
void initPreviousAlphaTextures();
|
||||
void initPreviousAlphaTextureEntry(LLAvatarAppearanceDefines::ETextureIndex te);
|
||||
@@ -123,8 +123,8 @@ private:
|
||||
LLFloaterCustomize* mCustomizeFloater;
|
||||
LLWearableType::EType mType;
|
||||
BOOL mCanTakeOff;
|
||||
typedef std::map<std::string, LLAvatarAppearanceDefines::ETextureIndex> string_texture_index_map_t;
|
||||
string_texture_index_map_t mAlphaCheckbox2Index;
|
||||
typedef std::map<LLUICtrl*, LLAvatarAppearanceDefines::ETextureIndex> ctrl_texture_index_map_t;
|
||||
ctrl_texture_index_map_t mAlphaCheckbox2Index;
|
||||
|
||||
typedef std::map<LLAvatarAppearanceDefines::ETextureIndex, LLUUID> s32_uuid_map_t;
|
||||
s32_uuid_map_t mPreviousAlphaTexture;
|
||||
@@ -135,6 +135,12 @@ private:
|
||||
//so this is needed to retain focus on this wearables tab over the messy transition.
|
||||
bool mPendingRefresh; //LLAgentWearables::setWearableOutfit fires a buttload of remove/wear calls which spams wearablesChanged
|
||||
//a bazillion pointless (and not particularly valid) times. Deferring to draw effectively sorts it all out.
|
||||
|
||||
// Cached UI
|
||||
LLUICtrl *mCreateNew, *mTakeOff, *mSexRadio, *mSave, *mSaveAs, *mRevert, *mNotWornT, *mNoModT, *mTitle, *mTitleLoading, *mPath, *mAvHeight;
|
||||
LLView *mNotWornI, *mNoModI, *mSquare;
|
||||
LLTabContainer* mTab;
|
||||
std::vector<LLButton*> mSubpartBtns;
|
||||
public:
|
||||
LLModalDialog* mActiveModal;
|
||||
};
|
||||
|
||||
@@ -77,10 +77,6 @@ LLScrollingPanelParam::LLScrollingPanelParam( const std::string& name,
|
||||
mHintMin->setAllowsUpdates( FALSE );
|
||||
mHintMax->setAllowsUpdates( FALSE );
|
||||
|
||||
std::string min_name = LLTrans::getString(param->getMinDisplayName());
|
||||
std::string max_name = LLTrans::getString(param->getMaxDisplayName());
|
||||
childSetValue("min param text", min_name);
|
||||
childSetValue("max param text", max_name);
|
||||
mLess = getChild<LLButton>("less");
|
||||
mLess->setMouseDownCallback( boost::bind(&LLScrollingPanelParam::onHintMouseDown, this, false) );
|
||||
mLess->setMouseUpCallback( boost::bind(&LLScrollingPanelParam::onHintMouseUp, this, false) );
|
||||
@@ -93,6 +89,10 @@ LLScrollingPanelParam::LLScrollingPanelParam( const std::string& name,
|
||||
mMore->setHeldDownCallback( boost::bind(&LLScrollingPanelParam::onHintHeldDown, this, true) );
|
||||
mMore->setHeldDownDelay( PARAM_STEP_TIME_THRESHOLD );
|
||||
}
|
||||
mMinText = getChildView("min param text");
|
||||
mMinText->setValue(LLTrans::getString(param->getMinDisplayName()));
|
||||
mMaxText = getChildView("max param text");
|
||||
mMaxText->setValue(LLTrans::getString(param->getMaxDisplayName()));
|
||||
|
||||
setVisible(FALSE);
|
||||
setBorderVisible( FALSE );
|
||||
@@ -157,9 +157,6 @@ void LLScrollingPanelParam::draw()
|
||||
if(mMore)
|
||||
mMore->setVisible(mHintMax && mHintMax->getVisible());
|
||||
|
||||
// Draw all the children except for the labels
|
||||
childSetVisible( "min param text", FALSE );
|
||||
childSetVisible( "max param text", FALSE );
|
||||
LLPanel::draw();
|
||||
|
||||
// Draw the hints over the "less" and "more" buttons.
|
||||
@@ -191,23 +188,8 @@ void LLScrollingPanelParam::draw()
|
||||
|
||||
|
||||
// Draw labels on top of the buttons
|
||||
childSetVisible( "min param text", TRUE );
|
||||
drawChild(getChild<LLView>("min param text"), BTN_BORDER, BTN_BORDER);
|
||||
|
||||
childSetVisible( "max param text", TRUE );
|
||||
drawChild(getChild<LLView>("max param text"), BTN_BORDER, BTN_BORDER);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLScrollingPanelParam::onSliderMouseDown(LLUICtrl* ctrl, void* userdata)
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
void LLScrollingPanelParam::onSliderMouseUp(LLUICtrl* ctrl, void* userdata)
|
||||
{
|
||||
LLScrollingPanelParam* self = (LLScrollingPanelParam*) userdata;
|
||||
LLVisualParamHint::requestHintUpdates( self->mHintMin, self->mHintMax );
|
||||
drawChild(mMinText, BTN_BORDER, BTN_BORDER, true);
|
||||
drawChild(mMaxText, BTN_BORDER, BTN_BORDER, true);
|
||||
}
|
||||
|
||||
void LLScrollingPanelParam::onHintMouseDown( bool max )
|
||||
@@ -262,17 +244,16 @@ void LLScrollingPanelParam::onHintHeldDown( bool max )
|
||||
// Make sure we're not taking the slider out of bounds
|
||||
// (this is where some simple UI limits are stored)
|
||||
F32 new_percent = weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = getChild<LLSliderCtrl>("param slider");
|
||||
if (slider)
|
||||
if (mSlider)
|
||||
{
|
||||
if (slider->getMinValue() < new_percent
|
||||
&& new_percent < slider->getMaxValue())
|
||||
if (mSlider->getMinValue() < new_percent
|
||||
&& new_percent < mSlider->getMaxValue())
|
||||
{
|
||||
mWearable->setVisualParamWeight(param->getID(), new_weight, FALSE);
|
||||
mWearable->writeToAvatar(gAgentAvatarp);
|
||||
gAgentAvatarp->updateVisualParams();
|
||||
|
||||
slider->setValue( weightToPercent( new_weight ) );
|
||||
mSlider->setValue( weightToPercent( new_weight ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,15 +282,14 @@ void LLScrollingPanelParam::onHintMouseUp( bool max )
|
||||
// step a fraction in the negative direction
|
||||
F32 new_weight = current_weight + (range / 10.f);
|
||||
F32 new_percent = weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = getChild<LLSliderCtrl>("param slider");
|
||||
if (slider)
|
||||
if (mSlider)
|
||||
{
|
||||
if (slider->getMinValue() < new_percent
|
||||
&& new_percent < slider->getMaxValue())
|
||||
if (mSlider->getMinValue() < new_percent
|
||||
&& new_percent < mSlider->getMaxValue())
|
||||
{
|
||||
mWearable->setVisualParamWeight(param->getID(), new_weight, FALSE);
|
||||
mWearable->writeToAvatar(gAgentAvatarp);
|
||||
slider->setValue( weightToPercent( new_weight ) );
|
||||
mSlider->setValue( weightToPercent( new_weight ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,9 +47,6 @@ public:
|
||||
virtual void setVisible( BOOL visible );
|
||||
virtual void updatePanel(BOOL allow_modify);
|
||||
|
||||
static void onSliderMouseDown(LLUICtrl* ctrl, void* userdata);
|
||||
static void onSliderMouseUp(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
void onHintMouseUp( bool max );
|
||||
void onHintMouseDown( bool max );
|
||||
void onHintHeldDown( bool max );
|
||||
@@ -69,6 +66,8 @@ public:
|
||||
protected:
|
||||
LLTimer mMouseDownTimer; // timer for how long mouse has been held down on a hint.
|
||||
F32 mLastHeldTime;
|
||||
private:
|
||||
LLView *mMinText, *mMaxText;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const std::string& name,
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_scrolling_param.xml");
|
||||
//Set up the slider
|
||||
LLSliderCtrl *slider = getChild<LLSliderCtrl>("param slider");
|
||||
mSlider = getChild<LLSliderCtrl>("param slider");
|
||||
|
||||
//Kill everything that isn't the slider...
|
||||
if(!bVisualHint)
|
||||
@@ -58,7 +58,7 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const std::string& name,
|
||||
child_list_t::const_iterator it;
|
||||
for (it = getChildList()->begin(); it != getChildList()->end(); it++)
|
||||
{
|
||||
if ((*it) != slider && (*it)->getName() != "panel border")
|
||||
if ((*it) != mSlider && (*it)->getName() != "panel border")
|
||||
{
|
||||
to_remove.push_back(*it);
|
||||
}
|
||||
@@ -68,14 +68,14 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const std::string& name,
|
||||
removeChild(*it);
|
||||
delete (*it);
|
||||
}
|
||||
slider->translate(0,/*PARAM_HINT_HEIGHT*/128);
|
||||
mSlider->translate(0,/*PARAM_HINT_HEIGHT*/128);
|
||||
reshape(getRect().getWidth(),getRect().getHeight()-128);
|
||||
}
|
||||
|
||||
slider->setValue(weightToPercent(param->getWeight()));
|
||||
slider->setLabelArg("[DESC]", param->getDisplayName());
|
||||
slider->setEnabled(mAllowModify);
|
||||
slider->setCommitCallback(boost::bind(&LLScrollingPanelParamBase::onSliderMoved, this, _1));
|
||||
mSlider->setValue(weightToPercent(param->getWeight()));
|
||||
mSlider->setLabelArg("[DESC]", param->getDisplayName());
|
||||
mSlider->setEnabled(mAllowModify);
|
||||
mSlider->setCommitCallback(boost::bind(&LLScrollingPanelParamBase::onSliderMoved, this, _1));
|
||||
|
||||
setVisible(FALSE);
|
||||
setBorderVisible( FALSE );
|
||||
@@ -87,37 +87,25 @@ LLScrollingPanelParamBase::~LLScrollingPanelParamBase()
|
||||
|
||||
void LLScrollingPanelParamBase::updatePanel(BOOL allow_modify)
|
||||
{
|
||||
LLViewerVisualParam* param = mParam;
|
||||
|
||||
if(!mWearable)
|
||||
if (!mWearable)
|
||||
{
|
||||
// not editing a wearable just now, no update necessary
|
||||
return;
|
||||
}
|
||||
|
||||
F32 current_weight = mWearable->getVisualParamWeight( param->getID() );
|
||||
childSetValue("param slider", weightToPercent( current_weight ) );
|
||||
F32 current_weight = mWearable->getVisualParamWeight(mParam->getID());
|
||||
mSlider->setValue(weightToPercent(current_weight));
|
||||
mAllowModify = allow_modify;
|
||||
childSetEnabled("param slider", mAllowModify);
|
||||
mSlider->setEnabled(mAllowModify);
|
||||
}
|
||||
|
||||
void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl)
|
||||
{
|
||||
if(!mParam)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(!mWearable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLSliderCtrl* slider = (LLSliderCtrl*) ctrl;
|
||||
if (!mParam || !mWearable) return;
|
||||
|
||||
F32 current_weight = mWearable->getVisualParamWeight(mParam->getID());
|
||||
F32 new_weight = percentToWeight( (F32)slider->getValue().asReal() );
|
||||
if (current_weight != new_weight )
|
||||
F32 new_weight = percentToWeight(ctrl->getValue().asFloat());
|
||||
if (current_weight != new_weight)
|
||||
{
|
||||
mWearable->setVisualParamWeight( mParam->getID(), new_weight, FALSE);
|
||||
mWearable->writeToAvatar(gAgentAvatarp);
|
||||
@@ -127,12 +115,10 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl)
|
||||
|
||||
F32 LLScrollingPanelParamBase::weightToPercent( F32 weight )
|
||||
{
|
||||
LLViewerVisualParam* param = mParam;
|
||||
return (weight - param->getMinWeight()) / (param->getMaxWeight() - param->getMinWeight()) * 100.f;
|
||||
return (weight - mParam->getMinWeight()) / (mParam->getMaxWeight() - mParam->getMinWeight()) * 100.f;
|
||||
}
|
||||
|
||||
F32 LLScrollingPanelParamBase::percentToWeight( F32 percent )
|
||||
{
|
||||
LLViewerVisualParam* param = mParam;
|
||||
return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight();
|
||||
return percent / 100.f * (mParam->getMaxWeight() - mParam->getMinWeight()) + mParam->getMinWeight();
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
protected:
|
||||
BOOL mAllowModify;
|
||||
LLWearable *mWearable;
|
||||
class LLSliderCtrl* mSlider;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1290,11 +1290,11 @@ one from scratch and wear it.
|
||||
can_apply_immediately="true" default_image_name="Default" allow_no_texture="true"
|
||||
follows="left|top" width="64" height="80" left_delta="90" bottom="-165"/>
|
||||
<check_box name="head alpha texture invisible"
|
||||
follows="left" width="16" height="16" left="142" bottom="-185"/>
|
||||
follows="left" width="16" height="16" left="142" bottom="-90"/>
|
||||
<check_box name="upper alpha texture invisible"
|
||||
follows="left" width="16" height="16" left_delta="90" bottom="-185"/>
|
||||
follows="left" width="16" height="16" left_delta="90" bottom="-90"/>
|
||||
<check_box name="lower alpha texture invisible"
|
||||
follows="left" width="16" height="16" left_delta="90" bottom="-185"/>
|
||||
follows="left" width="16" height="16" left_delta="90" bottom="-90"/>
|
||||
<texture_picker name="Hair Alpha" label="Hair Alpha" tool_tip="Click to choose a picture"
|
||||
can_apply_immediately="true" default_image_name="Default" allow_no_texture="true"
|
||||
follows="left|top" width="64" height="80" left="120" bottom="-280"/>
|
||||
@@ -1302,9 +1302,9 @@ one from scratch and wear it.
|
||||
can_apply_immediately="true" default_image_name="Default" allow_no_texture="true"
|
||||
follows="left|top" width="64" height="80" left_delta="90" bottom="-280"/>
|
||||
<check_box name="hair alpha texture invisible"
|
||||
follows="left" width="16" height="16" left="142" bottom="-300"/>
|
||||
follows="left" width="16" height="16" left="142" bottom="-205"/>
|
||||
<check_box name="eye alpha texture invisible"
|
||||
follows="left" width="16" height="16" left_delta="90" bottom="-300"/>
|
||||
follows="left" width="16" height="16" left_delta="90" bottom="-205"/>
|
||||
<button name="Create New" label="Create New Alpha" label_selected="Create New Alpha"
|
||||
follows="left|top" halign="center" width="170" height="24" left="160" bottom="-148"
|
||||
mouse_opaque="true" scale_image="true"/>
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-132" drop_shadow_visible="true" enabled="true" follows="left|top"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4"
|
||||
mouse_opaque="true" name="min param text" v_pad="0" width="128" />
|
||||
mouse_opaque="true" name="min param text" visible="false" v_pad="0" width="128" />
|
||||
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-132" drop_shadow_visible="true" enabled="true" follows="left|top"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="138"
|
||||
mouse_opaque="true" name="max param text" v_pad="0" width="128" />
|
||||
mouse_opaque="true" name="max param text" visible="false" v_pad="0" width="128" />
|
||||
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-27" drop_shadow_visible="true" enabled="true" follows="left|top"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="8"
|
||||
|
||||
Reference in New Issue
Block a user