summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-02-14 10:10:25 -0600
committerDave Parks <davep@lindenlab.com>2023-02-14 10:10:25 -0600
commit914ae0448fea64147d9a8b601e34ceac85e0dd01 (patch)
treed2333c82a6b9bbd40084cd191c0455deedb053db /indra/newview
parent68c4ff7dce2bd519431238f6209238aba46dc0ba (diff)
parenta549140fd072c0bf03047fa1809d4ea4b89b5a12 (diff)
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelface.cpp35
-rw-r--r--indra/newview/llpanelface.h4
2 files changed, 11 insertions, 28 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index cb09ec9fbf..ce086f2520 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1829,6 +1829,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
const bool show_texture_info = texture_info != LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
+ const bool new_state = show_texture_info && has_pbr_capabilities && has_pbr_material;
LLUICtrl* gltfCtrlTextureScaleU = getChild<LLUICtrl>("gltfTextureScaleU");
LLUICtrl* gltfCtrlTextureScaleV = getChild<LLUICtrl>("gltfTextureScaleV");
@@ -1836,13 +1837,15 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
LLUICtrl* gltfCtrlTextureOffsetU = getChild<LLUICtrl>("gltfTextureOffsetU");
LLUICtrl* gltfCtrlTextureOffsetV = getChild<LLUICtrl>("gltfTextureOffsetV");
- gltfCtrlTextureScaleU->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material);
- gltfCtrlTextureScaleV->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material);
- gltfCtrlTextureRotation->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material);
- gltfCtrlTextureOffsetU->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material);
- gltfCtrlTextureOffsetV->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material);
+ gltfCtrlTextureScaleU->setEnabled(new_state);
+ gltfCtrlTextureScaleV->setEnabled(new_state);
+ gltfCtrlTextureRotation->setEnabled(new_state);
+ gltfCtrlTextureOffsetU->setEnabled(new_state);
+ gltfCtrlTextureOffsetV->setEnabled(new_state);
- // Control values are set in setMaterialOverridesFromSelection
+ // Control values will be set once per frame in
+ // setMaterialOverridesFromSelection
+ sMaterialOverrideSelection.setDirty();
}
}
@@ -2821,7 +2824,6 @@ void LLPanelFace::onCommitPbrType(LLUICtrl* ctrl, void* userdata)
// and generally reflecting old state when switching tabs or objects
//
self->updateUI();
- self->setMaterialOverridesFromSelection();
}
// static
@@ -4768,17 +4770,7 @@ void LLPanelFace::Selection::connect()
bool LLPanelFace::Selection::update()
{
- const bool selection_changed = compareSelection();
- if (selection_changed)
- {
- clearObjectUpdatePending();
- }
- else if (isObjectUpdatePending())
- {
- return false;
- }
-
- const bool changed = mChanged;
+ const bool changed = mChanged || compareSelection();
mChanged = false;
return changed;
}
@@ -4794,16 +4786,9 @@ void LLPanelFace::Selection::onSelectedObjectUpdated(const LLUUID& object_id, S3
if (object_id == mSelectedObjectID && side == mSelectedSide)
{
mChanged = true;
- clearObjectUpdatePending();
}
}
-void LLPanelFace::Selection::clearObjectUpdatePending()
-{
- mPendingObjectID = LLUUID::null;
- mPendingSide = -1;
-}
-
bool LLPanelFace::Selection::compareSelection()
{
if (!mNeedsSelectionCheck)
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 707d693672..106259b84a 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -484,15 +484,13 @@ private:
// updated. Necessary to prevent controls updating when the mouse is
// held down.
void setObjectUpdatePending(const LLUUID &object_id, S32 side);
+ void setDirty() { mChanged = true; };
// Callbacks
void onSelectionChanged() { mNeedsSelectionCheck = true; }
void onSelectedObjectUpdated(const LLUUID &object_id, S32 side);
protected:
- void clearObjectUpdatePending();
- bool isObjectUpdatePending() { return mPendingSide != -1; }
-
bool compareSelection();
bool mChanged = false;