Added myraid of additional options to top scripts/top collisions floaters.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "llagent.h"
|
||||
#include "llbutton.h"
|
||||
#include "llfloatergodtools.h"
|
||||
#include "llfloateravatarinfo.h"
|
||||
#include "llparcel.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "lllineeditor.h"
|
||||
@@ -50,6 +51,10 @@
|
||||
#include "llviewerregion.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
|
||||
void cmdline_printchat(std::string message);
|
||||
|
||||
LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL;
|
||||
|
||||
@@ -104,6 +109,11 @@ BOOL LLFloaterTopObjects::postBuild()
|
||||
childSetAction("disable_all_btn", onDisableAll, this);
|
||||
childSetAction("refresh_btn", onRefresh, this);
|
||||
|
||||
childSetAction("lagwarning", onLagWarningBtn, this);
|
||||
childSetAction("profile", onProfileBtn, this);
|
||||
childSetAction("kick", onKickBtn, this);
|
||||
childSetAction("tpto", onTPBtn, this);
|
||||
|
||||
|
||||
childSetAction("filter_object_btn", onGetByObjectNameClicked, this);
|
||||
childSetAction("filter_owner_btn", onGetByOwnerNameClicked, this);
|
||||
@@ -202,6 +212,10 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
|
||||
element["columns"][1]["column"] = "name";
|
||||
element["columns"][1]["value"] = name_buf;
|
||||
element["columns"][1]["font"] = "SANSSERIF";
|
||||
if (name_buf == owner_buf)
|
||||
{
|
||||
element["columns"][1]["color"] = LLColor4::red.getValue();
|
||||
}
|
||||
element["columns"][2]["column"] = "owner";
|
||||
element["columns"][2]["value"] = owner_buf;
|
||||
element["columns"][2]["font"] = "SANSSERIF";
|
||||
@@ -292,6 +306,28 @@ void LLFloaterTopObjects::onDoubleClickObjectsList(void* data)
|
||||
{
|
||||
LLFloaterTopObjects* self = (LLFloaterTopObjects*)data;
|
||||
self->showBeacon();
|
||||
self->lookAtAvatar();
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::lookAtAvatar()
|
||||
{
|
||||
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
|
||||
if (!list) return;
|
||||
LLScrollListItem* first_selected = list->getFirstSelected();
|
||||
if (!first_selected) return;
|
||||
LLUUID taskid = first_selected->getUUID();
|
||||
|
||||
LLVOAvatar* voavatar = gObjectList.findAvatar(taskid);
|
||||
if(voavatar)
|
||||
{
|
||||
gAgentCamera.setFocusOnAvatar(FALSE, FALSE);
|
||||
gAgentCamera.changeCameraToThirdPerson();
|
||||
gAgentCamera.setFocusGlobal(voavatar->getPositionGlobal(),taskid);
|
||||
gAgentCamera.setCameraPosAndFocusGlobal(voavatar->getPositionGlobal()
|
||||
+ LLVector3d(3.5,1.35,0.75) * voavatar->getRotation(),
|
||||
voavatar->getPositionGlobal(),
|
||||
taskid );
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -381,6 +417,126 @@ void LLFloaterTopObjects::onReturnSelected(void* data)
|
||||
sInstance->doToObjects(ACTION_RETURN, false);
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::onLagWarningBtn(void* data)
|
||||
{
|
||||
LLFloaterTopObjects* self = (LLFloaterTopObjects*)data;
|
||||
|
||||
self->onLagWarning(data);
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::onLagWarning(void* data)
|
||||
{
|
||||
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
|
||||
if (!list) return;
|
||||
LLScrollListItem* first_selected = list->getFirstSelected();
|
||||
if (!first_selected) return;
|
||||
LLUUID taskid = first_selected->getUUID();
|
||||
|
||||
std::string name = first_selected->getColumn(1)->getValue().asString();
|
||||
std::string score = first_selected->getColumn(0)->getValue().asString();
|
||||
|
||||
std::istringstream stm;
|
||||
stm.str(score);
|
||||
F32 f_score;
|
||||
stm >> f_score;
|
||||
F32 percentage = 100.f * (f_score / 22);
|
||||
|
||||
std::string message = llformat(
|
||||
"Hello %s, you are receiving this automated message because you are wearing heavily scripted attachments/HUDs, "
|
||||
"causing excessive script lag (%5.2f ms, that's ca. %5.2f%% of the region's resources.)\n\n"
|
||||
"Please remove resizer scripts or attachments to reduce your script time, thank you.",
|
||||
name.c_str(),
|
||||
(F32)f_score,
|
||||
(F32)percentage
|
||||
);
|
||||
|
||||
std::string my_name;
|
||||
gAgent.buildFullname(my_name);
|
||||
|
||||
cmdline_printchat(llformat("Script time warning sent to %s: (%5.2f ms)",
|
||||
name.c_str(),(F32)f_score));
|
||||
|
||||
send_improved_im(LLUUID(taskid),
|
||||
my_name,
|
||||
message,
|
||||
IM_ONLINE,
|
||||
IM_NOTHING_SPECIAL,
|
||||
LLUUID::null,
|
||||
NO_TIMESTAMP,
|
||||
(U8*)EMPTY_BINARY_BUCKET,
|
||||
EMPTY_BINARY_BUCKET_SIZE);
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::onProfileBtn(void* data)
|
||||
{
|
||||
LLFloaterTopObjects* self = (LLFloaterTopObjects*)data;
|
||||
self->onProfile(data);
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::onProfile(void* data)
|
||||
{
|
||||
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
|
||||
if (!list) return;
|
||||
LLScrollListItem* first_selected = list->getFirstSelected();
|
||||
if (!first_selected) return;
|
||||
LLUUID taskid = first_selected->getUUID();
|
||||
LLFloaterAvatarInfo::showFromDirectory(taskid);
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::onKickBtn(void* data)
|
||||
{
|
||||
LLFloaterTopObjects* self = (LLFloaterTopObjects*)data;
|
||||
self->onKick(data);
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::onKick(void* data)
|
||||
{
|
||||
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
|
||||
if (!list) return;
|
||||
LLScrollListItem* first_selected = list->getFirstSelected();
|
||||
if (!first_selected) return;
|
||||
LLUUID taskid = first_selected->getUUID();
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessage("EstateOwnerMessage");
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used
|
||||
msg->nextBlock("MethodData");
|
||||
msg->addString("Method", "kickestate");
|
||||
msg->addUUID("Invoice", LLUUID::null);
|
||||
msg->nextBlock("ParamList");
|
||||
msg->addString("Parameter", taskid.asString().c_str());
|
||||
msg->sendReliable(gAgent.getRegionHost());
|
||||
}
|
||||
void LLFloaterTopObjects::onTPBtn(void* data)
|
||||
{
|
||||
LLFloaterTopObjects* self = (LLFloaterTopObjects*)data;
|
||||
self->onTP(data);
|
||||
}
|
||||
|
||||
void LLFloaterTopObjects::onTP(void* data)
|
||||
{
|
||||
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
|
||||
if (!list) return;
|
||||
LLScrollListItem* first_selected = list->getFirstSelected();
|
||||
if (!first_selected) return;
|
||||
|
||||
std::string name = first_selected->getColumn(1)->getValue().asString();
|
||||
std::string pos_string = first_selected->getColumn(3)->getValue().asString();
|
||||
|
||||
F32 x, y, z;
|
||||
S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z);
|
||||
if (matched != 3) return;
|
||||
|
||||
LLVector3 pos_agent(x, y, z);
|
||||
LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent);
|
||||
|
||||
gAgent.teleportViaLocation( pos_global );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//static
|
||||
bool LLFloaterTopObjects::callbackDisableAll(const LLSD& notification, const LLSD& response)
|
||||
|
||||
@@ -56,6 +56,11 @@ public:
|
||||
|
||||
static void setMode(U32 mode) { if (sInstance) sInstance->mCurrentMode = mode; }
|
||||
|
||||
void onProfile(void* data);
|
||||
void onKick(void* data);
|
||||
void onTP(void* data);
|
||||
void onLagWarning(void* data);
|
||||
|
||||
private:
|
||||
LLFloaterTopObjects();
|
||||
~LLFloaterTopObjects();
|
||||
@@ -64,6 +69,7 @@ private:
|
||||
|
||||
static void onCommitObjectsList(LLUICtrl* ctrl, void* data);
|
||||
static void onDoubleClickObjectsList(void* data);
|
||||
void lookAtAvatar();
|
||||
static void onClickShowBeacon(void* data);
|
||||
|
||||
void doToObjects(int action, bool all);
|
||||
@@ -73,6 +79,11 @@ private:
|
||||
static void onDisableAll(void* data);
|
||||
static void onDisableSelected(void* data);
|
||||
|
||||
static void onProfileBtn(void* data);
|
||||
static void onKickBtn(void* data);
|
||||
static void onTPBtn(void* data);
|
||||
static void onLagWarningBtn(void* data);
|
||||
|
||||
static bool callbackReturnAll(const LLSD& notification, const LLSD& response);
|
||||
static bool callbackDisableAll(const LLSD& notification, const LLSD& response);
|
||||
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true"
|
||||
height="350" min_height="300" min_width="450" name="top_objects"
|
||||
title="loading..." width="550">
|
||||
height="400" min_height="300" min_width="580" name="top_objects"
|
||||
title="loading..." width="580">
|
||||
<text bottom="-50" follows="left|top" font="SansSerif" height="20" left="10"
|
||||
name="title_text" width="400">
|
||||
Loading...
|
||||
</text>
|
||||
<scroll_list bottom_delta="-150" draw_border="true" draw_heading="true"
|
||||
follows="left|top|bottom|right" height="150" left="10" multi_select="true"
|
||||
name="objects_list" width="530">
|
||||
<column label="Score" name="score" width="55" />
|
||||
<column label="Name" name="name" width="140"/>
|
||||
<column label="Owner" name="owner" width="105" />
|
||||
<column label="Location" name="location" width="130" />
|
||||
<column label="Time" name="time" width="100" />
|
||||
<column label="Mono Time" name="mono_time" width="55" />
|
||||
</scroll_list>
|
||||
<scroll_list bottom_delta="-200" draw_border="true" draw_heading="true"
|
||||
follows="left|top|bottom|right" height="200" left="10" multi_select="true"
|
||||
name="objects_list" width="560">
|
||||
<column label="Score" name="score" width="43" />
|
||||
<column label="Name" name="name" dynamicwidth="true" />
|
||||
<column label="Owner" name="owner" width="100" />
|
||||
<column label="Location" name="location" width="100" />
|
||||
<column label="Time" name="time" width="105" />
|
||||
<column label="Mono Time" name="mono_time" width="50" />
|
||||
<column label="URLs" name="URLs" width="50" />
|
||||
</scroll_list>
|
||||
<text bottom_delta="-30" follows="left|bottom" font="SansSerifSmall" height="20"
|
||||
left="10" name="id_text" width="100">
|
||||
Object ID:
|
||||
</text>
|
||||
<line_editor bottom_delta="3" enabled="false"
|
||||
follows="left|bottom|right" font="SansSerifSmall" height="20" left="80"
|
||||
name="id_editor" width="350" />
|
||||
name="id_editor" width="385" />
|
||||
<button bottom_delta="0" follows="bottom|right" height="20" label="Show Beacon"
|
||||
name="show_beacon_btn" right="-10" width="100" />
|
||||
<text bottom_delta="-30" follows="left|bottom" font="SansSerifSmall" height="20"
|
||||
@@ -31,7 +32,7 @@
|
||||
</text>
|
||||
<line_editor bottom_delta="3" enabled="true"
|
||||
follows="left|bottom|right" font="SansSerifSmall" height="20" left="80"
|
||||
name="object_name_editor" width="350" />
|
||||
name="object_name_editor" width="385" />
|
||||
<button bottom_delta="0" follows="bottom|right" height="20" label="Filter"
|
||||
name="filter_object_btn" right="-10" width="100" />
|
||||
<text bottom_delta="-30" follows="left|bottom" font="SansSerifSmall" height="20"
|
||||
@@ -40,17 +41,26 @@
|
||||
</text>
|
||||
<line_editor bottom_delta="3" enabled="true"
|
||||
follows="left|bottom|right" font="SansSerifSmall" height="20" left="80"
|
||||
name="owner_name_editor" width="350" />
|
||||
name="owner_name_editor" width="385" />
|
||||
<button bottom_delta="0" follows="bottom|right" height="20" label="Filter"
|
||||
name="filter_owner_btn" right="-10" width="100" />
|
||||
<button bottom="35" follows="bottom|left" height="20" label="Return Selected" left="10"
|
||||
name="return_selected_btn" width="130" />
|
||||
<button bottom="35" follows="bottom|left" height="20" label="Return All" left="150"
|
||||
name="return_all_btn" width="130" />
|
||||
name="return_selected_btn" width="110" />
|
||||
<button bottom="35" follows="bottom|left" height="20" label="Return All" left="125"
|
||||
name="return_all_btn" width="110" />
|
||||
<button bottom="35" follows="bottom|left" height="20" label="Lag Warning" left="240"
|
||||
name="lagwarning" width="110" />
|
||||
<button bottom="35" follows="bottom|left" height="20" label="Kick" left="355"
|
||||
name="kick" width="110" />
|
||||
<button bottom="10" follows="bottom|left" height="20" label="Disable Selected"
|
||||
left="10" name="disable_selected_btn" width="130" />
|
||||
<button bottom="10" follows="bottom|left" height="20" label="Disable All" left="150"
|
||||
name="disable_all_btn" width="130" />
|
||||
left="10" name="disable_selected_btn" width="110" />
|
||||
<button bottom="10" follows="bottom|left" height="20" label="Disable All" left="125"
|
||||
name="disable_all_btn" width="110" />
|
||||
<button bottom="10" follows="bottom|left" height="20" label="Profile" left="240"
|
||||
name="profile" width="110" />
|
||||
<button bottom="10" follows="bottom|left" height="20" label="TP to" left="355"
|
||||
name="tpto" width="110" />
|
||||
|
||||
<button bottom="35" follows="bottom|right" height="20" label="Refresh"
|
||||
name="refresh_btn" right="-10" width="100" />
|
||||
<string name="top_scripts_title">
|
||||
|
||||
Reference in New Issue
Block a user