Skip to content

Commit

Permalink
Allow to import event data
Browse files Browse the repository at this point in the history
  • Loading branch information
Leanny committed Feb 6, 2020
1 parent 65b3029 commit 26f3c7b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions SeedSearcher/Forms/SeedSearcherGui.cs
Expand Up @@ -1761,14 +1761,18 @@ private void LoadEvent(object sender, EventArgs e)
var AppPath = Application.StartupPath.Trim() + "/";
ToolStripMenuItem tsmi = (ToolStripMenuItem)sender;
var EventData = $"{AppPath}{EventPath}{tsmi.Text}.json";
LoadEventData(EventData);
}

private void LoadEventData(string EventData)
{
if (!File.Exists(EventData))
{
updateEventDatabaseToolStripMenuItem_Click(null, null);
}
loadedEvent = $"{tsmi.Text}.json";
var content = File.ReadAllText(EventData);
PKHeX_Raid_Plugin.EventTableConverter.LoadFromJson(content, _raidTables);
if(CB_Nest.SelectedIndex == 0)
if (CB_Nest.SelectedIndex == 0)
{
CB_Nest_SelectedIndexChanged(null, null);
}
Expand Down Expand Up @@ -1937,7 +1941,11 @@ private void importDataToolStripMenuItem_Click(object sender, EventArgs e)
CB_Nest.SelectedIndex = si.Setup.NestID + 1;
if (si.Setup.NestID == -1)
{
var AppPath = Application.StartupPath.Trim() + "/";
// special case: load event
var EventData = $"{AppPath}{EventPath}{si.Setup.EventID}";
LoadEventData(EventData);
CB_Nest.SelectedIndex = 0;
}
CB_Game.SelectedIndex = si.Setup.GameID;

Expand Down

0 comments on commit 26f3c7b

Please sign in to comment.