summaryrefslogtreecommitdiff
path: root/indra/newview/lltooldraganddrop.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-03-19 00:03:19 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-03-19 00:03:42 +0200
commit969ed536806dce1fe2fa8fc9b312f1c80e671d84 (patch)
tree3e8c7e74cbecf7aefe250b03a72651dd781bf8ed /indra/newview/lltooldraganddrop.cpp
parentf462037b8e3474115a1f039ce0cd56c98e320227 (diff)
parentc99e3167ed8549bc13d7df03b1e12dc15b0a080f (diff)
Merge branch 'release/2025.03' into release/2025.04
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r--indra/newview/lltooldraganddrop.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 4efa289141..9d6f44c096 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -574,12 +574,13 @@ bool LLToolDragAndDrop::handleKey(KEY key, MASK mask)
bool LLToolDragAndDrop::handleToolTip(S32 x, S32 y, MASK mask)
{
+ const F32 DRAG_N_DROP_TOOLTIP_DELAY = 0.1f;
if (!mToolTipMsg.empty())
{
LLToolTipMgr::instance().unblockToolTips();
LLToolTipMgr::instance().show(LLToolTip::Params()
.message(mToolTipMsg)
- .delay_time(gSavedSettings.getF32( "DragAndDropToolTipDelay" )));
+ .delay_time(DRAG_N_DROP_TOOLTIP_DELAY));
return true;
}
return false;
@@ -1253,6 +1254,7 @@ void LLToolDragAndDrop::dropMaterial(LLViewerObject* hit_obj,
// If user dropped a material onto face it implies
// applying texture now without cancel, save to selection
if (nodep
+ && gFloaterTools
&& gFloaterTools->getVisible()
&& nodep->mSavedGLTFMaterialIds.size() > hit_face)
{
@@ -1429,10 +1431,10 @@ void LLToolDragAndDrop::dropTexture(LLViewerObject* hit_obj,
// If user dropped a texture onto face it implies
// applying texture now without cancel, save to selection
- LLPanelFace* panel_face = gFloaterTools->getPanelFace();
+ LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr;
if (nodep
- && gFloaterTools->getVisible()
&& panel_face
+ && gFloaterTools->getVisible()
&& panel_face->getTextureDropChannel() == 0 /*texture*/
&& nodep->mSavedTextures.size() > hit_face)
{
@@ -1488,8 +1490,8 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
if (allow_adding_to_override)
{
LLGLTFMaterial::TextureInfo drop_channel = LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR;
- LLPanelFace* panel_face = gFloaterTools->getPanelFace();
- if (gFloaterTools->getVisible() && panel_face)
+ LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr;
+ if (panel_face && gFloaterTools->getVisible())
{
drop_channel = panel_face->getPBRDropChannel();
}
@@ -1514,9 +1516,9 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
LLTextureEntry* tep = hit_obj->getTE(hit_face);
- LLPanelFace* panel_face = gFloaterTools->getPanelFace();
+ LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr;
- if (gFloaterTools->getVisible() && panel_face)
+ if (panel_face && gFloaterTools->getVisible())
{
tex_channel = (tex_channel > -1) ? tex_channel : panel_face->getTextureDropChannel();
switch (tex_channel)
@@ -1611,7 +1613,10 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj,
}
}
hit_obj->saveScript(new_script, active, true);
- gFloaterTools->dirty();
+ if (gFloaterTools)
+ {
+ gFloaterTools->dirty();
+ }
// VEFFECT: SetScript
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, true);
@@ -1844,7 +1849,10 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj,
effectp->setTargetObject(hit_obj);
effectp->setDuration(LL_HUD_DUR_SHORT);
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
- gFloaterTools->dirty();
+ if (gFloaterTools)
+ {
+ gFloaterTools->dirty();
+ }
}
// accessor that looks at permissions, copyability, and names of