summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-08-12 09:46:45 -0700
committerRichard Nelson <none@none>2010-08-12 09:46:45 -0700
commitbe50a053ed4ae7d0b15fc20f1c6ca0973c56ffd9 (patch)
tree0346d439706c1e61f0486e8ad0135ce9e55296cf
parent9327ef1ea0107df45c4e2066b379206a51a36c25 (diff)
first pass at hints
-rw-r--r--indra/newview/CMakeLists.txt3
-rw-r--r--indra/newview/app_settings/ignorable_dialogs.xml34
-rw-r--r--indra/newview/llbottomtray.cpp4
-rw-r--r--indra/newview/llchatbar.cpp4
-rw-r--r--indra/newview/llfirstuse.cpp33
-rw-r--r--indra/newview/llfirstuse.h4
-rw-r--r--indra/newview/llmoveview.cpp7
-rw-r--r--indra/newview/llnearbychathandler.cpp6
-rw-r--r--indra/newview/llnotificationhandler.h14
-rw-r--r--indra/newview/llnotificationmanager.cpp2
-rw-r--r--indra/newview/llsidetray.cpp2
-rw-r--r--indra/newview/llviewermessage.cpp3
-rw-r--r--indra/newview/llviewerwindow.cpp1
-rw-r--r--indra/newview/llviewerwindow.h2
-rw-r--r--indra/newview/skins/default/textures/textures.xml8
-rw-r--r--indra/newview/skins/default/textures/windows/hint_arrow_down.pngbin0 -> 3239 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/hint_arrow_left.pngbin0 -> 3163 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/hint_arrow_right.pngbin0 -> 3155 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/hint_arrow_up.pngbin0 -> 3248 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/hint_background.pngbin0 -> 3930 bytes
-rw-r--r--indra/newview/skins/default/xui/en/main_view.xml7
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml24
22 files changed, 155 insertions, 3 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 3e0aa587b1..7d70b2a49b 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -230,6 +230,7 @@ set(viewer_SOURCE_FILES
llgroupiconctrl.cpp
llgrouplist.cpp
llgroupmgr.cpp
+ llhints.cpp
llhomelocationresponder.cpp
llhudeffect.cpp
llhudeffectbeam.cpp
@@ -300,6 +301,7 @@ set(viewer_SOURCE_FILES
llnotificationalerthandler.cpp
llnotificationgrouphandler.cpp
llnotificationhandlerutil.cpp
+ llnotificationhinthandler.cpp
llnotificationmanager.cpp
llnotificationofferhandler.cpp
llnotificationscripthandler.cpp
@@ -754,6 +756,7 @@ set(viewer_HEADER_FILES
llgroupiconctrl.h
llgrouplist.h
llgroupmgr.h
+ llhints.h
llhomelocationresponder.h
llhudeffect.h
llhudeffectbeam.h
diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml
index f11e6b015e..a0b9e33aa9 100644
--- a/indra/newview/app_settings/ignorable_dialogs.xml
+++ b/indra/newview/app_settings/ignorable_dialogs.xml
@@ -1,6 +1,28 @@
<?xml version="1.0" ?>
<llsd>
<map>
+ <key>FirstInventoryOffer</key>
+ <map>
+ <key>Comment</key>
+ <string>Shows hint when a person or object offers you an inventory item</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>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>FirstOverrideKeys</key>
<map>
<key>Comment</key>
@@ -23,6 +45,18 @@
<key>Value</key>
<integer>1</integer>
</map>
+
+ <key>FirstSit</key>
+ <map>
+ <key>Comment</key>
+ <string>Shows hint when someone sits for the first time</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>AboutDirectX9</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 0e5e8d0fe7..7d4c0be3fa 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -47,6 +47,7 @@
#include "llagentcamera.h"
#include "llchiclet.h"
#include "llfloatercamera.h"
+#include "llhints.h"
#include "llimfloater.h" // for LLIMFloater
#include "llnearbychatbar.h"
#include "llspeakbutton.h"
@@ -474,8 +475,9 @@ BOOL LLBottomTray::postBuild()
mBottomTrayContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
gMenuHolder->addChild(mBottomTrayContextMenu);
-
mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar");
+ LLHints::registerHintTarget("nearby_chat_bar", mNearbyChatBar->LLView::getHandle());
+
mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
mMovementButton = getChild<LLButton>("movement_btn");
mCamButton = getChild<LLButton>("camera_btn");
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index 73fbe78298..96001a07a0 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -571,6 +571,10 @@ void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type,
void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate)
{
+ // as soon as we say something, we no longer care about teaching the user
+ // how to chat
+ gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE);
+
// Look for "/20 foo" channel chats.
S32 channel = 0;
LLWString out_text = stripChannelNumber(wtext, &channel);
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 7f74b18fd0..8906525676 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -94,6 +94,39 @@ void LLFirstUse::useOverrideKeys()
}
// static
+void LLFirstUse::otherAvatarChat()
+{
+ if (gWarningSettings.getBOOL("FirstOtherChatBeforeUser"))
+ {
+ gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE);
+
+ LLNotificationsUtil::add("HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
+ }
+}
+
+// static
+void LLFirstUse::sit()
+{
+ if (gWarningSettings.getBOOL("FirstSit"))
+ {
+ gWarningSettings.setBOOL("FirstSit", FALSE);
+
+ LLNotificationsUtil::add("HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
+ }
+}
+
+// static
+void LLFirstUse::inventoryOffer()
+{
+ if (gWarningSettings.getBOOL("FirstInventoryOffer"))
+ {
+ gWarningSettings.setBOOL("FirstInventoryOffer", FALSE);
+
+ LLNotificationsUtil::add("HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
+ }
+}
+
+// static
void LLFirstUse::useSandbox()
{
if (gWarningSettings.getBOOL("FirstSandbox"))
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index 20ddef04d7..ca7290fe17 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -86,7 +86,11 @@ public:
// Sets all controls back to show the dialogs.
static void disableFirstUse();
static void resetFirstUse();
+
static void useOverrideKeys();
+ static void otherAvatarChat();
+ static void sit();
+ static void inventoryOffer();
static void useSandbox();
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index fc41137686..19615def93 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -45,7 +45,9 @@
#include "llvoavatarself.h" // to check gAgentAvatarp->isSitting()
#include "llbottomtray.h"
#include "llbutton.h"
+#include "llfirstuse.h"
#include "llfloaterreg.h"
+#include "llhints.h"
#include "lljoystickbutton.h"
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
@@ -566,6 +568,10 @@ void LLPanelStandStopFlying::setStandStopFlyingMode(EStandStopFlyingMode mode)
{
LLPanelStandStopFlying* panel = getInstance();
+ if (mode == SSFM_STAND)
+ {
+ LLFirstUse::sit();
+ }
panel->mStandButton->setVisible(SSFM_STAND == mode);
panel->mStopFlyingButton->setVisible(SSFM_STOP_FLYING == mode);
@@ -596,6 +602,7 @@ BOOL LLPanelStandStopFlying::postBuild()
mStandButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStandButtonClick, this));
mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance, TRUE));
mStandButton->setVisible(FALSE);
+ LLHints::registerHintTarget("stand_btn", mStandButton->getHandle());
mStopFlyingButton = getChild<LLButton>("stop_fly_btn");
//mStopFlyingButton->setCommitCallback(boost::bind(&LLFloaterMove::setFlyingMode, FALSE));
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 1fadb126e4..31a59146d6 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -37,6 +37,7 @@
#include "llbottomtray.h"
#include "llchatitemscontainerctrl.h"
+#include "llfirstuse.h"
#include "llfloaterscriptdebug.h"
#include "llnearbychat.h"
#include "llrecentpeople.h"
@@ -347,7 +348,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
if(chat_msg.mMuted == TRUE)
return;
if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
- LLRecentPeople::instance().add(chat_msg.mFromID);
+ {
+ LLRecentPeople::instance().add(chat_msg.mFromID);
+ LLFirstUse::otherAvatarChat();
+ }
if(chat_msg.mText.empty())
return;//don't process empty messages
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 99a1fedcf3..7b8f530178 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -269,6 +269,20 @@ protected:
void onRejectToast(LLUUID& id);
};
+/**
+ * Handler for UI hints.
+ */
+class LLHintHandler : public LLSingleton<LLHintHandler>
+{
+public:
+ LLHintHandler();
+ virtual ~LLHintHandler();
+
+ // base interface functions
+ virtual bool processNotification(const LLSD& notify);
+};
+
+
class LLHandlerUtil
{
public:
diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index 4401bb953f..86496c9d02 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -66,6 +66,7 @@ void LLNotificationManager::init()
LLNotificationChannel::buildChannel("AlertModal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal"));
LLNotificationChannel::buildChannel("IM Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "notifytoast"));
LLNotificationChannel::buildChannel("Offer", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "offer"));
+ LLNotificationChannel::buildChannel("Hints", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "hint"));
LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
@@ -74,6 +75,7 @@ void LLNotificationManager::init()
LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
LLNotifications::instance().getChannel("IM Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+ LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
mNotifyHandlers["notifytip"] = boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 7104f3934d..066b694618 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -37,6 +37,7 @@
#include "llagentcamera.h"
#include "llappviewer.h"
#include "llbottomtray.h"
+#include "llhints.h"
#include "llsidetray.h"
#include "llviewerwindow.h"
#include "llaccordionctrl.h"
@@ -430,6 +431,7 @@ void LLSideTray::createButtons ()
mTabButtons[name] = button;
}
}
+ LLHints::registerHintTarget("inventory_btn", mTabButtons["sidebar_inventory"]->getHandle());
}
void LLSideTray::processTriState ()
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a04c919310..9bb734a3d3 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -56,6 +56,7 @@
#include "llagentcamera.h"
#include "llcallingcard.h"
#include "llbuycurrencyhtml.h"
+#include "llfirstuse.h"
#include "llfloaterbuyland.h"
#include "llfloaterland.h"
#include "llfloaterregioninfo.h"
@@ -1763,6 +1764,8 @@ void inventory_offer_handler(LLOfferInfo* info)
return;
}
+ LLFirstUse::inventoryOffer();
+
// Avoid the Accept/Discard dialog if the user so desires. JC
if (gSavedSettings.getBOOL("AutoAcceptNewInventory")
&& (info->mType == LLAssetType::AT_NOTECARD
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b36af7d95b..566f4b45ba 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1529,6 +1529,7 @@ void LLViewerWindow::initBase()
mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle();
mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle();
mPopupView = main_view->getChild<LLPopupView>("popup_holder");
+ mHintHolder = main_view->getChild<LLView>("hint_holder")->getHandle();
// Constrain floaters to inside the menu and status bar regions.
gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 1e0200a075..cd1ee8a5fd 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -294,6 +294,7 @@ public:
void updateWorldViewRect(bool use_full_window=false);
LLView* getNonSideTrayView() { return mNonSideTrayView.get(); }
LLView* getFloaterViewHolder() { return mFloaterViewHolder.get(); }
+ LLView* getHintHolder() { return mHintHolder.get(); }
BOOL handleKey(KEY key, MASK mask);
void handleScrollWheel (S32 clicks);
@@ -453,6 +454,7 @@ protected:
LLHandle<LLView> mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world
LLHandle<LLView> mNonSideTrayView; // parent of world view + bottom bar, etc...everything but the side tray
LLHandle<LLView> mFloaterViewHolder; // container for floater_view
+ LLHandle<LLView> mHintHolder; // container for hints
LLPopupView* mPopupView; // container for transient popups
class LLDebugText* mDebugText; // Internal class for debug text
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 082b37d80b..9fbbfb1d2b 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -645,5 +645,11 @@ with the same filename but different name
<texture name="buy_off" file_name="widgets/buy_off.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
<texture name="buy_over" file_name="widgets/buy_over.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
<texture name="buy_press" file_name="widgets/buy_press.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
-
+
+ <texture name="hint_background" file_name="windows/hint_background.png" preload="false" scale.left="8" scale.top="70" scale.right="195" scale.bottom="11"/>
+ <texture name="hint_arrow_left" file_name="windows/hint_arrow_left.png" preload="false"/>
+ <texture name="hint_arrow_right" file_name="windows/hint_arrow_right.png" preload="false"/>
+ <texture name="hint_arrow_up" file_name="windows/hint_arrow_up.png" preload="false"/>
+ <texture name="hint_arrow_down" file_name="windows/hint_arrow_down.png" preload="false"/>
+
</textures>
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_down.png b/indra/newview/skins/default/textures/windows/hint_arrow_down.png
new file mode 100644
index 0000000000..11ab3c2d0c
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_down.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_left.png b/indra/newview/skins/default/textures/windows/hint_arrow_left.png
new file mode 100644
index 0000000000..e5c597a550
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_left.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_right.png b/indra/newview/skins/default/textures/windows/hint_arrow_right.png
new file mode 100644
index 0000000000..3f89187e13
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_right.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_up.png b/indra/newview/skins/default/textures/windows/hint_arrow_up.png
new file mode 100644
index 0000000000..1050097efb
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_up.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_background.png b/indra/newview/skins/default/textures/windows/hint_background.png
new file mode 100644
index 0000000000..0839a95205
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/hint_background.png
Binary files differ
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index a1ca910cbb..0bf5717de8 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -208,6 +208,13 @@
bottom="-1"
height="11" />
</panel>
+ <view top="0"
+ left="0"
+ width="1024"
+ height="768"
+ name="hint_holder"
+ mouse_opaque="false"
+ follows="all"/>
<menu_holder top="0"
follows="all"
height="768"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 95ee374e39..962e3ac582 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6376,6 +6376,30 @@ Mute everyone?
<unique/>
</notification>
+ <notification
+ name="HintChat"
+ 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
+ name="HintSit"
+ 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
+ <!--<unique/>-->
+ </notification>
+
+ <notification
+ name="HintInventory"
+ 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>
+
<global name="UnsupportedCPU">
- Your CPU speed does not meet the minimum requirements.
</global>