Added option for animated script dialogs (V1 style)

master
ziree 2013-08-07 21:31:38 +02:00
parent bf4c87ee9c
commit 12cc84f048
5 changed files with 83 additions and 1 deletions

View File

@ -20877,5 +20877,18 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>1</integer>
</map>
<!-- <FS_Zi> Animated dialogs -->
<key>FSAnimatedScriptDialogs</key>
<map>
<key>Comment</key>
<string>Animates script dialogs V1 style. Only effective when dialogs in top right are activated.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<!-- <FS_Zi> Animated dialogs -->
</map>
</llsd>

View File

@ -497,5 +497,18 @@
<integer>1</integer>
</map>
<!-- <FS_Zi> Animated dialogs -->
<key>FSAnimatedScriptDialogs</key>
<map>
<key>Comment</key>
<string>Animates script dialogs V1 style. Only effective when dialogs in top right are activated.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<!-- <FS_Zi> Animated dialogs -->
</map>
</llsd>

View File

@ -209,7 +209,20 @@ void LLScriptFloater::createForm(const LLUUID& notification_id)
// make floater size fit form size
LLRect panel_rect = mScriptForm->getRect();
toast_rect.setLeftTopAndSize(toast_rect.mLeft, toast_rect.mTop, panel_rect.getWidth(), panel_rect.getHeight() + getHeaderHeight());
// <FS:Zi> Animated dialogs
// toast_rect.setLeftTopAndSize(toast_rect.mLeft, toast_rect.mTop, panel_rect.getWidth(), panel_rect.getHeight() + getHeaderHeight());
mDesiredHeight=panel_rect.getHeight()+getHeaderHeight();
if(gSavedSettings.getBOOL("FSAnimatedScriptDialogs") && gSavedSettings.getBOOL("ShowScriptDialogsTopRight"))
{
mCurrentHeight=0;
mStartTime=LLFrameTimer::getElapsedSeconds();
}
else
{
mCurrentHeight=mDesiredHeight;
}
toast_rect.setLeftTopAndSize(toast_rect.mLeft,toast_rect.mTop,panel_rect.getWidth(),mCurrentHeight);
// </FS:Zi>
setShape(toast_rect);
}
@ -744,4 +757,25 @@ bool LLScriptFloater::isScriptTextbox(LLNotificationPtr notification)
return false;
}
// <FS:Zi> Animated dialogs
void LLScriptFloater::draw()
{
if(mCurrentHeight<mDesiredHeight)
{
mCurrentHeight=(S32) ((LLFrameTimer::getElapsedSeconds()-mStartTime)*2.5*(F64) mDesiredHeight);
if(mCurrentHeight>mDesiredHeight)
{
mCurrentHeight=mDesiredHeight;
}
LLRect toast_rect=getRect();
toast_rect.setLeftTopAndSize(toast_rect.mLeft,toast_rect.mTop,toast_rect.getWidth(),mCurrentHeight);
setShape(toast_rect);
}
LLDockableFloater::draw();
}
// </FS:Zi>
// EOF

View File

@ -211,6 +211,15 @@ private:
LLUUID mObjectId;
bool mSaveFloaterPosition;
bool mNoTransparency;
// <FS:Zi> Animated menus
public:
S32 mCurrentHeight;
S32 mDesiredHeight;
F64 mStartTime;
virtual void draw();
// </FS:Zi>
};
#endif //LL_SCRIPTFLOATER_H

View File

@ -384,12 +384,25 @@
tool_tip="Set this to move script dialog notifications to the top right corner of the screen (Classic V1.x behavior)."
top_pad="2"
width="256" />
<check_box
control_name="FSAnimatedScriptDialogs"
enabled_control="ShowScriptDialogsTopRight"
height="16"
initial_value="true"
label="Animate Script Dialogs"
layout="topleft"
left="15"
name="FSAnimatedScriptDialogs"
tool_tip="Set this to make script dialogs animate when opening (Classic V1.x behavior)."
top_pad="2"
width="256" />
<check_box
control_name="ShowGroupNoticesTopRight"
height="16"
initial_value="true"
label="Group Notices and chiclets in Top Right"
layout="topleft"
left="5"
name="ShowGroupNoticesTopRight"
tool_tip="Set this to move group notifications and chiclet icons to the top right corner of the screen (Classic V1.x behavior)."
top_pad="2"