From 886be2faf19343843d8b2bf7a24c91bdeb1a9294 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 2 Jul 2024 11:44:14 +0300 Subject: viewer#1857 Reset texture transforms when terrain PBR is applied ctrls aren't dynamically alocated so getChild is preferable, but since other elements use findchild and validy checks used findChild as well --- indra/newview/llfloaterregioninfo.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index c019bd047d..d6ffab5825 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -1561,7 +1561,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)); @@ -1958,6 +1958,31 @@ bool LLPanelRegionTerrainInfo::sendUpdate() return true; } +void LLPanelRegionTerrainInfo::initMaterialCtrl(LLTextureCtrl*& ctrl, const std::string& name, S32 index) +{ + ctrl = findChild(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); -- cgit v1.2.3 From 9fdca96f8bd2211a99fe88e57b70cbecefa20b6d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 8 Jul 2024 20:27:14 +0200 Subject: Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now --- indra/newview/llfloaterregioninfo.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d6ffab5825..41d1fcff82 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -519,7 +519,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->getChild("object_bonus_spin")->setValue(LLSD(object_bonus_factor)); panel->getChild("access_combo")->setValue(LLSD(sim_access)); - panel->getChild("agent_limit_spin")->setMaxValue(hard_agent_limit); + panel->getChild("agent_limit_spin")->setMaxValue((F32)hard_agent_limit); LLPanelRegionGeneralInfo* panel_general = LLFloaterRegionInfo::getPanelGeneral(); if (panel) @@ -1931,11 +1931,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(); } } -- cgit v1.2.3 From aa3fe3352e5a96537aad475e6f6683baaa495090 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 11 Jul 2024 10:40:36 +0300 Subject: viewer#1975 Fixed "Allow Land Resell" option not switching --- indra/newview/llfloaterregioninfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 41d1fcff82..52eddcfc67 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -512,7 +512,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->getChild("block_fly_over_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_FLYOVER)); panel->getChild("allow_damage_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_ALLOW_DAMAGE)); panel->getChild("restrict_pushobject")->setValue(is_flag_set(region_flags, REGION_FLAGS_RESTRICT_PUSHOBJECT)); - panel->getChild("allow_land_resell_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_LAND_RESELL)); + panel->getChild("allow_land_resell_check")->setValue(!is_flag_set(region_flags, REGION_FLAGS_BLOCK_LAND_RESELL)); panel->getChild("allow_parcel_changes_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_ALLOW_PARCEL_CHANGES)); panel->getChild("block_parcel_search_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_PARCEL_SEARCH)); panel->getChild("agent_limit_spin")->setValue(LLSD((F32)agent_limit)); -- cgit v1.2.3 From 70f332d02e687c2c3d4806ccda0e1dcd8bde1232 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Wed, 24 Jul 2024 18:47:24 -0400 Subject: Fix findChild during draw in the parcel/region environment panel --- indra/newview/llfloaterregioninfo.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 52eddcfc67..fc6abf4bfe 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -4201,11 +4201,11 @@ bool LLPanelRegionEnvironment::postBuild() if (!LLPanelEnvironmentInfo::postBuild()) return false; - getChild(BTN_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); - getChild(CHK_ALLOWOVERRIDE)->setVisible(true); - getChild(PNL_ENVIRONMENT_ALTITUDES)->setVisible(true); + mBtnUseDefault->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); + mCheckAllowOverride->setVisible(true); + mPanelEnvAltitudes->setVisible(true); - getChild(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; @@ -4227,7 +4227,7 @@ void LLPanelRegionEnvironment::refresh() LLPanelEnvironmentInfo::refresh(); - getChild(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride); + mCheckAllowOverride->setValue(mAllowOverride); } bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) @@ -4293,7 +4293,7 @@ bool LLPanelRegionEnvironment::confirmUpdateEstateEnvironment(const LLSD& notifi case 1: mAllowOverride = mAllowOverrideRestore; - getChild(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride); + mCheckAllowOverride->setValue(mAllowOverride); break; default: break; -- cgit v1.2.3 From e3deb8340a5f2e5b1c997e66042f3515f33f5cea Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Wed, 24 Jul 2024 19:30:29 -0400 Subject: Fix excessive findChild calls during about land floater draw --- indra/newview/llfloaterregioninfo.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index fc6abf4bfe..cc9aca1338 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2331,7 +2331,6 @@ void LLPanelEstateInfo::refresh() // Disable access restriction controls if they make no sense. bool public_access = ("estate_public_access" == getChild("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); -- cgit v1.2.3 From 4d7f622a3c6a2fdec1c57ad4506ae49786b37dfc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:02:03 +0300 Subject: viewer#2065 Region restart schedule floater --- indra/newview/llfloaterregioninfo.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index cc9aca1338..02ef342c2a 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); @@ -862,6 +864,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 // @@ -877,6 +898,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 -- cgit v1.2.3 From fceec45641cf6a4b7eecaf37ea080a184c279239 Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Sat, 27 Jul 2024 17:10:17 +0200 Subject: Fix a bunch of XUI warnings (#2120) --- indra/newview/llfloaterregioninfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 02ef342c2a..7869abf66d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -854,8 +854,9 @@ void LLPanelRegionInfo::initCtrl(const std::string& name) template void LLPanelRegionInfo::initAndSetCtrl(CTRL*& ctrl, const std::string& name) { - initCtrl(name); ctrl = findChild(name); + if (ctrl) + ctrl->setCommitCallback(boost::bind(&LLPanelRegionInfo::onChangeAnything, this)); } void LLPanelRegionInfo::onClickManageTelehub() -- cgit v1.2.3 From 17fed3985f56033f6c433436935cfde32ea1e7c6 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 29 Aug 2024 15:43:01 +0200 Subject: #2360 Incorrect Day Cycle name in Edit Day Cycle floater (remove unused key CANMOD) --- indra/newview/llfloaterregioninfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 7869abf66d..66e88e8841 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -4291,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); } -- cgit v1.2.3 From 0f166a199d9a3deb82dd42dc5c68d72a2ca07165 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Tue, 3 Sep 2024 17:53:21 -0700 Subject: secondlife/viewer#2490: Fix PBR terrain texture transform feature flag handled by viewer in unpredictable manner --- indra/newview/llfloaterregioninfo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 66e88e8841..8070284e32 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -268,7 +268,7 @@ bool LLFloaterRegionInfo::postBuild() mInfoPanels.push_back(panel); static LLCachedControl feature_pbr_terrain_enabled(gSavedSettings, "RenderTerrainPBREnabled", false); static LLCachedControl 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"); } @@ -1694,7 +1694,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) static LLCachedControl 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; @@ -1724,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) @@ -1938,7 +1938,7 @@ bool LLPanelRegionTerrainInfo::sendUpdate() // POST to ModifyRegion endpoint, if enabled static LLCachedControl 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) -- cgit v1.2.3