diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-10-06 10:34:40 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-10-06 10:34:40 +0300 |
commit | 03ee1bd3929b4194afd4175f282bb9aadaf6c16d (patch) | |
tree | 82f6efc0973567cd91cee38878fb749c1e7b3d13 /NesMenuCollection.cs | |
parent | 5a691b3bfed7c51edcfe23d68e0b3ec6da90f7bb (diff) |
Folder split bug fixed
Diffstat (limited to 'NesMenuCollection.cs')
-rw-r--r-- | NesMenuCollection.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/NesMenuCollection.cs b/NesMenuCollection.cs index a82a9c57..5d706811 100644 --- a/NesMenuCollection.cs +++ b/NesMenuCollection.cs @@ -30,6 +30,7 @@ namespace com.clusterrr.hakchi_gui public void Split(SplitStyle style, int maxElements = 35)
{
bool originalToRoot = false;
+ int originalCount = 0;
switch (style)
{
case SplitStyle.Original_NoSplit:
@@ -39,14 +40,15 @@ namespace com.clusterrr.hakchi_gui case SplitStyle.Original_FoldersEqual:
case SplitStyle.Original_PagesEqual:
style--;
- if (this.Where(o => o is NesDefaultGame).Count() > 0)
+ originalCount = this.Where(o => o is NesDefaultGame).Count();
+ if (originalCount > 0)
originalToRoot = true;
break;
}
if (style == SplitStyle.NoSplit && !originalToRoot) return;
if (((style == SplitStyle.Auto && !originalToRoot) || style == SplitStyle.FoldersEqual || style == SplitStyle.PagesEqual) &&
(Count <= maxElements)) return;
- var total = Count;
+ var total = Count - originalCount;
var partsCount = (int)Math.Ceiling((float)total / (float)maxElements);
var perPart = (int)Math.Ceiling((float)total / (float)partsCount);
var alphaNum = new Regex("[^a-zA-Z0-9]");
|