From 0751b30d330dcd5329bbe54b0e113967abe68f0f Mon Sep 17 00:00:00 2001 From: IceReaper Date: Sun, 14 May 2023 21:30:41 +0200 Subject: [PATCH] Fixed duplicate asset selection in asset browser. --- OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs index 280ca0a368..8c77a81646 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs @@ -516,7 +516,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var fileExtension = Path.GetExtension(filename.ToLowerInvariant()); if (allowedSpriteExtensions.Contains(fileExtension)) { - currentSprites = spriteCache[filename]; + currentSprites = spriteCache[prefix + filename]; currentFrame = 0; if (frameSlider != null && currentSprites?.Length > 0) @@ -530,7 +530,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic else if (allowedModelExtensions.Contains(fileExtension)) { var voxelName = Path.GetFileNameWithoutExtension(filename); - currentVoxel = world.ModelCache.GetModel(voxelName); + currentVoxel = world.ModelCache.GetModel(prefix + voxelName); currentSprites = null; } else if (allowedAudioExtensions.Contains(fileExtension)) @@ -558,7 +558,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic // Mute music so it doesn't interfere with the current asset. MuteSounds(); - var video = VideoLoader.GetVideo(Game.ModData.DefaultFileSystem.Open(filename), true, Game.ModData.VideoLoaders); + var video = VideoLoader.GetVideo(Game.ModData.DefaultFileSystem.Open(prefix + filename), true, Game.ModData.VideoLoaders); if (video != null) { player = panel.Get("PLAYER");