Skip to content
Permalink
Browse files

[GameStudio] Improve default asset selection to match opened asset ed…

…itors
  • Loading branch information
xen2 committed Dec 14, 2018
1 parent 2e0bbe3 commit 68add353023da54323eaa6ea1fe9de297dc91efd
@@ -602,13 +602,6 @@ private SessionViewModel(IViewModelServiceProvider serviceProvider, ILogger logg

public void PluginsInitialized()
{
// Select the first package of the session
var packageToSelect = CurrentProject ?? LocalPackages.First();
Dispatcher.InvokeAsync(() =>
{
ActiveAssetView.SelectedLocations.Clear();
ActiveAssetView.SelectedLocations.Add(packageToSelect != null ? (object)packageToSelect : PackageCategories[LocalPackageCategoryName]);
});
IsEditorInitialized = true;
}

@@ -306,7 +306,9 @@ private async Task ReopenAssetEditors(IReadOnlyCollection<AssetId> assetIds)
return;
}
// Open assets
foreach (var asset in assetIds.Select(x => Editor.Session.GetAssetById(x)).NotNull())
var assets = assetIds.Select(x => Editor.Session.GetAssetById(x)).NotNull().ToList();
Editor.Session.ActiveAssetView.SelectAssets(assets.Last().Yield());
foreach (var asset in assets)
{
// HACK: temporary open and await asset editor sequentially
await assetEditorsManager.OpenAssetEditorWindow(asset, false);
@@ -359,6 +361,8 @@ private async void OpenDefaultScene(SessionViewModel session)
if (asset == null)
return;

Editor.Session.ActiveAssetView.SelectAssets(asset.Yield());

await assetEditorsManager.OpenAssetEditorWindow(asset);
}

0 comments on commit 68add35

Please sign in to comment.
You can’t perform that action at this time.