Cancel pose stand when quitting.

This fixes the bug that if you Quit while in the Singularity -> Pose
Stand, then you are permanently hovering over the group until you go
into Advanced -> Debug Settings and reset AscentAvatarZModifier.

It also fixes that before, when you changed AscentAvatarZModifier
in Advanced -> Debug Settings then you saw no effect (until the
viewer would sent an AvatarAppearance message.

After this patch, changing any of the AscentAvatar*Modifier settings
has immediate visible effect, and a pose stand (Z-offset) is reset
when quitting.
This commit is contained in:
Aleric Inglewood
2011-05-17 02:42:06 +02:00
parent addb7a559e
commit 3656939269
4 changed files with 27 additions and 4 deletions

View File

@@ -72,6 +72,7 @@ Aleric Inglewood
VWR-14914
VWR-24247
VWR-24312
VWR-24315
VWR-24320
VWR-24333
VWR-24334

View File

@@ -1122,8 +1122,12 @@ bool LLAppViewer::mainLoop()
return true;
}
extern void cleanup_pose_stand(void);
bool LLAppViewer::cleanup()
{
cleanup_pose_stand();
//flag all elements as needing to be destroyed immediately
// to ensure shutdown order
LLMortician::setZealous(TRUE);

View File

@@ -548,6 +548,7 @@ bool handleAscentSelfTag(const LLSD& newvalue)
gAgent.getAvatarObject()->mClientTag = "";
return true;
}
bool handleAscentGlobalTag(const LLSD& newvalue)
{
S32 object_count = gObjectList.getNumObjects();
@@ -560,6 +561,13 @@ bool handleAscentGlobalTag(const LLSD& newvalue)
return true;
}
bool handleAscentAvatarModifier(const LLSD& newvalue)
{
llinfos << "Calling gAgent.sendAgentSetAppearance() because AscentAvatar*Modifier changed." << llendl;
gAgent.sendAgentSetAppearance();
return true;
}
// [Ansariel: Display name support]
static bool handlePhoenixNameSystemChanged(const LLSD& newvalue)
{
@@ -725,6 +733,9 @@ void settings_setup_listeners()
gSavedSettings.getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
gSavedSettings.getControl("AscentAvatarXModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _1));
gSavedSettings.getControl("AscentAvatarYModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _1));
gSavedSettings.getControl("AscentAvatarZModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _1));
// [Ansariel: Display name support]
gSavedSettings.getControl("PhoenixNameSystem")->getSignal()->connect(boost::bind(&handlePhoenixNameSystemChanged, _1));

View File

@@ -429,13 +429,16 @@ void handle_area_search(void*);
// <dogmode> for pose stand
LLUUID current_pose = LLUUID::null;
bool on_pose_stand;
void set_current_pose(std::string anim)
{
if (current_pose == LLUUID::null)
if (!on_pose_stand)
{
on_pose_stand = true;
gSavedSettings.setF32("AscentAvatarZModifier", gSavedSettings.getF32("AscentAvatarZModifier") + 7.5);
}
gAgent.sendAgentSetAppearance();
gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP);
current_pose.set(anim);
gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START);
@@ -446,14 +449,18 @@ void handle_pose_stand(void*)
}
void handle_pose_stand_stop(void*)
{
if (current_pose != LLUUID::null)
if (on_pose_stand)
{
gSavedSettings.setF32("AscentAvatarZModifier", gSavedSettings.getF32("AscentAvatarZModifier") - 7.5);
gAgent.sendAgentSetAppearance();
on_pose_stand = false;
gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP);
current_pose = LLUUID::null;
}
}
void cleanup_pose_stand(void)
{
handle_pose_stand_stop(NULL);
}
void handle_toggle_pose(void* userdata) {
if(current_pose.isNull())