Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
beqjanus committed Apr 3, 2023
2 parents 48216e7 + 174bb09 commit 2f128c9
Show file tree
Hide file tree
Showing 23 changed files with 229 additions and 137 deletions.
11 changes: 11 additions & 0 deletions indra/newview/app_settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
94 changes: 46 additions & 48 deletions indra/newview/llpreviewanim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,33 @@
#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
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();
}
Expand Down Expand Up @@ -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>
6 changes: 2 additions & 4 deletions indra/newview/llpreviewanim.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ class LLPreviewAnim : public LLPreview

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
12 changes: 7 additions & 5 deletions indra/newview/skins/default/xui/da/floater_preview_animation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
<floater.string name="Title">
Animation: [NAME]
</floater.string>
<text name="desc txt">
Beskrivelse:
</text>
<button label="Afspil i verden" label_selected="Stop" name="Anim play btn" tool_tip="Vis denne animation så andre kan se den"/>
<button label="Afspil lokalt" label_selected="Stop" name="Anim audition btn" tool_tip="Vis denne animation så kun du kan se den"/>
<panel name="basic_info_panel">
<text name="desc txt">
Beskrivelse:
</text>
<button label="Afspil i verden" label_selected="Stop" name="Anim play btn" tool_tip="Vis denne animation så andre kan se den"/>
<button label="Afspil lokalt" label_selected="Stop" name="Anim audition btn" tool_tip="Vis denne animation så kun du kan se den"/>
</panel>
</floater>
23 changes: 13 additions & 10 deletions indra/newview/skins/default/xui/de/floater_preview_animation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
<floater.string name="Title">
Animation: [NAME]
</floater.string>
<text name="desc txt" width="90">
Beschreibung:
</text>
<line_editor name="desc"/>
<button label="Inworld abspielen" label_selected="Stopp" name="Inworld" tool_tip="Diese Animation so wiedergeben, dass andere sie sehen können."/>
<button label="Lokal wiedergeben" label_selected="Stopp" name="Locally" tool_tip="Diese Animation so wiedergeben, dass nur Sie sie sehen."/>
<text name="AdvancedStatsLeft">
<panel name="basic_info_panel">
<text name="desc txt" width="90">
Beschreibung:
</text>
<button label="Inworld abspielen" label_selected="Stopp" name="Inworld" tool_tip="Diese Animation so wiedergeben, dass andere sie sehen können."/>
<button label="Lokal wiedergeben" label_selected="Stopp" name="Locally" tool_tip="Diese Animation so wiedergeben, dass nur Sie sie sehen."/>
</panel>
<panel name="advanced_info_panel">
<text name="AdvancedStatsLeft">
Priorität: [PRIORITY]
Dauer: [DURATION]s
Schleife: [IS_LOOP]
</text>
<text name="AdvancedStatsRight">
</text>
<text name="AdvancedStatsRight">
Einblenden: [EASE_IN]s
Ausblenden: [EASE_OUT]s
Gelenke: [NUM_JOINTS]
</text>
</text>
</panel>
</floater>
69 changes: 59 additions & 10 deletions indra/newview/skins/default/xui/en/floater_preview_animation.xml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand All @@ -21,7 +43,6 @@
layout="topleft"
left="10"
name="desc txt"
top="25"
width="80">
Description:
</text>
Expand All @@ -38,44 +59,71 @@
top_delta="-2"
right="-10" />
<button
follows="left|top"
height="20"
label="Play Inworld"
label_selected="Stop"
layout="topleft"
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
Expand All @@ -86,14 +134,15 @@ 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">
Ease In: [EASE_IN]s
Ease Out: [EASE_OUT]s
Joints: [NUM_JOINTS]
</text>
</panel>
</floater>
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,14 @@
tool_tip="If enabled, you can preview animations during the upload process on your own avatar"
name="FSUploadAnimationOnOwnAvatar"
control_name="FSUploadAnimationOnOwnAvatar"/>
<check_box
top_pad="8"
follows="left|top"
height="16"
label="Always expand animation preview advanced information"
tool_tip="Expand the advanced animation information in the animation preview floater by default"
name="FSAnimationPreviewExpanded"
control_name="FSAnimationPreviewExpanded"/>
<check_box
top_pad="8"
follows="left|top"
Expand Down
12 changes: 7 additions & 5 deletions indra/newview/skins/default/xui/es/floater_preview_animation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
<floater.string name="Title">
Animación: [NAME]
</floater.string>
<text name="desc txt">
Descripción:
</text>
<button label="Ver en el mundo" label_selected="Detener" name="Inworld" tool_tip="Ejecutar esta animación de modo que puedan verla los demás" width="130"/>
<button label="Ejecutarla para usted" label_selected="Detener" left="135" name="Locally" tool_tip="Ejecutar esta animación de modo que sólo la vea yo" width="130"/>
<panel name="basic_info_panel">
<text name="desc txt">
Descripción:
</text>
<button label="Ver en el mundo" label_selected="Detener" name="Inworld" tool_tip="Ejecutar esta animación de modo que puedan verla los demás" width="130"/>
<button label="Ejecutarla para usted" label_selected="Detener" left="135" name="Locally" tool_tip="Ejecutar esta animación de modo que sólo la vea yo" width="130"/>
</panel>
</floater>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<floater name="Image Preview">
<text name="name_label">Nom :</text>
<text name="description_label">Description :</text>
<text name="preview_label" width="115">Prévisualiser l'image en tant que :</text>
<text name="preview_label" width="115">Prévisualiser :</text>
<combo_box label="Type de vêtement" left_delta="115" name="clothing_type_combo">
<item label="Image" name="Image"/>
<item label="Cheveux" name="Hair"/>
Expand Down
Loading

0 comments on commit 2f128c9

Please sign in to comment.