llfirstuse.cpp

Go to the documentation of this file.
00001 
00032 #include "llviewerprecompiledheaders.h"
00033 
00034 #include "llfirstuse.h"
00035 
00036 // library includes
00037 #include "indra_constants.h"
00038 
00039 // viewer includes
00040 #include "llnotify.h"
00041 #include "llfloatervoicewizard.h"
00042 #include "llviewercontrol.h"
00043 #include "llui.h"
00044 #include "viewer.h"
00045 
00046 // static
00047 std::set<LLString> LLFirstUse::sConfigVariables;
00048 
00049 // static
00050 void LLFirstUse::addConfigVariable(const LLString& var)
00051 {
00052         gSavedSettings.addWarning(var);
00053         sConfigVariables.insert(var);
00054 }
00055 
00056 // static
00057 void LLFirstUse::disableFirstUse()
00058 {
00059         // Set all first-use warnings to disabled
00060         for (std::set<LLString>::iterator iter = sConfigVariables.begin();
00061                  iter != sConfigVariables.end(); ++iter)
00062         {
00063                 gSavedSettings.setWarning(*iter, FALSE);
00064         }
00065 }
00066 
00067 // static
00068 void LLFirstUse::resetFirstUse()
00069 {
00070         // Set all first-use warnings to disabled
00071         for (std::set<LLString>::iterator iter = sConfigVariables.begin();
00072                  iter != sConfigVariables.end(); ++iter)
00073         {
00074                 gSavedSettings.setWarning(*iter, TRUE);
00075         }
00076 }
00077 
00078 
00079 // Called whenever the viewer detects that your balance went up
00080 void LLFirstUse::useBalanceIncrease(S32 delta)
00081 {
00082         if (gSavedSettings.getWarning("FirstBalanceIncrease"))
00083         {
00084                 gSavedSettings.setWarning("FirstBalanceIncrease", FALSE);
00085 
00086                 LLString::format_map_t args;
00087                 args["[AMOUNT]"] = llformat("%d",delta);
00088                 LLNotifyBox::showXml("FirstBalanceIncrease", args);
00089         }
00090 }
00091 
00092 
00093 // Called whenever the viewer detects your balance went down
00094 void LLFirstUse::useBalanceDecrease(S32 delta)
00095 {
00096         if (gSavedSettings.getWarning("FirstBalanceDecrease"))
00097         {
00098                 gSavedSettings.setWarning("FirstBalanceDecrease", FALSE);
00099 
00100                 LLString::format_map_t args;
00101                 args["[AMOUNT]"] = llformat("%d",-delta);
00102                 LLNotifyBox::showXml("FirstBalanceDecrease", args);
00103         }
00104 }
00105 
00106 
00107 // static
00108 void LLFirstUse::useSit()
00109 {
00110         if (gSavedSettings.getWarning("FirstSit"))
00111         {
00112                 gSavedSettings.setWarning("FirstSit", FALSE);
00113 
00114                 LLNotifyBox::showXml("FirstSit");
00115         }
00116 }
00117 
00118 // static
00119 void LLFirstUse::useMap()
00120 {
00121         if (gSavedSettings.getWarning("FirstMap"))
00122         {
00123                 gSavedSettings.setWarning("FirstMap", FALSE);
00124 
00125                 LLNotifyBox::showXml("FirstMap");
00126         }
00127 }
00128 
00129 // static
00130 void LLFirstUse::useGoTo()
00131 {
00132         // nothing for now JC
00133 }
00134 
00135 // static
00136 void LLFirstUse::useBuild()
00137 {
00138         if (gSavedSettings.getWarning("FirstBuild"))
00139         {
00140                 gSavedSettings.setWarning("FirstBuild", FALSE);
00141 
00142                 LLNotifyBox::showXml("FirstBuild");
00143         }
00144 }
00145 
00146 // static
00147 void LLFirstUse::useLeftClickNoHit()
00148 { 
00149         if (gSavedSettings.getWarning("FirstLeftClickNoHit"))
00150         {
00151                 gSavedSettings.setWarning("FirstLeftClickNoHit", FALSE);
00152 
00153                 LLNotifyBox::showXml("FirstLeftClickNoHit");
00154         }
00155 }
00156 
00157 // static
00158 void LLFirstUse::useTeleport()
00159 {
00160         if (gSavedSettings.getWarning("FirstTeleport"))
00161         {
00162                 gSavedSettings.setWarning("FirstTeleport", FALSE);
00163 
00164                 LLNotifyBox::showXml("FirstTeleport");
00165         }
00166 }
00167 
00168 // static
00169 void LLFirstUse::useOverrideKeys()
00170 {
00171         if (gSavedSettings.getWarning("FirstOverrideKeys"))
00172         {
00173                 gSavedSettings.setWarning("FirstOverrideKeys", FALSE);
00174 
00175                 LLNotifyBox::showXml("FirstOverrideKeys");
00176         }
00177 }
00178 
00179 // static
00180 void LLFirstUse::useAttach()
00181 {
00182         // nothing for now
00183 }
00184 
00185 // static
00186 void LLFirstUse::useAppearance()
00187 {
00188         if (gSavedSettings.getWarning("FirstAppearance"))
00189         {
00190                 gSavedSettings.setWarning("FirstAppearance", FALSE);
00191 
00192                 LLNotifyBox::showXml("FirstAppearance");
00193         }
00194 }
00195 
00196 // static
00197 void LLFirstUse::useInventory()
00198 {
00199         if (gSavedSettings.getWarning("FirstInventory"))
00200         {
00201                 gSavedSettings.setWarning("FirstInventory", FALSE);
00202 
00203                 LLNotifyBox::showXml("FirstInventory");
00204         }
00205 }
00206 
00207 
00208 // static
00209 void LLFirstUse::useSandbox()
00210 {
00211         if (gSavedSettings.getWarning("FirstSandbox"))
00212         {
00213                 gSavedSettings.setWarning("FirstSandbox", FALSE);
00214 
00215                 LLString::format_map_t args;
00216                 args["[HOURS]"] = llformat("%d",SANDBOX_CLEAN_FREQ);
00217                 args["[TIME]"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR);
00218                 LLNotifyBox::showXml("FirstSandbox", args);
00219         }
00220 }
00221 
00222 // static
00223 void LLFirstUse::useFlexible()
00224 {
00225         if (gSavedSettings.getWarning("FirstFlexible"))
00226         {
00227                 gSavedSettings.setWarning("FirstFlexible", FALSE);
00228 
00229                 LLNotifyBox::showXml("FirstFlexible");
00230         }
00231 }
00232 
00233 // static
00234 void LLFirstUse::useDebugMenus()
00235 {
00236         if (gSavedSettings.getWarning("FirstDebugMenus"))
00237         {
00238                 gSavedSettings.setWarning("FirstDebugMenus", FALSE);
00239 
00240                 LLNotifyBox::showXml("FirstDebugMenus");
00241         }
00242 }
00243 
00244 // static
00245 void LLFirstUse::useSculptedPrim()
00246 {
00247         if (gSavedSettings.getWarning("FirstSculptedPrim"))
00248         {
00249                 gSavedSettings.setWarning("FirstSculptedPrim", FALSE);
00250 
00251                 LLNotifyBox::showXml("FirstSculptedPrim");
00252                 
00253         }
00254 }
00255 
00256 // static 
00257 void LLFirstUse::useVoice()
00258 {
00259         if (gDisableVoice) return;
00260         if (gSavedSettings.getWarning("FirstVoice"))
00261         {
00262                 gSavedSettings.setWarning("FirstVoice", FALSE);
00263 
00264                 LLFloaterVoiceWizard::showInstance();
00265         }
00266 }

Generated on Thu Jul 1 06:08:30 2010 for Second Life Viewer by  doxygen 1.4.7