/** * A helper method that loads file dialogs for gmad.exe, gmpublish.exe, and any .gma files, prevents redundancy */ private void loadFileDialog(string title, string defaultPath, int numFilters, string[] filterPatterns, string filterDescription, int allowMultipleSelects, TextBox T1) { dialog = TinyFD.tinyfd_openFileDialog(title, defaultPath, numFilters, filterPatterns, filterDescription, allowMultipleSelects); dialogResult = stringFromAnsi(dialog); if (!string.IsNullOrWhiteSpace(dialogResult)) { T1.Text = dialogResult; } }
/** * A helper method that loads file dialogs for .jpg icons that are 512x512 */ private void loadIconDialog(string title, string defaultPath, int numFilters, string[] filterPatterns, string filterDescription, int allowMultipleSelects, TextBox T1) { dialog = TinyFD.tinyfd_openFileDialog(title, defaultPath, numFilters, filterPatterns, filterDescription, allowMultipleSelects); dialogResult = stringFromAnsi(dialog); if (!string.IsNullOrWhiteSpace(dialogResult)) { if (!dialogResult.Contains(".jpg")) { TinyFD.tinyfd_messageBox("Image Load Error", "This image is not a .jpg", "ok", "error", 1); return; } if (CheckIfFileIsImage(dialogResult)) { pbxIcon.Image = newImg; T1.Text = dialogResult; } } }