diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/lltoolindividual.cpp | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/lltoolindividual.cpp')
-rw-r--r-- | linden/indra/newview/lltoolindividual.cpp | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/linden/indra/newview/lltoolindividual.cpp b/linden/indra/newview/lltoolindividual.cpp new file mode 100644 index 0000000..e17a2a1 --- /dev/null +++ b/linden/indra/newview/lltoolindividual.cpp | |||
@@ -0,0 +1,121 @@ | |||
1 | /** | ||
2 | * @file lltoolindividual.cpp | ||
3 | * @brief LLToolIndividual class implementation | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | //***************************************************************************** | ||
29 | // | ||
30 | // This is a tool for selecting individual object from the | ||
31 | // toolbox. Handy for when you want to deal with child object | ||
32 | // inventory... | ||
33 | // | ||
34 | //***************************************************************************** | ||
35 | |||
36 | #include "llviewerprecompiledheaders.h" | ||
37 | #include "lltoolindividual.h" | ||
38 | |||
39 | #include "llselectmgr.h" | ||
40 | #include "llviewerobject.h" | ||
41 | #include "llviewerwindow.h" | ||
42 | #include "llfloatertools.h" | ||
43 | |||
44 | ///---------------------------------------------------------------------------- | ||
45 | /// Globals | ||
46 | ///---------------------------------------------------------------------------- | ||
47 | |||
48 | LLToolIndividual* gToolIndividual = NULL; | ||
49 | |||
50 | ///---------------------------------------------------------------------------- | ||
51 | /// Local function declarations, constants, enums, and typedefs | ||
52 | ///---------------------------------------------------------------------------- | ||
53 | |||
54 | |||
55 | ///---------------------------------------------------------------------------- | ||
56 | /// Class LLToolIndividual | ||
57 | ///---------------------------------------------------------------------------- | ||
58 | |||
59 | // Default constructor | ||
60 | LLToolIndividual::LLToolIndividual() | ||
61 | : LLTool("Individual") | ||
62 | { | ||
63 | } | ||
64 | |||
65 | // Destroys the object | ||
66 | LLToolIndividual::~LLToolIndividual() | ||
67 | { | ||
68 | } | ||
69 | |||
70 | BOOL LLToolIndividual::handleMouseDown(S32 x, S32 y, MASK mask) | ||
71 | { | ||
72 | gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, pickCallback); | ||
73 | return TRUE; | ||
74 | } | ||
75 | |||
76 | void LLToolIndividual::pickCallback(S32 x, S32 y, MASK mask) | ||
77 | { | ||
78 | LLViewerObject* obj = gViewerWindow->lastObjectHit(); | ||
79 | gSelectMgr->deselectAll(); | ||
80 | if(obj) | ||
81 | { | ||
82 | gSelectMgr->selectObjectOnly(obj); | ||
83 | } | ||
84 | } | ||
85 | |||
86 | BOOL LLToolIndividual::handleDoubleClick(S32 x, S32 y, MASK mask) | ||
87 | { | ||
88 | if(!gSelectMgr->isEmpty()) | ||
89 | { | ||
90 | // You should already have an object selected from the mousedown. | ||
91 | // If so, show its inventory. | ||
92 | //gBuildView->showInventoryPanel(); | ||
93 | //gBuildView->showPanel(LLBuildView::PANEL_CONTENTS); | ||
94 | gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS); | ||
95 | return TRUE; | ||
96 | } | ||
97 | else | ||
98 | { | ||
99 | // Nothing selected means the first mouse click was probably | ||
100 | // bad, so try again. | ||
101 | return FALSE; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | void LLToolIndividual::handleSelect() | ||
106 | { | ||
107 | LLViewerObject* obj = gSelectMgr->getFirstRootObject(); | ||
108 | if(!obj) | ||
109 | { | ||
110 | obj = gSelectMgr->getFirstObject(); | ||
111 | } | ||
112 | gSelectMgr->deselectAll(); | ||
113 | if(obj) | ||
114 | { | ||
115 | gSelectMgr->selectObjectOnly(obj); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | ///---------------------------------------------------------------------------- | ||
120 | /// Local function definitions | ||
121 | ///---------------------------------------------------------------------------- | ||