Merge branch 'V2MultiWear' of git://github.com/Shyotl/SingularityViewer into V2MultiWear
This commit is contained in:
@@ -2897,10 +2897,10 @@
|
||||
<real>6.0</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>CameraOffsetDefault</key>
|
||||
<key>CameraOffsetRearView</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default camera offset from avatar</string>
|
||||
<string>Initial camera offset from avatar in Rear View</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
@@ -2912,6 +2912,36 @@
|
||||
<real>0.75</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>CameraOffsetFrontView</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Initial camera offset from avatar in Front View</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Vector3</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>2.2</real>
|
||||
<real>0.0</real>
|
||||
<real>0.0</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>CameraOffsetGroupView</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Initial camera offset from avatar in Group View</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Vector3</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>-1.0</real>
|
||||
<real>0.7</real>
|
||||
<real>0.5</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>CameraOffsetScale</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -2949,6 +2979,18 @@
|
||||
<key>Value</key>
|
||||
<real>1.0</real>
|
||||
</map>
|
||||
<key>CameraPreset</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Preset camera position - view (0 - rear, 1 - front, 2 - group)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>CameraFocusTransitionTime</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -6667,14 +6709,14 @@
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FocusOffsetDefault</key>
|
||||
<key>FocusOffsetRearView</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default focus point offset relative to avatar (x-axis is forward)</string>
|
||||
<string>Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Vector3</string>
|
||||
<string>Vector3D</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>1.0</real>
|
||||
@@ -6682,6 +6724,36 @@
|
||||
<real>1.0</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>FocusOffsetFrontView</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Initial focus point offset relative to avatar for the camera preset Front View</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Vector3D</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>0.0</real>
|
||||
<real>0.0</real>
|
||||
<real>0.0</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>FocusOffsetGroupView</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Initial focus point offset relative to avatar for the camera preset Group View</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Vector3D</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>1.5</real>
|
||||
<real>0.7</real>
|
||||
<real>1.0</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>FocusPosOnLogout</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -128,7 +128,7 @@ LLAgentCamera::LLAgentCamera() :
|
||||
mCameraMode( CAMERA_MODE_THIRD_PERSON ),
|
||||
mLastCameraMode( CAMERA_MODE_THIRD_PERSON ),
|
||||
|
||||
//mCameraPreset(CAMERA_PRESET_REAR_VIEW),
|
||||
mCameraPreset(CAMERA_PRESET_REAR_VIEW),
|
||||
|
||||
mCameraAnimating( FALSE ),
|
||||
mAnimationCameraStartGlobal(),
|
||||
@@ -141,7 +141,6 @@ LLAgentCamera::LLAgentCamera() :
|
||||
mCameraFocusOffset(),
|
||||
mCameraFOVDefault(DEFAULT_FIELD_OF_VIEW),
|
||||
|
||||
mCameraOffsetDefault(),
|
||||
mCameraCollidePlane(),
|
||||
|
||||
mCurrentCameraDistance(2.f), // meters, set in init()
|
||||
@@ -212,8 +211,7 @@ void LLAgentCamera::init()
|
||||
|
||||
mCameraFocusOffsetTarget = LLVector4(gSavedSettings.getVector3("CameraOffsetBuild"));
|
||||
|
||||
mCameraOffsetDefault = gSavedSettings.getVector3("CameraOffsetDefault");//Legacy
|
||||
/*mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPreset");
|
||||
mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPreset");
|
||||
|
||||
mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("CameraOffsetRearView");
|
||||
mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("CameraOffsetFrontView");
|
||||
@@ -221,7 +219,7 @@ void LLAgentCamera::init()
|
||||
|
||||
mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("FocusOffsetRearView");
|
||||
mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("FocusOffsetFrontView");
|
||||
mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("FocusOffsetGroupView");*/
|
||||
mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("FocusOffsetGroupView");
|
||||
|
||||
mCameraCollidePlane.clearVec();
|
||||
mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale");
|
||||
@@ -1681,14 +1679,13 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset()
|
||||
{
|
||||
// ...offset from avatar
|
||||
LLVector3d focus_offset;
|
||||
focus_offset.setVec(gSavedSettings.getVector3("FocusOffsetDefault"));
|
||||
LLQuaternion agent_rot = gAgent.getFrameAgent().getQuaternion();
|
||||
if (isAgentAvatarValid() && gAgentAvatarp->getParent())
|
||||
{
|
||||
agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation();
|
||||
}
|
||||
|
||||
//focus_offset = convert_from_llsd<LLVector3d>(mFocusOffsetInitial[mCameraPreset]->get(), TYPE_VEC3D, "");
|
||||
focus_offset = convert_from_llsd<LLVector3d>(mFocusOffsetInitial[mCameraPreset]->get(), TYPE_VEC3D, "");
|
||||
return focus_offset * agent_rot;
|
||||
}
|
||||
|
||||
@@ -2023,8 +2020,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
|
||||
|
||||
LLVector3 LLAgentCamera::getCameraOffsetInitial()
|
||||
{
|
||||
//return convert_from_llsd<LLVector3>(mCameraOffsetInitial[mCameraPreset]->get(), TYPE_VEC3, "");
|
||||
return mCameraOffsetDefault;
|
||||
return convert_from_llsd<LLVector3>(mCameraOffsetInitial[mCameraPreset]->get(), TYPE_VEC3, "");
|
||||
}
|
||||
|
||||
|
||||
@@ -2418,15 +2414,17 @@ void LLAgentCamera::changeCameraToCustomizeAvatar()
|
||||
gAgentAvatarp->updateMeshTextures();
|
||||
}
|
||||
}
|
||||
|
||||
// <edit>
|
||||
if(!gSavedSettings.getBOOL("AppearanceCameraMovement"))
|
||||
{
|
||||
//hmm
|
||||
mCameraAnimating = FALSE;
|
||||
gAgent.endAnimationUpdateUI();
|
||||
return;
|
||||
}
|
||||
/*LLVector3 agent_at = gAgent.getAtAxis();
|
||||
// </edit>
|
||||
|
||||
LLVector3 agent_at = gAgent.getAtAxis();
|
||||
agent_at.mV[VZ] = 0.f;
|
||||
agent_at.normalize();
|
||||
|
||||
@@ -2441,11 +2439,13 @@ void LLAgentCamera::changeCameraToCustomizeAvatar()
|
||||
camera_offset *= CUSTOMIZE_AVATAR_CAMERA_DEFAULT_DIST;
|
||||
LLVector3d focus_target_global = gAgent.getPosGlobalFromAgent(focus_target);
|
||||
setAnimationDuration(gSavedSettings.getF32("ZoomTime"));
|
||||
setCameraPosAndFocusGlobal(focus_target_global + camera_offset, focus_target_global, gAgent.getID());*/
|
||||
setCameraPosAndFocusGlobal(focus_target_global + camera_offset, focus_target_global, gAgent.getID());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*void LLAgentCamera::switchCameraPreset(ECameraPreset preset)
|
||||
void LLAgentCamera::switchCameraPreset(ECameraPreset preset)
|
||||
{
|
||||
//zoom is supposed to be reset for the front and group views
|
||||
mCameraZoomFraction = 1.f;
|
||||
@@ -2456,7 +2456,7 @@ void LLAgentCamera::changeCameraToCustomizeAvatar()
|
||||
mCameraPreset = preset;
|
||||
|
||||
gSavedSettings.setU32("CameraPreset", mCameraPreset);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -46,6 +46,19 @@ enum ECameraMode
|
||||
CAMERA_MODE_FOLLOW
|
||||
};
|
||||
|
||||
/** Camera Presets for CAMERA_MODE_THIRD_PERSON */
|
||||
enum ECameraPreset
|
||||
{
|
||||
/** Default preset, what the Third Person Mode actually was */
|
||||
CAMERA_PRESET_REAR_VIEW,
|
||||
|
||||
/** "Looking at the Avatar from the front" */
|
||||
CAMERA_PRESET_FRONT_VIEW,
|
||||
|
||||
/** "Above and to the left, over the shoulder, pulled back a little on the zoom" */
|
||||
CAMERA_PRESET_GROUP_VIEW
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// LLAgentCamera
|
||||
//------------------------------------------------------------------------
|
||||
@@ -94,9 +107,28 @@ private:
|
||||
ECameraMode mCameraMode; // Target mode after transition animation is done
|
||||
ECameraMode mLastCameraMode;
|
||||
F32 mUIOffset;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Preset
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void switchCameraPreset(ECameraPreset preset);
|
||||
private:
|
||||
/** Determines default camera offset depending on the current camera preset */
|
||||
LLVector3 getCameraOffsetInitial();
|
||||
|
||||
/** Camera preset in Third Person Mode */
|
||||
ECameraPreset mCameraPreset;
|
||||
|
||||
/** Initial camera offsets */
|
||||
std::map<ECameraPreset, LLPointer<LLControlVariable> > mCameraOffsetInitial;
|
||||
|
||||
/** Initial focus offsets */
|
||||
std::map<ECameraPreset, LLPointer<LLControlVariable> > mFocusOffsetInitial;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Position
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLVector3d getCameraPositionGlobal() const;
|
||||
const LLVector3 &getCameraPositionAgent() const;
|
||||
@@ -185,7 +217,6 @@ public:
|
||||
private:
|
||||
LLVector3d mCameraFocusOffset; // Offset from focus point in build mode
|
||||
LLVector3d mCameraFocusOffsetTarget; // Target towards which we are lerping the camera's focus offset
|
||||
LLVector3 mCameraOffsetDefault;
|
||||
BOOL mFocusOnAvatar;
|
||||
LLVector3d mFocusGlobal;
|
||||
LLVector3d mFocusTargetGlobal;
|
||||
|
||||
@@ -724,6 +724,8 @@ bool LLAppViewer::init()
|
||||
&LLURLDispatcher::dispatchFromTextEditor,
|
||||
&LLURLDispatcher::dispatchFromTextEditor);
|
||||
|
||||
LLToolMgr::getInstance(); // Initialize tool manager if not already instantiated
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//
|
||||
// Load settings files
|
||||
@@ -1376,12 +1378,6 @@ extern void cleanup_pose_stand(void);
|
||||
|
||||
bool LLAppViewer::cleanup()
|
||||
{
|
||||
|
||||
//HACK: the selectmgr may hold a ref to gAgentAvatarp, which will defer the actual
|
||||
// destruction until LLSelectMgr::cleanupGlobals() is called AFTER the UI has been destroyed.
|
||||
// This presents issue, as ~LLVOAvatarSelf spawns notifications if DebugAvatarRezTime is true, which will
|
||||
// crash if the UI has been destroyed before then.
|
||||
LLSelectMgr::getInstance()->remove(gAgentAvatarp, SELECT_ALL_TES, false);
|
||||
//ditch LLVOAvatarSelf instance
|
||||
gAgentAvatarp = NULL;
|
||||
cleanup_pose_stand();
|
||||
|
||||
@@ -75,12 +75,29 @@ const F64 CURRENCY_ESTIMATE_FREQUENCY = 0.5;
|
||||
// esimate is fetched from the server
|
||||
|
||||
class LLFloaterBuyLandUI
|
||||
: public LLFloater
|
||||
: public LLFloater, public LLSingleton<LLFloaterBuyLandUI>
|
||||
{
|
||||
private:
|
||||
public:
|
||||
LLFloaterBuyLandUI();
|
||||
virtual ~LLFloaterBuyLandUI();
|
||||
|
||||
/*virtual*/ void onClose(bool app_quitting);
|
||||
|
||||
// Left padding for maturity rating icon.
|
||||
static const S32 ICON_PAD = 2;
|
||||
|
||||
private:
|
||||
class SelectionObserver : public LLParcelObserver
|
||||
{
|
||||
public:
|
||||
SelectionObserver(LLFloaterBuyLandUI* floater) : mFloater(floater) {}
|
||||
virtual void changed();
|
||||
private:
|
||||
LLFloaterBuyLandUI* mFloater;
|
||||
};
|
||||
|
||||
private:
|
||||
SelectionObserver mParcelSelectionObserver;
|
||||
LLViewerRegion* mRegion;
|
||||
LLParcelSelectionHandle mParcel;
|
||||
bool mIsClaim;
|
||||
@@ -146,11 +163,7 @@ private:
|
||||
|
||||
LLViewerParcelMgr::ParcelBuyInfo* mParcelBuyInfo;
|
||||
|
||||
static LLFloaterBuyLandUI* sInstance;
|
||||
|
||||
public:
|
||||
static LLFloaterBuyLandUI* soleInstance(bool createIfNeeded);
|
||||
|
||||
void setForGroup(bool is_for_group);
|
||||
void setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel);
|
||||
|
||||
@@ -158,10 +171,10 @@ public:
|
||||
void updateParcelInfo();
|
||||
void updateCovenantInfo();
|
||||
static void onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data);
|
||||
void updateCovenantText(const std::string& string, const LLUUID &asset_id);
|
||||
void updateEstateName(const std::string& name);
|
||||
void updateLastModified(const std::string& text);
|
||||
void updateEstateOwnerName(const std::string& name);
|
||||
void updateFloaterCovenantText(const std::string& string, const LLUUID &asset_id);
|
||||
void updateFloaterEstateName(const std::string& name);
|
||||
void updateFloaterLastModified(const std::string& text);
|
||||
void updateFloaterEstateOwnerName(const std::string& name);
|
||||
void updateWebSiteInfo();
|
||||
void finishWebSiteInfo();
|
||||
|
||||
@@ -170,10 +183,14 @@ public:
|
||||
void sendBuyLand();
|
||||
|
||||
void updateNames();
|
||||
// Name cache callback
|
||||
void updateName(const LLUUID& id,
|
||||
const std::string& name,
|
||||
bool is_group);
|
||||
|
||||
void refreshUI();
|
||||
|
||||
void startTransaction(TransactionType type, LLXMLRPCValue params);
|
||||
void startTransaction(TransactionType type, const LLXMLRPCValue& params);
|
||||
bool checkTransaction();
|
||||
|
||||
void tellUserError(const std::string& message, const std::string& uri);
|
||||
@@ -183,31 +200,16 @@ public:
|
||||
void startBuyPreConfirm();
|
||||
void startBuyPostConfirm(const std::string& password);
|
||||
|
||||
static void onClickBuy(void* data);
|
||||
static void onClickCancel(void* data);
|
||||
static void onClickErrorWeb(void* data);
|
||||
void onClickBuy();
|
||||
void onClickCancel();
|
||||
void onClickErrorWeb();
|
||||
|
||||
virtual void draw();
|
||||
virtual BOOL canClose();
|
||||
virtual void onClose(bool app_quitting);
|
||||
/*virtual*/ void setMinimized(BOOL b);
|
||||
|
||||
private:
|
||||
class SelectionObserver : public LLParcelObserver
|
||||
{
|
||||
public:
|
||||
virtual void changed();
|
||||
};
|
||||
};
|
||||
|
||||
static void cacheNameUpdateRefreshesBuyLand(const LLUUID& id, const std::string& full_name, bool is_group)
|
||||
{
|
||||
LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false);
|
||||
if (ui)
|
||||
{
|
||||
ui->updateNames();
|
||||
}
|
||||
}
|
||||
void onVisibilityChange ( const LLSD& new_visibility );
|
||||
|
||||
};
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLand::buyLand(
|
||||
@@ -219,102 +221,55 @@ void LLFloaterBuyLand::buyLand(
|
||||
return;
|
||||
}
|
||||
|
||||
LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(true);
|
||||
ui->setForGroup(is_for_group);
|
||||
ui->setParcel(region, parcel);
|
||||
ui->open(); /*Flawfinder: ignore*/
|
||||
LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::getInstance();
|
||||
if(ui)
|
||||
{
|
||||
ui->setForGroup(is_for_group);
|
||||
ui->setParcel(region, parcel);
|
||||
ui->open(); /*Flawfinder: ignore*/
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLand::updateCovenantText(const std::string& string, const LLUUID &asset_id)
|
||||
{
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE);
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::instanceExists() ? LLFloaterBuyLandUI::getInstance() : NULL;
|
||||
if (floater)
|
||||
{
|
||||
floater->updateCovenantText(string, asset_id);
|
||||
floater->updateFloaterCovenantText(string, asset_id);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLand::updateEstateName(const std::string& name)
|
||||
{
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE);
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::instanceExists() ? LLFloaterBuyLandUI::getInstance() : NULL;
|
||||
if (floater)
|
||||
{
|
||||
floater->updateEstateName(name);
|
||||
floater->updateFloaterEstateName(name);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLand::updateLastModified(const std::string& text)
|
||||
{
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE);
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::instanceExists() ? LLFloaterBuyLandUI::getInstance() : NULL;
|
||||
if (floater)
|
||||
{
|
||||
floater->updateLastModified(text);
|
||||
floater->updateFloaterLastModified(text);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLand::updateEstateOwnerName(const std::string& name)
|
||||
{
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE);
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::instanceExists() ? LLFloaterBuyLandUI::getInstance() : NULL;
|
||||
if (floater)
|
||||
{
|
||||
floater->updateEstateOwnerName(name);
|
||||
floater->updateFloaterEstateOwnerName(name);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
BOOL LLFloaterBuyLand::isOpen()
|
||||
{
|
||||
LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE);
|
||||
if (floater)
|
||||
{
|
||||
return floater->getVisible();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// static
|
||||
LLFloaterBuyLandUI* LLFloaterBuyLandUI::sInstance = NULL;
|
||||
|
||||
// static
|
||||
LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded)
|
||||
{
|
||||
#if !LL_RELEASE_FOR_DOWNLOAD
|
||||
if (createIfNeeded)
|
||||
{
|
||||
delete sInstance;
|
||||
sInstance = NULL;
|
||||
}
|
||||
#endif
|
||||
if (!sInstance && createIfNeeded)
|
||||
{
|
||||
sInstance = new LLFloaterBuyLandUI();
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_land.xml");
|
||||
sInstance->center();
|
||||
|
||||
static bool observingCacheName = false;
|
||||
if (!observingCacheName)
|
||||
{
|
||||
gCacheName->addObserver(cacheNameUpdateRefreshesBuyLand);
|
||||
observingCacheName = true;
|
||||
}
|
||||
|
||||
static SelectionObserver* parcelSelectionObserver = NULL;
|
||||
if (!parcelSelectionObserver)
|
||||
{
|
||||
parcelSelectionObserver = new SelectionObserver;
|
||||
LLViewerParcelMgr::getInstance()->addObserver(parcelSelectionObserver);
|
||||
}
|
||||
}
|
||||
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
|
||||
#if LL_WINDOWS
|
||||
// passing 'this' during construction generates a warning. The callee
|
||||
// only uses the pointer to hold a reference to 'this' which is
|
||||
@@ -324,39 +279,45 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded)
|
||||
#endif
|
||||
LLFloaterBuyLandUI::LLFloaterBuyLandUI()
|
||||
: LLFloater(std::string("Buy Land")),
|
||||
mParcelSelectionObserver(this),
|
||||
mParcel(0),
|
||||
mBought(false),
|
||||
mParcelValid(false), mSiteValid(false),
|
||||
mChildren(*this), mCurrency(*this), mTransaction(0),
|
||||
mParcelBuyInfo(0)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_land.xml");
|
||||
LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver);
|
||||
}
|
||||
|
||||
LLFloaterBuyLandUI::~LLFloaterBuyLandUI()
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->removeObserver(&mParcelSelectionObserver);
|
||||
LLViewerParcelMgr::getInstance()->deleteParcelBuy(&mParcelBuyInfo);
|
||||
delete mTransaction;
|
||||
|
||||
if (sInstance == this)
|
||||
{
|
||||
sInstance = NULL;
|
||||
}
|
||||
delete mTransaction;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterBuyLandUI::onClose(bool app_quitting)
|
||||
{
|
||||
// This object holds onto observer, transactions, and parcel state.
|
||||
// Despite being single_instance, destroy it to call destructors and clean
|
||||
// everything up.
|
||||
setVisible(FALSE);
|
||||
destroy();
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::SelectionObserver::changed()
|
||||
{
|
||||
LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false);
|
||||
if (ui)
|
||||
if (LLViewerParcelMgr::getInstance()->selectionEmpty())
|
||||
{
|
||||
if (LLViewerParcelMgr::getInstance()->selectionEmpty())
|
||||
{
|
||||
ui->close();
|
||||
}
|
||||
else {
|
||||
ui->setParcel(
|
||||
LLViewerParcelMgr::getInstance()->getSelectionRegion(),
|
||||
LLViewerParcelMgr::getInstance()->getParcelSelection());
|
||||
}
|
||||
mFloater->close();
|
||||
}
|
||||
else
|
||||
{
|
||||
mFloater->setParcel(LLViewerParcelMgr::getInstance()->getSelectionRegion(),
|
||||
LLViewerParcelMgr::getInstance()->getParcelSelection());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,16 +492,22 @@ void LLFloaterBuyLandUI::updateCovenantInfo()
|
||||
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
|
||||
if(!region) return;
|
||||
|
||||
U8 sim_access = region->getSimAccess();
|
||||
std::string rating = LLViewerRegion::accessToString(sim_access);
|
||||
|
||||
LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
|
||||
if (region_name)
|
||||
{
|
||||
region_name->setText(region->getName());
|
||||
std::string region_name_txt = region->getName() + " ("+rating +")";
|
||||
region_name->setText(region_name_txt);
|
||||
region_name->setToolTip(region_name->getText());
|
||||
}
|
||||
|
||||
LLTextBox* region_type = getChild<LLTextBox>("region_type_text");
|
||||
if (region_type)
|
||||
{
|
||||
region_type->setText(region->getLocalizedSimProductName());
|
||||
region_type->setToolTip(region->getLocalizedSimProductName());
|
||||
}
|
||||
|
||||
LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
|
||||
@@ -574,8 +541,7 @@ void LLFloaterBuyLandUI::updateCovenantInfo()
|
||||
{
|
||||
check->set(false);
|
||||
check->setEnabled(true);
|
||||
check->setCallbackUserData(this);
|
||||
check->setCommitCallback(onChangeAgreeCovenant);
|
||||
check->setCommitCallback(boost::bind(&LLFloaterBuyLandUI::onChangeAgreeCovenant,_1,(void*)this));
|
||||
}
|
||||
|
||||
LLTextBox* box = getChild<LLTextBox>("covenant_text");
|
||||
@@ -603,51 +569,46 @@ void LLFloaterBuyLandUI::onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data)
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::updateCovenantText(const std::string &string, const LLUUID& asset_id)
|
||||
void LLFloaterBuyLandUI::updateFloaterCovenantText(const std::string &string, const LLUUID& asset_id)
|
||||
{
|
||||
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor");
|
||||
if (editor)
|
||||
editor->setHandleEditKeysDirectly(FALSE);
|
||||
editor->setText(string);
|
||||
|
||||
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
|
||||
LLTextBox* box = getChild<LLTextBox>("covenant_text");
|
||||
if (asset_id.isNull())
|
||||
{
|
||||
editor->setHandleEditKeysDirectly(FALSE);
|
||||
editor->setText(string);
|
||||
check->set(true);
|
||||
check->setEnabled(false);
|
||||
refreshUI();
|
||||
|
||||
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
|
||||
LLTextBox* box = getChild<LLTextBox>("covenant_text");
|
||||
if(check && box)
|
||||
{
|
||||
if (asset_id.isNull())
|
||||
{
|
||||
check->set(true);
|
||||
check->setEnabled(false);
|
||||
refreshUI();
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
check->setEnabled(true);
|
||||
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
check->setEnabled(true);
|
||||
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(TRUE);
|
||||
}
|
||||
}
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::updateEstateName(const std::string& name)
|
||||
void LLFloaterBuyLandUI::updateFloaterEstateName(const std::string& name)
|
||||
{
|
||||
LLTextBox* box = getChild<LLTextBox>("estate_name_text");
|
||||
if (box) box->setText(name);
|
||||
box->setText(name);
|
||||
box->setToolTip(name);
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::updateLastModified(const std::string& text)
|
||||
void LLFloaterBuyLandUI::updateFloaterLastModified(const std::string& text)
|
||||
{
|
||||
LLTextBox* editor = getChild<LLTextBox>("covenant_timestamp_text");
|
||||
if (editor) editor->setText(text);
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::updateEstateOwnerName(const std::string& name)
|
||||
void LLFloaterBuyLandUI::updateFloaterEstateOwnerName(const std::string& name)
|
||||
{
|
||||
LLTextBox* box = getChild<LLTextBox>("estate_owner_text");
|
||||
if (box) box->setText(name);
|
||||
@@ -743,7 +704,7 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL remove_contribution = childGetValue("remove_contribution").asBoolean();
|
||||
BOOL remove_contribution = getChild<LLUICtrl>("remove_contribution")->getValue().asBoolean();
|
||||
mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(),
|
||||
gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution);
|
||||
|
||||
@@ -835,17 +796,34 @@ void LLFloaterBuyLandUI::updateNames()
|
||||
}
|
||||
else if (parcelp->getIsGroupOwned())
|
||||
{
|
||||
gCacheName->getGroupName(parcelp->getGroupID(), mParcelSellerName);
|
||||
mParcelSellerName = "(Loading...)";
|
||||
gCacheName->getGroup(parcelp->getGroupID(),
|
||||
boost::bind(&LLFloaterBuyLandUI::updateName, this,
|
||||
_1, _2, _3));
|
||||
}
|
||||
else
|
||||
{
|
||||
gCacheName->getFullName(parcelp->getOwnerID(), mParcelSellerName);
|
||||
mParcelSellerName = "(Loading...)";
|
||||
gCacheName->get(parcelp->getOwnerID(), false,
|
||||
boost::bind(&LLFloaterBuyLandUI::updateName, this,
|
||||
_1, _2, _3));
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::updateName(const LLUUID& id,
|
||||
const std::string& name,
|
||||
bool is_group)
|
||||
{
|
||||
LLParcel* parcelp = mParcel->getParcel();
|
||||
if (parcelp
|
||||
&& (is_group ? parcelp->getGroupID() : parcelp->getOwnerID()) == id)
|
||||
{
|
||||
// request is current
|
||||
mParcelSellerName = name;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::startTransaction(TransactionType type,
|
||||
LLXMLRPCValue params)
|
||||
void LLFloaterBuyLandUI::startTransaction(TransactionType type, const LLXMLRPCValue& params)
|
||||
{
|
||||
delete mTransaction;
|
||||
mTransaction = NULL;
|
||||
@@ -926,11 +904,14 @@ void LLFloaterBuyLandUI::tellUserError(
|
||||
// virtual
|
||||
BOOL LLFloaterBuyLandUI::postBuild()
|
||||
{
|
||||
setVisibleCallback(boost::bind(&LLFloaterBuyLandUI::onVisibilityChange, this, _2));
|
||||
mCurrency.prepare();
|
||||
|
||||
childSetAction("buy_btn", onClickBuy, this);
|
||||
childSetAction("cancel_btn", onClickCancel, this);
|
||||
childSetAction("error_web", onClickErrorWeb, this);
|
||||
getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickBuy, this));
|
||||
getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickCancel, this));
|
||||
getChild<LLUICtrl>("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickErrorWeb, this));
|
||||
|
||||
center();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -996,24 +977,14 @@ BOOL LLFloaterBuyLandUI::canClose()
|
||||
return can_close;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterBuyLandUI::setMinimized(BOOL minimize)
|
||||
void LLFloaterBuyLandUI::onVisibilityChange ( const LLSD& new_visibility )
|
||||
{
|
||||
bool restored = (isMinimized() && !minimize);
|
||||
LLFloater::setMinimized(minimize);
|
||||
if (restored)
|
||||
if (new_visibility.asBoolean())
|
||||
{
|
||||
refreshUI();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterBuyLandUI::onClose(bool app_quitting)
|
||||
{
|
||||
LLFloater::onClose(app_quitting);
|
||||
destroy();
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterBuyLandUI::refreshUI()
|
||||
{
|
||||
// section zero: title area
|
||||
@@ -1027,14 +998,14 @@ void LLFloaterBuyLandUI::refreshUI()
|
||||
|
||||
if (mParcelValid)
|
||||
{
|
||||
childSetText("info_parcel", mParcelLocation);
|
||||
getChild<LLUICtrl>("info_parcel")->setValue(mParcelLocation);
|
||||
|
||||
LLStringUtil::format_map_t string_args;
|
||||
string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea);
|
||||
string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects);
|
||||
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
|
||||
|
||||
childSetText("info_size", getString("meters_supports_object", string_args));
|
||||
getChild<LLUICtrl>("info_size")->setValue(getString("meters_supports_object", string_args));
|
||||
|
||||
F32 cost_per_sqm = 0.0f;
|
||||
if (mParcelActualArea > 0)
|
||||
@@ -1372,26 +1343,20 @@ void LLFloaterBuyLandUI::startBuyPostConfirm(const std::string& password)
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLandUI::onClickBuy(void* data)
|
||||
void LLFloaterBuyLandUI::onClickBuy()
|
||||
{
|
||||
LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data;
|
||||
self->startBuyPreConfirm();
|
||||
startBuyPreConfirm();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLandUI::onClickCancel(void* data)
|
||||
void LLFloaterBuyLandUI::onClickCancel()
|
||||
{
|
||||
LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data;
|
||||
self->close();
|
||||
close();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterBuyLandUI::onClickErrorWeb(void* data)
|
||||
void LLFloaterBuyLandUI::onClickErrorWeb()
|
||||
{
|
||||
LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data;
|
||||
LLWeb::loadURLExternal(self->mCannotBuyURI);
|
||||
self->close();
|
||||
LLWeb::loadURLExternal(mCannotBuyURI);
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#ifndef LL_LLFLOATERBUYLAND_H
|
||||
#define LL_LLFLOATERBUYLAND_H
|
||||
|
||||
class LLFloater;
|
||||
class LLViewerRegion;
|
||||
class LLViewerTextEditor;
|
||||
class LLParcelSelection;
|
||||
|
||||
class LLFloaterBuyLand
|
||||
@@ -47,7 +47,6 @@ public:
|
||||
static void updateEstateName(const std::string& name);
|
||||
static void updateLastModified(const std::string& text);
|
||||
static void updateEstateOwnerName(const std::string& name);
|
||||
static BOOL isOpen();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1154,20 +1154,6 @@ void LLPanelEditWearable::draw()
|
||||
ctrl->set(textureIsInvisible(te));
|
||||
}
|
||||
}
|
||||
|
||||
for (std::map<std::string, S32>::iterator iter = mInvisibilityList.begin();
|
||||
iter != mInvisibilityList.end(); ++iter)
|
||||
{
|
||||
std::string name = iter->first;
|
||||
ETextureIndex te = (ETextureIndex)iter->second;
|
||||
childSetVisible(name, is_copyable && is_modifiable && is_complete);
|
||||
childSetEnabled(name, is_copyable && is_modifiable && is_complete);
|
||||
LLCheckBoxCtrl* ctrl = getChild<LLCheckBoxCtrl>(name);
|
||||
if (ctrl)
|
||||
{
|
||||
ctrl->set(textureIsInvisible(te));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1318,11 +1304,6 @@ void LLPanelEditWearable::setUIPermissions(U32 perm_mask, BOOL is_complete)
|
||||
{
|
||||
childSetVisible(iter->first, is_copyable && is_modifiable && is_complete);
|
||||
}
|
||||
for (std::map<std::string, S32>::iterator iter = mInvisibilityList.begin();
|
||||
iter != mInvisibilityList.end(); ++iter)
|
||||
{
|
||||
childSetVisible(iter->first, is_copyable && is_modifiable && is_complete);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@@ -1342,15 +1323,9 @@ public:
|
||||
static void onSliderMoved(LLUICtrl* ctrl, void* userdata);
|
||||
static void onSliderMouseUp(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
static void onHintMinMouseDown(void* userdata);
|
||||
static void onHintMinHeldDown(void* userdata);
|
||||
static void onHintMaxMouseDown(void* userdata);
|
||||
static void onHintMaxHeldDown(void* userdata);
|
||||
static void onHintMinMouseUp(void* userdata);
|
||||
static void onHintMaxMouseUp(void* userdata);
|
||||
|
||||
void onHintMouseDown( LLVisualParamHint* hint );
|
||||
void onHintHeldDown( LLVisualParamHint* hint );
|
||||
void onHintMouseUp( bool max );
|
||||
void onHintMouseDown( bool max );
|
||||
void onHintHeldDown( bool max );
|
||||
|
||||
F32 weightToPercent( F32 weight );
|
||||
F32 percentToWeight( F32 percent );
|
||||
@@ -1419,15 +1394,15 @@ LLScrollingPanelParam::LLScrollingPanelParam( const std::string& name,
|
||||
childSetValue("min param text", min_name);
|
||||
childSetValue("max param text", max_name);
|
||||
mLess = getChild<LLButton>("less");
|
||||
mLess->setMouseDownCallback( boost::bind(&LLScrollingPanelParam::onHintMinMouseDown, this) );
|
||||
mLess->setMouseUpCallback( boost::bind(LLScrollingPanelParam::onHintMinMouseUp, this) );
|
||||
mLess->setHeldDownCallback( boost::bind(LLScrollingPanelParam::onHintMinHeldDown, this) );
|
||||
mLess->setMouseDownCallback( boost::bind(&LLScrollingPanelParam::onHintMouseDown, this, false) );
|
||||
mLess->setMouseUpCallback( boost::bind(&LLScrollingPanelParam::onHintMouseUp, this, false) );
|
||||
mLess->setHeldDownCallback( boost::bind(&LLScrollingPanelParam::onHintHeldDown, this, false) );
|
||||
mLess->setHeldDownDelay( PARAM_STEP_TIME_THRESHOLD );
|
||||
|
||||
mMore = getChild<LLButton>("more");
|
||||
mMore->setMouseDownCallback( boost::bind(LLScrollingPanelParam::onHintMaxMouseDown, this) );
|
||||
mMore->setMouseUpCallback( boost::bind(LLScrollingPanelParam::onHintMaxMouseUp, this) );
|
||||
mMore->setHeldDownCallback( boost::bind(LLScrollingPanelParam::onHintMaxHeldDown, this) );
|
||||
mMore->setMouseDownCallback( boost::bind(&LLScrollingPanelParam::onHintMouseDown, this, true) );
|
||||
mMore->setMouseUpCallback( boost::bind(&LLScrollingPanelParam::onHintMouseUp, this, true) );
|
||||
mMore->setHeldDownCallback( boost::bind(&LLScrollingPanelParam::onHintHeldDown, this, true) );
|
||||
mMore->setHeldDownDelay( PARAM_STEP_TIME_THRESHOLD );
|
||||
}
|
||||
else
|
||||
@@ -1603,23 +1578,9 @@ void LLScrollingPanelParam::onSliderMouseUp(LLUICtrl* ctrl, void* userdata)
|
||||
LLVisualParamHint::requestHintUpdates( self->mHintMin, self->mHintMax );
|
||||
}
|
||||
|
||||
// static
|
||||
void LLScrollingPanelParam::onHintMinMouseDown( void* userdata )
|
||||
{
|
||||
LLScrollingPanelParam* self = (LLScrollingPanelParam*) userdata;
|
||||
self->onHintMouseDown( self->mHintMin );
|
||||
}
|
||||
|
||||
// static
|
||||
void LLScrollingPanelParam::onHintMaxMouseDown( void* userdata )
|
||||
{
|
||||
LLScrollingPanelParam* self = (LLScrollingPanelParam*) userdata;
|
||||
self->onHintMouseDown( self->mHintMax );
|
||||
}
|
||||
|
||||
|
||||
void LLScrollingPanelParam::onHintMouseDown( LLVisualParamHint* hint )
|
||||
void LLScrollingPanelParam::onHintMouseDown( bool max )
|
||||
{
|
||||
LLVisualParamHint* hint = max ? mHintMax : mHintMin;
|
||||
// morph towards this result
|
||||
F32 current_weight = gAgentAvatarp->getVisualParamWeight( hint->getVisualParam() );
|
||||
|
||||
@@ -1630,23 +1591,10 @@ void LLScrollingPanelParam::onHintMouseDown( LLVisualParamHint* hint )
|
||||
mLastHeldTime = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLScrollingPanelParam::onHintMinHeldDown( void* userdata )
|
||||
{
|
||||
LLScrollingPanelParam* self = (LLScrollingPanelParam*) userdata;
|
||||
self->onHintHeldDown( self->mHintMin );
|
||||
}
|
||||
|
||||
// static
|
||||
void LLScrollingPanelParam::onHintMaxHeldDown( void* userdata )
|
||||
{
|
||||
LLScrollingPanelParam* self = (LLScrollingPanelParam*) userdata;
|
||||
self->onHintHeldDown( self->mHintMax );
|
||||
}
|
||||
|
||||
void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint )
|
||||
void LLScrollingPanelParam::onHintHeldDown( bool max )
|
||||
{
|
||||
LLVisualParamHint* hint = max ? mHintMax : mHintMin;
|
||||
LLViewerVisualParam* param = hint->getVisualParam();
|
||||
|
||||
LLWearable* wearable = gAgentWearables.getWearable((LLWearableType::EType)param->getWearableType(),0); // TODO: MULTI-WEARABLE
|
||||
@@ -1691,59 +1639,14 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint )
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLScrollingPanelParam::onHintMinMouseUp( void* userdata )
|
||||
void LLScrollingPanelParam::onHintMouseUp( bool max )
|
||||
{
|
||||
LLScrollingPanelParam* self = (LLScrollingPanelParam*) userdata;
|
||||
|
||||
F32 elapsed_time = self->mMouseDownTimer.getElapsedTimeF32();
|
||||
F32 elapsed_time = mMouseDownTimer.getElapsedTimeF32();
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if (avatar)
|
||||
{
|
||||
LLVisualParamHint* hint = self->mHintMin;
|
||||
|
||||
if (elapsed_time < PARAM_STEP_TIME_THRESHOLD)
|
||||
{
|
||||
LLViewerVisualParam* param = hint->getVisualParam();
|
||||
|
||||
LLWearable* wearable = gAgentWearables.getWearable((LLWearableType::EType)param->getWearableType(),0); // TODO: MULTI-WEARABLE
|
||||
if(wearable)
|
||||
{
|
||||
// step in direction
|
||||
F32 current_weight = wearable->getVisualParamWeight( param->getID() );
|
||||
F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight();
|
||||
// step a fraction in the negative direction
|
||||
F32 new_weight = current_weight - (range / 10.f);
|
||||
F32 new_percent = self->weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
|
||||
if (slider)
|
||||
{
|
||||
if (slider->getMinValue() < new_percent
|
||||
&& new_percent < slider->getMaxValue())
|
||||
{
|
||||
wearable->setVisualParamWeight(param->getID(), new_weight, TRUE);
|
||||
wearable->writeToAvatar();
|
||||
slider->setValue( self->weightToPercent( new_weight ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLVisualParamHint::requestHintUpdates( self->mHintMin, self->mHintMax );
|
||||
}
|
||||
|
||||
void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata )
|
||||
{
|
||||
LLScrollingPanelParam* self = (LLScrollingPanelParam*) userdata;
|
||||
|
||||
F32 elapsed_time = self->mMouseDownTimer.getElapsedTimeF32();
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if (avatar)
|
||||
{
|
||||
LLVisualParamHint* hint = self->mHintMax;
|
||||
LLVisualParamHint* hint = max ? mHintMax : mHintMin;
|
||||
|
||||
if (elapsed_time < PARAM_STEP_TIME_THRESHOLD)
|
||||
{
|
||||
@@ -1754,11 +1657,14 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata )
|
||||
{
|
||||
// step in direction
|
||||
F32 current_weight = wearable->getVisualParamWeight( param->getID() );
|
||||
F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight();
|
||||
F32 range = mHintMax->getVisualParamWeight() - mHintMin->getVisualParamWeight();
|
||||
//if min, range should be negative.
|
||||
if(!max)
|
||||
range *= -1.f;
|
||||
// step a fraction in the negative direction
|
||||
F32 new_weight = current_weight + (range / 10.f);
|
||||
F32 new_percent = self->weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
|
||||
F32 new_percent = weightToPercent(new_weight);
|
||||
LLSliderCtrl* slider = getChild<LLSliderCtrl>("param slider");
|
||||
if (slider)
|
||||
{
|
||||
if (slider->getMinValue() < new_percent
|
||||
@@ -1766,14 +1672,14 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata )
|
||||
{
|
||||
wearable->setVisualParamWeight(param->getID(), new_weight, TRUE);
|
||||
wearable->writeToAvatar();
|
||||
slider->setValue( self->weightToPercent( new_weight ) );
|
||||
slider->setValue( weightToPercent( new_weight ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLVisualParamHint::requestHintUpdates( self->mHintMin, self->mHintMax );
|
||||
LLVisualParamHint::requestHintUpdates( mHintMin, mHintMax );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -102,7 +102,6 @@ const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] =
|
||||
};
|
||||
|
||||
// Local prototypes
|
||||
void commit_select_tool(LLUICtrl *ctrl, void *data);
|
||||
void commit_select_component(LLUICtrl *ctrl, void *data);
|
||||
void click_show_more(void*);
|
||||
void click_popup_info(void*);
|
||||
@@ -123,6 +122,7 @@ void commit_radio_orbit(LLUICtrl *, void*);
|
||||
void commit_radio_pan(LLUICtrl *, void*);
|
||||
void commit_grid_mode(LLUICtrl *, void*);
|
||||
void commit_slider_zoom(LLUICtrl *, void*);
|
||||
void commit_select_tool(LLUICtrl *ctrl, void *data);
|
||||
|
||||
|
||||
//static
|
||||
@@ -254,15 +254,15 @@ BOOL LLFloaterTools::postBuild()
|
||||
mRadioSpin = getChild<LLCheckBoxCtrl>("radio spin");
|
||||
childSetCommitCallback("radio spin",click_popup_grab_spin,NULL);
|
||||
mRadioPosition = getChild<LLCheckBoxCtrl>("radio position");
|
||||
childSetCommitCallback("radio position",commit_select_tool,LLToolCompTranslate::getInstance());
|
||||
childSetCommitCallback("radio position",commit_select_tool,NULL);
|
||||
mRadioRotate = getChild<LLCheckBoxCtrl>("radio rotate");
|
||||
childSetCommitCallback("radio rotate",commit_select_tool,LLToolCompRotate::getInstance());
|
||||
childSetCommitCallback("radio rotate",commit_select_tool,NULL);
|
||||
mRadioStretch = getChild<LLCheckBoxCtrl>("radio stretch");
|
||||
childSetCommitCallback("radio stretch",commit_select_tool,LLToolCompScale::getInstance());
|
||||
childSetCommitCallback("radio stretch",commit_select_tool,NULL);
|
||||
mRadioSelectFace = getChild<LLCheckBoxCtrl>("radio select face");
|
||||
childSetCommitCallback("radio select face",commit_select_tool,LLToolFace::getInstance());
|
||||
childSetCommitCallback("radio select face",commit_select_tool,NULL);
|
||||
mRadioAlign = getChild<LLCheckBoxCtrl>("radio align");
|
||||
childSetCommitCallback("radio align",commit_select_tool,QToolAlign::getInstance());
|
||||
childSetCommitCallback("radio align",commit_select_tool,NULL);
|
||||
mCheckSelectIndividual = getChild<LLCheckBoxCtrl>("checkbox edit linked parts");
|
||||
childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
childSetCommitCallback("checkbox edit linked parts",commit_select_component,this);
|
||||
@@ -307,7 +307,7 @@ BOOL LLFloaterTools::postBuild()
|
||||
mCheckCopyRotates = getChild<LLCheckBoxCtrl>("checkbox copy rotates");
|
||||
childSetValue("checkbox copy rotates",(BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates"));
|
||||
mRadioSelectLand = getChild<LLCheckBoxCtrl>("radio select land");
|
||||
childSetCommitCallback("radio select land",commit_select_tool, LLToolSelectLand::getInstance());
|
||||
childSetCommitCallback("radio select land",commit_select_tool, NULL);
|
||||
mRadioDozerFlatten = getChild<LLCheckBoxCtrl>("radio flatten");
|
||||
childSetCommitCallback("radio flatten",click_popup_dozer_mode, (void*)0);
|
||||
mRadioDozerRaise = getChild<LLCheckBoxCtrl>("radio raise");
|
||||
@@ -997,7 +997,33 @@ void click_apply_to_selection(void* user)
|
||||
void commit_select_tool(LLUICtrl *ctrl, void *data)
|
||||
{
|
||||
S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners");
|
||||
gFloaterTools->setEditTool(data);
|
||||
|
||||
LLCheckBoxCtrl* group = (LLCheckBoxCtrl*)ctrl;
|
||||
std::string selected = group->getValue().asString();
|
||||
if (selected == "radio position")
|
||||
{
|
||||
LLFloaterTools::setEditTool( LLToolCompTranslate::getInstance() );
|
||||
}
|
||||
else if (selected == "radio rotate")
|
||||
{
|
||||
LLFloaterTools::setEditTool( LLToolCompRotate::getInstance() );
|
||||
}
|
||||
else if (selected == "radio stretch")
|
||||
{
|
||||
LLFloaterTools::setEditTool( LLToolCompScale::getInstance() );
|
||||
}
|
||||
else if (selected == "radio select face")
|
||||
{
|
||||
LLFloaterTools::setEditTool( LLToolFace::getInstance() );
|
||||
}
|
||||
else if (selected == "radio align")
|
||||
{
|
||||
LLFloaterTools::setEditTool( QToolAlign::getInstance() );
|
||||
}
|
||||
else if (selected == "radio select land")
|
||||
{
|
||||
LLFloaterTools::setEditTool( LLToolSelectLand::getInstance());
|
||||
}
|
||||
gSavedSettings.setBOOL("ShowParcelOwners", show_owners);
|
||||
}
|
||||
|
||||
@@ -1051,7 +1077,8 @@ void LLFloaterTools::onClickGridOptions(void* data)
|
||||
|
||||
void LLFloaterTools::setEditTool(void* tool_pointer)
|
||||
{
|
||||
select_tool(tool_pointer);
|
||||
LLTool *tool = (LLTool *)tool_pointer;
|
||||
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( tool );
|
||||
}
|
||||
|
||||
void LLFloaterTools::onFocusReceived()
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file lltextureview.cpp
|
||||
* @brief LLTextureView class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -44,16 +38,21 @@
|
||||
#include "llrender.h"
|
||||
|
||||
#include "llappviewer.h"
|
||||
#include "llhoverview.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "lltexlayer.h"
|
||||
#include "lltexturecache.h"
|
||||
#include "lltexturefetch.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llviewertexture.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llvovolume.h"
|
||||
#include "llviewerstats.h"
|
||||
|
||||
// For avatar texture view
|
||||
#include "llvoavatarself.h"
|
||||
#include "lltexlayer.h"
|
||||
|
||||
extern F32 texmem_lower_bound_scale;
|
||||
|
||||
LLTextureView *gTextureView = NULL;
|
||||
@@ -61,6 +60,7 @@ LLTextureSizeView *gTextureSizeView = NULL;
|
||||
LLTextureSizeView *gTextureCategoryView = NULL;
|
||||
|
||||
#define HIGH_PRIORITY 100000000.f
|
||||
|
||||
//static
|
||||
std::set<LLViewerFetchedTexture*> LLTextureView::sDebugImages;
|
||||
|
||||
@@ -381,6 +381,98 @@ LLRect LLTextureBar::getRequiredRect()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class LLAvatarTexBar : public LLView
|
||||
{
|
||||
public:
|
||||
|
||||
LLAvatarTexBar(const std::string& name, LLTextureView* texview)
|
||||
: LLView(name, FALSE),
|
||||
mTextureView(texview)
|
||||
{
|
||||
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
|
||||
setRect(LLRect(0,0,100,line_height * 4));
|
||||
}
|
||||
|
||||
virtual void draw();
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual LLRect getRequiredRect(); // Return the height of this object, given the set options.
|
||||
|
||||
private:
|
||||
LLTextureView* mTextureView;
|
||||
};
|
||||
|
||||
void LLAvatarTexBar::draw()
|
||||
{
|
||||
if (!gSavedSettings.getBOOL("DebugAvatarRezTime")) return;
|
||||
|
||||
LLVOAvatarSelf* avatarp = gAgentAvatarp;
|
||||
if (!avatarp) return;
|
||||
|
||||
const S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
|
||||
const S32 v_offset = 0;
|
||||
const S32 l_offset = 3;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
LLGLSUIDefault gls_ui;
|
||||
LLColor4 color;
|
||||
|
||||
U32 line_num = 1;
|
||||
for (LLVOAvatarDefines::LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDefines::LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
|
||||
baked_iter != LLVOAvatarDefines::LLVOAvatarDictionary::getInstance()->getBakedTextures().end();
|
||||
++baked_iter)
|
||||
{
|
||||
const LLVOAvatarDefines::EBakedTextureIndex baked_index = baked_iter->first;
|
||||
const LLTexLayerSet *layerset = avatarp->debugGetLayerSet(baked_index);
|
||||
if (!layerset) continue;
|
||||
const LLTexLayerSetBuffer *layerset_buffer = layerset->getComposite();
|
||||
if (!layerset_buffer) continue;
|
||||
|
||||
LLColor4 text_color = LLColor4::white;
|
||||
|
||||
if (layerset_buffer->uploadNeeded())
|
||||
{
|
||||
text_color = LLColor4::red;
|
||||
}
|
||||
if (layerset_buffer->uploadInProgress())
|
||||
{
|
||||
text_color = LLColor4::magenta;
|
||||
}
|
||||
std::string text = layerset_buffer->dumpTextureInfo();
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, l_offset, v_offset + line_height*line_num,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT);
|
||||
line_num++;
|
||||
}
|
||||
const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureUploadTimeout");
|
||||
const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
|
||||
|
||||
LLColor4 header_color(1.f, 1.f, 1.f, 0.9f);
|
||||
|
||||
const std::string texture_timeout_str = texture_timeout ? llformat("%d",texture_timeout) : "Disabled";
|
||||
const std::string override_tex_discard_level_str = override_tex_discard_level ? llformat("%d",override_tex_discard_level) : "Disabled";
|
||||
std::string header_text = llformat("[ Timeout('AvatarBakedTextureUploadTimeout'):%s ] [ LOD_Override('TextureDiscardLevel'):%s ]", texture_timeout_str.c_str(), override_tex_discard_level_str.c_str());
|
||||
LLFontGL::getFontMonospace()->renderUTF8(header_text, 0, l_offset, v_offset + line_height*line_num,
|
||||
header_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT);
|
||||
line_num++;
|
||||
std::string section_text = "Avatar Textures Information:";
|
||||
LLFontGL::getFontMonospace()->renderUTF8(section_text, 0, 0, v_offset + line_height*line_num,
|
||||
header_color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT);
|
||||
}
|
||||
|
||||
BOOL LLAvatarTexBar::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LLRect LLAvatarTexBar::getRequiredRect()
|
||||
{
|
||||
LLRect rect;
|
||||
rect.mTop = 100;
|
||||
if (!gSavedSettings.getBOOL("DebugAvatarRezTime")) rect.mTop = 0;
|
||||
return rect;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class LLGLTexMemBar : public LLView
|
||||
{
|
||||
public:
|
||||
@@ -410,38 +502,39 @@ void LLGLTexMemBar::draw()
|
||||
F32 cache_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getUsage()) ;
|
||||
F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ;
|
||||
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
|
||||
S32 v_offset = 0;
|
||||
F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024);
|
||||
F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024);
|
||||
// U32 cache_max_entries = LLAppViewer::getTextureCache()->getMaxEntries();
|
||||
|
||||
U32 total_http_requests = LLAppViewer::getTextureFetch()->getTotalNumHTTPRequests() ;
|
||||
//----------------------------------------------------------------------------
|
||||
LLGLSUIDefault gls_ui;
|
||||
LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
|
||||
LLColor4 color;
|
||||
|
||||
std::string text;
|
||||
|
||||
std::string text = "";
|
||||
|
||||
S32 global_raw_memory;
|
||||
{
|
||||
global_raw_memory = *AIAccess<S32>(LLImageRaw::sGlobalRawMemory);
|
||||
}
|
||||
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB",
|
||||
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d",
|
||||
total_mem,
|
||||
max_total_mem,
|
||||
bound_mem,
|
||||
max_bound_mem,
|
||||
LLRenderTarget::sBytesAllocated/(1024*1024),
|
||||
global_raw_memory >> 20, discard_bias,
|
||||
cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded);
|
||||
cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded, total_http_requests);
|
||||
//, cache_entries, cache_max_entries
|
||||
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, line_height*3,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#if 0
|
||||
S32 bar_left = 400;
|
||||
S32 bar_width = 200;
|
||||
S32 top = line_height*3 - 2;
|
||||
S32 top = line_height*3 - 2 + v_offset;
|
||||
S32 bottom = top - 6;
|
||||
S32 left = bar_left;
|
||||
S32 right = left + bar_width;
|
||||
@@ -469,7 +562,7 @@ void LLGLTexMemBar::draw()
|
||||
color = (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale)) ? LLColor4::green :
|
||||
(total_mem < max_total_mem) ? LLColor4::yellow : LLColor4::red;
|
||||
color[VALPHA] = .75f;
|
||||
gGL.diffuseColor4f(color.mV);
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
|
||||
gl_rect_2d(left, top, right, bottom); // red/yellow/green
|
||||
|
||||
@@ -492,7 +585,7 @@ void LLGLTexMemBar::draw()
|
||||
color = (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale)) ? LLColor4::green :
|
||||
(bound_mem < max_bound_mem) ? LLColor4::yellow : LLColor4::red;
|
||||
color[VALPHA] = .75f;
|
||||
gGL.diffuseColor4f(color.mV);
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
|
||||
gl_rect_2d(left, top, right, bottom);
|
||||
#else
|
||||
@@ -512,7 +605,7 @@ void LLGLTexMemBar::draw()
|
||||
LLAppViewer::getImageDecodeThread()->getPending(),
|
||||
gTextureList.mCreateTextureList.size());
|
||||
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, line_height*2,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*2,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
left += LLFontGL::getFontMonospace()->getWidth(text);
|
||||
@@ -521,40 +614,40 @@ void LLGLTexMemBar::draw()
|
||||
color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color;
|
||||
color[VALPHA] = text_color[VALPHA];
|
||||
text = llformat("BW:%.0f/%.0f",bandwidth, max_bandwidth);
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, line_height*2,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, v_offset + line_height*2,
|
||||
color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
S32 dx1 = 0;
|
||||
if (LLAppViewer::getTextureFetch()->mDebugPause)
|
||||
{
|
||||
LLFontGL::getFontMonospace()->renderUTF8(std::string("!"), 0, title_x1, line_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(std::string("!"), 0, title_x1, v_offset + line_height,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
dx1 += 8;
|
||||
}
|
||||
if (mTextureView->mFreezeView)
|
||||
{
|
||||
LLFontGL::getFontMonospace()->renderUTF8(std::string("*"), 0, title_x1, line_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(std::string("*"), 0, title_x1, v_offset + line_height,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
dx1 += 8;
|
||||
}
|
||||
if (mTextureView->mOrderFetch)
|
||||
{
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string1b, 0, title_x1+dx1, line_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string1b, 0, title_x1+dx1, v_offset + line_height,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string1a, 0, title_x1+dx1, line_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string1a, 0, title_x1+dx1, v_offset + line_height,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
}
|
||||
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string2, 0, title_x2, line_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string2, 0, title_x2, v_offset + line_height,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string3, 0, title_x3, line_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string3, 0, title_x3, v_offset + line_height,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string4, 0, title_x4, line_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(title_string4, 0, title_x4, v_offset + line_height,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
}
|
||||
|
||||
@@ -566,7 +659,7 @@ BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
LLRect LLGLTexMemBar::getRequiredRect()
|
||||
{
|
||||
LLRect rect;
|
||||
rect.mTop = 8;
|
||||
rect.mTop = 50;
|
||||
return rect;
|
||||
}
|
||||
|
||||
@@ -646,6 +739,7 @@ LLTextureView::LLTextureView(const std::string& name, const LLRect& rect)
|
||||
|
||||
setDisplayChildren(TRUE);
|
||||
mGLTexMemBar = 0;
|
||||
mAvatarTexBar = 0;
|
||||
}
|
||||
|
||||
LLTextureView::~LLTextureView()
|
||||
@@ -653,6 +747,9 @@ LLTextureView::~LLTextureView()
|
||||
// Children all cleaned up by default view destructor.
|
||||
delete mGLTexMemBar;
|
||||
mGLTexMemBar = 0;
|
||||
|
||||
delete mAvatarTexBar;
|
||||
mAvatarTexBar = 0;
|
||||
}
|
||||
|
||||
typedef std::pair<F32,LLViewerFetchedTexture*> decode_pair_t;
|
||||
@@ -664,6 +761,15 @@ struct compare_decode_pair
|
||||
}
|
||||
};
|
||||
|
||||
struct KillView
|
||||
{
|
||||
void operator()(LLView* viewp)
|
||||
{
|
||||
viewp->getParent()->removeChild(viewp);
|
||||
viewp->die();
|
||||
}
|
||||
};
|
||||
|
||||
void LLTextureView::draw()
|
||||
{
|
||||
if (!mFreezeView)
|
||||
@@ -671,12 +777,23 @@ void LLTextureView::draw()
|
||||
// LLViewerObject *objectp;
|
||||
// S32 te;
|
||||
|
||||
for_each(mTextureBars.begin(), mTextureBars.end(), DeletePointer());
|
||||
for_each(mTextureBars.begin(), mTextureBars.end(), KillView());
|
||||
mTextureBars.clear();
|
||||
|
||||
delete mGLTexMemBar;
|
||||
mGLTexMemBar = 0;
|
||||
|
||||
|
||||
if (mGLTexMemBar)
|
||||
{
|
||||
removeChild(mGLTexMemBar);
|
||||
mGLTexMemBar->die();
|
||||
mGLTexMemBar = 0;
|
||||
}
|
||||
|
||||
if (mAvatarTexBar)
|
||||
{
|
||||
removeChild(mAvatarTexBar);
|
||||
mAvatarTexBar->die();
|
||||
mAvatarTexBar = 0;
|
||||
}
|
||||
|
||||
typedef std::multiset<decode_pair_t, compare_decode_pair > display_list_t;
|
||||
display_list_t display_image_list;
|
||||
|
||||
@@ -813,6 +930,7 @@ void LLTextureView::draw()
|
||||
|
||||
static S32 max_count = 50;
|
||||
S32 count = 0;
|
||||
mNumTextureBars = 0 ;
|
||||
for (display_list_t::iterator iter = display_image_list.begin();
|
||||
iter != display_image_list.end(); iter++)
|
||||
{
|
||||
@@ -840,6 +958,9 @@ void LLTextureView::draw()
|
||||
mGLTexMemBar = new LLGLTexMemBar("gl texmem bar", this);
|
||||
addChild(mGLTexMemBar);
|
||||
|
||||
mAvatarTexBar = new LLAvatarTexBar("gl avatartex bar", this);
|
||||
addChild(mAvatarTexBar);
|
||||
|
||||
reshape(getRect().getWidth(), getRect().getHeight(), TRUE);
|
||||
|
||||
/*
|
||||
@@ -920,7 +1041,7 @@ BOOL LLTextureView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
LLTextureSizeView::LLTextureSizeView(const std::string& name) : LLView(name, FALSE)
|
||||
LLTextureSizeView::LLTextureSizeView(const std::string& name) : LLContainerView(name, LLRect())
|
||||
{
|
||||
setVisible(FALSE) ;
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file lltextureview.h
|
||||
* @brief LLTextureView class header file
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -38,11 +32,13 @@
|
||||
class LLViewerFetchedTexture;
|
||||
class LLTextureBar;
|
||||
class LLGLTexMemBar;
|
||||
class LLAvatarTexBar;
|
||||
|
||||
class LLTextureView : public LLContainerView
|
||||
{
|
||||
friend class LLTextureBar;
|
||||
friend class LLGLTexMemBar;
|
||||
friend class LLAvatarTexBar;
|
||||
public:
|
||||
LLTextureView(const std::string& name, const LLRect& rect);
|
||||
~LLTextureView();
|
||||
@@ -71,13 +67,13 @@ private:
|
||||
U32 mNumTextureBars;
|
||||
|
||||
LLGLTexMemBar* mGLTexMemBar;
|
||||
|
||||
LLAvatarTexBar* mAvatarTexBar;
|
||||
public:
|
||||
static std::set<LLViewerFetchedTexture*> sDebugImages;
|
||||
};
|
||||
|
||||
class LLGLTexSizeBar;
|
||||
class LLTextureSizeView : public LLView
|
||||
class LLTextureSizeView : public LLContainerView
|
||||
{
|
||||
public:
|
||||
LLTextureSizeView(const std::string& name);
|
||||
|
||||
@@ -537,7 +537,7 @@ void LLToolBar::onClickDirectory(void*)
|
||||
// static
|
||||
void LLToolBar::onClickBuild(void*)
|
||||
{
|
||||
toggle_build_mode();
|
||||
LLToolMgr::getInstance()->toggleBuildMode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,10 +51,18 @@
|
||||
#include "lltoolselectland.h"
|
||||
#include "lltoolobjpicker.h"
|
||||
#include "lltoolpipette.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llmemberlistener.h"
|
||||
#include "llevent.h"
|
||||
#include "llviewerjoystick.h"
|
||||
#include "llviewermenu.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloatertools.h"
|
||||
|
||||
#include "rlvhandler.h"
|
||||
|
||||
|
||||
// Used when app not active to avoid processing hover.
|
||||
@@ -69,6 +77,24 @@ LLToolset* gFaceEditToolset = NULL;
|
||||
/////////////////////////////////////////////////////
|
||||
// LLToolMgr
|
||||
|
||||
class LLViewBuildMode : public LLMemberListener<LLView>
|
||||
{
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
LLToolMgr::getInstance()->toggleBuildMode();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
class LLViewCheckBuildMode : public LLMemberListener<LLView>
|
||||
{
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
bool new_value = LLToolMgr::getInstance()->inEdit();
|
||||
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
LLToolMgr::LLToolMgr()
|
||||
:
|
||||
mBaseTool(NULL),
|
||||
@@ -88,6 +114,14 @@ LLToolMgr::LLToolMgr()
|
||||
gFaceEditToolset = new LLToolset("FaceEdit");
|
||||
}
|
||||
|
||||
void LLToolMgr::initMenu(std::vector<LLPointer<LLMemberListener<LLView> > >& menu_list)
|
||||
{
|
||||
menu_list.push_back(new LLViewBuildMode());
|
||||
menu_list.back()->registerListener(gMenuHolder, "View.BuildMode");
|
||||
menu_list.push_back(new LLViewCheckBuildMode());
|
||||
menu_list.back()->registerListener(gMenuHolder, "View.CheckBuildMode");
|
||||
}
|
||||
|
||||
void LLToolMgr::initTools()
|
||||
{
|
||||
static BOOL initialized = FALSE;
|
||||
@@ -236,7 +270,7 @@ void LLToolMgr::updateToolStatus()
|
||||
getCurrentTool();
|
||||
}
|
||||
|
||||
BOOL LLToolMgr::inEdit()
|
||||
bool LLToolMgr::inEdit()
|
||||
{
|
||||
return mBaseTool != LLToolPie::getInstance() && mBaseTool != gToolNull;
|
||||
}
|
||||
@@ -245,6 +279,77 @@ bool LLToolMgr::canEdit()
|
||||
{
|
||||
return LLViewerParcelMgr::getInstance()->allowAgentBuild();
|
||||
}
|
||||
|
||||
void LLToolMgr::toggleBuildMode()
|
||||
{
|
||||
if (!inBuildMode())
|
||||
{
|
||||
ECameraMode camMode = gAgentCamera.getCameraMode();
|
||||
if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode)
|
||||
{
|
||||
// pull the user out of mouselook or appearance mode when entering build mode
|
||||
handle_reset_view();
|
||||
}
|
||||
|
||||
if (gSavedSettings.getBOOL("EditCameraMovement"))
|
||||
{
|
||||
// camera should be set
|
||||
if (LLViewerJoystick::getInstance()->getOverrideCamera())
|
||||
{
|
||||
handle_toggle_flycam();
|
||||
}
|
||||
|
||||
if (gAgentCamera.getFocusOnAvatar())
|
||||
{
|
||||
// zoom in if we're looking at the avatar
|
||||
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
|
||||
gAgentCamera.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis()));
|
||||
gAgentCamera.cameraZoomIn(0.666f);
|
||||
gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD );
|
||||
}
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b)
|
||||
bool fRlvCanEdit = (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ));
|
||||
if (!fRlvCanEdit)
|
||||
{
|
||||
LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection();
|
||||
RlvSelectIsEditable f;
|
||||
if ((hSel.notNull()) && ((hSel->getFirstRootNode(&f, TRUE)) != NULL))
|
||||
LLSelectMgr::getInstance()->deselectAll();
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
setCurrentToolset(gBasicToolset);
|
||||
getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
|
||||
|
||||
// Could be first use
|
||||
LLFirstUse::useBuild();
|
||||
|
||||
gAgentCamera.resetView(false);
|
||||
|
||||
// avoid spurious avatar movements
|
||||
LLViewerJoystick::getInstance()->setNeedsReset();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gSavedSettings.getBOOL("EditCameraMovement"))
|
||||
{
|
||||
// just reset the view, will pull us out of edit mode
|
||||
handle_reset_view();
|
||||
}
|
||||
else
|
||||
{
|
||||
// manually disable edit mode, but do not affect the camera
|
||||
gAgentCamera.resetView(false);
|
||||
gFloaterTools->close();
|
||||
gViewerWindow->showCursor();
|
||||
}
|
||||
// avoid spurious avatar movements pulling out of edit mode
|
||||
LLViewerJoystick::getInstance()->setNeedsReset();
|
||||
}
|
||||
}
|
||||
bool LLToolMgr::inBuildMode()
|
||||
{
|
||||
// when entering mouselook inEdit() immediately returns true before
|
||||
@@ -408,9 +513,3 @@ void LLToolset::selectPrevTool()
|
||||
selectToolByIndex((S32)mToolList.size()-1);
|
||||
}
|
||||
}
|
||||
|
||||
void select_tool( void *tool_pointer )
|
||||
{
|
||||
LLTool *tool = (LLTool *)tool_pointer;
|
||||
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( tool );
|
||||
}
|
||||
|
||||
@@ -35,8 +35,11 @@
|
||||
|
||||
#include "llkeyboard.h"
|
||||
|
||||
#include "llmemberlistener.h"
|
||||
|
||||
class LLTool;
|
||||
class LLToolset;
|
||||
class LLView;
|
||||
|
||||
// Key bindings for common operations
|
||||
const MASK MASK_VERTICAL = MASK_CONTROL;
|
||||
@@ -52,14 +55,17 @@ public:
|
||||
LLToolMgr();
|
||||
~LLToolMgr();
|
||||
|
||||
void initMenu(std::vector<LLPointer<LLMemberListener<LLView> > >& menu_list);
|
||||
|
||||
// Must be called after gSavedSettings set up.
|
||||
void initTools();
|
||||
|
||||
LLTool* getCurrentTool(); // returns active tool, taking into account keyboard state
|
||||
LLTool* getBaseTool(); // returns active tool when overrides are deactivated
|
||||
|
||||
BOOL inEdit();
|
||||
bool inEdit();
|
||||
bool canEdit();
|
||||
void toggleBuildMode();
|
||||
|
||||
/* Determines if we are in Build mode or not. */
|
||||
bool inBuildMode();
|
||||
@@ -118,10 +124,6 @@ protected:
|
||||
tool_list_t mToolList;
|
||||
};
|
||||
|
||||
// Handy callbacks for switching tools
|
||||
void select_tool(void *tool);
|
||||
|
||||
|
||||
// Globals
|
||||
|
||||
extern LLToolset* gBasicToolset;
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
extern void handle_buy(void*);
|
||||
extern void handle_buy();
|
||||
|
||||
extern BOOL gDebugClicks;
|
||||
|
||||
@@ -627,7 +627,7 @@ void LLToolPie::selectionPropertiesReceived()
|
||||
switch (click_action)
|
||||
{
|
||||
case CLICK_ACTION_BUY:
|
||||
handle_buy(NULL);
|
||||
handle_buy();
|
||||
break;
|
||||
case CLICK_ACTION_PAY:
|
||||
handle_give_money_dialog();
|
||||
|
||||
@@ -164,6 +164,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
|
||||
if (isObjectAttached(object))
|
||||
{
|
||||
llinfos << "(same object re-attached)" << llendl;
|
||||
LL_INFOS("Attachment") << object->getID() << " ("<<object->getAttachmentPointName()<<") OBJECT re-attached" << llendl;
|
||||
removeObject(object);
|
||||
// Pass through anyway to let setupDrawable()
|
||||
// re-connect object to the joint correctly
|
||||
@@ -178,6 +179,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
|
||||
if (getAttachedObject(object->getAttachmentItemID()))
|
||||
{
|
||||
llinfos << "(same object re-attached)" << llendl;
|
||||
LL_INFOS("Attachment") << object->getID() << " ("<<object->getAttachmentPointName()<<") ITEM re-attached" << llendl;
|
||||
object->markDead();
|
||||
|
||||
// If this happens to be attached to self, then detach.
|
||||
|
||||
@@ -344,7 +344,6 @@ typedef LLMemberListener<LLView> view_listener_t;
|
||||
//
|
||||
// Local prototypes
|
||||
//
|
||||
void handle_leave_group(void *);
|
||||
|
||||
// File Menu
|
||||
void handle_compress_image(void*);
|
||||
@@ -368,37 +367,34 @@ void handle_region_clear_temp_asset_data(void*);
|
||||
BOOL sitting_on_selection();
|
||||
|
||||
void near_sit_object();
|
||||
void label_sit_or_stand(std::string& label, void*);
|
||||
//void label_sit_or_stand(std::string& label, void*);
|
||||
// buy and take alias into the same UI positions, so these
|
||||
// declarations handle this mess.
|
||||
BOOL is_selection_buy_not_take();
|
||||
S32 selection_price();
|
||||
BOOL enable_take();
|
||||
void handle_take();
|
||||
bool confirm_take(const LLSD& notification, const LLSD& response);
|
||||
BOOL enable_buy(void*);
|
||||
void handle_buy(void *);
|
||||
bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection_handle);
|
||||
|
||||
void handle_buy_object(LLSaleInfo sale_info);
|
||||
void handle_buy_contents(LLSaleInfo sale_info);
|
||||
void label_touch(std::string& label, void*);
|
||||
|
||||
bool for_sale_selection(LLSelectNode* nodep);
|
||||
|
||||
// Land pie menu
|
||||
void near_sit_down_point(BOOL success, void *);
|
||||
|
||||
// Avatar pie menu
|
||||
void handle_follow(void *userdata);
|
||||
void handle_talk_to(void *userdata);
|
||||
|
||||
// Debug menu
|
||||
void show_permissions_control(void*);
|
||||
void toggle_build_options(void* user_data);
|
||||
void reload_ui(void*);
|
||||
|
||||
|
||||
void handle_agent_stop_moving(void*);
|
||||
void print_packets_lost(void*);
|
||||
void drop_packet(void*);
|
||||
void velocity_interpolate( void* data );
|
||||
void toggle_wind_audio(void);
|
||||
void toggle_water_audio(void);
|
||||
void handle_rebake_textures(void*);
|
||||
BOOL check_admin_override(void*);
|
||||
void handle_admin_override_toggle(void*);
|
||||
@@ -407,14 +403,6 @@ void handle_toggle_hacked_godmode(void*);
|
||||
BOOL check_toggle_hacked_godmode(void*);
|
||||
#endif
|
||||
|
||||
void toggle_glow(void *);
|
||||
BOOL check_glow(void *);
|
||||
|
||||
void toggle_vertex_shaders(void *);
|
||||
BOOL check_vertex_shaders(void *);
|
||||
|
||||
void toggle_cull_small(void *);
|
||||
|
||||
void toggle_show_xui_names(void *);
|
||||
BOOL check_show_xui_names(void *);
|
||||
|
||||
@@ -568,14 +556,8 @@ void handle_crash(void*);
|
||||
void handle_dump_followcam(void*);
|
||||
void handle_viewer_enable_message_log(void*);
|
||||
void handle_viewer_disable_message_log(void*);
|
||||
void handle_send_postcard(void*);
|
||||
void handle_gestures_old(void*);
|
||||
void handle_focus(void *);
|
||||
|
||||
BOOL enable_buy_land(void*);
|
||||
void handle_move(void*);
|
||||
void handle_show_inventory(void*);
|
||||
void handle_activate(void*);
|
||||
BOOL enable_activate(void*);
|
||||
|
||||
// Help menu
|
||||
void handle_buy_currency(void*);
|
||||
@@ -687,6 +669,8 @@ void set_underclothes_menu_options()
|
||||
}
|
||||
}
|
||||
|
||||
static std::vector<LLPointer<view_listener_t> > sMenus;
|
||||
|
||||
void init_menus()
|
||||
{
|
||||
S32 top = gViewerWindow->getRootView()->getRect().getHeight();
|
||||
@@ -892,6 +876,7 @@ void init_menus()
|
||||
|
||||
gMenuHolder->addChild(gLoginMenuBarView);
|
||||
|
||||
LLToolMgr::getInstance()->initMenu(sMenus);
|
||||
}
|
||||
|
||||
|
||||
@@ -900,8 +885,6 @@ void init_client_menu(LLMenuGL* menu)
|
||||
{
|
||||
LLMenuGL* sub_menu = NULL;
|
||||
|
||||
//menu->addChild(new LLMenuItemCallGL("Permissions Control", &show_permissions_control));
|
||||
// this is now in the view menu so we don't need it here!
|
||||
|
||||
{
|
||||
// *TODO: Translate
|
||||
@@ -1544,7 +1527,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addChild(new LLMenuItemCheckGL("Axes", menu_toggle_control, NULL, menu_check_control, (void*)"ShowAxes"));
|
||||
//menu->addChild(new LLMenuItemCheckGL("Cull Small Objects", toggle_cull_small, NULL, menu_check_control, (void*)"RenderCullBySize"));
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addChild(new LLMenuItemCheckGL("Hide Selected", menu_toggle_control, NULL, menu_check_control, (void*)"HideSelectedObjects"));
|
||||
@@ -1809,8 +1791,6 @@ void init_server_menu(LLMenuGL* menu)
|
||||
menu->createJumpKeys();
|
||||
}
|
||||
|
||||
static std::vector<LLPointer<view_listener_t> > sMenus;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// cleanup_menus()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1968,18 +1948,19 @@ class LLObjectEnableTouch : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
void label_touch(std::string& label, void*)
|
||||
{
|
||||
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
|
||||
if (node && node->mValid && !node->mTouchName.empty())
|
||||
{
|
||||
label.assign(node->mTouchName);
|
||||
}
|
||||
else
|
||||
{
|
||||
label.assign("Touch");
|
||||
}
|
||||
}
|
||||
|
||||
//void label_touch(std::string& label, void*)
|
||||
//{
|
||||
// LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
|
||||
// if (node && node->mValid && !node->mTouchName.empty())
|
||||
// {
|
||||
// label.assign(node->mTouchName);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// label.assign("Touch");
|
||||
// }
|
||||
//}
|
||||
|
||||
bool handle_object_open()
|
||||
{
|
||||
@@ -2028,95 +2009,7 @@ class LLObjectEnableOpen : public view_listener_t
|
||||
};
|
||||
|
||||
|
||||
class LLViewCheckBuildMode : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
bool new_value = LLToolMgr::getInstance()->inEdit();
|
||||
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool toggle_build_mode()
|
||||
{
|
||||
if (LLToolMgr::getInstance()->inBuildMode())
|
||||
{
|
||||
if (gSavedSettings.getBOOL("EditCameraMovement"))
|
||||
{
|
||||
// just reset the view, will pull us out of edit mode
|
||||
handle_reset_view();
|
||||
}
|
||||
else
|
||||
{
|
||||
// manually disable edit mode, but do not affect the camera
|
||||
gAgentCamera.resetView(false);
|
||||
gFloaterTools->close();
|
||||
gViewerWindow->showCursor();
|
||||
}
|
||||
// avoid spurious avatar movements pulling out of edit mode
|
||||
LLViewerJoystick::getInstance()->setNeedsReset();
|
||||
}
|
||||
else
|
||||
{
|
||||
ECameraMode camMode = gAgentCamera.getCameraMode();
|
||||
if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode)
|
||||
{
|
||||
// pull the user out of mouselook or appearance mode when entering build mode
|
||||
handle_reset_view();
|
||||
}
|
||||
|
||||
if (gSavedSettings.getBOOL("EditCameraMovement"))
|
||||
{
|
||||
// camera should be set
|
||||
if (LLViewerJoystick::getInstance()->getOverrideCamera())
|
||||
{
|
||||
handle_toggle_flycam();
|
||||
}
|
||||
|
||||
if (gAgentCamera.getFocusOnAvatar())
|
||||
{
|
||||
// zoom in if we're looking at the avatar
|
||||
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
|
||||
gAgentCamera.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis()));
|
||||
gAgentCamera.cameraZoomIn(0.666f);
|
||||
gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD );
|
||||
}
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b)
|
||||
bool fRlvCanEdit = (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ));
|
||||
if (!fRlvCanEdit)
|
||||
{
|
||||
LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection();
|
||||
RlvSelectIsEditable f;
|
||||
if ((hSel.notNull()) && ((hSel->getFirstRootNode(&f, TRUE)) != NULL))
|
||||
LLSelectMgr::getInstance()->deselectAll();
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
|
||||
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
|
||||
|
||||
// Could be first use
|
||||
LLFirstUse::useBuild();
|
||||
|
||||
gAgentCamera.resetView(false);
|
||||
|
||||
// avoid spurious avatar movements
|
||||
LLViewerJoystick::getInstance()->setNeedsReset();
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
class LLViewBuildMode : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
return toggle_build_mode();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class LLViewJoystickFlycam : public view_listener_t
|
||||
@@ -2517,15 +2410,18 @@ BOOL enable_has_attachments(void*)
|
||||
//---------------------------------------------------------------------------
|
||||
// Avatar pie menu
|
||||
//---------------------------------------------------------------------------
|
||||
void handle_follow(void *userdata)
|
||||
{
|
||||
// follow a given avatar by ID
|
||||
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
|
||||
if (objectp)
|
||||
{
|
||||
gAgent.startFollowPilot(objectp->getID());
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// Avatar pie menu
|
||||
//---------------------------------------------------------------------------
|
||||
//void handle_follow(void *userdata)
|
||||
//{
|
||||
// // follow a given avatar by ID
|
||||
// LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
|
||||
// if (objectp)
|
||||
// {
|
||||
// gAgent.startFollowPilot(objectp->getID());
|
||||
// }
|
||||
//}
|
||||
|
||||
class LLObjectEnableMute : public view_listener_t
|
||||
{
|
||||
@@ -3415,16 +3311,6 @@ bool callback_leave_group(const LLSD& notification, const LLSD& response)
|
||||
return false;
|
||||
}
|
||||
|
||||
void handle_leave_group(void *)
|
||||
{
|
||||
if (gAgent.getGroupID() != LLUUID::null)
|
||||
{
|
||||
LLSD args;
|
||||
args["GROUP"] = gAgent.getGroupName();
|
||||
LLNotificationsUtil::add("GroupLeaveConfirmMember", args, LLSD(), callback_leave_group);
|
||||
}
|
||||
}
|
||||
|
||||
void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm, PermissionBit bit, const char* txt)
|
||||
{
|
||||
LLAggregatePermissions::EValue val = ag_perm.getValue(bit);
|
||||
@@ -3447,32 +3333,35 @@ void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm
|
||||
string.append(buffer);
|
||||
}
|
||||
|
||||
BOOL enable_buy(void*)
|
||||
bool enable_buy_object()
|
||||
{
|
||||
// In order to buy, there must only be 1 purchaseable object in
|
||||
// the selection manger.
|
||||
if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return FALSE;
|
||||
if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return false;
|
||||
LLViewerObject* obj = NULL;
|
||||
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
|
||||
if(node)
|
||||
{
|
||||
obj = node->getObject();
|
||||
if(!obj) return FALSE;
|
||||
if(!obj) return false;
|
||||
|
||||
if(node->mSaleInfo.isForSale() && node->mPermissions->getMaskOwner() & PERM_TRANSFER &&
|
||||
(node->mPermissions->getMaskOwner() & PERM_COPY || node->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY))
|
||||
if( for_sale_selection(node) )
|
||||
{
|
||||
if(obj->permAnyOwner()) return TRUE;
|
||||
// *NOTE: Is this needed? This checks to see if anyone owns the
|
||||
// object, dating back to when we had "public" objects owned by
|
||||
// no one. JC
|
||||
if(obj->permAnyOwner()) return true;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
class LLObjectEnableBuy : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
bool new_value = enable_buy(NULL);
|
||||
bool new_value = enable_buy_object();
|
||||
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
|
||||
return true;
|
||||
}
|
||||
@@ -4108,15 +3997,6 @@ class LLLandSit : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
void show_permissions_control(void*)
|
||||
{
|
||||
LLFloaterPermissionsMgr* floaterp = LLFloaterPermissionsMgr::show();
|
||||
floaterp->mPermissions->addPermissionsData("foo1", LLUUID::null, 0);
|
||||
floaterp->mPermissions->addPermissionsData("foo2", LLUUID::null, 0);
|
||||
floaterp->mPermissions->addPermissionsData("foo3", LLUUID::null, 0);
|
||||
}
|
||||
|
||||
|
||||
class LLCreateLandmarkCallback : public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
@@ -4127,11 +4007,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void reload_ui(void *)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->rebuild();
|
||||
}
|
||||
|
||||
class LLWorldFly : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
@@ -4278,7 +4153,9 @@ void reset_view_final( BOOL proceed )
|
||||
return;
|
||||
}
|
||||
|
||||
gAgentCamera.switchCameraPreset(CAMERA_PRESET_REAR_VIEW);
|
||||
gAgentCamera.resetView(TRUE, TRUE);
|
||||
gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR);
|
||||
}
|
||||
|
||||
class LLViewLookAtLastChatter : public view_listener_t
|
||||
@@ -4994,7 +4871,7 @@ void handle_take()
|
||||
|
||||
LLNotification::Params params("ConfirmObjectTakeLock");
|
||||
params.payload(payload)
|
||||
.functor(confirm_take);
|
||||
.functor(boost::bind(&confirm_take, _1, _2, LLSelectMgr::instance().getSelection()));
|
||||
|
||||
if(locked_but_takeable_object ||
|
||||
!you_own_everything)
|
||||
@@ -5021,7 +4898,7 @@ void handle_take()
|
||||
}
|
||||
}
|
||||
|
||||
bool confirm_take(const LLSD& notification, const LLSD& response)
|
||||
bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection_handle)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if(enable_take() && (option == 0))
|
||||
@@ -5091,7 +4968,7 @@ class LLToolsBuyOrTake : public view_listener_t
|
||||
|
||||
if (total_price <= gStatusBar->getBalance() || total_price == 0)
|
||||
{
|
||||
handle_buy(NULL);
|
||||
handle_buy();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5112,7 +4989,7 @@ class LLToolsEnableBuyOrTake : public view_listener_t
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
bool is_buy = is_selection_buy_not_take();
|
||||
bool new_value = is_buy ? enable_buy(NULL) : enable_take();
|
||||
bool new_value = is_buy ? enable_buy_object() : enable_take();
|
||||
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
|
||||
|
||||
// Update label
|
||||
@@ -5230,7 +5107,7 @@ void handle_buy_currency(void*)
|
||||
// LLFloaterBuyCurrency::buyCurrency();
|
||||
}
|
||||
|
||||
void handle_buy(void*)
|
||||
void handle_buy()
|
||||
{
|
||||
if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return;
|
||||
|
||||
@@ -5252,11 +5129,26 @@ class LLObjectBuy : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
handle_buy(NULL);
|
||||
handle_buy();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool anyone_copy_selection(LLSelectNode* nodep)
|
||||
{
|
||||
bool perm_copy = (bool)(nodep->getObject()->permCopy());
|
||||
bool all_copy = (bool)(nodep->mPermissions->getMaskEveryone() & PERM_COPY);
|
||||
return perm_copy && all_copy;
|
||||
}
|
||||
|
||||
bool for_sale_selection(LLSelectNode* nodep)
|
||||
{
|
||||
return nodep->mSaleInfo.isForSale()
|
||||
&& nodep->mPermissions->getMaskOwner() & PERM_TRANSFER
|
||||
&& (nodep->mPermissions->getMaskOwner() & PERM_COPY
|
||||
|| nodep->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY);
|
||||
}
|
||||
|
||||
BOOL sitting_on_selection()
|
||||
{
|
||||
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
|
||||
@@ -6843,33 +6735,6 @@ class LLShowAgentGroups : public view_listener_t
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void handle_focus(void *)
|
||||
{
|
||||
if (gDisconnected)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (gAgentCamera.getFocusOnAvatar())
|
||||
{
|
||||
// zoom in if we're looking at the avatar
|
||||
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
|
||||
gAgentCamera.setFocusGlobal(LLToolPie::getInstance()->getPick());
|
||||
gAgentCamera.cameraZoomIn(0.666f);
|
||||
}
|
||||
else
|
||||
{
|
||||
gAgentCamera.setFocusGlobal(LLToolPie::getInstance()->getPick());
|
||||
}
|
||||
|
||||
gViewerWindow->moveCursorToCenter();
|
||||
|
||||
// Switch to camera toolset
|
||||
// LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset);
|
||||
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCamera::getInstance() );
|
||||
}
|
||||
|
||||
class LLLandEdit : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
@@ -6928,26 +6793,6 @@ BOOL enable_buy_land(void*)
|
||||
}
|
||||
|
||||
|
||||
void handle_move(void*)
|
||||
{
|
||||
if (gAgentCamera.getFocusOnAvatar())
|
||||
{
|
||||
// zoom in if we're looking at the avatar
|
||||
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
|
||||
gAgentCamera.setFocusGlobal(LLToolPie::getInstance()->getPick());
|
||||
|
||||
gAgentCamera.cameraZoomIn(0.666f);
|
||||
}
|
||||
else
|
||||
{
|
||||
gAgentCamera.setFocusGlobal(LLToolPie::getInstance()->getPick());
|
||||
}
|
||||
|
||||
gViewerWindow->moveCursorToCenter();
|
||||
|
||||
LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
|
||||
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() );
|
||||
}
|
||||
|
||||
class LLObjectAttachToAvatar : public view_listener_t
|
||||
{
|
||||
@@ -7558,16 +7403,6 @@ class LLAvatarSendIM : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void handle_activate(void*)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL enable_activate(void*)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
struct QueueObjects : public LLSelectedObjectFunctor
|
||||
@@ -8302,19 +8137,6 @@ BOOL enable_god_basic(void*)
|
||||
//return gAgent.getGodLevel() > GOD_NOT;
|
||||
}
|
||||
|
||||
#if 0 // 1.9.2
|
||||
void toggle_vertex_shaders(void *)
|
||||
{
|
||||
BOOL use_shaders = gPipeline.getUseVertexShaders();
|
||||
gPipeline.setUseVertexShaders(use_shaders);
|
||||
}
|
||||
|
||||
BOOL check_vertex_shaders(void *)
|
||||
{
|
||||
return gPipeline.getUseVertexShaders();
|
||||
}
|
||||
#endif
|
||||
|
||||
void toggle_show_xui_names(void *)
|
||||
{
|
||||
BOOL showXUINames = gSavedSettings.getBOOL("ShowXUINames");
|
||||
@@ -8328,15 +8150,6 @@ BOOL check_show_xui_names(void *)
|
||||
return gSavedSettings.getBOOL("ShowXUINames");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void toggle_cull_small(void *)
|
||||
{
|
||||
// gPipeline.mCullBySize = !gPipeline.mCullBySize;
|
||||
//
|
||||
// gSavedSettings.setBOOL("RenderCullBySize", gPipeline.mCullBySize);
|
||||
}
|
||||
|
||||
class LLToolsSelectOnlyMyObjects : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
@@ -9424,7 +9237,7 @@ class LLWorldDayCycle : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
static void addMenu(view_listener_t *menu, const std::string& name)
|
||||
void addMenu(view_listener_t *menu, const std::string& name)
|
||||
{
|
||||
sMenus.push_back(menu);
|
||||
menu->registerListener(gMenuHolder, name);
|
||||
@@ -9494,7 +9307,6 @@ void initialize_menus()
|
||||
|
||||
// View menu
|
||||
addMenu(new LLViewMouselook(), "View.Mouselook");
|
||||
addMenu(new LLViewBuildMode(), "View.BuildMode");
|
||||
addMenu(new LLViewJoystickFlycam(), "View.JoystickFlycam");
|
||||
addMenu(new LLViewCommunicate(), "View.Communicate");
|
||||
addMenu(new LLViewResetView(), "View.ResetView");
|
||||
@@ -9514,7 +9326,6 @@ void initialize_menus()
|
||||
addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter");
|
||||
addMenu(new LLViewToggleRadar(), "View.ToggleAvatarList");
|
||||
|
||||
addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode");
|
||||
addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam");
|
||||
addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips");
|
||||
addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent");
|
||||
|
||||
@@ -39,7 +39,7 @@ class LLUICtrl;
|
||||
class LLView;
|
||||
class LLParcelSelection;
|
||||
class LLObjectSelection;
|
||||
|
||||
class LLSelectNode;
|
||||
|
||||
void pre_init_menus();
|
||||
void init_menus();
|
||||
@@ -97,8 +97,17 @@ void exchange_callingcard(const LLUUID& dest_id);
|
||||
|
||||
void handle_gestures(void*);
|
||||
void handle_sit_down(void*);
|
||||
bool toggle_build_mode();
|
||||
void handle_object_build(void*);
|
||||
|
||||
void handle_buy();
|
||||
// Can anyone take a free copy of the object?
|
||||
// *TODO: Move to separate file
|
||||
bool anyone_copy_selection(LLSelectNode* nodep);
|
||||
|
||||
// Is this selected object for sale?
|
||||
// *TODO: Move to separate file
|
||||
bool for_sale_selection(LLSelectNode* nodep);
|
||||
|
||||
void handle_save_snapshot(void *);
|
||||
void handle_toggle_flycam();
|
||||
void handle_fake_away_status(void*);
|
||||
@@ -106,6 +115,7 @@ void handle_fake_away_status(void*);
|
||||
bool handle_sit_or_stand();
|
||||
bool handle_give_money_dialog();
|
||||
bool handle_object_open();
|
||||
bool enable_buy_object();
|
||||
bool handle_go_to();
|
||||
|
||||
// Export to XML or Collada
|
||||
|
||||
@@ -1769,6 +1769,22 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
|
||||
LLViewerObject *sent_parentp = gObjectList.findObject(parent_uuid);
|
||||
|
||||
if(isAttachment())
|
||||
{
|
||||
llassert_always(gAgentID.notNull());
|
||||
if(parent_uuid == gAgentID)
|
||||
{
|
||||
static std::map<LLUUID,bool> state_map;
|
||||
std::map<LLUUID,bool>::iterator it = state_map.find(getID());
|
||||
|
||||
if(it == state_map.end() || (!it->second && sent_parentp))
|
||||
{
|
||||
it->second = sent_parentp != NULL;
|
||||
LL_INFOS("Attachment") << getID() << " ("<<getAttachmentPointName()<<") has " << (sent_parentp ? "" : "no ") << "parent." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check to see if we have the corresponding viewer object for the parent.
|
||||
//
|
||||
|
||||
@@ -824,7 +824,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
||||
//------------------------------------------------------------------------
|
||||
LLVOAvatar::~LLVOAvatar()
|
||||
{
|
||||
if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
|
||||
//App teardown is a mess. Avatar destruction can be unpredictable due to all potential refs to the smartptr.
|
||||
//Cannot guarantee that LLNotificationUtil will be usable during shutdown chain.
|
||||
if (!LLApp::isQuitting() && gSavedSettings.getBOOL("DebugAvatarRezTime"))
|
||||
{
|
||||
if (!mFullyLoaded)
|
||||
{
|
||||
@@ -6753,10 +6755,19 @@ void LLVOAvatar::addChild(LLViewerObject *childp)
|
||||
LLViewerObject::addChild(childp);
|
||||
if (childp->mDrawable)
|
||||
{
|
||||
if(isSelf())
|
||||
{
|
||||
LL_INFOS("Attachment") << childp->getID() << " ("<<childp->getAttachmentPointName()<<") attached." << llendl;
|
||||
llassert(std::find(mPendingAttachment.begin(), mPendingAttachment.end(), childp) == mPendingAttachment.end());
|
||||
}
|
||||
attachObject(childp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isSelf())
|
||||
{
|
||||
LL_INFOS("Attachment") << childp->getID() << " ("<<childp->getAttachmentPointName()<<") pending." << llendl;
|
||||
}
|
||||
mPendingAttachment.push_back(childp);
|
||||
}
|
||||
}
|
||||
@@ -6890,6 +6901,10 @@ void LLVOAvatar::lazyAttach()
|
||||
{
|
||||
if (mPendingAttachment[i]->mDrawable)
|
||||
{
|
||||
if(isSelf())
|
||||
{
|
||||
LL_INFOS("Attachment") << mPendingAttachment[i]->getID() << " ("<<mPendingAttachment[i]->getAttachmentPointName()<<") done pending. attached." << llendl;
|
||||
}
|
||||
attachObject(mPendingAttachment[i]);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user