diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-08-31 21:25:47 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-09-01 20:43:42 +0800 |
commit | 95582654e49422d51b55665c3f2821c848ad1cb8 (patch) | |
tree | d6d03a887b8e1b6c3be1b139d63b1638c5d0fdcd /indra/newview/llfloaterregioninfo.cpp | |
parent | ab3f483a3e5ed213882a83b882095cfdb6a4de57 (diff) | |
parent | b0fefd62adbf51f32434ba077e9f52d8a9241d15 (diff) |
Merge remote-tracking branch 'secondlife/release/2024.08-DeltaFPS' into 2024.08-DeltaFPS
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 75 |
1 files changed, 61 insertions, 14 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 14ae03d9ce..e90e8ae48a 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); @@ -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)); @@ -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) @@ -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; |