From e0d0c01f62d4de08db7c08b90c9fe5a04b986f64 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 11 Oct 2009 08:11:27 -0700 Subject: Made advanced water toggle --- linden/indra/newview/llfloaterwater.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'linden/indra/newview/llfloaterwater.cpp') diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp index d2ea74e..7e2f188 100644 --- a/linden/indra/newview/llfloaterwater.cpp +++ b/linden/indra/newview/llfloaterwater.cpp @@ -316,14 +316,26 @@ LLFloaterWater* LLFloaterWater::instance() } void LLFloaterWater::show() { - LLFloaterWater* water = instance(); - water->syncMenu(); - - // comment in if you want the menu to rebuild each time - //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); - //water->initCallbacks(); + if (!sWaterMenu) + { + LLFloaterWater* water = instance(); + water->syncMenu(); - water->open(); + // comment in if you want the menu to rebuild each time + //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); + //water->initCallbacks(); + } + else + { + if (sWaterMenu->getVisible()) + { + sWaterMenu->close(); + } + else + { + sWaterMenu->open(); + } + } } bool LLFloaterWater::isOpen() -- cgit v1.1