aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatercustomize.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llfloatercustomize.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llfloatercustomize.cpp')
-rw-r--r--linden/indra/newview/llfloatercustomize.cpp57
1 files changed, 20 insertions, 37 deletions
diff --git a/linden/indra/newview/llfloatercustomize.cpp b/linden/indra/newview/llfloatercustomize.cpp
index 8da5417..923c358 100644
--- a/linden/indra/newview/llfloatercustomize.cpp
+++ b/linden/indra/newview/llfloatercustomize.cpp
@@ -88,7 +88,7 @@ const F32 PARAM_STEP_TIME_THRESHOLD = 0.25f;
88// LLUndoWearable 88// LLUndoWearable
89 89
90class LLUndoWearable 90class LLUndoWearable
91: public LLUndoAction 91 : public LLUndoBuffer::LLUndoAction
92{ 92{
93protected: 93protected:
94 LLAppearance mAppearance; 94 LLAppearance mAppearance;
@@ -230,12 +230,13 @@ public:
230 LLVOAvatar* avatar = gAgent.getAvatarObject(); 230 LLVOAvatar* avatar = gAgent.getAvatarObject();
231 if( avatar ) 231 if( avatar )
232 { 232 {
233 for (LLViewerJointAttachment* attachment = avatar->mAttachmentPoints.getFirstData(); 233 for (LLVOAvatar::attachment_map_t::iterator iter = avatar->mAttachmentPoints.begin();
234 attachment; 234 iter != avatar->mAttachmentPoints.end(); )
235 attachment = gAgent.getAvatarObject()->mAttachmentPoints.getNextData())
236 { 235 {
236 LLVOAvatar::attachment_map_t::iterator curiter = iter++;
237 LLViewerJointAttachment* attachment = curiter->second;
238 S32 attachment_pt = curiter->first;
237 BOOL object_attached = ( attachment->getNumObjects() > 0 ); 239 BOOL object_attached = ( attachment->getNumObjects() > 0 );
238 S32 attachment_pt = avatar->mAttachmentPoints.getCurrentKeyWithoutIncrement();
239 LLString name = LLString("checkbox_") + attachment->getName(); 240 LLString name = LLString("checkbox_") + attachment->getName();
240 mCheckBoxList.push_back(std::make_pair(name,attachment_pt)); 241 mCheckBoxList.push_back(std::make_pair(name,attachment_pt));
241 childSetEnabled(name, object_attached); 242 childSetEnabled(name, object_attached);
@@ -405,10 +406,10 @@ public:
405 virtual void setVisible( BOOL visible ); 406 virtual void setVisible( BOOL visible );
406 407
407 // Inherted methods from LLEditMenuHandler 408 // Inherted methods from LLEditMenuHandler
408 virtual void undo(); 409 virtual void undo() { mUndoBuffer->undoAction(); }
409 virtual BOOL canUndo(); 410 virtual BOOL canUndo() const { return mUndoBuffer->canUndo(); }
410 virtual void redo(); 411 virtual void redo() { mUndoBuffer->redoAction(); }
411 virtual BOOL canRedo(); 412 virtual BOOL canRedo() const { return mUndoBuffer->canRedo(); }
412 413
413 // Callbacks 414 // Callbacks
414 static void onBtnSubpart( void* userdata ); 415 static void onBtnSubpart( void* userdata );
@@ -992,26 +993,6 @@ void LLPanelEditWearable::addVisualParamToUndoBuffer( S32 param_id, F32 current_
992 action->setVisualParam( param_id, current_weight ); 993 action->setVisualParam( param_id, current_weight );
993} 994}
994 995
995void LLPanelEditWearable::undo()
996{
997 mUndoBuffer->undoAction();
998}
999
1000void LLPanelEditWearable::redo()
1001{
1002 mUndoBuffer->redoAction();
1003}
1004
1005BOOL LLPanelEditWearable::canUndo()
1006{
1007 return mUndoBuffer->canUndo();
1008}
1009
1010BOOL LLPanelEditWearable::canRedo()
1011{
1012 return mUndoBuffer->canRedo();
1013}
1014
1015void LLPanelEditWearable::switchToDefaultSubpart() 996void LLPanelEditWearable::switchToDefaultSubpart()
1016{ 997{
1017 setSubpart( getDefaultSubpart() ); 998 setSubpart( getDefaultSubpart() );
@@ -1294,10 +1275,10 @@ void LLScrollingPanelParam::draw()
1294 1275
1295 // Draw labels on top of the buttons 1276 // Draw labels on top of the buttons
1296 childSetVisible( "min param text", TRUE ); 1277 childSetVisible( "min param text", TRUE );
1297 drawChild(getChildByName("min param text"), BTN_BORDER, BTN_BORDER); 1278 drawChild(getChild<LLView>("min param text"), BTN_BORDER, BTN_BORDER);
1298 1279
1299 childSetVisible( "max param text", TRUE ); 1280 childSetVisible( "max param text", TRUE );
1300 drawChild(getChildByName("max param text"), BTN_BORDER, BTN_BORDER); 1281 drawChild(getChild<LLView>("max param text"), BTN_BORDER, BTN_BORDER);
1301 } 1282 }
1302} 1283}
1303 1284
@@ -1609,7 +1590,7 @@ BOOL LLFloaterCustomize::postBuild()
1609 // Remove underwear panels for teens 1590 // Remove underwear panels for teens
1610 if (gAgent.isTeen()) 1591 if (gAgent.isTeen())
1611 { 1592 {
1612 LLTabContainerCommon* tab_container = LLUICtrlFactory::getTabContainerByName(this, "customize tab container"); 1593 LLTabContainer* tab_container = LLUICtrlFactory::getTabContainerByName(this, "customize tab container");
1613 if (tab_container) 1594 if (tab_container)
1614 { 1595 {
1615 LLPanel* panel; 1596 LLPanel* panel;
@@ -1666,6 +1647,7 @@ void LLFloaterCustomize::onBtnSnapshot( void* userdata )
1666 gViewerWindow->getWindowWidth(), 1647 gViewerWindow->getWindowWidth(),
1667 gViewerWindow->getWindowHeight(), 1648 gViewerWindow->getWindowHeight(),
1668 TRUE, // keep window aspect ratio 1649 TRUE, // keep window aspect ratio
1650 FALSE,
1669 FALSE, // UI in snapshot off 1651 FALSE, // UI in snapshot off
1670 FALSE); // do_rebuild off 1652 FALSE); // do_rebuild off
1671 if (!success) return; 1653 if (!success) return;
@@ -2492,13 +2474,14 @@ void LLUndoWearable::applyUndoRedo()
2492 ESex old_sex = avatar->getSex(); 2474 ESex old_sex = avatar->getSex();
2493 2475
2494 // Parameters 2476 // Parameters
2495 for( F32* weightp = mAppearance.mParamMap.getFirstData(); weightp; weightp = mAppearance.mParamMap.getNextData() ) 2477 for (LLAppearance::param_map_t::iterator iter = mAppearance.mParamMap.begin();
2478 iter != mAppearance.mParamMap.end(); ++iter)
2496 { 2479 {
2497 S32 param_id = mAppearance.mParamMap.getCurrentKeyWithoutIncrement(); 2480 S32 param_id = iter->first;
2498 2481 F32 weight = iter->second;
2499 F32 existing_weight = gAgent.getAvatarObject()->getVisualParamWeight( param_id ); 2482 F32 existing_weight = gAgent.getAvatarObject()->getVisualParamWeight( param_id );
2500 avatar->setVisualParamWeight(param_id, *weightp, TRUE); 2483 avatar->setVisualParamWeight(param_id, weight, TRUE);
2501 *weightp = existing_weight; 2484 iter->second = existing_weight;
2502 } 2485 }
2503 2486
2504 // Textures 2487 // Textures