FIRE-36164 Do not ignore a custom "New Script" setting for new scripts created in inventory
Signed-off-by: PanteraPolnocy <panterapolnocy@gmail.com>master
parent
6aff026508
commit
06679e6f49
|
|
@ -2296,12 +2296,50 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLUUID dest_id, const L
|
|||
else if ("lsl" == type_name)
|
||||
{
|
||||
const LLUUID parent_id = dest_id.notNull() ? dest_id : gInventory.findCategoryUUIDForType(LLFolderType::FT_LSL_TEXT);
|
||||
|
||||
// <FS:PP> FIRE-36164 Apply the custom "New Script" setting for inventory scripts
|
||||
bool custom_script_inserted = false;
|
||||
if (gSavedPerAccountSettings.getBOOL("FSBuildPrefs_UseCustomScript"))
|
||||
{
|
||||
if (LLUUID custom_script_id(gSavedPerAccountSettings.getString("FSBuildPrefs_CustomScriptItem")); custom_script_id.notNull())
|
||||
{
|
||||
if (auto custom_script = gInventory.getItem(custom_script_id); custom_script && custom_script->getType() == LLAssetType::AT_LSL_TEXT)
|
||||
{
|
||||
LLPointer<LLBoostFuncInventoryCallback> cb = NULL;
|
||||
if (created_cb != NULL)
|
||||
{
|
||||
cb = new LLBoostFuncInventoryCallback(create_script_cb);
|
||||
cb->addOnFireFunc(created_cb);
|
||||
}
|
||||
else
|
||||
{
|
||||
cb = new LLBoostFuncInventoryCallback(create_script_cb);
|
||||
}
|
||||
copy_inventory_item(
|
||||
gAgent.getID(),
|
||||
custom_script->getPermissions().getOwner(),
|
||||
custom_script_id,
|
||||
parent_id,
|
||||
NEW_LSL_NAME,
|
||||
cb);
|
||||
custom_script_inserted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!custom_script_inserted)
|
||||
{
|
||||
// </FS:PP>
|
||||
|
||||
create_new_item(NEW_LSL_NAME,
|
||||
parent_id,
|
||||
LLAssetType::AT_LSL_TEXT,
|
||||
LLInventoryType::IT_LSL,
|
||||
PERM_MOVE | PERM_TRANSFER,
|
||||
created_cb); // overridden in create_new_item
|
||||
|
||||
// <FS:PP>
|
||||
}
|
||||
// </FS:PP>
|
||||
}
|
||||
else if ("notecard" == type_name)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue