Added script info button to top objects floater (FIRE-2206)

Ansariel 2012-04-07 12:48:37 +02:00
parent 74f4bfd44e
commit b0e9858b4e
4 changed files with 40 additions and 7 deletions

View File

@ -52,6 +52,7 @@
#include "llviewerwindow.h"
#include "llavataractions.h"
#include "llviewercontrol.h"
//LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL;
@ -92,6 +93,8 @@ LLFloaterTopObjects::LLFloaterTopObjects(const LLSD& key)
mCommitCallbackRegistrar.add("TopObjects.Kick", boost::bind(&LLFloaterTopObjects::onKick, this));
// <FS:Ansariel> Show profile
mCommitCallbackRegistrar.add("TopObjects.Profile", boost::bind(&LLFloaterTopObjects::onProfile, this));
// <FS:Ansariel> Script info
mCommitCallbackRegistrar.add("TopObjects.ScriptInfo", boost::bind(&LLFloaterTopObjects::onScriptInfo, this));
}
LLFloaterTopObjects::~LLFloaterTopObjects()
@ -594,4 +597,18 @@ void LLFloaterTopObjects::onAvatarCheck(const LLUUID& avatar_id, LLAvatarName av
getChild<LLButton>("estate_kick_btn")->setEnabled(isAvatar);
}
}
// </FS:Ansariel> Enable avatar-specific buttons if current selection is an avatar
// </FS:Ansariel> Enable avatar-specific buttons if current selection is an avatar
// <FS:Ansariel> Script info
void LLFloaterTopObjects::onScriptInfo()
{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
if (!list) return;
LLScrollListItem* first_selected = list->getFirstSelected();
if (!first_selected) return;
const LLUUID& objectId = first_selected->getUUID();
LLAvatarActions::getScriptInfo(objectId);
}
// </FS:Ansariel> Script info

View File

@ -75,6 +75,8 @@ private:
void onKick();
// <FS:Ansariel> Show profile
void onProfile();
// <FS:Ansariel> Script info
void onScriptInfo();
// <FS:Ansariel> Enable avatar-specific buttons if current selection is an avatar
void onAvatarCheck(const LLUUID& avatar_id, const LLAvatarName av_name);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="top_objects" title="Top-Objekte">
<floater name="top_objects" title="TOP-OBJEKTE">
<floater.string name="top_scripts_title">
Top-Skripts
TOP-SKRIPTE
</floater.string>
<floater.string name="top_scripts_text">
[COUNT] Skripts benötigen insgesamt [TIME] ms
@ -13,7 +13,7 @@
Mono-Uhrzeit:
</floater.string>
<floater.string name="top_colliders_title">
Top-Kollisionsobjekte
TOP-KOLLISIONSOBJEKTE
</floater.string>
<floater.string name="top_colliders_text">
Top [COUNT] Objekte mit vielen potenziellen Kollisionen
@ -58,5 +58,6 @@
<button label="Profil" left="150" name="profile_btn" width="134"/>
<button label="Auswahl deaktivieren" name="disable_selected_btn" width="134"/>
<button label="Alle deaktivieren" left="150" name="disable_all_btn" width="134"/>
<button label="Skript-Info" left="150" name="script_info_btn" width="134"/>
<button label="Estate: Hinauswerfen" left="150" name="estate_kick_btn" width="134"/>
</floater>

View File

@ -8,11 +8,11 @@
min_width="450"
name="top_objects"
help_topic="top_objects"
title="Top Objects"
title="TOP OBJECTS"
width="800">
<floater.string
name="top_scripts_title">
Top Scripts
TOP SCRIPTS
</floater.string>
<floater.string
name="top_scripts_text">
@ -28,7 +28,7 @@
</floater.string>
<floater.string
name="top_colliders_title">
Top Colliders
TOP COLLIDERS
</floater.string>
<floater.string
name="top_colliders_text">
@ -278,6 +278,19 @@
<button.commit_callback
function="TopObjects.DisableAll" />
</button>
<button
enabled_control="UseLSLBridge"
follows="bottom|left"
height="23"
label="Script Info"
layout="topleft"
left_pad="10"
name="script_info_btn"
top_delta="0"
width="130">
<button.commit_callback
function="TopObjects.ScriptInfo" />
</button>
<button
enabled="false"
follows="bottom|left"