Skip to content

Commit

Permalink
[GameStudio] Allow drag & dropping of read-only assets (as long as th…
Browse files Browse the repository at this point in the history
…ey wouldn't be modified)
  • Loading branch information
xen2 committed Jan 29, 2019
1 parent 4347414 commit f542345
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -314,7 +314,7 @@ protected object InitializeDrag(object originalSource)
}
object data = null;
var container = GetContainer(originalSource);
var itemsToDrag = GetItemsToDrag(container).Where(x => !(x is IIsEditableViewModel) || ((IIsEditableViewModel)x).IsEditable).ToList();
var itemsToDrag = GetItemsToDrag(container).ToList();
if (itemsToDrag.Count > 0)
{
var dragContainer = new DragContainer(itemsToDrag);
Expand Down
Expand Up @@ -190,6 +190,12 @@ protected void UpdateAssetUrls()

bool IAddChildViewModel.CanAddChildren(IReadOnlyCollection<object> children, AddChildModifiers modifiers, out string message)
{
if (children.Any(x => (x is IIsEditableViewModel) && !((IIsEditableViewModel)x).IsEditable))
{
message = "Some source items are read-only";
return false;
}

if (!Package.IsEditable)
{
message = "Read-only package";
Expand Down

0 comments on commit f542345

Please sign in to comment.