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/llfirstuse.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/llfirstuse.cpp')
-rw-r--r-- | linden/indra/newview/llfirstuse.cpp | 215 |
1 files changed, 215 insertions, 0 deletions
diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp new file mode 100644 index 0000000..1127f8b --- /dev/null +++ b/linden/indra/newview/llfirstuse.cpp | |||
@@ -0,0 +1,215 @@ | |||
1 | /** | ||
2 | * @file llfirstuse.cpp | ||
3 | * @brief Methods that spawn "first-use" dialogs | ||
4 | * | ||
5 | * Copyright (c) 2003-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 | #include "llviewerprecompiledheaders.h" | ||
29 | |||
30 | #include "llfirstuse.h" | ||
31 | |||
32 | // library includes | ||
33 | #include "indra_constants.h" | ||
34 | |||
35 | // viewer includes | ||
36 | #include "llnotify.h" | ||
37 | #include "llviewercontrol.h" | ||
38 | #include "llui.h" | ||
39 | #include "viewer.h" | ||
40 | |||
41 | // static | ||
42 | std::set<LLString> LLFirstUse::sConfigVariables; | ||
43 | |||
44 | // static | ||
45 | void LLFirstUse::addConfigVariable(const LLString& var) | ||
46 | { | ||
47 | gSavedSettings.addWarning(var); | ||
48 | sConfigVariables.insert(var); | ||
49 | } | ||
50 | |||
51 | // static | ||
52 | void LLFirstUse::disableFirstUse() | ||
53 | { | ||
54 | // Set all first-use warnings to disabled | ||
55 | for (std::set<LLString>::iterator iter = sConfigVariables.begin(); | ||
56 | iter != sConfigVariables.end(); ++iter) | ||
57 | { | ||
58 | gSavedSettings.setWarning(*iter, FALSE); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | // Called whenever the viewer detects that your balance went up | ||
63 | void LLFirstUse::useBalanceIncrease(S32 delta) | ||
64 | { | ||
65 | if (gSavedSettings.getWarning("FirstBalanceIncrease")) | ||
66 | { | ||
67 | gSavedSettings.setWarning("FirstBalanceIncrease", FALSE); | ||
68 | |||
69 | LLString::format_map_t args; | ||
70 | args["[AMOUNT]"] = llformat("%d",delta); | ||
71 | LLNotifyBox::showXml("FirstBalanceIncrease", args); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | |||
76 | // Called whenever the viewer detects your balance went down | ||
77 | void LLFirstUse::useBalanceDecrease(S32 delta) | ||
78 | { | ||
79 | if (gSavedSettings.getWarning("FirstBalanceDecrease")) | ||
80 | { | ||
81 | gSavedSettings.setWarning("FirstBalanceDecrease", FALSE); | ||
82 | |||
83 | LLString::format_map_t args; | ||
84 | args["[AMOUNT]"] = llformat("%d",-delta); | ||
85 | LLNotifyBox::showXml("FirstBalanceDecrease", args); | ||
86 | } | ||
87 | } | ||
88 | |||
89 | |||
90 | // static | ||
91 | void LLFirstUse::useSit() | ||
92 | { | ||
93 | if (gSavedSettings.getWarning("FirstSit")) | ||
94 | { | ||
95 | gSavedSettings.setWarning("FirstSit", FALSE); | ||
96 | |||
97 | LLNotifyBox::showXml("FirstSit"); | ||
98 | } | ||
99 | } | ||
100 | |||
101 | // static | ||
102 | void LLFirstUse::useMap() | ||
103 | { | ||
104 | if (gSavedSettings.getWarning("FirstMap")) | ||
105 | { | ||
106 | gSavedSettings.setWarning("FirstMap", FALSE); | ||
107 | |||
108 | LLNotifyBox::showXml("FirstMap"); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | // static | ||
113 | void LLFirstUse::useGoTo() | ||
114 | { | ||
115 | // nothing for now JC | ||
116 | } | ||
117 | |||
118 | // static | ||
119 | void LLFirstUse::useBuild() | ||
120 | { | ||
121 | if (gSavedSettings.getWarning("FirstBuild")) | ||
122 | { | ||
123 | gSavedSettings.setWarning("FirstBuild", FALSE); | ||
124 | |||
125 | LLNotifyBox::showXml("FirstBuild"); | ||
126 | } | ||
127 | } | ||
128 | |||
129 | // static | ||
130 | void LLFirstUse::useLeftClickNoHit() | ||
131 | { | ||
132 | if (gSavedSettings.getWarning("FirstLeftClickNoHit")) | ||
133 | { | ||
134 | gSavedSettings.setWarning("FirstLeftClickNoHit", FALSE); | ||
135 | |||
136 | LLNotifyBox::showXml("FirstLeftClickNoHit"); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | // static | ||
141 | void LLFirstUse::useTeleport() | ||
142 | { | ||
143 | if (gSavedSettings.getWarning("FirstTeleport")) | ||
144 | { | ||
145 | gSavedSettings.setWarning("FirstTeleport", FALSE); | ||
146 | |||
147 | LLNotifyBox::showXml("FirstTeleport"); | ||
148 | } | ||
149 | } | ||
150 | |||
151 | // static | ||
152 | void LLFirstUse::useOverrideKeys() | ||
153 | { | ||
154 | if (gSavedSettings.getWarning("FirstOverrideKeys")) | ||
155 | { | ||
156 | gSavedSettings.setWarning("FirstOverrideKeys", FALSE); | ||
157 | |||
158 | LLNotifyBox::showXml("FirstOverrideKeys"); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | // static | ||
163 | void LLFirstUse::useAttach() | ||
164 | { | ||
165 | // nothing for now | ||
166 | } | ||
167 | |||
168 | // static | ||
169 | void LLFirstUse::useAppearance() | ||
170 | { | ||
171 | if (gSavedSettings.getWarning("FirstAppearance")) | ||
172 | { | ||
173 | gSavedSettings.setWarning("FirstAppearance", FALSE); | ||
174 | |||
175 | LLNotifyBox::showXml("FirstAppearance"); | ||
176 | } | ||
177 | } | ||
178 | |||
179 | // static | ||
180 | void LLFirstUse::useInventory() | ||
181 | { | ||
182 | if (gSavedSettings.getWarning("FirstInventory")) | ||
183 | { | ||
184 | gSavedSettings.setWarning("FirstInventory", FALSE); | ||
185 | |||
186 | LLNotifyBox::showXml("FirstInventory"); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | |||
191 | // static | ||
192 | void LLFirstUse::useSandbox() | ||
193 | { | ||
194 | if (gSavedSettings.getWarning("FirstSandbox")) | ||
195 | { | ||
196 | gSavedSettings.setWarning("FirstSandbox", FALSE); | ||
197 | |||
198 | LLString::format_map_t args; | ||
199 | args["[HOURS]"] = llformat("%d",SANDBOX_CLEAN_FREQ); | ||
200 | args["[TIME]"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR); | ||
201 | LLNotifyBox::showXml("FirstSandbox", args); | ||
202 | } | ||
203 | } | ||
204 | |||
205 | // static | ||
206 | void LLFirstUse::useFlexible() | ||
207 | { | ||
208 | if (gSavedSettings.getWarning("FirstFlexible")) | ||
209 | { | ||
210 | gSavedSettings.setWarning("FirstFlexible", FALSE); | ||
211 | |||
212 | LLNotifyBox::showXml("FirstFlexible"); | ||
213 | } | ||
214 | } | ||
215 | |||