STORM-1253 WIP Debugging stuff.
parent
4b348d0065
commit
dda7df4ac9
|
|
@ -835,6 +835,56 @@ void LLEnvManagerNew::dumpUserPrefs()
|
|||
LL_DEBUGS("Windlight") << "UseDayCycle: " << gSavedSettings.getBOOL("UseDayCycle") << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLEnvManagerNew::dumpPresets()
|
||||
{
|
||||
const LLEnvironmentSettings& region_settings = getRegionSettings();
|
||||
std::string region_name = gAgent.getRegion() ? gAgent.getRegion()->getName() : "Unknown region";
|
||||
|
||||
// Dump water presets.
|
||||
LL_DEBUGS("Windlight") << "Waters:" << LL_ENDL;
|
||||
if (region_settings.getWaterParams().size() != 0)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL;
|
||||
}
|
||||
const std::map<std::string, LLWaterParamSet> &water_params_map = LLWaterParamManager::instance().mParamList;
|
||||
for (std::map<std::string, LLWaterParamSet>::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << " - " << it->first << LL_ENDL;
|
||||
}
|
||||
|
||||
// Dump sky presets.
|
||||
LL_DEBUGS("Windlight") << "Skies:" << LL_ENDL;
|
||||
const std::map<LLWLParamKey, LLWLParamSet> &sky_params_map = LLWLParamManager::getInstance()->mParamList;
|
||||
for (std::map<LLWLParamKey, LLWLParamSet>::const_iterator it = sky_params_map.begin(); it != sky_params_map.end(); it++)
|
||||
{
|
||||
std::string preset_name = it->first.name;
|
||||
std::string item_title;
|
||||
|
||||
if (it->first.scope == LLEnvKey::SCOPE_LOCAL) // local preset
|
||||
{
|
||||
item_title = preset_name;
|
||||
}
|
||||
else // region preset
|
||||
{
|
||||
item_title = preset_name + " (" + region_name + ")";
|
||||
}
|
||||
LL_DEBUGS("Windlight") << " - " << item_title << LL_ENDL;
|
||||
}
|
||||
|
||||
// Dump day cycles.
|
||||
LL_DEBUGS("Windlight") << "Days:" << LL_ENDL;
|
||||
const LLSD& cur_region_dc = region_settings.getWLDayCycle();
|
||||
if (cur_region_dc.size() != 0)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL;
|
||||
}
|
||||
const LLDayCycleManager::dc_map_t& map = LLDayCycleManager::instance().getPresets();
|
||||
for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << " - " << it->first << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLEnvManagerNew::requestRegionSettings()
|
||||
{
|
||||
LLEnvironmentRequest::initiate();
|
||||
|
|
|
|||
|
|
@ -301,6 +301,7 @@ public:
|
|||
bool use_fixed_sky,
|
||||
bool use_region_settings);
|
||||
void dumpUserPrefs();
|
||||
void dumpPresets();
|
||||
|
||||
// Misc.
|
||||
void requestRegionSettings();
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ BOOL LLFloaterEnvironmentSettings::postBuild()
|
|||
childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), NULL);
|
||||
getChild<LLUICtrl>("ok_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance()));
|
||||
childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), NULL);
|
||||
getChild<LLUICtrl>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance()));
|
||||
|
||||
setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this));
|
||||
|
||||
|
|
|
|||
|
|
@ -3295,6 +3295,7 @@ BOOL LLPanelEnvironmentInfo::postBuild()
|
|||
childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL);
|
||||
getChild<LLButton>("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance()));
|
||||
childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL);
|
||||
getChild<LLButton>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance()));
|
||||
|
||||
LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this));
|
||||
LLEnvManagerNew::instance().setRegionSettingsAppliedCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingsApplied, this, _1));
|
||||
|
|
|
|||
|
|
@ -678,6 +678,8 @@ bool LLWLParamManager::addParamSet(const LLWLParamKey& key, LLWLParamSet& param)
|
|||
std::map<LLWLParamKey, LLWLParamSet>::iterator mIt = mParamList.find(key);
|
||||
if(mIt == mParamList.end())
|
||||
{
|
||||
llassert(!key.name.empty());
|
||||
// *TODO: validate params
|
||||
mParamList[key] = param;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -691,6 +693,8 @@ BOOL LLWLParamManager::addParamSet(const LLWLParamKey& key, LLSD const & param)
|
|||
std::map<LLWLParamKey, LLWLParamSet>::const_iterator finder = mParamList.find(key);
|
||||
if(finder == mParamList.end())
|
||||
{
|
||||
llassert(!key.name.empty());
|
||||
// *TODO: validate params
|
||||
mParamList[key].setAll(param);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -716,6 +720,8 @@ bool LLWLParamManager::getParamSet(const LLWLParamKey& key, LLWLParamSet& param)
|
|||
|
||||
bool LLWLParamManager::setParamSet(const LLWLParamKey& key, LLWLParamSet& param)
|
||||
{
|
||||
llassert(!key.name.empty());
|
||||
// *TODO: validate params
|
||||
mParamList[key] = param;
|
||||
|
||||
return true;
|
||||
|
|
@ -723,6 +729,9 @@ bool LLWLParamManager::setParamSet(const LLWLParamKey& key, LLWLParamSet& param)
|
|||
|
||||
bool LLWLParamManager::setParamSet(const LLWLParamKey& key, const LLSD & param)
|
||||
{
|
||||
llassert(!key.name.empty());
|
||||
// *TODO: validate params
|
||||
|
||||
// quick, non robust (we won't be working with files, but assets) check
|
||||
// this might not actually be true anymore....
|
||||
if(!param.isMap())
|
||||
|
|
|
|||
Loading…
Reference in New Issue