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.cpp214
1 files changed, 59 insertions, 155 deletions
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 4d5b08243a..b08c113923 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -30,7 +30,7 @@
// library includes
#include "indra_constants.h"
-#include "llnotificationsutil.h"
+#include "llnotifications.h"
// viewer includes
#include "llagent.h" // for gAgent.inPrelude()
@@ -39,7 +39,7 @@
#include "llappviewer.h"
#include "lltracker.h"
-/*
+
// static
std::set<std::string> LLFirstUse::sConfigVariables;
@@ -70,211 +70,115 @@ 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::otherAvatarChatFirst(bool enable)
{
- if (gWarningSettings.getBOOL("FirstBalanceDecrease"))
- {
- gWarningSettings.setBOOL("FirstBalanceDecrease", FALSE);
-
- LLSD args;
- args["AMOUNT"] = llformat("%d",-delta);
- LLNotificationsUtil::add("FirstBalanceDecrease", args);
- }
+ firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "chat_bar").with("direction", "top_right").with("distance", 24));
}
-
// static
-void LLFirstUse::useSit()
+void LLFirstUse::sit(bool enable)
{
- // 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");
- //}
+ firstUseNotification("FirstSit", enable, "HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
}
// static
-void LLFirstUse::useMap()
+void LLFirstUse::newInventory(bool enable)
{
- if (gWarningSettings.getBOOL("FirstMap"))
- {
- gWarningSettings.setBOOL("FirstMap", FALSE);
-
- LLNotificationsUtil::add("FirstMap");
- }
+ // turning this off until bug EXP-62 can be fixed (inventory hint appears for new users when their initial inventory is acquired)
+ // firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
}
// static
-void LLFirstUse::useGoTo()
+void LLFirstUse::useSandbox()
{
- // nothing for now JC
+ firstUseNotification("FirstSandbox", true, "FirstSandbox", LLSD().with("HOURS", SANDBOX_CLEAN_FREQ).with("TIME", SANDBOX_FIRST_CLEAN_HOUR));
}
// static
-void LLFirstUse::useBuild()
+void LLFirstUse::notUsingDestinationGuide(bool enable)
{
- if (gWarningSettings.getBOOL("FirstBuild"))
- {
- gWarningSettings.setBOOL("FirstBuild", FALSE);
-
- LLNotificationsUtil::add("FirstBuild");
- }
+ // not doing this yet
+ //firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_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::notUsingSidePanel(bool enable)
{
- if (gWarningSettings.getBOOL("FirstTeleport"))
- {
- LLVector3d teleportDestination = LLTracker::getTrackedPositionGlobal();
- if(teleportDestination != LLVector3d::zero)
- {
- gWarningSettings.setBOOL("FirstTeleport", FALSE);
-
- LLNotificationsUtil::add("FirstTeleport");
- }
- }
+ // not doing this yet
+ //firstUseNotification("FirstNotUseSidePanel", enable, "HintSidePanel", LLSD(), LLSD().with("target", "side_panel_btn").with("direction", "left"));
}
-*/
-// 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::notMoving(bool enable)
{
- // nothing for now
+ firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top"));
}
// static
-void LLFirstUse::useAppearance()
+void LLFirstUse::setDisplayName(bool enable)
{
- if (gWarningSettings.getBOOL("FirstAppearance"))
- {
- gWarningSettings.setBOOL("FirstAppearance", FALSE);
-
- LLNotificationsUtil::add("FirstAppearance");
- }
+ firstUseNotification("FirstDisplayName", enable, "HintDisplayName", LLSD(), LLSD().with("target", "set_display_name").with("direction", "left"));
}
// static
-void LLFirstUse::useInventory()
+void LLFirstUse::receiveLindens(bool enable)
{
- if (gWarningSettings.getBOOL("FirstInventory"))
- {
- gWarningSettings.setBOOL("FirstInventory", FALSE);
-
- LLNotificationsUtil::add("FirstInventory");
- }
+ firstUseNotification("FirstReceiveLindens", enable, "HintLindenDollar", LLSD(), LLSD().with("target", "linden_balance").with("direction", "bottom"));
}
-*/
-// static
-void LLFirstUse::useSandbox()
+//static
+void LLFirstUse::firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args, LLSD payload)
{
- if (gWarningSettings.getBOOL("FirstSandbox"))
- {
- gWarningSettings.setBOOL("FirstSandbox", FALSE);
+ init();
- LLSD args;
- args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ);
- args["TIME"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR);
- LLNotificationsUtil::add("FirstSandbox", args);
- }
-}
-/*
-// static
-void LLFirstUse::useFlexible()
-{
- if (gWarningSettings.getBOOL("FirstFlexible"))
+ if (enable)
{
- gWarningSettings.setBOOL("FirstFlexible", FALSE);
-
- LLNotificationsUtil::add("FirstFlexible");
- }
-}
+ if (gSavedSettings.getBOOL("EnableUIHints"))
+ {
+ LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL;
-// static
-void LLFirstUse::useDebugMenus()
-{
- if (gWarningSettings.getBOOL("FirstDebugMenus"))
+ // if notification doesn't already exist and this notification hasn't been disabled...
+ if (gWarningSettings.getBOOL(control_var))
+ { // create new notification
+ LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var)));
+ }
+ }
+ }
+ else
{
- gWarningSettings.setBOOL("FirstDebugMenus", FALSE);
-
- LLNotificationsUtil::add("FirstDebugMenus");
+ LL_DEBUGS("LLFirstUse") << "Disabling first use notification " << notification_name << LL_ENDL;
+ LLNotifications::instance().cancelByName(notification_name);
+ // redundantly clear settings var here, in case there are no notifications to cancel
+ gWarningSettings.setBOOL(control_var, FALSE);
}
+
}
// static
-void LLFirstUse::useSculptedPrim()
+void LLFirstUse::init()
{
- if (gWarningSettings.getBOOL("FirstSculptedPrim"))
+ static bool initialized = false;
+ if (!initialized)
{
- gWarningSettings.setBOOL("FirstSculptedPrim", FALSE);
-
- LLNotificationsUtil::add("FirstSculptedPrim");
-
+ LLNotifications::instance().getChannel("Hints")->connectChanged(&processNotification);
}
+ initialized = true;
}
-// static
-void LLFirstUse::useMedia()
+//static
+bool LLFirstUse::processNotification(const LLSD& notify)
{
- if (gWarningSettings.getBOOL("FirstMedia"))
+ if (notify["sigtype"].asString() == "delete")
{
- 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");
+ LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+ if (notification)
+ {
+ // disable any future notifications
+ gWarningSettings.setBOOL(notification->getPayload()["control_var"], FALSE);
+ }
}
+ return false;
}
-*/