summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/ignorable_dialogs.xml48
-rw-r--r--indra/newview/llbottomtray.cpp5
-rw-r--r--indra/newview/llfirstuse.cpp88
-rw-r--r--indra/newview/llfirstuse.h16
-rw-r--r--indra/newview/llhints.cpp40
-rw-r--r--indra/newview/llhints.h3
-rw-r--r--indra/newview/llnotificationhinthandler.cpp10
-rw-r--r--indra/newview/llsidepanelinventory.cpp3
-rw-r--r--indra/newview/llsidetray.cpp2
-rw-r--r--indra/newview/llstatusbar.cpp3
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml31
11 files changed, 189 insertions, 60 deletions
diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml
index a0b9e33aa9..0720ccee49 100644
--- a/indra/newview/app_settings/ignorable_dialogs.xml
+++ b/indra/newview/app_settings/ignorable_dialogs.xml
@@ -4,7 +4,7 @@
<key>FirstInventoryOffer</key>
<map>
<key>Comment</key>
- <string>Shows hint when a person or object offers you an inventory item</string>
+ <string>Shows hint when a person or object offers resident an inventory item</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -12,7 +12,51 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>FirstOtherChatBeforeUser</key>
+ <key>FirstNotUseDestinationGuide</key>
+ <map>
+ <key>Comment</key>
+ <string>Shows hint when resident doesn't activate destination guide</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>FirstNotUseSidePanel</key>
+ <map>
+ <key>Comment</key>
+ <string>Shows hint when resident doesn't activate side panel</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>FirstNotMoving</key>
+ <map>
+ <key>Comment</key>
+ <string>Shows hint when resident doesn't move</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>FirstReceiveLindens</key>
+ <map>
+ <key>Comment</key>
+ <string>Shows hint when resident receives linden dollars</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>FirstOtherChatBeforeUser</key>
<map>
<key>Comment</key>
<string>Shows hint when someone else chats first</string>
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 7d4c0be3fa..e0b605a724 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -69,10 +69,6 @@ template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
namespace
{
const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel";
- const std::string& PANEL_CHATBAR_NAME = "chat_bar";
- const std::string& PANEL_MOVEMENT_NAME = "movement_panel";
- const std::string& PANEL_CAMERA_NAME = "cam_panel";
- const std::string& PANEL_GESTURE_NAME = "gesture_panel";
S32 get_panel_min_width(LLLayoutStack* stack, LLView* panel)
{
@@ -480,6 +476,7 @@ BOOL LLBottomTray::postBuild()
mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
mMovementButton = getChild<LLButton>("movement_btn");
+ LLHints::registerHintTarget("move_btn", mMovementButton->getHandle());
mCamButton = getChild<LLButton>("camera_btn");
setRightMouseDownCallback(boost::bind(&LLBottomTray::showBottomTrayContextMenu,this, _2, _3,_4));
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 8906525676..d2dff49904 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()
@@ -48,6 +48,7 @@
// static
std::set<std::string> LLFirstUse::sConfigVariables;
+std::map<std::string, LLNotificationPtr> LLFirstUse::sNotifications;
// static
void LLFirstUse::addConfigVariable(const std::string& var)
@@ -84,58 +85,79 @@ void LLFirstUse::useOverrideKeys()
// 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");
- }
+ firstUseNotification("FirstOverrideKeys", true, "FirstOverrideKeys");
}
}
// static
-void LLFirstUse::otherAvatarChat()
+void LLFirstUse::otherAvatarChat(bool enable)
{
- if (gWarningSettings.getBOOL("FirstOtherChatBeforeUser"))
- {
- gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE);
+ firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
+}
- LLNotificationsUtil::add("HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
- }
+// static
+void LLFirstUse::sit(bool enable)
+{
+ firstUseNotification("FirstSit", enable, "HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
}
// static
-void LLFirstUse::sit()
+void LLFirstUse::inventoryOffer(bool enable)
{
- if (gWarningSettings.getBOOL("FirstSit"))
- {
- gWarningSettings.setBOOL("FirstSit", FALSE);
+ firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
+}
- LLNotificationsUtil::add("HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
- }
+// static
+void LLFirstUse::useSandbox()
+{
+ firstUseNotification("FirstSandbox", true, "FirstSandbox", LLSD().with("HOURS", SANDBOX_CLEAN_FREQ).with("TIME", SANDBOX_FIRST_CLEAN_HOUR));
}
// static
-void LLFirstUse::inventoryOffer()
+void LLFirstUse::notUsingDestinationGuide(bool enable)
{
- if (gWarningSettings.getBOOL("FirstInventoryOffer"))
- {
- gWarningSettings.setBOOL("FirstInventoryOffer", FALSE);
+ firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_btn").with("direction", "left"));
+}
- LLNotificationsUtil::add("HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
- }
+// static
+void LLFirstUse::notUsingSidePanel(bool enable)
+{
+ firstUseNotification("FirstNotUseSidePanel", enable, "HintSidePanel", LLSD(), LLSD().with("target", "side_panel_btn").with("direction", "left"));
}
// static
-void LLFirstUse::useSandbox()
+void LLFirstUse::notMoving(bool enable)
{
- if (gWarningSettings.getBOOL("FirstSandbox"))
- {
- gWarningSettings.setBOOL("FirstSandbox", FALSE);
+ firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top"));
+}
+
+// static
+void LLFirstUse::receiveLindens(bool enable)
+{
+ firstUseNotification("FirstReceiveLindens", enable, "HintLindenDollar", LLSD(), LLSD().with("target", "linden_balance").with("direction", "bottom"));
+}
+
+
+//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];
- LLSD args;
- args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ);
- args["TIME"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR);
- LLNotificationsUtil::add("FirstSandbox", args);
+ if (enable)
+ {
+ 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);
+ }
}
+
}
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index ca7290fe17..abf7d9836e 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -76,6 +76,9 @@ object or from inventory.
14. First time you create/edit a sculpted prim.
*/
+class LLNotification;
+
+
class LLFirstUse
{
public:
@@ -88,14 +91,19 @@ public:
static void resetFirstUse();
static void useOverrideKeys();
- static void otherAvatarChat();
- static void sit();
- static void inventoryOffer();
-
+ static void otherAvatarChat(bool enable = true);
+ static void sit(bool enable = true);
+ static void notUsingDestinationGuide(bool enable = true);
+ static void notUsingSidePanel(bool enable = true);
+ static void notMoving(bool enable = true);
+ static void inventoryOffer(bool enable = true);
+ static void receiveLindens(bool enable = true);
static void useSandbox();
protected:
+ static void firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args = LLSD(), LLSD payload = LLSD());
static std::set<std::string> sConfigVariables;
+ static std::map<std::string, boost::shared_ptr<LLNotification> > sNotifications;
};
#endif
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index a8c3183301..2f3504efed 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -149,7 +149,7 @@ void LLHintPopup::draw()
targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent());
LLRect my_local_rect = getLocalRect();
- LLRect my_rect = getRect();
+ LLRect my_rect;
LLRect arrow_rect;
LLUIImagePtr arrow_imagep;
@@ -158,10 +158,10 @@ void LLHintPopup::draw()
switch(mDirection)
{
case LEFT:
- my_rect.setCenterAndSize( target_rect.mLeft - (my_rect.getWidth() / 2 + mDistance),
+ my_rect.setCenterAndSize( target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance),
target_rect.getCenterY(),
- my_rect.getWidth(),
- my_rect.getHeight());
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP,
my_local_rect.getCenterY(),
mArrowRight->getWidth(),
@@ -170,9 +170,9 @@ void LLHintPopup::draw()
break;
case TOP:
my_rect.setCenterAndSize( target_rect.getCenterX(),
- target_rect.mTop + (my_rect.getHeight() / 2 + mDistance),
- my_rect.getWidth(),
- my_rect.getHeight());
+ target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance),
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP,
mArrowDown->getWidth(),
@@ -181,9 +181,9 @@ void LLHintPopup::draw()
break;
case RIGHT:
my_rect.setCenterAndSize( target_rect.getCenterX(),
- target_rect.mTop - (my_rect.getHeight() / 2 + mDistance),
- my_rect.getWidth(),
- my_rect.getHeight());
+ target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance),
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP,
my_local_rect.getCenterY(),
mArrowLeft->getWidth(),
@@ -191,10 +191,10 @@ void LLHintPopup::draw()
arrow_imagep = mArrowLeft;
break;
case BOTTOM:
- my_rect.setCenterAndSize( target_rect.mLeft + (my_rect.getWidth() / 2 + mDistance),
+ my_rect.setCenterAndSize( target_rect.mLeft + (my_local_rect.getWidth() / 2 + mDistance),
target_rect.getCenterY(),
- my_rect.getWidth(),
- my_rect.getHeight());
+ my_local_rect.getWidth(),
+ my_local_rect.getHeight());
arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP,
mArrowUp->getWidth(),
@@ -211,6 +211,7 @@ void LLHintPopup::draw()
LLRegistry<std::string, LLHandle<LLView> > LLHints::sTargetRegistry;
+std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints;
//static
void LLHints::show(LLNotificationPtr hint)
@@ -221,6 +222,9 @@ void LLHints::show(LLNotificationPtr hint)
p.notification = hint;
LLHintPopup* popup = new LLHintPopup(p);
+
+ sHints[hint] = popup;
+
LLView* hint_holder = gViewerWindow->getHintHolder();
if (hint_holder)
{
@@ -229,6 +233,16 @@ void LLHints::show(LLNotificationPtr hint)
}
}
+void LLHints::hide(LLNotificationPtr hint)
+{
+ hint_map_t::iterator found_it = sHints.find(hint);
+ if (found_it != sHints.end())
+ {
+ found_it->second->hide();
+ sHints.erase(found_it);
+ }
+}
+
//static
void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target)
{
diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h
index b5255db95b..4ecdc9937c 100644
--- a/indra/newview/llhints.h
+++ b/indra/newview/llhints.h
@@ -41,10 +41,13 @@ class LLHints
{
public:
static void show(LLNotificationPtr hint);
+ static void hide(LLNotificationPtr hint);
static void registerHintTarget(const std::string& name, LLHandle<LLView> target);
static LLHandle<LLView> getHintTarget(const std::string& name);
private:
static LLRegistry<std::string, LLHandle<LLView> > sTargetRegistry;
+ typedef std::map<LLNotificationPtr, class LLHintPopup*> hint_map_t;
+ static hint_map_t sHints;
};
diff --git a/indra/newview/llnotificationhinthandler.cpp b/indra/newview/llnotificationhinthandler.cpp
index f5c0330b2a..a9460821b0 100644
--- a/indra/newview/llnotificationhinthandler.cpp
+++ b/indra/newview/llnotificationhinthandler.cpp
@@ -49,10 +49,16 @@ LLHintHandler::~LLHintHandler()
bool LLHintHandler::processNotification(const LLSD& notify)
{
- if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "load")
+ LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+
+ std::string sigtype = notify["sigtype"].asString();
+ if (sigtype == "add" || sigtype == "load")
{
- LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
LLHints::show(notification);
}
+ else if (sigtype == "delete")
+ {
+ LLHints::hide(notification);
+ }
return false;
}
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 0951586dd5..7eda4fad20 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -36,6 +36,7 @@
#include "llappearancemgr.h"
#include "llavataractions.h"
#include "llbutton.h"
+#include "llfirstuse.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llinventorypanel.h"
@@ -148,6 +149,8 @@ void LLSidepanelInventory::onOpen(const LLSD& key)
mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
showTaskInfoPanel();
}
+
+ LLFirstUse::inventoryOffer(false);
}
void LLSidepanelInventory::onInfoButtonClicked()
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 066b694618..7e8dc2747b 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -423,6 +423,7 @@ void LLSideTray::createButtons ()
{
mCollapseButton = createButton("",sidebar_tab->mImage,sidebar_tab->getTabTitle(),
boost::bind(&LLSideTray::onToggleCollapse, this));
+ LLHints::registerHintTarget("side_panel_btn", mCollapseButton->getHandle());
}
else
{
@@ -432,6 +433,7 @@ void LLSideTray::createButtons ()
}
}
LLHints::registerHintTarget("inventory_btn", mTabButtons["sidebar_inventory"]->getHandle());
+ LLHints::registerHintTarget("dest_guide_btn", mTabButtons["sidebar_places"]->getHandle());
}
void LLSideTray::processTriState ()
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index a6bb4d4d5f..46d148c088 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -47,6 +47,7 @@
#include "llpanelvolumepulldown.h"
#include "llfloaterregioninfo.h"
#include "llfloaterscriptdebug.h"
+#include "llhints.h"
#include "llhudicon.h"
#include "llnavigationbar.h"
#include "llkeyboard.h"
@@ -191,6 +192,8 @@ BOOL LLStatusBar::postBuild()
mMediaToggle->setClickedCallback( &LLStatusBar::onClickMediaToggle, this );
mMediaToggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this));
+ LLHints::registerHintTarget("linden_balance", getChild<LLView>("balance_bg")->getHandle());
+
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
// Adding Net Stat Graph
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index d7684e434e..8db89a7622 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6389,7 +6389,6 @@ Mute everyone?
label="Hint for Chatting"
type="hint">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
- <!--<unique/>-->
</notification>
<notification
@@ -6397,6 +6396,28 @@ Mute everyone?
label="Hint for Sitting"
type="hint">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+ </notification>
+
+ <notification
+ name="HintDestinationGuide"
+ label="Hint for Destination Guide"
+ type="hint">
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+ </notification>
+
+ <notification
+ name="HintSidePanel"
+ label="Hint for Side Panel"
+ type="hint">
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+ <!--<unique/>-->
+ </notification>
+
+ <notification
+ name="HintMove"
+ label="Hint for Movement"
+ type="hint">
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
<!--<unique/>-->
</notification>
@@ -6405,7 +6426,13 @@ Mute everyone?
label="Hint for Inventory"
type="hint">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
- <!--<unique/>-->
+ </notification>
+
+ <notification
+ name="HintLindenDollar"
+ label="Hint for L$"
+ type="hint">
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
</notification>
<global name="UnsupportedCPU">