Sort syncshells by VRAM usage

This commit is contained in:
2025-09-03 12:53:21 +01:00
parent f7ecb45774
commit 11e097d696
7 changed files with 67 additions and 35 deletions

View File

@@ -20,6 +20,7 @@ public class DrawGroupPair : DrawPairBase
private readonly GroupPairFullInfoDto _fullInfoDto;
private readonly GroupFullInfoDto _group;
private readonly CharaDataManager _charaDataManager;
public long _VRAMBytes;
public DrawGroupPair(string id, Pair entry, ApiController apiController,
MareMediator mareMediator, GroupFullInfoDto group, GroupPairFullInfoDto fullInfoDto,
@@ -80,11 +81,13 @@ public class DrawGroupPair : DrawPairBase
}
if (_pair.LastAppliedDataBytes >= 0)
{
presenceText += UiSharedService.TooltipSeparator;
presenceText += ((!_pair.IsVisible) ? "(Last) " : string.Empty) + "Mods Info" + Environment.NewLine;
presenceText += "Files Size: " + UiSharedService.ByteToString(_pair.LastAppliedDataBytes, true);
if (_pair.LastAppliedApproximateVRAMBytes >= 0)
{
_VRAMBytes = _pair.LastAppliedApproximateVRAMBytes;
presenceText += Environment.NewLine + "Approx. VRAM Usage: " + UiSharedService.ByteToString(_pair.LastAppliedApproximateVRAMBytes, true);
}
if (_pair.LastAppliedDataTris >= 0)

View File

@@ -452,7 +452,16 @@ internal sealed class GroupPanel
{
ImGui.TextUnformatted("Visible");
ImGui.Separator();
_uidDisplayHandler.RenderPairList(visibleUsers);
if (_mareConfig.Current.SortSyncshellsByVRAM)
{
List<DrawGroupPair> sortedVisibleUsers = visibleUsers.OrderBy(o=>o._VRAMBytes).ToList();
_uidDisplayHandler.RenderPairList(sortedVisibleUsers);
}
else
{
_uidDisplayHandler.RenderPairList(visibleUsers);
}
}
if (onlineUsers.Count > 0)