Add a basic ground-sit lock to the built-in pose stand
parent
f0a571b52e
commit
b2a14f6ed0
|
|
@ -20084,5 +20084,16 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<string />
|
||||
</map>
|
||||
<key>FSPoseStandLock</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>When enabled, posestand will lock the avatar to the ground.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -14,12 +14,16 @@
|
|||
#include "fsfloaterposestand.h"
|
||||
|
||||
#include "fspose.h"
|
||||
#include "llagent.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "lltrans.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
FSFloaterPoseStand::FSFloaterPoseStand(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
mComboPose(NULL)
|
||||
mComboPose(NULL),
|
||||
mPoseStandLock(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -40,12 +44,21 @@ BOOL FSFloaterPoseStand::postBuild()
|
|||
// virtual
|
||||
void FSFloaterPoseStand::onOpen(const LLSD& key)
|
||||
{
|
||||
if (gSavedSettings.getBOOL("FSPoseStandLock") && !gAgentAvatarp->isSitting() && isAgentAvatarValid())
|
||||
{
|
||||
gAgent.sitDown();
|
||||
mPoseStandLock = true;
|
||||
}
|
||||
gAgentAvatarp->setIsEditingAppearance(TRUE);
|
||||
onCommitCombo();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void FSFloaterPoseStand::onClose(bool app_quitting)
|
||||
{
|
||||
if (mPoseStandLock == true && gAgentAvatarp->isSitting() && isAgentAvatarValid())
|
||||
gAgent.standUp();
|
||||
gAgentAvatarp->setIsEditingAppearance(FALSE);
|
||||
FSPose::getInstance()->stopPose();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ private:
|
|||
void loadPoses();
|
||||
void onCommitCombo();
|
||||
|
||||
bool mPoseStandLock;
|
||||
LLComboBox* mComboPose;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -655,7 +655,8 @@ public:
|
|||
// True if we are currently in appearance editing mode. Often but
|
||||
// not always the same as isUsingLocalAppearance().
|
||||
/*virtual*/ BOOL isEditingAppearance() const { return mIsEditingAppearance; }
|
||||
|
||||
void setIsEditingAppearance(BOOL editing) { mIsEditingAppearance = editing; } // <FS:CR> for Built-in Posestand
|
||||
|
||||
// FIXME review isUsingLocalAppearance uses, some should be isEditing instead.
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
height="48"
|
||||
width="250"
|
||||
width="280"
|
||||
help_topic="pose_stand"
|
||||
layout="topleft"
|
||||
legacy_header_height="18"
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
single_instance="true"
|
||||
title="Pose Stand">
|
||||
<combo_box
|
||||
follows="right|top"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
height="23"
|
||||
allow_text_entry="false"
|
||||
|
|
@ -18,5 +18,23 @@
|
|||
left="5"
|
||||
name="pose_combo"
|
||||
width="240"/>
|
||||
<check_box
|
||||
control_name="FSPoseStandLock"
|
||||
height="16"
|
||||
label=""
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
left_pad="1"
|
||||
name="enable_lock"
|
||||
width="16" />
|
||||
<icon
|
||||
height="14"
|
||||
image_name="Locked_Icon"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
left_pad="2"
|
||||
top_delta="-2"
|
||||
mouse_opaque="true"
|
||||
name="lock"
|
||||
width="10" />
|
||||
</floater>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue