summaryrefslogtreecommitdiff
path: root/indra/newview/llfirstuse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfirstuse.cpp')
-rw-r--r--indra/newview/llfirstuse.cpp210
1 files changed, 45 insertions, 165 deletions
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index b3fdf60b11..15de138c95 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -36,7 +36,7 @@
// library includes
#include "indra_constants.h"
-#include "llnotificationsutil.h"
+#include "llnotifications.h"
// viewer includes
#include "llagent.h" // for gAgent.inPrelude()
@@ -45,9 +45,10 @@
#include "llappviewer.h"
#include "lltracker.h"
-/*
+
// static
std::set<std::string> LLFirstUse::sConfigVariables;
+std::map<std::string, LLNotificationPtr> LLFirstUse::sNotifications;
// static
void LLFirstUse::addConfigVariable(const std::string& var)
@@ -76,211 +77,90 @@ void LLFirstUse::resetFirstUse()
gWarningSettings.setBOOL(*iter, TRUE);
}
}
-*/
-/*
-
-// Called whenever the viewer detects that your balance went up
-void LLFirstUse::useBalanceIncrease(S32 delta)
-{
- if (gWarningSettings.getBOOL("FirstBalanceIncrease"))
- {
- gWarningSettings.setBOOL("FirstBalanceIncrease", FALSE);
-
- LLSD args;
- args["AMOUNT"] = llformat("%d",delta);
- LLNotificationsUtil::add("FirstBalanceIncrease", args);
- }
-}
-
-// Called whenever the viewer detects your balance went down
-void LLFirstUse::useBalanceDecrease(S32 delta)
+// static
+void LLFirstUse::useOverrideKeys()
{
- if (gWarningSettings.getBOOL("FirstBalanceDecrease"))
+ // Our orientation island uses key overrides to teach vehicle driving
+ // so don't show this message until you get off OI. JC
+ if (!gAgent.inPrelude())
{
- gWarningSettings.setBOOL("FirstBalanceDecrease", FALSE);
-
- LLSD args;
- args["AMOUNT"] = llformat("%d",-delta);
- LLNotificationsUtil::add("FirstBalanceDecrease", args);
+ firstUseNotification("FirstOverrideKeys", true, "FirstOverrideKeys");
}
}
-
-// static
-void LLFirstUse::useSit()
-{
- // Our orientation island uses sitting to teach vehicle driving
- // so just never show this message. JC
- //if (gWarningSettings.getBOOL("FirstSit"))
- //{
- // gWarningSettings.setBOOL("FirstSit", FALSE);
- //
- // LLNotificationsUtil::add("FirstSit");
- //}
-}
-
// static
-void LLFirstUse::useMap()
+void LLFirstUse::otherAvatarChatFirst(bool enable)
{
- if (gWarningSettings.getBOOL("FirstMap"))
- {
- gWarningSettings.setBOOL("FirstMap", FALSE);
-
- LLNotificationsUtil::add("FirstMap");
- }
+ firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
}
// static
-void LLFirstUse::useGoTo()
+void LLFirstUse::sit(bool enable)
{
- // nothing for now JC
+ firstUseNotification("FirstSit", enable, "HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
}
// static
-void LLFirstUse::useBuild()
+void LLFirstUse::inventoryOffer(bool enable)
{
- if (gWarningSettings.getBOOL("FirstBuild"))
- {
- gWarningSettings.setBOOL("FirstBuild", FALSE);
-
- LLNotificationsUtil::add("FirstBuild");
- }
+ firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
}
-
- */
-/*
-// static
-void LLFirstUse::useLeftClickNoHit()
-{
- if (gWarningSettings.getBOOL("FirstLeftClickNoHit"))
- {
- gWarningSettings.setBOOL("FirstLeftClickNoHit", FALSE);
- LLNotificationsUtil::add("FirstLeftClickNoHit");
- }
-}
-*/
-/*
// static
-void LLFirstUse::useTeleport()
+void LLFirstUse::useSandbox()
{
- if (gWarningSettings.getBOOL("FirstTeleport"))
- {
- LLVector3d teleportDestination = LLTracker::getTrackedPositionGlobal();
- if(teleportDestination != LLVector3d::zero)
- {
- gWarningSettings.setBOOL("FirstTeleport", FALSE);
-
- LLNotificationsUtil::add("FirstTeleport");
- }
- }
+ firstUseNotification("FirstSandbox", true, "FirstSandbox", LLSD().with("HOURS", SANDBOX_CLEAN_FREQ).with("TIME", SANDBOX_FIRST_CLEAN_HOUR));
}
-*/
-// static
-void LLFirstUse::useOverrideKeys()
-{
- // Our orientation island uses key overrides to teach vehicle driving
- // so don't show this message until you get off OI. JC
- if (!gAgent.inPrelude())
- {
- if (gWarningSettings.getBOOL("FirstOverrideKeys"))
- {
- gWarningSettings.setBOOL("FirstOverrideKeys", FALSE);
- LLNotificationsUtil::add("FirstOverrideKeys");
- }
- }
-}
-/*
// static
-void LLFirstUse::useAttach()
+void LLFirstUse::notUsingDestinationGuide(bool enable)
{
- // nothing for now
+ // not doing this yet
+ //firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_btn").with("direction", "left"));
}
// static
-void LLFirstUse::useAppearance()
+void LLFirstUse::notUsingSidePanel(bool enable)
{
- if (gWarningSettings.getBOOL("FirstAppearance"))
- {
- gWarningSettings.setBOOL("FirstAppearance", FALSE);
-
- LLNotificationsUtil::add("FirstAppearance");
- }
+ // not doing this yet
+ //firstUseNotification("FirstNotUseSidePanel", enable, "HintSidePanel", LLSD(), LLSD().with("target", "side_panel_btn").with("direction", "left"));
}
// static
-void LLFirstUse::useInventory()
+void LLFirstUse::notMoving(bool enable)
{
- if (gWarningSettings.getBOOL("FirstInventory"))
- {
- gWarningSettings.setBOOL("FirstInventory", FALSE);
-
- LLNotificationsUtil::add("FirstInventory");
- }
+ firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top"));
}
-*/
-
// static
-void LLFirstUse::useSandbox()
+void LLFirstUse::receiveLindens(bool enable)
{
- if (gWarningSettings.getBOOL("FirstSandbox"))
- {
- gWarningSettings.setBOOL("FirstSandbox", FALSE);
-
- LLSD args;
- args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ);
- args["TIME"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR);
- LLNotificationsUtil::add("FirstSandbox", args);
- }
+ firstUseNotification("FirstReceiveLindens", enable, "HintLindenDollar", LLSD(), LLSD().with("target", "linden_balance").with("direction", "bottom"));
}
-/*
-// static
-void LLFirstUse::useFlexible()
-{
- if (gWarningSettings.getBOOL("FirstFlexible"))
- {
- gWarningSettings.setBOOL("FirstFlexible", FALSE);
- LLNotificationsUtil::add("FirstFlexible");
- }
-}
-// static
-void LLFirstUse::useDebugMenus()
+//static
+void LLFirstUse::firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args, LLSD payload)
{
- if (gWarningSettings.getBOOL("FirstDebugMenus"))
- {
- gWarningSettings.setBOOL("FirstDebugMenus", FALSE);
+ LLNotificationPtr notif = sNotifications[notification_name];
- LLNotificationsUtil::add("FirstDebugMenus");
- }
-}
-
-// static
-void LLFirstUse::useSculptedPrim()
-{
- if (gWarningSettings.getBOOL("FirstSculptedPrim"))
+ if (enable)
{
- gWarningSettings.setBOOL("FirstSculptedPrim", FALSE);
-
- LLNotificationsUtil::add("FirstSculptedPrim");
-
+ if (!notif && gWarningSettings.getBOOL(control_var))
+ { // create new notification
+ sNotifications[notification_name] = LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload));
+ gWarningSettings.setBOOL(control_var, FALSE);
+ }
+ }
+ else
+ { // want to hide notification
+ if (notif)
+ { // cancel existing notification
+ LLNotifications::instance().cancel(notif);
+ sNotifications.erase(notification_name);
+ }
+ gWarningSettings.setBOOL(control_var, FALSE);
}
-}
-// static
-void LLFirstUse::useMedia()
-{
- if (gWarningSettings.getBOOL("FirstMedia"))
- {
- gWarningSettings.setBOOL("FirstMedia", FALSE);
-
- // Popup removed as a short-term fix for EXT-1643.
- // Ultimately, the plan is to kill all First Use dialogs
- //LLNotificationsUtil::add("FirstMedia");
- }
}
-*/