9
3

ParseDetalis.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace Movement_Loop_Generator_2._0
  11. {
  12. public partial class ParseDetalis : Form
  13. {
  14. private string parseName;
  15. private string parseAuthor;
  16. private int parseSpeed;
  17. private int parseDelay;
  18. private string parseFunction;
  19. public ParseDetalis()
  20. {
  21. InitializeComponent();
  22. }
  23. private void btnParse_Click(object sender, EventArgs e)
  24. {
  25. parseName = tbSpawnName.Text;
  26. parseAuthor = tbAuthorName.Text;
  27. if (string.IsNullOrEmpty(tbSpeed.Text))
  28. {
  29. parseSpeed = 2;
  30. }
  31. else
  32. {
  33. parseSpeed = Convert.ToInt32(tbSpeed.Text);
  34. }
  35. if (string.IsNullOrEmpty(tbDelay.Text))
  36. {
  37. parseDelay = 0;
  38. }
  39. else
  40. {
  41. parseDelay = Convert.ToInt32(tbDelay.Text);
  42. }
  43. parseFunction = tbFunction.Text;
  44. if (string.IsNullOrEmpty(tbAuthorName.Text))
  45. {
  46. parseAuthor = "Generated with Movement Loop Generator 2.0";
  47. }
  48. if (string.IsNullOrEmpty(tbSpawnName.Text))
  49. {
  50. MessageBox.Show("Spawn Name must be entered", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  51. }
  52. else
  53. {
  54. this.Close();
  55. }
  56. }
  57. public string getName()
  58. {
  59. return parseName;
  60. }
  61. public string getAuthor()
  62. {
  63. return parseAuthor;
  64. }
  65. public int getSpeed()
  66. {
  67. return parseSpeed;
  68. }
  69. public int getDelay()
  70. {
  71. return parseDelay;
  72. }
  73. public string getFunction()
  74. {
  75. return parseFunction;
  76. }
  77. private void ParseDetalis_Load(object sender, EventArgs e)
  78. {
  79. this.AcceptButton = btnParse;
  80. }
  81. }
  82. }