summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-07-30 16:16:55 +0300
committerMike Antipov <mantipov@productengine.com>2010-07-30 16:16:55 +0300
commit84c848504c53a571a8be0281616e0dfecce53db3 (patch)
tree7e5a069dbe36421eaca030a2c708f54ed9d48da8
parent1302ad710eb4708d68342af82e03fdc751ae510a (diff)
EXT-7796 ADDITIOANL FIXED Reopen reason - Camera Floater did not take into account edit appearance mode while it is being built.
FIX: Store the "edit appearance" mode as internal floater's flag and apply it while building to ensure that its controls have right "enable" state. Also added forcing of Pan Camera mode if floater is opened first time in Edit appearance mode. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/824/ --HG-- branch : product-engine
-rw-r--r--indra/newview/llfloatercamera.cpp23
-rw-r--r--indra/newview/llfloatercamera.h3
2 files changed, 22 insertions, 4 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 0fa536dfad..85a5f076ab 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -62,6 +62,7 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f;
#define CONTROLS "controls"
bool LLFloaterCamera::sFreeCamera = false;
+bool LLFloaterCamera::sAppearanceEditing = false;
// Zoom the camera in and out
class LLPanelCameraZoom
@@ -245,16 +246,21 @@ void LLFloaterCamera::resetCameraMode()
void LLFloaterCamera::onAvatarEditingAppearance(bool editing)
{
+ sAppearanceEditing = editing;
LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance();
if (!floater_camera) return;
+ floater_camera->handleAvatarEditingAppearance(editing);
+}
+void LLFloaterCamera::handleAvatarEditingAppearance(bool editing)
+{
//camera presets (rear, front, etc.)
- floater_camera->childSetEnabled("preset_views_list", !editing);
- floater_camera->childSetEnabled("presets_btn", !editing);
+ childSetEnabled("preset_views_list", !editing);
+ childSetEnabled("presets_btn", !editing);
//camera modes (object view, mouselook view)
- floater_camera->childSetEnabled("camera_modes_list", !editing);
- floater_camera->childSetEnabled("avatarview_btn", !editing);
+ childSetEnabled("camera_modes_list", !editing);
+ childSetEnabled("avatarview_btn", !editing);
}
void LLFloaterCamera::update()
@@ -349,6 +355,9 @@ BOOL LLFloaterCamera::postBuild()
update();
+ // ensure that appearance mode is handled while building. See EXT-7796.
+ handleAvatarEditingAppearance(sAppearanceEditing);
+
return LLDockableFloater::postBuild();
}
@@ -371,6 +380,12 @@ void LLFloaterCamera::fillFlatlistFromPanel (LLFlatListView* list, LLPanel* pane
ECameraControlMode LLFloaterCamera::determineMode()
{
+ if (sAppearanceEditing)
+ {
+ // this is the only enabled camera mode while editing agent appearance.
+ return CAMERA_CTRL_MODE_PAN;
+ }
+
LLTool* curr_tool = LLToolMgr::getInstance()->getCurrentTool();
if (curr_tool == LLToolCamera::getInstance())
{
diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h
index c5f8cd6db5..737bd17e72 100644
--- a/indra/newview/llfloatercamera.h
+++ b/indra/newview/llfloatercamera.h
@@ -124,9 +124,12 @@ private:
// fills flatlist with items from given panel
void fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel);
+ void handleAvatarEditingAppearance(bool editing);
+
// set to true when free camera mode is selected in modes list
// remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed
static bool sFreeCamera;
+ static bool sAppearanceEditing;
BOOL mClosed;
ECameraControlMode mPrevMode;
ECameraControlMode mCurrMode;