Skip to content

Commit

Permalink
Correctly set the Index on Auto-Sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Nov 4, 2024
1 parent eb4adeb commit b994f2e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Bannerlord.LauncherManager/LauncherManagerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ public IReadOnlyList<IModuleViewModel> GetViewModelsFromModules(IEnumerable<Modu
if (GetAllModuleViewModels() is not { } viewModels)
return Array.Empty<IModuleViewModel>();

return modules.Select(moduleInfoExtended => viewModels.First(x => x.ModuleInfoExtended == moduleInfoExtended)).ToList();
return modules.Select((moduleInfoExtended, i) =>
{
var vm = viewModels.First(x => x.ModuleInfoExtended == moduleInfoExtended);
vm.Index = i;
return vm;
}).ToList();
}
}

0 comments on commit b994f2e

Please sign in to comment.