first pass at hints

master
Richard Nelson 2010-08-12 09:46:45 -07:00
parent 9327ef1ea0
commit be50a053ed
22 changed files with 155 additions and 3 deletions

View File

@ -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

View File

@ -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>

View File

@ -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");

View File

@ -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);

View File

@ -93,6 +93,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()
{

View File

@ -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();

View File

@ -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));

View File

@ -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

View File

@ -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:

View File

@ -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()));

View File

@ -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 ()

View File

@ -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

View File

@ -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");

View File

@ -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

View File

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -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"

View File

@ -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>