Skip to content

Commit

Permalink
Fix issue with new garlandtools database
Browse files Browse the repository at this point in the history
Fix Apply button position when modifying window size
Usability : use checked item as crafting list element when crafting list is empty
Remove database update (useless)
UI cleanup
  • Loading branch information
ShishioValentine committed Oct 21, 2020
1 parent 6d138c4 commit 6f8dc51
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 180 deletions.
172 changes: 15 additions & 157 deletions MainUserControlV2.Designer.cs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions MainUserControlV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ private void _craftButton_Click(object sender, EventArgs e)
ScenarioForm scenarioForm = new ScenarioForm();

scenarioForm.ListItemsToCraft = _itemsToCraft;
if(scenarioForm.ListItemsToCraft.Count <= 0)
{
_addToCraftingListButton_Click(sender, e);
scenarioForm.ListItemsToCraft = _itemsToCraft;
}
scenarioForm.ShowDialog();
}

Expand Down Expand Up @@ -196,17 +201,13 @@ private void UpdateJobButtonStatus(Button iButton)

private void UpdateBDDStatusFromOptions()
{
VPThreading.SetText(_gridStatusLabel, "-");

try
{
MiqoCraftOptions options = new MiqoCraftOptions();
options.Load(OptionLocation.GlobalOption);

int percentage = options.ListGridOKItems.Count * 100 / options.ListGatherableItems.Count;

VPThreading.SetText(_gridStatusLabel, percentage + " % (" + options.ListGridOKItems.Count + " / " + options.ListGatherableItems.Count + ")");

int nbOK = 0;
string OKList = "";
string KOList = "";
Expand Down Expand Up @@ -239,7 +240,6 @@ private void UpdateGridBDDThread()
List<string> _gridOKItemNames = new List<string>();

Service_Misc.LogText(_logTextBox, "Updating database...");
VPThreading.SetText(_gridStatusLabel, "-");

MiqoCraftCore.MiqoCraftCore.DownloadGrids();

Expand Down
9 changes: 5 additions & 4 deletions MiqoCraftCore/GarlandTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.Linq;
using System.Net;
using System.Windows.Forms;

namespace MiqoCraftCore
{
Expand Down Expand Up @@ -219,7 +220,7 @@ public static List<FFXIVGatheringNode> GetGatheringNodesFromItem(string iItemID)
string dataResultContent = "";
if (File.Exists(logName))
{
dataResultContent = File.ReadAllText(logName);
dataResultContent = Service_Misc.RemoveIllegalCharacters(File.ReadAllText(logName));
}

if (dataResultContent == "")
Expand Down Expand Up @@ -253,9 +254,9 @@ public static List<FFXIVGatheringNode> GetGatheringNodesFromItem(string iItemID)
return ReadGatheredNodes(iCookies, ref oCookies, ref oCode, dataToken, itemToken, nodeToken);
}
}
catch
catch(Exception exc)
{

MessageBox.Show("Failed to parse garlandtools.org database. Please report this bug.");
}

return result;
Expand Down Expand Up @@ -328,7 +329,7 @@ public static FFXIVItem RecBuildCraftingTree(System.Windows.Forms.TextBox iLogBo
string dataResultContent = "";
if (File.Exists(logName))
{
dataResultContent = File.ReadAllText(logName);
dataResultContent = Service_Misc.RemoveIllegalCharacters(File.ReadAllText(logName));
}

if (dataResultContent == "")
Expand Down
6 changes: 6 additions & 0 deletions MiqoCraftCore/Service_Misc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,13 @@ public static string RemoveIllegalCharacters(string iString)
Encoding.UTF8.GetBytes(iString)
)).Replace("", "")
.Replace("%}", "%\"}")
.Replace("%?}", "%\"}")
.Replace("+1}", "+1\"}")
.Replace("+1?}", "+1\"}")
.Replace("+2?}", "+2\"}")
.Replace("+3?}", "+3\"}")
.Replace("+4?}", "+4\"}")
.Replace("+5?}", "+5\"}")
.Replace("・・", "\"");
}
}
Expand Down
Binary file modified MiqoCraftCore/bin/Debug/MiqoCraftCore.dll
Binary file not shown.
Binary file modified MiqoCraftCore/bin/Debug/MiqoCraftCore.pdb
Binary file not shown.
21 changes: 19 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using MiqoCraftCore;
using System;
using System.IO;
using System.Windows.Forms;
using VPL.Application.Data;

Expand All @@ -14,9 +16,24 @@ static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

VPApplication.ApplicationName = "MiqoCrafter";

//Clean cache

string logName = Path.Combine(Service_Misc.GetExecutionPath(), "GeneralDataBase.log");
if(File.Exists(logName))
{
try
{
File.Delete(logName);
}
catch
{

}
}

Application.Run(new MainForm());
}
}
Expand Down
25 changes: 13 additions & 12 deletions ScenarioForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f8dc51

Please sign in to comment.