Make advanced animation information optional and switchable on the fly.
parent
bdc94eac5c
commit
6a40b64d0a
|
|
@ -26294,5 +26294,16 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSAnimationPreviewExpanded</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Expand or collapse the advanced animation information in the animation preview floater by default</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -40,13 +40,17 @@
|
|||
#include "lluictrlfactory.h"
|
||||
#include "lldatapacker.h"
|
||||
|
||||
#include "llviewercontrol.h" // <FS:Zi> Make advanced animation preview optional
|
||||
|
||||
extern LLAgent gAgent;
|
||||
//const S32 ADVANCED_VPAD = 3; // <FS:Ansariel> Improved animation preview
|
||||
|
||||
LLPreviewAnim::LLPreviewAnim(const LLSD& key)
|
||||
: LLPreview( key )
|
||||
{
|
||||
mCommitCallbackRegistrar.add("PreviewAnim.Play", boost::bind(&LLPreviewAnim::play, this, _2));
|
||||
// <FS:Zi> Make advanced animation preview optional
|
||||
mCommitCallbackRegistrar.add("PreviewAnim.Expand", boost::bind(&LLPreviewAnim::expand, this, _2));
|
||||
// </FS:Zi>
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
@ -54,15 +58,15 @@ BOOL LLPreviewAnim::postBuild()
|
|||
{
|
||||
childSetCommitCallback("desc", LLPreview::onText, this);
|
||||
getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
|
||||
// <FS:Ansariel> Improved animation preview
|
||||
//getChild<LLTextBox>("adv_trigger")->setClickedCallback(boost::bind(&LLPreviewAnim::showAdvanced, this));
|
||||
//pAdvancedStatsTextBox = getChild<LLTextBox>("AdvancedStats");
|
||||
|
||||
//// Assume that advanced stats start visible (for XUI preview tool's purposes)
|
||||
//pAdvancedStatsTextBox->setVisible(FALSE);
|
||||
//LLRect rect = getRect();
|
||||
//reshape(rect.getWidth(), rect.getHeight() - pAdvancedStatsTextBox->getRect().getHeight() - ADVANCED_VPAD, FALSE);
|
||||
// </FS:Ansariel>
|
||||
// <FS:Zi> Make advanced animation preview optional
|
||||
bool expanded = gSavedSettings.getBOOL("FSAnimationPreviewExpanded");
|
||||
|
||||
getChild<LLView>("advanced_info_panel")->setVisible(!expanded);
|
||||
getChild<LLButton>("btn_expand")->setToggleState(expanded);
|
||||
|
||||
expand(LLSD());
|
||||
// </FS:Zi>
|
||||
|
||||
return LLPreview::postBuild();
|
||||
}
|
||||
|
|
@ -214,42 +218,36 @@ void LLPreviewAnim::onClose(bool app_quitting)
|
|||
}
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Improved animation preview
|
||||
//void LLPreviewAnim::showAdvanced()
|
||||
//{
|
||||
// BOOL was_visible = pAdvancedStatsTextBox->getVisible();
|
||||
//
|
||||
// if (was_visible)
|
||||
// {
|
||||
// pAdvancedStatsTextBox->setVisible(FALSE);
|
||||
// LLRect rect = getRect();
|
||||
// reshape(rect.getWidth(), rect.getHeight() - pAdvancedStatsTextBox->getRect().getHeight() - ADVANCED_VPAD, FALSE);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// pAdvancedStatsTextBox->setVisible(TRUE);
|
||||
// LLRect rect = getRect();
|
||||
// reshape(rect.getWidth(), rect.getHeight() + pAdvancedStatsTextBox->getRect().getHeight() + ADVANCED_VPAD, FALSE);
|
||||
//
|
||||
// LLMotion *motion = NULL;
|
||||
// const LLInventoryItem* item = getItem();
|
||||
// if (item)
|
||||
// {
|
||||
// // if motion exists, will return existing one.
|
||||
// // Needed because viewer can purge motions
|
||||
// motion = gAgentAvatarp->createMotion(item->getAssetUUID());
|
||||
// }
|
||||
//
|
||||
// // set text
|
||||
// if (motion)
|
||||
// {
|
||||
// pAdvancedStatsTextBox->setTextArg("[PRIORITY]", llformat("%d", pMotion->getPriority()));
|
||||
// pAdvancedStatsTextBox->setTextArg("[DURATION]", llformat("%.2f", pMotion->getDuration()));
|
||||
// pAdvancedStatsTextBox->setTextArg("[EASE_IN]", llformat("%.2f", pMotion->getEaseInDuration()));
|
||||
// pAdvancedStatsTextBox->setTextArg("[EASE_OUT]", llformat("%.2f", pMotion->getEaseOutDuration()));
|
||||
// pAdvancedStatsTextBox->setTextArg("[IS_LOOP]", (pMotion->getLoop() ? LLTrans::getString("PermYes") : LLTrans::getString("PermNo")));
|
||||
// pAdvancedStatsTextBox->setTextArg("[NUM_JOINTS]", llformat("%d", pMotion->getNumJointMotions()));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// </FS:Ansariel>
|
||||
// <FS:Zi> Make advanced animation preview optional
|
||||
void LLPreviewAnim::expand(const LLSD& param)
|
||||
{
|
||||
LLView* basic_info_panel = getChild<LLView>("basic_info_panel");
|
||||
LLView* advanced_info_panel = getChild<LLView>("advanced_info_panel");
|
||||
|
||||
// I don't get why we can't use getLocalRect().mTop or something similar to get the .top from the XML -Zi
|
||||
S32 height = getRect().getHeight() - basic_info_panel->getRect().mTop;
|
||||
S32 basic_info_height = basic_info_panel->getRect().getHeight();
|
||||
S32 advanced_info_height = advanced_info_panel->getRect().getHeight();
|
||||
|
||||
bool was_expanded = advanced_info_panel->getVisible();
|
||||
advanced_info_panel->setVisible(!was_expanded);
|
||||
|
||||
height += basic_info_height;
|
||||
if (!was_expanded)
|
||||
{
|
||||
height += advanced_info_height;
|
||||
}
|
||||
|
||||
LLRect rect = getRect();
|
||||
|
||||
rect.setLeftTopAndSize(rect.mLeft, rect.mTop, rect.getWidth(), height);
|
||||
reshape(rect.getWidth(), rect.getHeight(), false);
|
||||
|
||||
setRect(rect);
|
||||
|
||||
if(getHost())
|
||||
{
|
||||
getHost()->growToFit(rect.getWidth(), height);
|
||||
}
|
||||
}
|
||||
// </FS:Zi>
|
||||
|
|
|
|||
|
|
@ -45,15 +45,13 @@ public:
|
|||
|
||||
void cleanup(); // cleanup 'playing' state
|
||||
void play(const LLSD& param);
|
||||
// <FS:Ansariel> Improved animation preview
|
||||
//void showAdvanced();
|
||||
|
||||
protected:
|
||||
|
||||
void expand(const LLSD& param); // <FS:Zi> Make advanced animation preview optional
|
||||
|
||||
LLUUID mItemID; // Not an item id, but a playing asset id
|
||||
bool mDidStart;
|
||||
// <FS:Ansariel> Improved animation preview
|
||||
//LLTextBox* pAdvancedStatsTextBox;
|
||||
};
|
||||
|
||||
#endif // LL_LLPREVIEWANIM_H
|
||||
|
|
|
|||
|
|
@ -1,7 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
|
||||
<!-- <FS:Zi> This floater's height changes at runtime when display of advanced info changes:
|
||||
|
||||
collapsed:
|
||||
floater height = basic_info_panel.top + basic_info_panel.height 25 + 60
|
||||
|
||||
expanded:
|
||||
floater height = basic_info_panel.top + basic_info_panel.height + advanced_info_panel.height 25 + 60 + 56
|
||||
|
||||
-->
|
||||
|
||||
<floater
|
||||
legacy_header_height="18"
|
||||
height="121"
|
||||
height="141"
|
||||
layout="topleft"
|
||||
name="preview_anim"
|
||||
help_topic="fs_animation_inventory_preview"
|
||||
|
|
@ -12,6 +23,17 @@
|
|||
name="Title">
|
||||
Animation: [NAME]
|
||||
</floater.string>
|
||||
|
||||
<!-- <FS:Zi> panel that holds the basic animation info and gives size hints to the code -->
|
||||
<panel
|
||||
follows="left|top|right"
|
||||
height="60"
|
||||
layout="topleft"
|
||||
left="0"
|
||||
name="basic_info_panel"
|
||||
top="25"
|
||||
width="320">
|
||||
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
|
|
@ -21,7 +43,6 @@
|
|||
layout="topleft"
|
||||
left="10"
|
||||
name="desc txt"
|
||||
top="25"
|
||||
width="80">
|
||||
Description:
|
||||
</text>
|
||||
|
|
@ -38,6 +59,7 @@
|
|||
top_delta="-2"
|
||||
right="-10" />
|
||||
<button
|
||||
follows="left|top"
|
||||
height="20"
|
||||
label="Play Inworld"
|
||||
label_selected="Stop"
|
||||
|
|
@ -45,37 +67,63 @@
|
|||
left="8"
|
||||
name="Inworld"
|
||||
tool_tip="Play this animation so that others can see it"
|
||||
top="47"
|
||||
width="150">
|
||||
top_pad="8"
|
||||
width="132">
|
||||
<button.commit_callback
|
||||
function="PreviewAnim.Play"
|
||||
parameter="Inworld" />
|
||||
</button>
|
||||
<button
|
||||
follows="left|top"
|
||||
height="20"
|
||||
label="Play Locally"
|
||||
label_selected="Stop"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
left_pad="6"
|
||||
name="Locally"
|
||||
tool_tip="Play this animation so that only you can see it"
|
||||
top_delta="0"
|
||||
width="150">
|
||||
width="132">
|
||||
<button.commit_callback
|
||||
function="PreviewAnim.Play"
|
||||
parameter="Locally" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
follows="left|top"
|
||||
height="20"
|
||||
image_overlay="DisclosureArrow_Opened_Off"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
name="btn_expand"
|
||||
toggle="true"
|
||||
tool_tip="Expand to see advanced information about this animation"
|
||||
top_delta="0"
|
||||
width="32">
|
||||
<button.commit_callback
|
||||
function="PreviewAnim.Expand" />
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
<!-- <FS:Zi> panel that holds the (optional) advanced animation info and gives size hints to the code -->
|
||||
<panel
|
||||
follows="left|top|right"
|
||||
height="56"
|
||||
layout="topleft"
|
||||
name="advanced_info_panel"
|
||||
top_pad="0"
|
||||
visible="true">
|
||||
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="91"
|
||||
height="52"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
name="AdvancedStatsLeft"
|
||||
top_pad="3"
|
||||
top_pad="0"
|
||||
width="150">
|
||||
Priority: [PRIORITY]
|
||||
Duration: [DURATION]s
|
||||
|
|
@ -86,9 +134,9 @@ Loop: [IS_LOOP]
|
|||
length="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="91"
|
||||
height="52"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
left_pad="10"
|
||||
name="AdvancedStatsRight"
|
||||
top_delta="0"
|
||||
width="150">
|
||||
|
|
@ -96,4 +144,5 @@ Ease In: [EASE_IN]s
|
|||
Ease Out: [EASE_OUT]s
|
||||
Joints: [NUM_JOINTS]
|
||||
</text>
|
||||
</panel>
|
||||
</floater>
|
||||
|
|
|
|||
Loading…
Reference in New Issue