# Conflicts:
#	indra/newview/lltoolbarview.cpp
master
Ansariel 2025-09-30 17:52:52 +02:00
commit b84ea39dba
8 changed files with 45 additions and 46 deletions

View File

@ -1258,7 +1258,7 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
// if drop is set, it's time to call the callback to get the operation done
if (handled && drop)
{
handled = mHandleDropCallback(cargo_data, x, y, this);
handled = mHandleDropCallback(cargo_data, cargo_type, x, y, this);
}
// We accept only single tool drop on toolbars

View File

@ -41,7 +41,7 @@ class LLIconCtrl;
typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t;
typedef boost::function<bool (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;
typedef boost::function<bool (void* data, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t;
typedef boost::function<bool (void* data, EDragAndDropType cargo_type, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t;
class LLToolBarButton : public LLButton
{

View File

@ -63,7 +63,7 @@ bool LLFloaterToybox::postBuild()
mToolBar->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3));
mToolBar->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4));
mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4));
mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4,_5));
mToolBar->setButtonEnterCallback(boost::bind(&LLFloaterToybox::onToolBarButtonEnter,this,_1));
//

View File

@ -359,6 +359,7 @@ void LLGLTFMaterialList::queueApply(const LLViewerObject* obj, S32 side, const L
{
if (asset_id.isNull() || override_json.empty())
{
// If there is no asset, there can't be an override
queueApply(obj, side, asset_id);
}
else
@ -371,6 +372,7 @@ void LLGLTFMaterialList::queueApply(const LLViewerObject* obj, S32 side, const L
{
if (asset_id.isNull() || material_override == nullptr)
{
// If there is no asset, there can't be an override
queueApply(obj, side, asset_id);
}
else
@ -470,7 +472,7 @@ void LLGLTFMaterialList::flushUpdatesOnce(std::shared_ptr<CallbackHolder> callba
{
data[i]["gltf_json"] = e.override_data->asJSON();
}
if (!e.override_json.empty())
else if (!e.override_json.empty())
{
data[i]["gltf_json"] = e.override_json;
}

View File

@ -126,25 +126,27 @@ bool LLScriptFloater::toggle(const LLUUID& notification_id)
LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id)
{
LLScriptFloater* floater = LLFloaterReg::getTypedInstance<LLScriptFloater>("script_floater", notification_id);
floater->setNotificationId(notification_id);
floater->createForm(notification_id);
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
floater->setAutoFocus(false);
if(LLScriptFloaterManager::OBJ_SCRIPT == LLScriptFloaterManager::getObjectType(notification_id))
if (floater)
{
floater->setSavePosition(true);
floater->restorePosition();
}
else
{
floater->dockToChiclet(true);
}
floater->setNotificationId(notification_id);
floater->createForm(notification_id);
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id, false);
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
floater->setAutoFocus(false);
if (LLScriptFloaterManager::OBJ_SCRIPT == LLScriptFloaterManager::getObjectType(notification_id))
{
floater->setSavePosition(true);
floater->restorePosition();
}
else
{
floater->dockToChiclet(true);
}
//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id, false);
}
return floater;
}
// </FS:Zi>

View File

@ -2411,23 +2411,9 @@ void LLSelectMgr::selectionRevertGLTFMaterials()
//blank override out
LLGLTFMaterialList::queueApply(objectp, te, asset_id);
}
if (old_asset_id != asset_id)
{
// Restore overrides and base material
// Note: might not work reliably if asset is already there, might
// have a server sided problem where servers applies override
// first then resets it by adding asset, in which case need
// to create a server ticket and chain asset then override
// application.
LLGLTFMaterialList::queueApply(objectp, te, asset_id, material);
}
else
{
// Enqueue override update to server
// Note: this is suboptimal, better to send asset id as well
// but there seems to be a server problem with queueApply
// that ignores override in some cases
LLGLTFMaterialList::queueModify(objectp, te, material);
LLGLTFMaterialList::queueApply(objectp, te, asset_id, material);
}
}
return true;

View File

@ -123,7 +123,7 @@ bool LLToolBarView::postBuild()
{
mToolbars[i]->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3));
mToolbars[i]->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4));
mToolbars[i]->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4));
mToolbars[i]->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4,_5));
mToolbars[i]->setButtonAddCallback(boost::bind(LLToolBarView::onToolBarButtonAdded,_1));
mToolbars[i]->setButtonRemoveCallback(boost::bind(LLToolBarView::onToolBarButtonRemoved,_1));
}
@ -737,8 +737,14 @@ bool LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
return false;
}
bool LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar)
bool LLToolBarView::handleDropTool( void* cargo_data, EDragAndDropType cargo_type, S32 x, S32 y, LLToolBar* toolbar)
{
if (cargo_type == DAD_PERSON)
{
// DAD_PERSON means that cargo_data contains an uuid, not an LLInventoryObject
resetDragTool(NULL);
return false;
}
// <FS:Zi> Do not drag and drop when toolbars are locked
if(gSavedSettings.getBOOL("LockToolbars"))
{
@ -767,15 +773,18 @@ bool LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
if (old_toolbar_loc != LLToolBarEnums::TOOLBAR_NONE)
{
llassert(gToolBarView->mDragToolbarButton);
old_toolbar = gToolBarView->mDragToolbarButton->getParentByType<LLToolBar>();
if (old_toolbar->isReadOnly() && toolbar->isReadOnly())
if (gToolBarView->mDragToolbarButton)
{
// do nothing
}
else
{
int old_rank = LLToolBar::RANK_NONE;
gToolBarView->removeCommand(command_id, old_rank);
old_toolbar = gToolBarView->mDragToolbarButton->getParentByType<LLToolBar>();
if (old_toolbar->isReadOnly() && toolbar->isReadOnly())
{
// do nothing
}
else
{
int old_rank = LLToolBar::RANK_NONE;
gToolBarView->removeCommand(command_id, old_rank);
}
}
}

View File

@ -94,7 +94,7 @@ public:
static void startDragTool(S32 x, S32 y, LLToolBarButton* toolbarButton);
static bool handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);
static bool handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
static bool handleDropTool(void* cargo_data, EDragAndDropType cargo_type, S32 x, S32 y, LLToolBar* toolbar);
static void resetDragTool(LLToolBarButton* toolbarButton);
LLInventoryObject* getDragItem();
LLView* getBottomToolbar() { return mBottomToolbarPanel; }