Added menu for animation explorer and made it so you could move the dummy around, add a check so dummy avatars dont show up in radar, and uploading the explore anim floater.
This commit is contained in:
@@ -416,7 +416,8 @@ void LLFloaterAvatarList::updateAvatarList()
|
||||
|
||||
// Skip if avatar is dead(what's that?)
|
||||
// or if the avatar is ourselves.
|
||||
if (avatarp->isDead() || avatarp->isSelf())
|
||||
// or if the avatar is a dummy
|
||||
if (avatarp->isDead() || avatarp->isSelf() || avatarp->mIsDummy)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "lllocalinventory.h"
|
||||
#include "llviewercamera.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "lltoolmgr.h"
|
||||
// <stuff for jelly roll>
|
||||
#include "llfloatertools.h"
|
||||
#include "llselectmgr.h"
|
||||
@@ -24,6 +27,9 @@ LLAnimHistoryItem::LLAnimHistoryItem(LLUUID assetid)
|
||||
LLFloaterExploreAnimations::LLFloaterExploreAnimations(LLUUID avatarid)
|
||||
: LLFloater()
|
||||
{
|
||||
mLastMouseX = 0;
|
||||
mLastMouseY = 0;
|
||||
|
||||
LLFloaterExploreAnimations::sInstance = this;
|
||||
mAvatarID = avatarid;
|
||||
mAnimPreview = new LLPreviewAnimation(256, 256);
|
||||
@@ -48,6 +54,8 @@ BOOL LLFloaterExploreAnimations::postBuild(void)
|
||||
childSetAction("copy_uuid_btn", onClickCopyUUID, this);
|
||||
childSetAction("open_btn", onClickOpen, this);
|
||||
childSetAction("jelly_roll_btn", onClickJellyRoll, this);
|
||||
LLRect r = getRect();
|
||||
mPreviewRect.set(r.getWidth() - 266, r.getHeight() - 25, r.getWidth() - 10, r.getHeight() - 256);
|
||||
update();
|
||||
return TRUE;
|
||||
}
|
||||
@@ -90,6 +98,7 @@ void LLFloaterExploreAnimations::draw()
|
||||
LLFloater::draw();
|
||||
|
||||
LLRect r = getRect();
|
||||
mPreviewRect.set(r.getWidth() - 266, r.getHeight() - 25, r.getWidth() - 10, r.getHeight() - 256);
|
||||
|
||||
gGL.color3f(1.f, 1.f, 1.f);
|
||||
|
||||
@@ -98,13 +107,13 @@ void LLFloaterExploreAnimations::draw()
|
||||
gGL.begin( LLRender::QUADS );
|
||||
{
|
||||
gGL.texCoord2f(0.f, 1.f);
|
||||
gGL.vertex2i(r.getWidth() - 266, r.getHeight() - 25);
|
||||
gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop);
|
||||
gGL.texCoord2f(0.f, 0.f);
|
||||
gGL.vertex2i(r.getWidth() - 266, r.getHeight() - 256);
|
||||
gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom);
|
||||
gGL.texCoord2f(1.f, 0.f);
|
||||
gGL.vertex2i(r.getWidth() - 10, r.getHeight() - 256);
|
||||
gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom);
|
||||
gGL.texCoord2f(1.f, 1.f);
|
||||
gGL.vertex2i(r.getWidth() - 10, r.getHeight() - 25);
|
||||
gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mTop);
|
||||
}
|
||||
gGL.end();
|
||||
|
||||
@@ -306,5 +315,106 @@ void LLFloaterExploreAnimations::onClickJellyRoll(void* data)
|
||||
createy->childSetValue("type_combo", "animatn");
|
||||
createy->childSetText("creator_id_line", LLFloaterNewLocalInventory::sLastCreatorId.asString());
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// handleMouseDown()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterExploreAnimations::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (mPreviewRect.pointInRect(x, y))
|
||||
{
|
||||
//llinfos << "lolwut" << llendl;
|
||||
bringToFront( x, y );
|
||||
gFocusMgr.setMouseCapture(this);
|
||||
gViewerWindow->hideCursor();
|
||||
mLastMouseX = x;
|
||||
mLastMouseY = y;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return LLFloater::handleMouseDown(x, y, mask);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// handleMouseUp()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterExploreAnimations::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
//llinfos << "lolwut pear" << llendl;
|
||||
gFocusMgr.setMouseCapture(FALSE);
|
||||
gViewerWindow->showCursor();
|
||||
return LLFloater::handleMouseUp(x, y, mask);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// handleHover()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterExploreAnimations::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
MASK local_mask = mask & ~MASK_ALT;
|
||||
|
||||
if (mAnimPreview && hasMouseCapture())
|
||||
{
|
||||
if (local_mask == MASK_PAN)
|
||||
{
|
||||
// pan here
|
||||
mAnimPreview->pan((F32)(x - mLastMouseX) * -0.005f, (F32)(y - mLastMouseY) * -0.005f);
|
||||
}
|
||||
else if (local_mask == MASK_ORBIT)
|
||||
{
|
||||
F32 yaw_radians = (F32)(x - mLastMouseX) * -0.01f;
|
||||
F32 pitch_radians = (F32)(y - mLastMouseY) * 0.02f;
|
||||
|
||||
mAnimPreview->rotate(yaw_radians, pitch_radians);
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 yaw_radians = (F32)(x - mLastMouseX) * -0.01f;
|
||||
F32 zoom_amt = (F32)(y - mLastMouseY) * 0.02f;
|
||||
|
||||
mAnimPreview->rotate(yaw_radians, 0.f);
|
||||
mAnimPreview->zoom(zoom_amt);
|
||||
}
|
||||
|
||||
mAnimPreview->requestUpdate();
|
||||
|
||||
LLUI::setCursorPositionLocal(this, mLastMouseX, mLastMouseY);
|
||||
}
|
||||
|
||||
if (!mPreviewRect.pointInRect(x, y) || !mAnimPreview)
|
||||
{
|
||||
return LLFloater::handleHover(x, y, mask);
|
||||
}
|
||||
else if (local_mask == MASK_ORBIT)
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLCAMERA);
|
||||
}
|
||||
else if (local_mask == MASK_PAN)
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLPAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLZOOMIN);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// handleScrollWheel()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterExploreAnimations::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
mAnimPreview->zoom((F32)clicks * -0.2f);
|
||||
mAnimPreview->requestUpdate();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// onMouseCaptureLost()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLFloaterExploreAnimations::onMouseCaptureLost()
|
||||
{
|
||||
gViewerWindow->showCursor();
|
||||
}
|
||||
// </edit>
|
||||
|
||||
@@ -42,6 +42,12 @@ public:
|
||||
static void onClickOpen(void* data);
|
||||
static void onClickJellyRoll(void* data);
|
||||
|
||||
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
void onMouseCaptureLost();
|
||||
|
||||
static void startAnim(LLUUID avatarid, LLUUID assetid);
|
||||
static void stopAnim(LLUUID avatarid, LLUUID assetid);
|
||||
|
||||
@@ -52,6 +58,9 @@ private:
|
||||
|
||||
protected:
|
||||
void draw();
|
||||
LLRect mPreviewRect;
|
||||
S32 mLastMouseX;
|
||||
S32 mLastMouseY;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8270,7 +8270,7 @@ void initialize_menus()
|
||||
addMenu(new LLAvatarEject(), "Avatar.Eject");
|
||||
addMenu(new LLAvatarSendIM(), "Avatar.SendIM");
|
||||
addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse");
|
||||
|
||||
addMenu(new LLAvatarAnims(),"Avatar.Anims");
|
||||
addMenu(new LLObjectEnableMute(), "Avatar.EnableMute");
|
||||
addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend");
|
||||
addMenu(new LLAvatarEnableFreezeEject(), "Avatar.EnableFreezeEject");
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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="300" width="532" min_width="532" min_height="300"
|
||||
name="floater_explore_animations" title="Animations">
|
||||
<scroll_list bottom="10" can_resize="true" column_padding="0" draw_heading="false"
|
||||
follows="left|top|bottom|right" left="10" multi_select="false"
|
||||
name="anim_list" search_column="0" top="-25" right="-276" width="256">
|
||||
<column dynamicwidth="true" label="Name" name="name" />
|
||||
<column dynamicwidth="false" width ="100" label="" name="info" />
|
||||
</scroll_list>
|
||||
<button top="35" bottom="15" follows="top|right" height="20" label="Copy UUID" name="copy_uuid_btn"
|
||||
right="351" width="85" />
|
||||
<button top="35" bottom="15" follows="top|right" height="20" label="Open" name="open_btn"
|
||||
right="436" width="85" />
|
||||
<button top="35" bottom="15" follows="top|right" height="20" label="Jelly Roll" name="jelly_roll_btn"
|
||||
right="522" width="85" />
|
||||
</floater>
|
||||
@@ -44,6 +44,10 @@
|
||||
<menu_item_call enabled="true" label="Debug..." mouse_opaque="true" name="Debug Layers">
|
||||
<on_click function="Avatar.Debug" />
|
||||
</menu_item_call>
|
||||
<menu_item_call enabled="true" hidden="false" label="Anims..." mouse_opaque="true"
|
||||
name="Anims...">
|
||||
<on_click function="Avatar.Anims" />
|
||||
</menu_item_call>
|
||||
<menu_item_call enabled="true" label="Inspect" mouse_opaque="true" name="Object Inspect">
|
||||
<on_click function="Object.Inspect" />
|
||||
<on_enable function="Object.EnableInspect" />
|
||||
|
||||
Reference in New Issue
Block a user