EXT-1325 Texture Picker does not open

EXT-1264 'Zoom in' world context menu opens IM session
reviewed by Richard
meow-7.2.2
Leyla Farazha 2009-10-08 00:31:01 +00:00
parent 3a6a18ee30
commit 6f66cdf7a1
8 changed files with 84 additions and 43 deletions

View File

@ -109,10 +109,11 @@ private:
void onClickPay();
void onClickBlock();
void onClickReport();
void onClickZoomIn();
void onClickFindOnMap();
bool onVisibleFindOnMap();
bool onVisibleGodMode();
void onClickMuteVolume();
void onFindOnMap();
void onVolumeChange(const LLSD& data);
// Callback for gCacheName to look up avatar name
@ -196,7 +197,8 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd)
mCommitCallbackRegistrar.add("InspectAvatar.Pay", boost::bind(&LLInspectAvatar::onClickPay, this));
mCommitCallbackRegistrar.add("InspectAvatar.Block", boost::bind(&LLInspectAvatar::onClickBlock, this));
mCommitCallbackRegistrar.add("InspectAvatar.Report", boost::bind(&LLInspectAvatar::onClickReport, this));
mCommitCallbackRegistrar.add("InspectAvatar.FindOnMap", boost::bind(&LLInspectAvatar::onFindOnMap, this));
mCommitCallbackRegistrar.add("InspectAvatar.FindOnMap", boost::bind(&LLInspectAvatar::onClickFindOnMap, this));
mCommitCallbackRegistrar.add("InspectAvatar.ZoomIn", boost::bind(&LLInspectAvatar::onClickZoomIn, this));
mVisibleCallbackRegistrar.add("InspectAvatar.VisibleFindOnMap", boost::bind(&LLInspectAvatar::onVisibleFindOnMap, this));
mVisibleCallbackRegistrar.add("InspectAvatar.VisibleGodMode", boost::bind(&LLInspectAvatar::onVisibleGodMode, this));
@ -476,7 +478,6 @@ void LLInspectAvatar::onClickViewProfile()
// hide inspector when showing profile
setFocus(FALSE);
LLAvatarActions::showProfile(mAvatarID);
}
bool LLInspectAvatar::onVisibleFindOnMap()
@ -521,8 +522,13 @@ void LLInspectAvatar::onClickReport()
LLFloaterReporter::showFromObject(mAvatarID);
}
void LLInspectAvatar::onClickZoomIn()
{
handle_zoom_to_object(mAvatarID);
closeFloater();
}
void LLInspectAvatar::onFindOnMap()
void LLInspectAvatar::onClickFindOnMap()
{
gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName);
LLFloaterReg::showInstance("world_map");

View File

@ -109,6 +109,7 @@ private:
void onClickSit();
void onClickOpen();
void onClickMoreInfo();
void onClickZoomIn();
private:
LLUUID mObjectID;
@ -132,6 +133,7 @@ LLInspectObject::LLInspectObject(const LLSD& sd)
mCommitCallbackRegistrar.add("InspectObject.Sit", boost::bind(&LLInspectObject::onClickSit, this));
mCommitCallbackRegistrar.add("InspectObject.Open", boost::bind(&LLInspectObject::onClickOpen, this));
mCommitCallbackRegistrar.add("InspectObject.MoreInfo", boost::bind(&LLInspectObject::onClickMoreInfo, this));
mCommitCallbackRegistrar.add("InspectObject.ZoomIn", boost::bind(&LLInspectObject::onClickZoomIn, this));
}
@ -554,6 +556,12 @@ void LLInspectObject::onClickMoreInfo()
closeFloater();
}
void LLInspectObject::onClickZoomIn()
{
handle_look_at_selection("zoom");
closeFloater();
}
//////////////////////////////////////////////////////////////////////////////
// LLInspectObjectUtil
//////////////////////////////////////////////////////////////////////////////

View File

@ -1066,15 +1066,17 @@ BOOL LLTextureCtrl::handleHover(S32 x, S32 y, MASK mask)
BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask)
{
BOOL handled = LLUICtrl::handleMouseDown( x, y , mask );
if( handled )
if( !handled )
{
showPicker(FALSE);
//grab textures first...
gInventory.startBackgroundFetch(gInventory.findCategoryUUIDForType(LLAssetType::AT_TEXTURE));
//...then start full inventory fetch.
gInventory.startBackgroundFetch();
handled = TRUE;
}
return handled;
}

View File

@ -5338,42 +5338,64 @@ class LLWorldCreateLandmark : public view_listener_t
}
};
class LLToolsLookAtSelection : public view_listener_t
void handle_look_at_selection(const LLSD& param)
{
bool handleEvent(const LLSD& userdata)
const F32 PADDING_FACTOR = 2.f;
BOOL zoom = (param.asString() == "zoom");
if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
{
const F32 PADDING_FACTOR = 2.f;
BOOL zoom = (userdata.asString() == "zoom");
if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
gAgent.setFocusOnAvatar(FALSE, ANIMATE);
LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
F32 distance = selection_bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view);
LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent();
obj_to_cam.normVec();
LLUUID object_id;
if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())
{
gAgent.setFocusOnAvatar(FALSE, ANIMATE);
LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
F32 distance = selection_bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view);
LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent();
obj_to_cam.normVec();
LLUUID object_id;
if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())
{
object_id = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID;
}
if (zoom)
{
gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance),
LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
object_id );
}
else
{
gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id );
}
object_id = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID;
}
if (zoom)
{
gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance),
LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
object_id );
}
else
{
gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id );
}
return true;
}
};
}
void handle_zoom_to_object(LLUUID object_id)
{
const F32 PADDING_FACTOR = 2.f;
LLViewerObject* object = gObjectList.findObject(object_id);
if (object)
{
gAgent.setFocusOnAvatar(FALSE, ANIMATE);
LLBBox bbox = object->getBoundingBoxAgent() ;
F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
F32 distance = bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view);
LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent();
obj_to_cam.normVec();
LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent());
gAgent.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance),
object_center_global,
object_id );
}
}
class LLAvatarInviteToGroup : public view_listener_t
{
@ -7753,8 +7775,8 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsUnlink(), "Tools.Unlink");
view_listener_t::addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations");
view_listener_t::addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys");
view_listener_t::addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys");
view_listener_t::addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection");
view_listener_t::addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys");
commit.add("Tools.LookAtSelection", boost::bind(&handle_look_at_selection, _2));
commit.add("Tools.BuyOrTake", boost::bind(&handle_buy_or_take));
commit.add("Tools.TakeCopy", boost::bind(&handle_take_copy));
view_listener_t::addMenu(new LLToolsSaveToInventory(), "Tools.SaveToInventory");

View File

@ -98,8 +98,9 @@ bool enable_object_open();
// Buy either contents or object itself
void handle_buy();
void handle_take_copy();
void handle_look_at_selection(const LLSD& param);
void handle_zoom_to_object(LLUUID object_id);
// Can anyone take a free copy of the object?
// *TODO: Move to separate file

View File

@ -144,7 +144,7 @@ This is a really long description for an object being as how it is at least 80 c
image_disabled="OptionsMenu_Disabled"
image_selected="OptionsMenu_Press"
image_unselected="OptionsMenu_Off"
menu_filename="menu_inspect_avatar_gear.xml"
menu_filename="menu_inspect_object_gear.xml"
name="gear_btn"
picture_style="true"
right="-10"

View File

@ -99,10 +99,11 @@
function="InspectAvatar.VisibleFindOnMap"/>
</menu_item_call>
<menu_item_call
enabled="false"
label="Zoom In"
layout="topleft"
name="zoom_in">
<menu_item_call.on_click
function="InspectAvatar.ZoomIn"/>
</menu_item_call>
<menu_item_call
label="Pay"

View File

@ -105,10 +105,11 @@
function="Object.VisibleMute" />
</menu_item_call>
<menu_item_call
enabled="false"
label="Zoom In"
layout="topleft"
name="zoom_in">
<menu_item_call.on_click
function="InspectObject.ZoomIn" />
</menu_item_call>
<menu_item_call
label="Remove"