fixed FCurrentAsset not always up to date

This commit is contained in:
iAmAsval 2019-12-10 10:20:38 +01:00
parent 23e454533c
commit b35f2b74b2

View File

@ -39,10 +39,10 @@ namespace FModel.Methods.Assets
DebugHelper.WriteLine("Assets: User selected " + item);
cToken.ThrowIfCancellationRequested(); //if clicked on 'Stop' it breaks at the following item
FWindow.FMain.Dispatcher.InvokeAsync(() => //ui thread because if not, FCurrentAsset isn't updated in time to Auto Save a JSON Data for example
while (!string.Equals(FWindow.FCurrentAsset, item))
{
FWindow.FCurrentAsset = item;
});
}
LoadAsset(treePath + "/" + item);
}
@ -110,10 +110,10 @@ namespace FModel.Methods.Assets
target = asset.Substring(0, asset.LastIndexOf(".")); //uassets
}
FWindow.FMain.Dispatcher.InvokeAsync(() => //ui thread because if not, FCurrentAsset isn't updated in time to Auto Save a JSON Data for example
while (!string.Equals(FWindow.FCurrentAsset, Path.GetFileName(target)))
{
FWindow.FCurrentAsset = Path.GetFileName(target);
});
}
LoadAsset(target);
}
}
@ -171,10 +171,10 @@ namespace FModel.Methods.Assets
target = asset.Substring(0, asset.LastIndexOf(".")); //uassets
}
FWindow.FMain.Dispatcher.InvokeAsync(() => //ui thread because if not, FCurrentAsset isn't updated in time to Auto Save a JSON Data for example
while (!string.Equals(FWindow.FCurrentAsset, Path.GetFileName(target)))
{
FWindow.FCurrentAsset = Path.GetFileName(target);
});
}
LoadAsset(target);
}
}