// > gmpublish functions private void button_actions_gmpublish_publish_Click(object sender, EventArgs e) { SaveSettings(); // > Get paths string gmpublish_path = textbox_settings_paths_gmpublish.Text; string addon_path = textbox_settings_paths_addon.Text; string icon_path = StringPath.RemoveExtension(addon_path) + ".jpg"; // > Check .gma if (!CheckAddonPath(true)) { return; } if (!(CheckGMA(addon_path))) { return; } // > Check icon if (!File.Exists(icon_path)) { Notification.NoFileError(icon_path); } // > Publish string stdout = Shell.Execute(gmpublish_path, $"create -icon {icon_path} -addon {addon_path}"); Notification.Information("gmpublish.exe:\n" + stdout); // > Write ID Match match = Regex.Match(stdout, @"[id=](\d+)"); string id = (match.Success ? match.Value : "null").Replace("=", ""); File.WriteAllText(StringPath.RemoveExtension(addon_path) + ".id", id); }
private void button_actions_gmpublish_update_Click(object sender, EventArgs e) { SaveSettings(); // > Get paths string gmpublish_path = textbox_settings_paths_gmpublish.Text; string addon_path = textbox_settings_paths_addon.Text; string icon_path = StringPath.RemoveExtension(addon_path) + ".jpg"; string id_path = StringPath.RemoveExtension(addon_path) + ".id"; string id = File.ReadAllText(id_path); // > Check .gma if (!CheckAddonPath(true)) { return; } if (!(CheckGMA(addon_path))) { return; } // > Check icon //if( !File.Exists( icon_path ) ) //{ // Notification.NoFileError( icon_path ); //} // > Publish string stdout = Shell.Execute(gmpublish_path, $"update -icon {icon_path} -addon {addon_path} -id {id}"); Notification.Information("gmpublish.exe:\n" + stdout); }
private void button_actions_gmad_extract_Click(object sender, EventArgs e) { SaveSettings(); // > Get paths string gmad_path = textbox_settings_paths_gmad.Text; string addon_path = textbox_settings_paths_addon.Text; string output = GetOutput(StringPath.RemoveExtension(addon_path)); // > Check if (!CheckAddonPath(true)) { return; } if (!(CheckGMA(addon_path))) { return; } // > Create directory if (!Directory.Exists(output)) { Console.WriteLine(output); Directory.CreateDirectory(output); } // > Extract gma string stdout = Shell.Execute(gmad_path, $"extract -file {addon_path} -out {output}"); if (stdout.Length == 0) { return; } Notification.Information("gmad.exe:\n" + stdout); }