diff options
author | Richard Nelson <none@none> | 2010-08-16 15:01:39 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-08-16 15:01:39 -0700 |
commit | 32e4cda7dc730d505190db3d6658d6dd94bfc28f (patch) | |
tree | 4215ef7fd16cf5d61b53154a7f01f5eead674415 /indra/newview/llfirstuse.cpp | |
parent | c20bd2dfee1068d5a23eef9a10d21c2035c0b324 (diff) |
made hints only expire when explicitly responded to, not implicitly after first seeing them
added hint_popup.xml for hint styling
Diffstat (limited to 'indra/newview/llfirstuse.cpp')
-rw-r--r-- | indra/newview/llfirstuse.cpp | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 15de138c95..038579c0bd 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -48,7 +48,6 @@ // static std::set<std::string> LLFirstUse::sConfigVariables; -std::map<std::string, LLNotificationPtr> LLFirstUse::sNotifications; // static void LLFirstUse::addConfigVariable(const std::string& var) @@ -79,20 +78,9 @@ void LLFirstUse::resetFirstUse() } // 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()) - { - firstUseNotification("FirstOverrideKeys", true, "FirstOverrideKeys"); - } -} - -// static void LLFirstUse::otherAvatarChatFirst(bool enable) { - firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top")); + firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "incoming_chat").with("direction", "right")); } // static @@ -143,24 +131,48 @@ void LLFirstUse::receiveLindens(bool enable) //static void LLFirstUse::firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args, LLSD payload) { - LLNotificationPtr notif = sNotifications[notification_name]; + init(); if (enable) { - if (!notif && gWarningSettings.getBOOL(control_var)) + LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL; + + // if notification doesn't already exist and this notification hasn't been disabled... + if (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); + LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var))); } } else - { // want to hide notification - if (notif) - { // cancel existing notification - LLNotifications::instance().cancel(notif); - sNotifications.erase(notification_name); - } - gWarningSettings.setBOOL(control_var, FALSE); + { + LL_DEBUGS("LLFirstUse") << "Disabling first use notification " << notification_name << LL_ENDL; + LLNotifications::instance().cancelByName(notification_name); + } + +} + +// static +void LLFirstUse::init() +{ + static bool initialized = false; + if (!initialized) + { + LLNotifications::instance().getChannel("Hints")->connectChanged(processNotification); } + initialized = true; +} +//static +bool LLFirstUse::processNotification(const LLSD& notify) +{ + if (notify["sigtype"].asString() == "delete") + { + LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); + if (notification) + { + // disable any future notifications + gWarningSettings.setBOOL(notification->getPayload()["control_var"], FALSE); + } + } + return false; } |