summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llagentcamera.cpp10
-rw-r--r--indra/newview/llappviewer.cpp153
-rw-r--r--indra/newview/llappviewer.h1
-rw-r--r--indra/newview/llchathistory.cpp18
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp19
-rw-r--r--indra/newview/llfloaterpreference.cpp2
-rw-r--r--indra/newview/llviewermenu.cpp8
-rw-r--r--indra/newview/llviewermenu.h2
-rw-r--r--indra/newview/skins/default/xui/en/menu_object_icon.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_objectim.xml7
-rw-r--r--indra/newview/skins/default/xui/en/panel_people.xml21
12 files changed, 125 insertions, 129 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0614be8bf6..f939e94fc3 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1159,7 +1159,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>ShowDiscordActivityDetails</key>
<map>
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index d4767e18af..86909b6989 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1753,7 +1753,6 @@ F32 LLAgentCamera::calcCameraFOVZoomFactor()
LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
{
// Compute base camera position and look-at points.
- F32 camera_land_height;
LLVector3d frame_center_global = !isAgentAvatarValid() ?
gAgent.getPositionGlobal() :
gAgent.getPosGlobalFromAgent(getAvatarRootPosition());
@@ -1990,10 +1989,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
}
}
- // Don't let camera go underground
- F32 camera_min_off_ground = getCameraMinOffGround();
- camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global);
- F32 minZ = llmax(F_ALMOST_ZERO, camera_land_height + camera_min_off_ground);
+ // Don't let camera go underground if constrained
+ // If not constrained, permit going 1000m below 0, use case: retrieving objects
+ F32 camera_min_off_ground = getCameraMinOffGround(); // checks isDisableCameraConstraints
+ F32 camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global);
+ F32 minZ = camera_land_height + camera_min_off_ground;
if (camera_position_global.mdV[VZ] < minZ)
{
camera_position_global.mdV[VZ] = minZ;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 28b40543e9..f507be9225 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -5914,100 +5914,21 @@ void LLAppViewer::initDiscordSocial()
gDiscordPartyMaxSize = 0;
gDiscordTimestampsStart = time(nullptr);
gDiscordClient = std::make_shared<discordpp::Client>();
- gDiscordClient->SetStatusChangedCallback([](discordpp::Client::Status status, discordpp::Client::Error, int32_t) {
- if (status == discordpp::Client::Status::Ready)
- {
- updateDiscordActivity();
- }
- });
- if (gSavedSettings.getBOOL("EnableDiscord"))
- {
- auto credential = gSecAPIHandler->loadCredential("Discord");
- if (credential.notNull())
- {
- gDiscordClient->UpdateToken(discordpp::AuthorizationTokenType::Bearer, credential->getAuthenticator()["token"].asString(), [](discordpp::ClientResult result) {
- if (result.Successful())
- gDiscordClient->Connect();
- else
- LL_WARNS("Discord") << result.Error() << LL_ENDL;
- });
- }
- else
- {
- LL_WARNS("Discord") << "Integration was enabled, but no credentials. Disabling integration." << LL_ENDL;
- gSavedSettings.setBOOL("EnableDiscord", false);
- }
- }
+ gDiscordClient->SetApplicationId(1394782217405862001);
+ updateDiscordActivity();
}
-void LLAppViewer::toggleDiscordIntegration(const LLSD& value)
+void LLAppViewer::updateDiscordActivity()
{
- static const uint64_t APPLICATION_ID = 1394782217405862001;
- if (value.asBoolean())
- {
- discordpp::AuthorizationArgs args{};
- args.SetClientId(APPLICATION_ID);
- args.SetScopes(discordpp::Client::GetDefaultPresenceScopes());
- auto codeVerifier = gDiscordClient->CreateAuthorizationCodeVerifier();
- args.SetCodeChallenge(codeVerifier.Challenge());
- gDiscordClient->Authorize(args, [codeVerifier](auto result, auto code, auto redirectUri) {
- if (result.Successful())
- {
- gDiscordClient->GetToken(APPLICATION_ID, code, codeVerifier.Verifier(), redirectUri, [](discordpp::ClientResult result, std::string accessToken, std::string, discordpp::AuthorizationTokenType, int32_t, std::string) {
- if (result.Successful())
- {
- gDiscordClient->UpdateToken(discordpp::AuthorizationTokenType::Bearer, accessToken, [accessToken](discordpp::ClientResult result) {
- if (result.Successful())
- {
- LLSD authenticator = LLSD::emptyMap();
- authenticator["token"] = accessToken;
- gSecAPIHandler->saveCredential(gSecAPIHandler->createCredential("Discord", LLSD::emptyMap(), authenticator), true);
- gDiscordClient->Connect();
- }
- else
- {
- LL_WARNS("Discord") << result.Error() << LL_ENDL;
- }
- });
- }
- else
- {
- LL_WARNS("Discord") << result.Error() << LL_ENDL;
- }
- });
- }
- else
- {
- LL_WARNS("Discord") << result.Error() << LL_ENDL;
- gSavedSettings.setBOOL("EnableDiscord", false);
- }
- });
- }
- else
+ LL_PROFILE_ZONE_SCOPED;
+
+ static LLCachedControl<bool> integration_enabled(gSavedSettings, "EnableDiscord", true);
+ if (!integration_enabled)
{
- gDiscordClient->Disconnect();
- auto credential = gSecAPIHandler->loadCredential("Discord");
- if (credential.notNull())
- {
- gDiscordClient->RevokeToken(APPLICATION_ID, credential->getAuthenticator()["token"].asString(), [](discordpp::ClientResult result) {
- if (result.Successful())
- LL_INFOS("Discord") << "Access token successfully revoked." << LL_ENDL;
- else
- LL_WARNS("Discord") << "No access token to revoke." << LL_ENDL;
- });
- auto cred = new LLCredential("Discord");
- gSecAPIHandler->deleteCredential(cred);
- }
- else
- {
- LL_WARNS("Discord") << "Credentials are already nonexistent." << LL_ENDL;
- }
+ gDiscordClient->ClearRichPresence();
+ return;
}
-}
-void LLAppViewer::updateDiscordActivity()
-{
- LL_PROFILE_ZONE_SCOPED;
discordpp::Activity activity;
activity.SetType(discordpp::ActivityTypes::Playing);
discordpp::ActivityTimestamps timestamps;
@@ -6035,37 +5956,39 @@ void LLAppViewer::updateDiscordActivity()
activity.SetDetails(gDiscordActivityDetails);
}
+ auto agent_pos_region = gAgent.getPositionAgent();
+ S32 pos_x = S32(agent_pos_region.mV[VX] + 0.5f);
+ S32 pos_y = S32(agent_pos_region.mV[VY] + 0.5f);
+ S32 pos_z = S32(agent_pos_region.mV[VZ] + 0.5f);
+ F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared();
+ const F32 FLY_CUTOFF = 6.f;
+ const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF;
+ const F32 WALK_CUTOFF = 1.5f;
+ const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF;
+ if (velocity_mag_sq > FLY_CUTOFF_SQ)
+ {
+ pos_x -= pos_x % 4;
+ pos_y -= pos_y % 4;
+ }
+ else if (velocity_mag_sq > WALK_CUTOFF_SQ)
+ {
+ pos_x -= pos_x % 2;
+ pos_y -= pos_y % 2;
+ }
+
+ std::string location = "Hidden Region";
static LLCachedControl<bool> show_state(gSavedSettings, "ShowDiscordActivityState", false);
if (show_state)
{
- auto agent_pos_region = gAgent.getPositionAgent();
- S32 pos_x = S32(agent_pos_region.mV[VX] + 0.5f);
- S32 pos_y = S32(agent_pos_region.mV[VY] + 0.5f);
- S32 pos_z = S32(agent_pos_region.mV[VZ] + 0.5f);
- F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared();
- const F32 FLY_CUTOFF = 6.f;
- const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF;
- const F32 WALK_CUTOFF = 1.5f;
- const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF;
- if (velocity_mag_sq > FLY_CUTOFF_SQ)
- {
- pos_x -= pos_x % 4;
- pos_y -= pos_y % 4;
- }
- else if (velocity_mag_sq > WALK_CUTOFF_SQ)
- {
- pos_x -= pos_x % 2;
- pos_y -= pos_y % 2;
- }
- auto location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z);
- activity.SetState(location);
-
- discordpp::ActivityParty party;
- party.SetId(location);
- party.SetCurrentSize(gDiscordPartyCurrentSize);
- party.SetMaxSize(gDiscordPartyMaxSize);
- activity.SetParty(party);
+ location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z);
}
+ activity.SetState(location);
+
+ discordpp::ActivityParty party;
+ party.SetId(location);
+ party.SetCurrentSize(gDiscordPartyCurrentSize);
+ party.SetMaxSize(gDiscordPartyMaxSize);
+ activity.SetParty(party);
gDiscordClient->UpdateRichPresence(activity, [](discordpp::ClientResult) {});
}
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 14e96afe94..132d7bfe25 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -253,7 +253,6 @@ public:
#ifdef LL_DISCORD
static void initDiscordSocial();
- static void toggleDiscordIntegration(const LLSD& value);
static void updateDiscordActivity();
static void updateDiscordPartyCurrentSize(int32_t size);
static void updateDiscordPartyMaxSize(int32_t size);
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index a48e22bc73..4d8a49ac0e 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -189,7 +189,14 @@ public:
std::string url = "secondlife://" + mObjectData["slurl"].asString();
LLUrlAction::teleportToLocation(url);
}
-
+ else if (level == "obj_zoom_in")
+ {
+ LLUUID obj_id = mObjectData["object_id"];
+ if (obj_id.notNull())
+ {
+ handle_zoom_to_object(obj_id);
+ }
+ }
}
bool onObjectIconContextMenuItemVisible(const LLSD& userdata)
@@ -203,6 +210,15 @@ public:
{
return !LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat);
}
+ else if (level == "obj_zoom_in")
+ {
+ LLUUID obj_id = mObjectData["object_id"];
+ if (obj_id.notNull())
+ {
+ return nullptr != gObjectList.findObject(mAvatarID);
+ }
+ return false;
+ }
return false;
}
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index 550dfeb802..5ac4ce0d52 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -37,6 +37,8 @@
#include "lllocalcliprect.h"
#include "lltrans.h"
#include "llfloaterimnearbychat.h"
+#include "llfloaterworldmap.h"
+#include "llviewermenu.h"
#include "llviewercontrol.h"
#include "llagentdata.h"
@@ -75,6 +77,23 @@ public:
return true;
}
+ if (verb == "zoomin")
+ {
+ if (!handle_zoom_to_object(object_id) && params.size() > 2)
+ {
+ // zoom faled, show location
+ // secondlife:///app/object/object_id/zoomin/{LOCATION}/{COORDS} SLapp
+ const std::string region_name = LLURI::unescape(params[0].asString());
+ S32 x = (params.size() > 1) ? params[1].asInteger() : 128;
+ S32 y = (params.size() > 2) ? params[2].asInteger() : 128;
+ S32 z = (params.size() > 3) ? params[3].asInteger() : 0;
+
+ LLFloaterWorldMap::getInstance()->trackURL(region_name, x, y, z);
+ LLFloaterReg::showInstance("world_map", "center");
+ }
+ return true;
+ }
+
return false;
}
};
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index c84728248c..42d45719f5 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -367,7 +367,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.DeleteTranscripts", boost::bind(&LLFloaterPreference::onDeleteTranscripts, this));
mCommitCallbackRegistrar.add("UpdateFilter", boost::bind(&LLFloaterPreference::onUpdateFilterTerm, this, false)); // <FS:ND/> Hook up for filtering
#ifdef LL_DISCORD
- gSavedSettings.getControl("EnableDiscord")->getCommitSignal()->connect(boost::bind(&LLAppViewer::toggleDiscordIntegration, _2));
+ gSavedSettings.getControl("EnableDiscord")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity));
gSavedSettings.getControl("ShowDiscordActivityDetails")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity));
gSavedSettings.getControl("ShowDiscordActivityState")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity));
#endif
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 44157d2d2d..9625df5b7b 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6485,7 +6485,7 @@ void handle_look_at_selection(const LLSD& param)
}
}
-void handle_zoom_to_object(const LLUUID& object_id)
+bool handle_zoom_to_object(const LLUUID& object_id)
{
const F32 PADDING_FACTOR = 2.f;
@@ -6503,12 +6503,14 @@ void handle_zoom_to_object(const LLUUID& object_id)
obj_to_cam.normVec();
- LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent());
+ LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent());
- gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance),
+ gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance),
object_center_global,
object_id );
+ return true;
}
+ return false;
}
class LLAvatarInviteToGroup : public view_listener_t
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 68c3dbc126..522c7e8109 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -73,7 +73,7 @@ void handle_buy();
void handle_take(bool take_separate = false);
void handle_take_copy();
void handle_look_at_selection(const LLSD& param);
-void handle_zoom_to_object(const LLUUID& object_id);
+bool handle_zoom_to_object(const LLUUID& object_id);
void handle_object_return();
void handle_object_delete();
void handle_object_edit();
diff --git a/indra/newview/skins/default/xui/en/menu_object_icon.xml b/indra/newview/skins/default/xui/en/menu_object_icon.xml
index f3e520700b..d43ce26e56 100644
--- a/indra/newview/skins/default/xui/en/menu_object_icon.xml
+++ b/indra/newview/skins/default/xui/en/menu_object_icon.xml
@@ -41,6 +41,17 @@
<menu_item_separator
layout="topleft" />
<menu_item_call
+ label="Zoom in"
+ layout="topleft"
+ name="zoom_in">
+ <menu_item_call.on_click
+ function="ObjectIcon.Action"
+ parameter="obj_zoom_in" />
+ <menu_item_call.on_enable
+ function="ObjectIcon.Visible"
+ parameter="obj_zoom_in" />
+ </menu_item_call>
+ <menu_item_call
label="Show on Map"
layout="topleft"
name="show_on_map">
diff --git a/indra/newview/skins/default/xui/en/menu_url_objectim.xml b/indra/newview/skins/default/xui/en/menu_url_objectim.xml
index 1874c01f8d..fb6081e1fb 100644
--- a/indra/newview/skins/default/xui/en/menu_url_objectim.xml
+++ b/indra/newview/skins/default/xui/en/menu_url_objectim.xml
@@ -26,6 +26,13 @@
<menu_item_separator
layout="topleft" />
<menu_item_call
+ label="Zoom in"
+ layout="topleft"
+ name="zoom_in">
+ <menu_item_call.on_click
+ function="Url.ZoomInObject" />
+ </menu_item_call>
+ <menu_item_call
label="Show on Map"
layout="topleft"
name="show_on_map">
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index c31e6c94ea..1be34550fa 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -177,6 +177,25 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip
function="People.DelFriend" />
</dnd_button>
</panel>
+ <slider
+ control_name="NearMeRange"
+ decimal_digits="0"
+ increment="1"
+ follows="left|top"
+ left="5"
+ min_val="0"
+ max_val="4096"
+ label="Range:"
+ name="near_me_range"
+ tool_tip="Nearby people range"
+ width="230"/>
+ <text
+ type="string"
+ follows="left|top"
+ left_delta="225"
+ name="near_me_range_text2">
+ m
+ </text>
<layout_stack
clip="false"
follows="all"
@@ -216,7 +235,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip
<avatar_list
allow_select="true"
follows="all"
- height="211"
+ height="197"
ignore_online_status="true"
layout="topleft"
left="3"