private void openFolder_Button_Click(object sender, EventArgs e) { TreeNode node; if ((node = GetAnySelectedNode()) != null) { var selected = node.FullPath; var loc = mountPoint_TextBox.Text + selected.Substring(MiscTools.CommonStartsWith(selected, remoteLocation_TextBox.Text).Length).Replace('/', Path.DirectorySeparatorChar); Process.Start(loc); } }
private void modifyInstance_Button_Click(object sender, EventArgs e) { var modifyTypeChooser = new ModifyTypeChooser(); if (modifyTypeChooser.ShowDialog() == DialogResult.OK) { switch (modifyTypeChooser.SelectionBox.SelectedItem) { case "Modify": /*if (GetAnySelectedNode() != null) * { * var modifier = new InstanceModifier(); * modifier.Editor = Editor; * modifier.ManagerHandler = handler; * modifier.FullDirPath = GetAnySelectedNode().FullPath; * modifier.Show(); * } * else * { * MessageBox.Show("Select a directory in the idle instances."); * }*/ MessageBox.Show("This is pretty broken and useless right now. You should probably just have the drive mounted and use your own text editor and other programs."); break; case "Update": if (GetAnySelectedNode() != null) { var children = GetAnySelectedNode().Nodes; bool isInstance = false; foreach (TreeNode child in children) { if (child.Text.Equals("launch.sh")) { isInstance = true; } } if (isInstance) { var instpath = GetAnySelectedNode().FullPath; var wizard = new InstanceCreationWizard(); wizard.Order = new[] { CreatorTab.Start, CreatorTab.DownloadLink }; wizard.instanceName_TextBox.Text = instpath.Substring(MiscTools.CommonStartsWith(instpath, mcServerPath_TextBox.Text).Length); wizard.BasePath = mcServerPath_TextBox.Text; var chooser = new InstallTypeChooser(); if (chooser.ShowDialog() == DialogResult.OK) { switch (chooser.SelectionBox.SelectedItem) { case "Modded": wizard.ServerType = ServerType.Modded; break; case "Spigot": wizard.ServerType = ServerType.Bukkit; break; case "Bedrock": wizard.ServerType = ServerType.Bedrock; break; } } if (wizard.ShowDialog() == DialogResult.OK) { if (wizard.ServerType == ServerType.Modded) { wizard.ResultValues.Item1.ExcludedFiles = new[] { // TODO: don't hardcode this "backups", "journeymap", "logs", "schematics", "world", "banned-ips.json", "banned-players.json", "eula.txt", "ops.json", "server.properties", "usercache.json", "usernamecache.json", "whitelist.json", "mods/aaasponge.jar", "config/sponge" } } ; handler.UpdateInstance(wizard.ResultValues.Item1); } } else { MessageBox.Show("Select an instance in the idle instances"); } } else { MessageBox.Show("Select an instance in the idle instances"); } break; } } }