STORM-1285 WIP Connected "Create/Edit Water / Sky / Day Cycle" floaters (not functional) to the main menu.

master
Vadim ProductEngine 2011-05-26 23:09:30 +03:00
parent ebfbf2a561
commit bbde07245b
12 changed files with 408 additions and 19 deletions

View File

@ -176,6 +176,9 @@ set(viewer_SOURCE_FILES
llfloaterdaycycle.cpp
llfloaterdeleteenvpreset.cpp
llfloaterdisplayname.cpp
llfloatereditdaycycle.cpp
llfloatereditsky.cpp
llfloatereditwater.cpp
llfloaterenvsettings.cpp
llfloaterenvironmentsettings.cpp
llfloaterevent.cpp
@ -726,6 +729,9 @@ set(viewer_HEADER_FILES
llfloaterdaycycle.h
llfloaterdeleteenvpreset.h
llfloaterdisplayname.h
llfloatereditdaycycle.h
llfloatereditsky.h
llfloatereditwater.h
llfloaterenvsettings.h
llfloaterenvironmentsettings.h
llfloaterevent.h

View File

@ -0,0 +1,73 @@
/**
* @file llfloatereditdaycycle.cpp
* @brief Floater to create or edit a day cycle
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloatereditdaycycle.h"
// libs
#include "llbutton.h"
// newview
LLFloaterEditDayCycle::LLFloaterEditDayCycle(const LLSD &key)
: LLFloater(key)
{
}
// virtual
BOOL LLFloaterEditDayCycle::postBuild()
{
getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onBtnCancel, this));
// Disable some non-functional controls.
getChildView("day_cycle_combo")->setEnabled(FALSE);
getChildView("save")->setEnabled(FALSE);
return TRUE;
}
// virtual
void LLFloaterEditDayCycle::onOpen(const LLSD& key)
{
std::string param = key.asString();
std::string floater_title = getString(std::string("title_") + param);
std::string hint = getString(std::string("hint_" + param));
// Update floater title.
setTitle(floater_title);
// Update the hint at the top.
getChild<LLUICtrl>("hint")->setValue(hint);
// Hide the hint to the right of the combo if we're invoked to create a new preset.
getChildView("note")->setVisible(param == "edit");
}
void LLFloaterEditDayCycle::onBtnCancel()
{
closeFloater();
}

View File

@ -0,0 +1,45 @@
/**
* @file llfloatereditdaycycle.h
* @brief Floater to create or edit a day cycle
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#ifndef LL_LLFLOATEREDITDAYCYCLE_H
#define LL_LLFLOATEREDITDAYCYCLE_H
#include "llfloater.h"
class LLFloaterEditDayCycle : public LLFloater
{
LOG_CLASS(LLFloaterEditDayCycle);
public:
LLFloaterEditDayCycle(const LLSD &key);
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
void onBtnCancel();
};
#endif // LL_LLFLOATEREDITDAYCYCLE_H

View File

@ -0,0 +1,73 @@
/**
* @file llfloatereditsky.h
* @brief Floater to create or edit a sky preset
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloatereditsky.h"
// libs
#include "llbutton.h"
// newview
LLFloaterEditSky::LLFloaterEditSky(const LLSD &key)
: LLFloater(key)
{
}
// virtual
BOOL LLFloaterEditSky::postBuild()
{
getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this));
// Disable some non-functional controls.
getChildView("sky_preset_combo")->setEnabled(FALSE);
getChildView("save")->setEnabled(FALSE);
return TRUE;
}
// virtual
void LLFloaterEditSky::onOpen(const LLSD& key)
{
std::string param = key.asString();
std::string floater_title = getString(std::string("title_") + param);
std::string hint = getString(std::string("hint_" + param));
// Update floater title.
setTitle(floater_title);
// Update the hint at the top.
getChild<LLUICtrl>("hint")->setValue(hint);
// Hide the hint to the right of the combo if we're invoked to create a new preset.
getChildView("note")->setVisible(param == "edit");
}
void LLFloaterEditSky::onBtnCancel()
{
closeFloater();
}

View File

@ -0,0 +1,45 @@
/**
* @file llfloatereditsky.h
* @brief Floater to create or edit a sky preset
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#ifndef LL_LLFLOATEREDITSKY_H
#define LL_LLFLOATEREDITSKY_H
#include "llfloater.h"
class LLFloaterEditSky : public LLFloater
{
LOG_CLASS(LLFloaterEditSky);
public:
LLFloaterEditSky(const LLSD &key);
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
void onBtnCancel();
};
#endif // LL_LLFLOATEREDITSKY_H

View File

@ -0,0 +1,73 @@
/**
* @file llfloatereditwater.cpp
* @brief Floater to create or edit a water preset
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloatereditwater.h"
// libs
#include "llbutton.h"
// newview
LLFloaterEditWater::LLFloaterEditWater(const LLSD &key)
: LLFloater(key)
{
}
// virtual
BOOL LLFloaterEditWater::postBuild()
{
getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditWater::onBtnCancel, this));
// Disable some non-functional controls.
getChildView("water_preset_combo")->setEnabled(FALSE);
getChildView("save")->setEnabled(FALSE);
return TRUE;
}
// virtual
void LLFloaterEditWater::onOpen(const LLSD& key)
{
std::string param = key.asString();
std::string floater_title = getString(std::string("title_") + param);
std::string hint = getString(std::string("hint_" + param));
// Update floater title.
setTitle(floater_title);
// Update the hint at the top.
getChild<LLUICtrl>("hint")->setValue(hint);
// Hide the hint to the right of the combo if we're invoked to create a new preset.
getChildView("note")->setVisible(param == "edit");
}
void LLFloaterEditWater::onBtnCancel()
{
closeFloater();
}

View File

@ -0,0 +1,45 @@
/**
* @file llfloatereditwater.h
* @brief Floater to create or edit a water preset
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#ifndef LL_LLFLOATEREDITWATER_H
#define LL_LLFLOATEREDITWATER_H
#include "llfloater.h"
class LLFloaterEditWater : public LLFloater
{
LOG_CLASS(LLFloaterEditWater);
public:
LLFloaterEditWater(const LLSD &key);
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
void onBtnCancel();
};
#endif // LL_LLFLOATEREDITWATER_H

View File

@ -51,6 +51,9 @@
#include "llfloaterdaycycle.h"
#include "llfloaterdeleteenvpreset.h"
#include "llfloaterdisplayname.h"
#include "llfloatereditdaycycle.h"
#include "llfloatereditsky.h"
#include "llfloatereditwater.h"
#include "llfloaterenvironmentsettings.h"
#include "llfloaterevent.h"
#include "llfloatersearch.h"
@ -161,6 +164,9 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("env_water", "floater_water.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWater>);
LLFloaterReg::add("env_windlight", "floater_windlight_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWindLight>);
LLFloaterReg::add("env_delete_preset", "floater_delete_env_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDeleteEnvPreset>);
LLFloaterReg::add("env_edit_sky", "floater_edit_sky_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditSky>);
LLFloaterReg::add("env_edit_water", "floater_edit_water_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditWater>);
LLFloaterReg::add("env_edit_day_cycle", "floater_edit_day_cycle.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditDayCycle>);
LLFloaterReg::add("event", "floater_event.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEvent>);

View File

@ -7627,9 +7627,11 @@ class LLWorldEnvPreset : public view_listener_t
if (item == "new_water")
{
LLFloaterReg::showInstance("env_edit_water", "new");
}
else if (item == "edit_water")
{
LLFloaterReg::showInstance("env_edit_water", "edit");
}
else if (item == "delete_water")
{
@ -7637,9 +7639,11 @@ class LLWorldEnvPreset : public view_listener_t
}
else if (item == "new_sky")
{
LLFloaterReg::showInstance("env_edit_sky", "new");
}
else if (item == "edit_sky")
{
LLFloaterReg::showInstance("env_edit_sky", "edit");
}
else if (item == "delete_sky")
{
@ -7647,9 +7651,11 @@ class LLWorldEnvPreset : public view_listener_t
}
else if (item == "new_day_cycle")
{
LLFloaterReg::showInstance("env_edit_day_cycle", "new");
}
else if (item == "edit_day_cycle")
{
LLFloaterReg::showInstance("env_edit_day_cycle", "edit");
}
else if (item == "delete_day_cycle")
{

View File

@ -3,17 +3,23 @@
legacy_header_height="18"
height="450"
layout="topleft"
name="Environment Editor Floater"
help_topic="environment_editor_floater"
name="Edit Day cycle"
help_topic=""
save_rect="true"
title="Edit Day Cycle"
width="800">
<string name="title_new">Create a New Day Cycle</string>
<string name="title_edit">Edit Day Cycle</string>
<string name="hint_new">Name your day cycle, adjust the controls to create it, and click "Save".</string>
<string name="hint_edit">To edit your day cycle, adjust the controls below and click "Save".</string>
<text
follows="top|left|right"
height="10"
layout="topleft"
left="30"
name="info_string"
name="hint"
top="25"
width="700">
To edit your preset, adjust the controls then click "Save"
@ -24,7 +30,7 @@
height="10"
layout="topleft"
left="30"
name="info_string"
name="label"
top_pad="25"
width="120">
Preset Name:
@ -34,7 +40,7 @@
follows="top|left"
layout="topleft"
left_pad="10"
name="water_preset_combo"
name="day_cycle_combo"
top_delta="-5"
width="200">
<combo_box.item
@ -47,7 +53,7 @@
height="40"
layout="topleft"
left_pad="10"
name="info_string"
name="note"
top_delta="0"
width="405"
wrap="true">
@ -452,7 +458,7 @@
<check_box
follows="top|left"
height="10"
label="Make this preset my new water setting"
label="Make this my new day cycle"
layout="topleft"
left="330"
name="new_water_preset_chb"

View File

@ -3,17 +3,23 @@
legacy_header_height="18"
height="375"
layout="topleft"
name="Environment Editor Floater"
help_topic="environment_editor_floater"
name="Edit Sky Preset"
help_topic=""
save_rect="true"
title="Edit Sky Preset"
width="900">
<string name="title_new">Create a New Sky Preset</string>
<string name="title_edit">Edit Sky Preset</string>
<string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string>
<string name="hint_edit">To edit your sky preset, adjust the controls and click "Save".</string>
<text
follows="top|left|right"
height="10"
layout="topleft"
left="30"
name="info_string"
name="hint"
top="25"
width="700">
To edit your preset, adjust the controls then click "Save"
@ -24,7 +30,7 @@
height="10"
layout="topleft"
left="30"
name="info_string"
name="label"
top_pad="25"
width="120">
Preset Name:
@ -34,7 +40,7 @@
follows="top|left"
layout="topleft"
left_pad="10"
name="water_preset_combo"
name="sky_preset_combo"
top_delta="-5"
width="200">
<combo_box.item
@ -47,7 +53,7 @@
height="40"
layout="topleft"
left_pad="10"
name="info_string"
name="note"
top_delta="0"
width="405"
wrap="true">

View File

@ -3,18 +3,23 @@
legacy_header_height="18"
height="450"
layout="topleft"
name="Environment Editor Floater"
help_topic="environment_editor_floater"
name="Edit Water Preset"
help_topic=""
save_rect="true"
title="Edit Water Preset"
width="900">
<string name="title_new">Create a New Water Preset</string>
<string name="title_edit">Edit a Water Preset</string>
<string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string>
<string name="hint_edit">To edit your water preset, adjust the controls and click "Save".</string>
<text
follows="top|left|right"
height="10"
layout="topleft"
left="30"
name="info_string"
name="hint"
top="25"
width="700">
To edit your preset, adjust the controls then click "Save"
@ -26,7 +31,7 @@
height="10"
layout="topleft"
left="30"
name="info_string"
name="label"
top_pad="25"
width="120">
Preset Name:
@ -51,7 +56,7 @@
height="40"
layout="topleft"
left_pad="10"
name="info_string"
name="note"
top_delta="0"
width="405"
wrap="true">