Fri, 18 Mar 2016 23:55:58 -0700
Fix FIRE-17951: Reworked build tools show highlight to be less hacks
1.1 --- a/indra/newview/llfloatertools.cpp Fri Mar 18 14:59:40 2016 +0100 1.2 +++ b/indra/newview/llfloatertools.cpp Fri Mar 18 23:55:58 2016 -0700 1.3 @@ -126,6 +126,9 @@ 1.4 void commit_grid_mode(LLUICtrl *); 1.5 void commit_slider_zoom(LLUICtrl *ctrl); 1.6 1.7 +// <FS:KC> show/hide build highlight 1.8 +void commit_show_highlight(void *ctrl); 1.9 + 1.10 /** 1.11 * Class LLLandImpactsObserver 1.12 * 1.13 @@ -267,10 +270,9 @@ 1.14 mComboGridMode = getChild<LLComboBox>("combobox grid mode"); 1.15 1.16 // <FS:KC> show highlight 1.17 - //mCheckStretchUniformLabel = getChild<LLTextBox>("checkbox uniform label"); 1.18 mCheckShowHighlight = getChild<LLCheckBoxCtrl>("checkbox show highlight"); 1.19 - mOrginalShowHighlight = gSavedSettings.getBOOL("RenderHighlightSelections"); 1.20 - mCheckShowHighlight->setValue(mOrginalShowHighlight); 1.21 + mCheckShowHighlight->setValue(gSavedSettings.getBOOL("RenderHighlightSelections")); 1.22 + LLSelectMgr::instance().setFSShowHideHighlight(FS_SHOW_HIDE_HIGHLIGHT_NORMAL); 1.23 1.24 mCheckActualRoot = getChild<LLCheckBoxCtrl>("checkbox actual root"); 1.25 // </FS:KC> 1.26 @@ -394,7 +396,6 @@ 1.27 mCheckStretchUniform(NULL), 1.28 mCheckStretchTexture(NULL), 1.29 // <FS:KC> 1.30 - //mCheckStretchUniformLabel(NULL), 1.31 mCheckShowHighlight(NULL), 1.32 mCheckActualRoot(NULL), 1.33 // </FS:KC> 1.34 @@ -482,6 +483,9 @@ 1.35 // <FS:Ansariel> FIRE-7802: Grass and tree selection in build tool 1.36 mCommitCallbackRegistrar.add("BuildTool.TreeGrass", boost::bind(&LLFloaterTools::onSelectTreeGrassCombo, this)); 1.37 1.38 + // <FS:KC> show/hide build highlight 1.39 + mCommitCallbackRegistrar.add("BuildTool.commitShowHighlight", boost::bind(&commit_show_highlight, this)); 1.40 + 1.41 mLandImpactsObserver = new LLLandImpactsObserver(); 1.42 LLViewerParcelMgr::getInstance()->addObserver(mLandImpactsObserver); 1.43 } 1.44 @@ -928,7 +932,6 @@ 1.45 if (mCheckStretchUniform) mCheckStretchUniform->setVisible( edit_visible ); 1.46 if (mCheckStretchTexture) mCheckStretchTexture->setVisible( edit_visible ); 1.47 // <FS:KC> 1.48 - //if (mCheckStretchUniformLabel) mCheckStretchUniformLabel->setVisible( edit_visible ); 1.49 if (mCheckShowHighlight) mCheckShowHighlight->setVisible( edit_visible ); 1.50 if (mCheckActualRoot) mCheckActualRoot->setVisible( edit_visible ); 1.51 // </FS:KC> 1.52 @@ -1067,8 +1070,7 @@ 1.53 if (!mOpen) 1.54 { 1.55 mOpen = TRUE; 1.56 - mOrginalShowHighlight = gSavedSettings.getBOOL("RenderHighlightSelections"); 1.57 - mCheckShowHighlight->setValue(mOrginalShowHighlight); 1.58 + mCheckShowHighlight->setValue(gSavedSettings.getBOOL("RenderHighlightSelections")); 1.59 } 1.60 // </FS:KC> 1.61 1.62 @@ -1101,7 +1103,8 @@ 1.63 gSavedSettings.setBOOL("EditLinkedParts", FALSE); 1.64 1.65 // <FS:KC> 1.66 - gSavedSettings.setBOOL("RenderHighlightSelections", mOrginalShowHighlight); 1.67 + LLSelectMgr::instance().setFSShowHideHighlight(FS_SHOW_HIDE_HIGHLIGHT_NORMAL); 1.68 + 1.69 mOpen = FALSE; //hack cause onOpen runs on every selection change but onClose doesnt. 1.70 // </FS:KC> 1.71 1.72 @@ -1277,7 +1280,6 @@ 1.73 gSavedSettings.setS32("RadioLandBrushAction", dozer_mode); 1.74 } 1.75 } 1.76 - 1.77 void commit_select_component(void *data) 1.78 { 1.79 LLFloaterTools* floaterp = (LLFloaterTools*)data; 1.80 @@ -1302,6 +1304,23 @@ 1.81 } 1.82 } 1.83 1.84 +// <FS:KC> show/hide build highlight 1.85 +void commit_show_highlight(void *data) 1.86 +{ 1.87 + LLFloaterTools* floaterp = (LLFloaterTools*)data; 1.88 + BOOL show_highlight = floaterp->mCheckShowHighlight->get(); 1.89 + if (show_highlight) 1.90 + { 1.91 + LLSelectMgr::getInstance()->setFSShowHideHighlight(FS_SHOW_HIDE_HIGHLIGHT_SHOW); 1.92 + } 1.93 + else 1.94 + { 1.95 + LLSelectMgr::getInstance()->setFSShowHideHighlight(FS_SHOW_HIDE_HIGHLIGHT_HIDE); 1.96 + } 1.97 +} 1.98 +// </FS:KC> 1.99 + 1.100 + 1.101 // static 1.102 void LLFloaterTools::setObjectType( LLPCode pcode ) 1.103 {
2.1 --- a/indra/newview/llfloatertools.h Fri Mar 18 14:59:40 2016 +0100 2.2 +++ b/indra/newview/llfloatertools.h Fri Mar 18 23:55:58 2016 -0700 2.3 @@ -224,7 +224,6 @@ 2.4 private: 2.5 BOOL mDirty; 2.6 BOOL mHasSelection; 2.7 - BOOL mOrginalShowHighlight; //Phoenix:KC 2.8 BOOL mOpen; //Phoenix:KC 2.9 2.10 //Phoenix:KC
3.1 --- a/indra/newview/llselectmgr.cpp Fri Mar 18 14:59:40 2016 +0100 3.2 +++ b/indra/newview/llselectmgr.cpp Fri Mar 18 23:55:58 2016 -0700 3.3 @@ -235,6 +235,11 @@ 3.4 3.5 mForceSelection = FALSE; 3.6 mShowSelection = FALSE; 3.7 + 3.8 + // <FS:KC> show/hide build highlight 3.9 + mFSShowHideHighlight = FS_SHOW_HIDE_HIGHLIGHT_NORMAL; 3.10 + // </FS:KC> 3.11 + 3.12 } 3.13 3.14 3.15 @@ -5933,7 +5938,10 @@ 3.16 } 3.17 void LLSelectMgr::renderSilhouettes(BOOL for_hud) 3.18 { 3.19 - if (!mRenderSilhouettes || !mRenderHighlightSelections) 3.20 + // <FS:KC> show/hide build highlight 3.21 + // if (!mRenderSilhouettes || !mRenderHighlightSelections) 3.22 + if (((mFSShowHideHighlight == FS_SHOW_HIDE_HIGHLIGHT_NORMAL) && (!mRenderSilhouettes || !mRenderHighlightSelections)) || (mFSShowHideHighlight == FS_SHOW_HIDE_HIGHLIGHT_HIDE)) 3.23 + // </FS:KC> 3.24 { 3.25 return; 3.26 }
4.1 --- a/indra/newview/llselectmgr.h Fri Mar 18 14:59:40 2016 +0100 4.2 +++ b/indra/newview/llselectmgr.h Fri Mar 18 23:55:58 2016 -0700 4.3 @@ -69,6 +69,14 @@ 4.4 const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32; 4.5 // </FS:Ansariel> 4.6 4.7 +// <FS:KC> show/hide build highlight 4.8 +enum EFSShowHideHighlilght 4.9 +{ 4.10 + FS_SHOW_HIDE_HIGHLIGHT_NORMAL = 0, 4.11 + FS_SHOW_HIDE_HIGHLIGHT_SHOW = 1, 4.12 + FS_SHOW_HIDE_HIGHLIGHT_HIDE = 2 4.13 +}; 4.14 +// </FS:KC> 4.15 4.16 // This is used by the DeRezObject message to determine where to put 4.17 // derezed tasks. 4.18 @@ -609,6 +617,10 @@ 4.19 void renderSilhouettes(BOOL for_hud); 4.20 void enableSilhouette(BOOL enable) { mRenderSilhouettes = enable; } 4.21 4.22 + // <FS:KC> show/hide build highlight 4.23 + void setFSShowHideHighlight(EFSShowHideHighlilght state) { mFSShowHideHighlight = state; } 4.24 + // </FS:KC> 4.25 + 4.26 //////////////////////////////////////////////////////////////// 4.27 // Utility functions that operate on the current selection 4.28 //////////////////////////////////////////////////////////////// 4.29 @@ -907,6 +919,10 @@ 4.30 4.31 LLAnimPauseRequest mPauseRequest; 4.32 4.33 +// <FS:KC> show/hide build highlight 4.34 + EFSShowHideHighlilght mFSShowHideHighlight; 4.35 +// </FS:KC> 4.36 + 4.37 // <FS:Zi> Warning when trying to duplicate while in edit linked parts/select face mode 4.38 public: 4.39 // returns TRUE if current selection does not contain individual selections
5.1 --- a/indra/newview/skins/default/xui/en/floater_tools.xml Fri Mar 18 14:59:40 2016 +0100 5.2 +++ b/indra/newview/skins/default/xui/en/floater_tools.xml Fri Mar 18 23:55:58 2016 -0700 5.3 @@ -396,14 +396,16 @@ 5.4 name="checkbox actual root" 5.5 width="134" /> 5.6 <check_box 5.7 - control_name="RenderHighlightSelections" 5.8 height="18" 5.9 initial_value="true" 5.10 label="Show Highlight" 5.11 layout="topleft" 5.12 top_pad="-2" 5.13 name="checkbox show highlight" 5.14 - width="134" /> 5.15 + width="134" > 5.16 + <check_box.commit_callback 5.17 + function="BuildTool.commitShowHighlight"/> 5.18 + </check_box> 5.19 <button 5.20 left_pad="0" 5.21 image_selected="ForwardArrow_Press"