diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-04-17 02:25:04 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-04-17 02:25:04 +0000 |
commit | d2597d35cf3aeaf0c47a134dfe9119ef7932b98a (patch) | |
tree | 73c9e027e31810a582dfaeeaae6c51ef7208d6d1 /indra/newview/llfloatercamera.cpp | |
parent | c57beb8b4bd51add9a92ddc4d704e7bea9c4d940 (diff) |
Undid previous commit (bogus merge)
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 64 |
1 files changed, 54 insertions, 10 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index ab85a8c3c1..6bc14b331b 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -43,17 +43,21 @@ // Constants const F32 CAMERA_BUTTON_DELAY = 0.0f; +// Globals +LLFloaterCamera* gFloaterCamera = NULL; + + // // Member functions // -LLFloaterCamera::LLFloaterCamera(const LLSD& val) -: LLFloater("camera floater") // uses "FloaterCameraRect3" +LLFloaterCamera::LLFloaterCamera(const std::string& name) +: LLFloater(name) // uses "FloaterCameraRect3" { setIsChrome(TRUE); - const BOOL DONT_OPEN = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml", NULL, DONT_OPEN); + // For now, only used for size and tooltip strings + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml"); S32 top = getRect().getHeight(); S32 bottom = 0; @@ -99,12 +103,11 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val) addChild(mTrack); } -// virtual -void LLFloaterCamera::onOpen() + +LLFloaterCamera::~LLFloaterCamera() { - LLFloater::onOpen(); - - gSavedSettings.setBOOL("ShowCameraControls", TRUE); + // children all deleted by LLView destructor + gFloaterCamera = NULL; } // virtual @@ -116,4 +119,45 @@ void LLFloaterCamera::onClose(bool app_quitting) { gSavedSettings.setBOOL("ShowCameraControls", FALSE); } -}
\ No newline at end of file +} + +// +// Static member functions +// + +// static +void LLFloaterCamera::show(void*) +{ + if(!gFloaterCamera) + { + gFloaterCamera = new LLFloaterCamera("camera floater"); + } + gFloaterCamera->open(); /* Flawfinder: ignore */ + gSavedSettings.setBOOL("ShowCameraControls", TRUE); +} + +// static +void LLFloaterCamera::toggle(void*) +{ + if (gFloaterCamera) + { + gFloaterCamera->close(); + } + else + { + show(NULL); + } +} + +// static +BOOL LLFloaterCamera::visible(void*) +{ + if (gFloaterCamera) + { + return gFloaterCamera->getVisible(); + } + else + { + return FALSE; + } +} |