diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 11:00:11 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 11:00:11 -0400 |
commit | 000a23ba0534fdf9bfc4a1b051b7cee0adceef3e (patch) | |
tree | 776fe10c7aaf76371a889f79c48c3c9405fd5a4e /indra/newview/llfloaterregioninfo.cpp | |
parent | 7ac4c3b56e5246fceaa73e7c9c665d3c04827d6c (diff) | |
parent | bacf9cfeab90bd1ffad827fa3c34ced985c768a2 (diff) |
Merge branch 'develop' into release/luau-scripting
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 85 |
1 files changed, 66 insertions, 19 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index ccdfffc079..99ab75f713 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -61,6 +61,7 @@ #include "llfloatergroups.h" #include "llfloaterreg.h" #include "llfloaterregiondebugconsole.h" +#include "llfloaterregionrestartschedule.h" #include "llfloatertelehub.h" #include "llgltfmateriallist.h" #include "llinventorymodel.h" @@ -259,6 +260,7 @@ bool LLFloaterRegionInfo::postBuild() panel = new LLPanelRegionGeneralInfo; mInfoPanels.push_back(panel); panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", { boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel) }); + panel->getCommitCallbackRegistrar().add("RegionInfo.ManageRestart", { boost::bind(&LLPanelRegionInfo::onClickManageRestartSchedule, panel) }); panel->buildFromFile("panel_region_general.xml"); mTab->addTabPanel(panel); @@ -266,7 +268,7 @@ bool LLFloaterRegionInfo::postBuild() mInfoPanels.push_back(panel); static LLCachedControl<bool> feature_pbr_terrain_enabled(gSavedSettings, "RenderTerrainPBREnabled", false); static LLCachedControl<bool> feature_pbr_terrain_transforms_enabled(gSavedSettings, "RenderTerrainPBRTransformsEnabled", false); - if (!feature_pbr_terrain_transforms_enabled || !feature_pbr_terrain_enabled) + if (!feature_pbr_terrain_transforms_enabled() || !feature_pbr_terrain_enabled()) { panel->buildFromFile("panel_region_terrain.xml"); } @@ -519,7 +521,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->getChild<LLUICtrl>("object_bonus_spin")->setValue(LLSD(object_bonus_factor)); panel->getChild<LLUICtrl>("access_combo")->setValue(LLSD(sim_access)); - panel->getChild<LLSpinCtrl>("agent_limit_spin")->setMaxValue(hard_agent_limit); + panel->getChild<LLSpinCtrl>("agent_limit_spin")->setMaxValue((F32)hard_agent_limit); LLPanelRegionGeneralInfo* panel_general = LLFloaterRegionInfo::getPanelGeneral(); if (panel) @@ -863,6 +865,25 @@ void LLPanelRegionInfo::onClickManageTelehub() LLFloaterReg::showInstance("telehubs"); } +void LLPanelRegionInfo::onClickManageRestartSchedule() +{ + LLFloater* floaterp = mFloaterRestartScheduleHandle.get(); + // Show the dialog + if (!floaterp) + { + floaterp = new LLFloaterRegionRestartSchedule(this); + } + + if (floaterp->getVisible()) + { + floaterp->closeFloater(); + } + else + { + floaterp->openFloater(); + } +} + ///////////////////////////////////////////////////////////////////////////// // LLPanelRegionGeneralInfo // @@ -878,6 +899,8 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region) getChildView("kick_all_btn")->setEnabled(allow_modify); getChildView("im_btn")->setEnabled(allow_modify); getChildView("manage_telehub_btn")->setEnabled(allow_modify); + getChildView("manage_restart_btn")->setEnabled(allow_modify); + getChildView("manage_restart_btn")->setVisible(LLFloaterRegionRestartSchedule::canUse()); // Data gets filled in by processRegionInfo @@ -1562,7 +1585,7 @@ bool LLPanelRegionTerrainInfo::postBuild() { mTextureDetailCtrl[i]->setBakeTextureEnabled(false); } - initAndSetCtrl(mMaterialDetailCtrl[i], llformat("material_detail_%d", i)); + initMaterialCtrl(mMaterialDetailCtrl[i], llformat("material_detail_%d", i), i); initAndSetCtrl(mMaterialScaleUCtrl[i], llformat("terrain%dScaleU", i)); initAndSetCtrl(mMaterialScaleVCtrl[i], llformat("terrain%dScaleV", i)); @@ -1671,7 +1694,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) static LLCachedControl<bool> feature_pbr_terrain_enabled(gSavedSettings, "RenderTerrainPBREnabled", false); const bool textures_ready = compp->makeTexturesReady(false, false); - const bool materials_ready = feature_pbr_terrain_enabled && compp->makeMaterialsReady(false, false); + const bool materials_ready = feature_pbr_terrain_enabled() && compp->makeMaterialsReady(false, false); bool set_texture_swatches; bool set_material_swatches; @@ -1701,7 +1724,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) { material_type_to_ctrl(mMaterialTypeCtrl, material_type); updateForMaterialType(); - mMaterialTypeCtrl->setVisible(feature_pbr_terrain_enabled); + mMaterialTypeCtrl->setVisible(feature_pbr_terrain_enabled()); } if (set_texture_swatches) @@ -1915,7 +1938,7 @@ bool LLPanelRegionTerrainInfo::sendUpdate() // POST to ModifyRegion endpoint, if enabled static LLCachedControl<bool> feature_pbr_terrain_transforms_enabled(gSavedSettings, "RenderTerrainPBRTransformsEnabled", false); - if (material_type == LLTerrainMaterials::Type::PBR && feature_pbr_terrain_transforms_enabled) + if (material_type == LLTerrainMaterials::Type::PBR && feature_pbr_terrain_transforms_enabled()) { LLTerrainMaterials composition; for (S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) @@ -1932,11 +1955,11 @@ bool LLPanelRegionTerrainInfo::sendUpdate() for (U32 tt = 0; tt < LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; ++tt) { LLGLTFMaterial::TextureTransform& transform = mat_override->mTextureTransform[tt]; - transform.mScale.mV[VX] = mMaterialScaleUCtrl[i]->getValue().asReal(); - transform.mScale.mV[VY] = mMaterialScaleVCtrl[i]->getValue().asReal(); - transform.mRotation = mMaterialRotationCtrl[i]->getValue().asReal() * DEG_TO_RAD; - transform.mOffset.mV[VX] = mMaterialOffsetUCtrl[i]->getValue().asReal(); - transform.mOffset.mV[VY] = mMaterialOffsetVCtrl[i]->getValue().asReal(); + transform.mScale.mV[VX] = (F32)mMaterialScaleUCtrl[i]->getValue().asReal(); + transform.mScale.mV[VY] = (F32)mMaterialScaleVCtrl[i]->getValue().asReal(); + transform.mRotation = (F32)mMaterialRotationCtrl[i]->getValue().asReal() * DEG_TO_RAD; + transform.mOffset.mV[VX] = (F32)mMaterialOffsetUCtrl[i]->getValue().asReal(); + transform.mOffset.mV[VY] = (F32)mMaterialOffsetVCtrl[i]->getValue().asReal(); } } @@ -1959,6 +1982,31 @@ bool LLPanelRegionTerrainInfo::sendUpdate() return true; } +void LLPanelRegionTerrainInfo::initMaterialCtrl(LLTextureCtrl*& ctrl, const std::string& name, S32 index) +{ + ctrl = findChild<LLTextureCtrl>(name, true); + if (!ctrl) return; + + // consume cancel events, otherwise they will trigger commit callbacks + ctrl->setOnCancelCallback([](LLUICtrl* ctrl, const LLSD& param) {}); + ctrl->setCommitCallback( + [this, index](LLUICtrl* ctrl, const LLSD& param) + { + if (!mMaterialScaleUCtrl[index] + || !mMaterialScaleVCtrl[index] + || !mMaterialRotationCtrl[index] + || !mMaterialOffsetUCtrl[index] + || !mMaterialOffsetVCtrl[index]) return; + + mMaterialScaleUCtrl[index]->setValue(1.f); + mMaterialScaleVCtrl[index]->setValue(1.f); + mMaterialRotationCtrl[index]->setValue(0.f); + mMaterialOffsetUCtrl[index]->setValue(0.f); + mMaterialOffsetVCtrl[index]->setValue(0.f); + onChangeAnything(); + }); +} + bool LLPanelRegionTerrainInfo::callbackTextureHeights(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -2307,7 +2355,6 @@ void LLPanelEstateInfo::refresh() // Disable access restriction controls if they make no sense. bool public_access = ("estate_public_access" == getChild<LLUICtrl>("externally_visible_radio")->getValue().asString()); - getChildView("Only Allow")->setEnabled(public_access); getChildView("limit_payment")->setEnabled(public_access); getChildView("limit_age_verified")->setEnabled(public_access); getChildView("limit_bots")->setEnabled(public_access); @@ -4177,11 +4224,11 @@ bool LLPanelRegionEnvironment::postBuild() if (!LLPanelEnvironmentInfo::postBuild()) return false; - getChild<LLUICtrl>(BTN_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); - getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setVisible(true); - getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(true); + mBtnUseDefault->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); + mCheckAllowOverride->setVisible(true); + mPanelEnvAltitudes->setVisible(true); - getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setCommitCallback([this](LLUICtrl *, const LLSD &value){ onChkAllowOverride(value.asBoolean()); }); + mCheckAllowOverride->setCommitCallback([this](LLUICtrl *, const LLSD &value){ onChkAllowOverride(value.asBoolean()); }); mCommitConnect = estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); return true; @@ -4203,7 +4250,7 @@ void LLPanelRegionEnvironment::refresh() LLPanelEnvironmentInfo::refresh(); - getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride); + mCheckAllowOverride->setValue(mAllowOverride); } bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) @@ -4244,7 +4291,7 @@ void LLPanelRegionEnvironment::refreshFromSource() } LLEnvironment::instance().requestRegion( - [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); + [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { onEnvironmentReceived(that_h, parcel_id, envifo); }); setControlsEnabled(false); } @@ -4269,7 +4316,7 @@ bool LLPanelRegionEnvironment::confirmUpdateEstateEnvironment(const LLSD& notifi case 1: mAllowOverride = mAllowOverrideRestore; - getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride); + mCheckAllowOverride->setValue(mAllowOverride); break; default: break; |