diff options
Diffstat (limited to 'indra/newview/lltoolplacer.cpp')
-rw-r--r-- | indra/newview/lltoolplacer.cpp | 100 |
1 files changed, 6 insertions, 94 deletions
diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 88fddd9336..607818305e 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -35,9 +35,6 @@ // self header #include "lltoolplacer.h" -// linden library headers -#include "llprimitive.h" - // viewer headers #include "llbutton.h" #include "llviewercontrol.h" @@ -65,13 +62,17 @@ #include "llviewercamera.h" #include "llviewerstats.h" +// linden library headers +#include "llprimitive.h" +#include "llwindow.h" // incBusyCount() + const LLVector3 DEFAULT_OBJECT_SCALE(0.5f, 0.5f, 0.5f); //static LLPCode LLToolPlacer::sObjectType = LL_PCODE_CUBE; LLToolPlacer::LLToolPlacer() -: LLTool( std::string("Create") ) +: LLTool( "Create" ) { } @@ -521,7 +522,7 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) BOOL LLToolPlacer::handleHover(S32 x, S32 y, MASK mask) { lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPlacer" << llendl; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLCREATE); + gViewerWindow->setCursor(UI_CURSOR_TOOLCREATE); return TRUE; } @@ -534,92 +535,3 @@ void LLToolPlacer::handleDeselect() { } -////////////////////////////////////////////////////// -// LLToolPlacerPanel - -// static -LLPCode LLToolPlacerPanel::sCube = LL_PCODE_CUBE; -LLPCode LLToolPlacerPanel::sPrism = LL_PCODE_PRISM; -LLPCode LLToolPlacerPanel::sPyramid = LL_PCODE_PYRAMID; -LLPCode LLToolPlacerPanel::sTetrahedron = LL_PCODE_TETRAHEDRON; -LLPCode LLToolPlacerPanel::sCylinder = LL_PCODE_CYLINDER; -LLPCode LLToolPlacerPanel::sCylinderHemi= LL_PCODE_CYLINDER_HEMI; -LLPCode LLToolPlacerPanel::sCone = LL_PCODE_CONE; -LLPCode LLToolPlacerPanel::sConeHemi = LL_PCODE_CONE_HEMI; -LLPCode LLToolPlacerPanel::sTorus = LL_PCODE_TORUS; -LLPCode LLToolPlacerPanel::sSquareTorus = LLViewerObject::LL_VO_SQUARE_TORUS; -LLPCode LLToolPlacerPanel::sTriangleTorus = LLViewerObject::LL_VO_TRIANGLE_TORUS; -LLPCode LLToolPlacerPanel::sSphere = LL_PCODE_SPHERE; -LLPCode LLToolPlacerPanel::sSphereHemi = LL_PCODE_SPHERE_HEMI; -LLPCode LLToolPlacerPanel::sTree = LL_PCODE_LEGACY_TREE; -LLPCode LLToolPlacerPanel::sGrass = LL_PCODE_LEGACY_GRASS; - -S32 LLToolPlacerPanel::sButtonsAdded = 0; -LLButton* LLToolPlacerPanel::sButtons[ TOOL_PLACER_NUM_BUTTONS ]; - -LLToolPlacerPanel::LLToolPlacerPanel(const std::string& name, const LLRect& rect) - : - LLPanel( name, rect ) -{ - /* DEPRECATED - JC - addButton( "UIImgCubeUUID", "UIImgCubeSelectedUUID", &LLToolPlacerPanel::sCube ); - addButton( "UIImgPrismUUID", "UIImgPrismSelectedUUID", &LLToolPlacerPanel::sPrism ); - addButton( "UIImgPyramidUUID", "UIImgPyramidSelectedUUID", &LLToolPlacerPanel::sPyramid ); - addButton( "UIImgTetrahedronUUID", "UIImgTetrahedronSelectedUUID", &LLToolPlacerPanel::sTetrahedron ); - addButton( "UIImgCylinderUUID", "UIImgCylinderSelectedUUID", &LLToolPlacerPanel::sCylinder ); - addButton( "UIImgHalfCylinderUUID", "UIImgHalfCylinderSelectedUUID",&LLToolPlacerPanel::sCylinderHemi ); - addButton( "UIImgConeUUID", "UIImgConeSelectedUUID", &LLToolPlacerPanel::sCone ); - addButton( "UIImgHalfConeUUID", "UIImgHalfConeSelectedUUID", &LLToolPlacerPanel::sConeHemi ); - addButton( "UIImgSphereUUID", "UIImgSphereSelectedUUID", &LLToolPlacerPanel::sSphere ); - addButton( "UIImgHalfSphereUUID", "UIImgHalfSphereSelectedUUID", &LLToolPlacerPanel::sSphereHemi ); - addButton( "UIImgTreeUUID", "UIImgTreeSelectedUUID", &LLToolPlacerPanel::sTree ); - addButton( "UIImgGrassUUID", "UIImgGrassSelectedUUID", &LLToolPlacerPanel::sGrass ); - addButton( "ObjectTorusImageID", "ObjectTorusActiveImageID", &LLToolPlacerPanel::sTorus ); - addButton( "ObjectTubeImageID", "ObjectTubeActiveImageID", &LLToolPlacerPanel::sSquareTorus ); - */ -} - -void LLToolPlacerPanel::addButton( const std::string& up_state, const std::string& down_state, LLPCode* pcode ) -{ - const S32 TOOL_SIZE = 32; - const S32 HORIZ_SPACING = TOOL_SIZE + 5; - const S32 VERT_SPACING = TOOL_SIZE + 5; - const S32 VPAD = 10; - const S32 HPAD = 7; - - S32 row = sButtonsAdded / 4; - S32 column = sButtonsAdded % 4; - - LLRect help_rect = gSavedSettings.getRect("ToolHelpRect"); - - // Build the rectangle, recalling the origin is at lower left - // and we want the icons to build down from the top. - LLRect rect; - rect.setLeftTopAndSize( - HPAD + (column * HORIZ_SPACING), - help_rect.mBottom - VPAD - (row * VERT_SPACING), - TOOL_SIZE, - TOOL_SIZE ); - - LLButton* btn = new LLButton( - std::string("ToolPlacerOptBtn"), - rect, - up_state, - down_state, - LLStringUtil::null, &LLToolPlacerPanel::setObjectType, - pcode, - LLFontGL::getFontSansSerif()); - btn->setFollowsBottom(); - btn->setFollowsLeft(); - addChild(btn); - - sButtons[sButtonsAdded] = btn; - sButtonsAdded++; -} - -// static -void LLToolPlacerPanel::setObjectType( void* data ) -{ - LLPCode pcode = *(LLPCode*) data; - LLToolPlacer::setObjectType( pcode ); -} |