private async void buttonYaesha_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.InitialDirectory = Directory.GetParent(AppContext.BaseDirectory).Parent.FullName + @"\instances\yaesha";
if (dialog.ShowDialog() == DialogResult.OK)
{
selectedInstances = dialog.SelectedPath;
textBoxInstances.Text = dialog.SelectedPath;
}
if (File.Exists(dialog.SelectedPath + @"\README.md"))
{
await webView2Readme.EnsureCoreWebView2Async(null);
string yolo = Markdown.ToHtml(File.ReadAllText(dialog.SelectedPath + @"\README.md"));
webView2Readme.NavigateToString(yolo);
}
pictureBoxMiniMap.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBoxInfo.SizeMode = PictureBoxSizeMode.StretchImage;
if (File.Exists(dialog.SelectedPath + @"\info\mini-map.png"))
pictureBoxMiniMap.Image = Image.FromFile(dialog.SelectedPath + @"\info\mini-map.png");
else if (File.Exists(dialog.SelectedPath + @"\..\info\mini-map.png"))
pictureBoxMiniMap.Image = Image.FromFile(dialog.SelectedPath + @"\..\info\mini-map.png");
else
pictureBoxMiniMap.Image = null;
if (File.Exists(dialog.SelectedPath + @"\info\info.png"))
pictureBoxInfo.Image = Image.FromFile(dialog.SelectedPath + @"\info\info.png");
else if (File.Exists(dialog.SelectedPath + @"\..\info\info.png"))
pictureBoxInfo.Image = Image.FromFile(dialog.SelectedPath + @"\..\info\info.png");
else
pictureBoxInfo.Image = null;
}