SL-19263 Tidy up the reflection probe warning modal and add a cancel button.

meow-7.2.2
Dave Parks 2023-02-28 12:08:25 -06:00
parent d5e558fffc
commit 36f37ebf8a
3 changed files with 52 additions and 23 deletions

View File

@ -749,29 +749,49 @@ void LLPanelVolume::sendIsReflectionProbe()
BOOL value = getChild<LLUICtrl>("Reflection Probe")->getValue();
BOOL old_value = volobjp->isReflectionProbe();
volobjp->setIsReflectionProbe(value);
LL_INFOS() << "update reflection probe sent" << LL_ENDL;
if (value && value != old_value)
{ // defer to notification util as to whether or not we *really* make this object a reflection probe
LLNotificationsUtil::add("ReflectionProbeApplied", LLSD(), LLSD(), boost::bind(&LLPanelVolume::doSendIsReflectionProbe, this, _1, _2));
}
else
{
volobjp->setIsReflectionProbe(value);
}
}
if (value && !old_value)
{ // has become a reflection probe, slam to a 10m sphere and pop up a message
// warning people about the pitfalls of reflection probes
#if 0
auto* select_mgr = LLSelectMgr::getInstance();
void LLPanelVolume::doSendIsReflectionProbe(const LLSD & notification, const LLSD & response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0) // YES
{
LLViewerObject* objectp = mObject;
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
{
return;
}
LLVOVolume* volobjp = (LLVOVolume*)objectp;
mObject->setScale(LLVector3(10.f, 10.f, 10.f));
select_mgr->sendMultipleUpdate(UPD_ROTATION | UPD_POSITION | UPD_SCALE);
volobjp->setIsReflectionProbe(true);
select_mgr->selectionUpdatePhantom(true);
select_mgr->selectionSetGLTFMaterial(LLUUID::null);
select_mgr->selectionSetAlphaOnly(0.f);
LLVolumeParams params;
params.getPathParams().setCurveType(LL_PCODE_PATH_CIRCLE);
params.getProfileParams().setCurveType(LL_PCODE_PROFILE_CIRCLE_HALF);
mObject->updateVolume(params);
#endif
{ // has become a reflection probe, slam to a 10m sphere and pop up a message
// warning people about the pitfalls of reflection probes
LLNotificationsUtil::add("ReflectionProbeApplied");
auto* select_mgr = LLSelectMgr::getInstance();
select_mgr->selectionUpdatePhantom(true);
select_mgr->selectionSetGLTFMaterial(LLUUID::null);
select_mgr->selectionSetAlphaOnly(0.f);
LLVolumeParams params;
params.getPathParams().setCurveType(LL_PCODE_PATH_CIRCLE);
params.getProfileParams().setCurveType(LL_PCODE_PROFILE_CIRCLE_HALF);
mObject->updateVolume(params);
}
}
else
{
// cancelled, touch up UI state
getChild<LLUICtrl>("Reflection Probe")->setValue(false);
}
}

View File

@ -57,7 +57,14 @@ public:
void refresh();
void sendIsLight();
// when an object is becoming a refleciton probe, present a dialog asking for confirmation
// otherwise, send the reflection probe update immediately
void sendIsReflectionProbe();
// callback for handling response of the ok/cancel/ignore dialog for making an object a reflection probe
void doSendIsReflectionProbe(const LLSD& notification, const LLSD& response);
void sendIsFlexible();
static bool precommitValidate(const LLSD& data);

View File

@ -12041,10 +12041,12 @@ Material successfully created. Asset ID: [ASSET_ID]
name="ReflectionProbeApplied"
persist="true"
type="alertmodal">
WARNING: You have made your object a Refelction Probe. Continuing to manipulate the object while it is a probe will implicitly change the object to mimic its influence volume and will make irreversible changes to the object. If you don't know what a reflection probe is, uncheck "Reflection Probe" immediately. To learn more about Reflection Probes and how to use them, see https://wiki.secondlife.com/wiki/PBR_Materials#Understanding_and_Assisting_the_New_Reflections_System.
<usetemplate ignoretext="Reflection Probe tips"
name="okignore"
yestext="OK"/>
WARNING: You have made your object a Reflection Probe. This will implicitly change the object to mimic its influence volume and will make irreversible changes to the object. Do you want to continue?
<usetemplate
ignoretext="Reflection Probe tips"
name="okcancelignore"
notext="Cancel"
yestext="OK"/>
</notification>
</notifications>