Skip to content

Commit

Permalink
UI: Fix issue loading older xebuild packs
Browse files Browse the repository at this point in the history
  • Loading branch information
Octal450 committed Jan 12, 2023
1 parent 734741a commit d109c01
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
8 changes: 8 additions & 0 deletions J-Runner/Functions/parse_ini.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,18 @@ public static void getLabelsandCBs(string filename, ref List<string> labels, ref
{
cbs.Add(temp.Substring(temp.IndexOf("cb_") + 3, temp.IndexOf(".bin") - 3));
}
else if (temp.Contains("cb."))
{
cbs.Add(temp.Substring(temp.IndexOf("cb.") + 3, temp.IndexOf(".bin") - 3));
}
else if (temp.Contains("cbb_"))
{
cbs.Add(temp.Substring(temp.IndexOf("cbb_") + 4, temp.IndexOf(".bin") - 4));
}
else if (temp.Contains("cbb."))
{
cbs.Add(temp.Substring(temp.IndexOf("cbb.") + 4, temp.IndexOf(".bin") - 4));
}
}
}
}
Expand Down
13 changes: 10 additions & 3 deletions J-Runner/Panels/XeBuildPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1620,12 +1620,16 @@ public void setComboCB(bool erase = false, bool wait = false)
List<string> cbs = new List<string>();
parse_ini.getLabelsandCBs(ini, ref labels, ref cbs);
string defaultCB = null;

foreach (string s in labels)
{
if (!s.Contains("bl")) continue;
if (variables.ctype.ID == -1)
{
if (s.Contains("_")) cbList.Add(new CB(s.Substring(s.IndexOf("_") + 1), true));
if (s.Contains("_"))
{
cbList.Add(new CB(s.Substring(s.IndexOf("_") + 1), true));
}
else
{
string cb = cbs[labels.IndexOf(s)];
Expand All @@ -1637,7 +1641,10 @@ public void setComboCB(bool erase = false, bool wait = false)
{
if (s.Contains(variables.ctype.Ini))
{
if (s.Contains("_")) cbList.Add(new CB(s.Substring(s.IndexOf("_") + 1), true));
if (s.Contains("_"))
{
cbList.Add(new CB(s.Substring(s.IndexOf("_") + 1), true));
}
else
{
string cb = cbs[labels.IndexOf(s)];
Expand All @@ -1648,7 +1655,7 @@ public void setComboCB(bool erase = false, bool wait = false)
}
}

cbList.Sort((a, b) => Convert.ToInt32(a.Version) - Convert.ToInt32(b.Version));
//cbList.Sort((a, b) => Convert.ToInt32(a.Version) - Convert.ToInt32(b.Version));

int defaultIndex = 0; // Fallback
foreach (CB cb in cbList)
Expand Down
2 changes: 1 addition & 1 deletion J-Runner/Resources/Build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
01-09-2023 18:56:27
01-12-2023 21:29:31

0 comments on commit d109c01

Please sign in to comment.