Innitial commit. Pulled minor changes out of bulk of changes comming for multi-wearables.

This commit is contained in:
Shyotl
2012-02-16 12:00:38 -06:00
parent 9f9a4cbaaf
commit a90d7bbb46
79 changed files with 1162 additions and 1292 deletions

View File

@@ -38,6 +38,7 @@
#include <deque>
#include "llimagejpeg.h"
#include "llagentui.h"
#include "llanimationstates.h"
#include "llaudioengine.h"
#include "llavatarnamecache.h"
@@ -122,6 +123,7 @@
#include "lluploaddialog.h"
#include "llviewercamera.h"
#include "llviewerdisplay.h"
#include "llviewerfoldertype.h"
#include "llviewergenericmessage.h"
#include "llviewerinventory.h"
#include "llviewerjoystick.h"
@@ -954,8 +956,8 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
{
std::vector<LLUUID>::const_iterator it = items.begin();
std::vector<LLUUID>::const_iterator end = items.end();
uuid_vec_t::const_iterator it = items.begin();
uuid_vec_t::const_iterator end = items.end();
LLInventoryItem* item;
for(; it != end; ++it)
{
@@ -1153,7 +1155,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
{
LLChat chat;
std::string log_message;
S32 button = LLNotification::getSelectedOption(notification, response);
S32 button = LLNotificationsUtil::getSelectedOption(notification, response);
// For muting, we need to add the mute, then decline the offer.
// This must be done here because:
@@ -1177,7 +1179,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
msg->addUUIDFast(_PREHASH_ID, mTransactionID);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
gAgent.buildFullname(name);
LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, "");
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
@@ -1573,7 +1575,7 @@ bool lure_callback(const LLSD& notification, const LLSD& response)
}
else
{
option = LLNotification::getSelectedOption(notification, response);
option = LLNotificationsUtil::getSelectedOption(notification, response);
}
LLUUID from_id = notification["payload"]["from_id"].asUUID();
@@ -1604,7 +1606,7 @@ static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lu
bool goto_url_callback(const LLSD& notification, const LLSD& response)
{
std::string url = notification["payload"]["url"].asString();
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if(1 == option)
{
LLWeb::loadURL(url);
@@ -1665,6 +1667,16 @@ static std::string clean_name_from_im(const std::string& name, EInstantMessage t
}
}
void notification_display_name_callback(const LLUUID& id,
const LLAvatarName& av_name,
const std::string& name,
LLSD& substitutions,
const LLSD& payload)
{
substitutions["NAME"] = av_name.mDisplayName;
LLNotificationsUtil::add(name, substitutions, payload);
}
void process_improved_im(LLMessageSystem *msg, void **user_data)
{
if (gNoRender)
@@ -2025,7 +2037,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// if there is not a panel for this conversation (i.e. it is a new IM conversation
// initiated by the other party) then...
std::string my_name;
gAgent.buildFullname(my_name);
LLAgentUI::buildFullname(my_name);
std::string response = gSavedPerAccountSettings.getText("BusyModeResponse");
pack_instant_message(
gMessageSystem,
@@ -2211,7 +2223,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
if (has_inventory)
{
info = new LLOfferInfo;
info = new LLOfferInfo();
info->mIM = IM_GROUP_NOTICE;
info->mFromID = from_id;
@@ -2812,7 +2824,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
send_generic_message("requestonlinenotification", strings);
args["NAME"] = name;
LLNotificationsUtil::add("FriendshipAccepted", args);
LLSD payload;
payload["from_id"] = from_id;
LLAvatarNameCache::get(from_id, boost::bind(&notification_display_name_callback,
_1,
_2,
"FriendshipAccepted",
args,
payload));
}
break;
@@ -2836,7 +2855,7 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id)
if (gAgent.getBusy())
{
std::string my_name;
gAgent.buildFullname(my_name);
LLAgentUI::buildFullname(my_name);
std::string response = gSavedPerAccountSettings.getText("BusyModeResponse");
pack_instant_message(
gMessageSystem,
@@ -2854,7 +2873,7 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id)
bool callingcard_offer_callback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLUUID fid;
LLUUID from_id;
LLMessageSystem* msg = gMessageSystem;
@@ -3817,6 +3836,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
M7WindlightInterface::getInstance()->receiveReset();
// Make sure we're standing
gAgent.standUp();
// now, use the circuit info to tell simulator about us!
LL_INFOS("Messaging") << "process_teleport_finish() Enabling "
<< sim_host << " with code " << msg->mOurCircuitCode << LL_ENDL;
@@ -3950,7 +3972,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
gAgent.sendAgentSetAppearance();
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
if ( (gAgentAvatarp) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
if ( (isAgentAvatarValid()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
// [/RLVa:KB]
// if (avatarp)
{
@@ -4990,9 +5012,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
BOOL force_mouselook;
mesgsys->getBOOLFast(_PREHASH_SitTransform, _PREHASH_ForceMouselook, force_mouselook);
LLVOAvatar* avatar = gAgentAvatarp;
if (avatar && dist_vec_squared(camera_eye, camera_at) > 0.0001f)
if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > 0.0001f)
{
gAgentCamera.setSitCamera(sitObjectID, camera_eye, camera_at);
}
@@ -5006,7 +5026,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
if (object)
{
LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation());
if (!use_autopilot || (avatar && avatar->isSitting() && avatar->getRoot() == object->getRoot()))
if (!use_autopilot || isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot())
{
//we're already sitting on this object, so don't autopilot
}
@@ -5273,7 +5293,9 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
S32 credit = 0;
S32 committed = 0;
std::string desc;
LLUUID tid;
msg->getUUID("MoneyData", "TransactionID", tid);
msg->getS32("MoneyData", "MoneyBalance", balance);
msg->getS32("MoneyData", "SquareMetersCredit", credit);
msg->getS32("MoneyData", "SquareMetersCommitted", committed);
@@ -5303,9 +5325,6 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
gStatusBar->setLandCredit(credit);
gStatusBar->setLandCommitted(committed);
}
LLUUID tid;
msg->getUUID("MoneyData", "TransactionID", tid);
static std::deque<LLUUID> recent;
if(!desc.empty() && gSavedSettings.getBOOL("NotifyMoneyChange")
&& (std::find(recent.rbegin(), recent.rend(), tid) == recent.rend()))
@@ -5337,7 +5356,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
bool handle_special_notification_callback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{
@@ -5358,18 +5377,18 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess);
// we're going to throw the LLSD in there in case anyone ever wants to use it
LLNotifications::instance().add(notificationID+"_Notify", llsdBlock);
LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock);
if (regionAccess == SIM_ACCESS_MATURE)
{
if (gAgent.isTeen())
{
LLNotifications::instance().add(notificationID+"_KB", llsdBlock);
LLNotificationsUtil::add(notificationID+"_KB", llsdBlock);
return true;
}
else if (gAgent.prefersPG())
{
LLNotifications::instance().add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback);
LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback);
return true;
}
}
@@ -5377,12 +5396,12 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
{
if (!gAgent.isAdult())
{
LLNotifications::instance().add(notificationID+"_KB", llsdBlock);
LLNotificationsUtil::add(notificationID+"_KB", llsdBlock);
return true;
}
else if (gAgent.prefersPG() || gAgent.prefersMature())
{
LLNotifications::instance().add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback);
LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback);
return true;
}
}
@@ -5442,7 +5461,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
}
}
LLNotifications::instance().add(notificationID, llsdBlock);
LLNotificationsUtil::add(notificationID, llsdBlock);
return true;
}
return false;
@@ -5508,14 +5527,14 @@ void process_alert_core(const std::string& message, BOOL modal)
// Allow the server to spawn a named alert so that server alerts can be
// translated out of English.
std::string alert_name(message.substr(ALERT_PREFIX.length()));
LLNotifications::instance().add(alert_name);
LLNotificationsUtil::add(alert_name);
}
else if (message.find(NOTIFY_PREFIX) == 0)
{
// Allow the server to spawn a named notification so that server notifications can be
// translated out of English.
std::string notify_name(message.substr(NOTIFY_PREFIX.length()));
LLNotifications::instance().add(notify_name);
LLNotificationsUtil::add(notify_name);
}
else if (message[0] == '/')
{
@@ -5784,7 +5803,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
bool script_question_cb(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLMessageSystem *msg = gMessageSystem;
S32 orig = notification["payload"]["questions"].asInteger();
S32 new_questions = orig;
@@ -5836,7 +5855,7 @@ bool script_question_cb(const LLSD& notification, const LLSD& response)
{
return (notification->getPayload()["item_id"].asUUID() == blocked_id);
}
return FALSE;
return false;
}
private:
const LLUUID& blocked_id;
@@ -5848,7 +5867,7 @@ bool script_question_cb(const LLSD& notification, const LLSD& response)
if (response["Details"])
{
// respawn notification...
LLNotifications::instance().add(notification["name"], notification["substitutions"], notification["payload"]);
LLNotificationsUtil::add(notification["name"], notification["substitutions"], notification["payload"]);
// ...with description on top
LLNotificationsUtil::add("DebitPermissionDetails");
@@ -5884,7 +5903,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
// so we'll reuse the same namespace for both throttle types.
std::string throttle_name = owner_name;
std::string self_name;
gAgent.getName( self_name );
LLAgentUI::buildFullname( self_name );
if( owner_name == self_name )
{
throttle_name = taskid.getString();
@@ -5920,7 +5939,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
S32 count = 0;
LLSD args;
args["OBJECTNAME"] = object_name;
args["NAME"] = owner_name;
args["NAME"] = LLCacheName::cleanFullName(owner_name);
// check the received permission flags against each permission
for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++)
@@ -5975,7 +5994,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
//if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
{
// display the caution permissions prompt
LLNotifications::instance().add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload);
LLNotificationsUtil::add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload);
}
else
{
@@ -6254,7 +6273,7 @@ void send_simple_im(const LLUUID& to_id,
const LLUUID& id)
{
std::string my_name;
gAgent.buildFullname(my_name);
LLAgentUI::buildFullname(my_name);
send_improved_im(to_id,
my_name,
message,
@@ -6275,7 +6294,7 @@ void send_group_notice(const LLUUID& group_id,
// This will mean converting the item to a binary bucket,
// and the subject/message into a single field.
std::string my_name;
gAgent.buildFullname(my_name);
LLAgentUI::buildFullname(my_name);
// Combine subject + message into a single string.
std::ostringstream subject_and_message;
@@ -6646,7 +6665,7 @@ std::vector<LLSD> gLoadUrlList;
bool callback_load_url(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{