Advertisement
Eduardo_AC

NTD Project Creator (EXE)

Aug 18th, 2022 (edited)
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. TextDrawReader tdReader = new TextDrawReader();
  2. ProgressBarReader pbReader = new ProgressBarReader();
  3. TextDraw[] tdArray = tdReader.TextDraw(txtArquivoTD.Text);
  4. ProgressBar[] pbArray = pbReader.ProgressBar(txtArquivoTD.Text);
  5.  
  6. string line = "";
  7. int countIdx = 0;
  8. int countPlayer = 0, countGlobal = 0;
  9. int countProgressBar = 0;
  10. foreach (TextDraw td in tdArray)
  11. {
  12.     line += $"td_{countIdx}_string={td.Text.Replace(' ', '_')}\r\n";
  13.     line += $"td_{countIdx}_data=";
  14.     line += td.Position.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  15.     line += td.Position.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  16.     line += td.Font + " ";
  17.     line += (td.IsPublic ? 1 : 0) + " ";
  18.     line += td.Outline + " ";
  19.     line += td.Shadow + " ";
  20.     line += td.LetterSize.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  21.     line += td.LetterSize.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  22.     line += td.Color + " ";
  23.     line += td.BackgroundColor + " ";
  24.     line += td.BoxColor + " ";
  25.     line += (td.UseBox ? 1 : 0) + " ";
  26.     line += td.TextSize.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  27.     line += td.TextSize.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  28.     line += (td.Selectable ? 1 : 0) + " ";
  29.     line += td.Alignment + " ";
  30.     line += td.Proportional + " ";
  31.     line += td.Preview.Model + " ";
  32.     line += td.Preview.Color1 + " ";
  33.     line += td.Preview.Color2 + " ";
  34.     line += td.Preview.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  35.     line += td.Preview.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  36.     line += td.Preview.Z.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  37.     line += td.Preview.Zoom.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  38.     line += "255 "; // Color Alpha
  39.     line += "255 "; // Background Color Alpha
  40.     line += "50 "; // Box Color Alpha
  41.     line += td.VariableName + "\r\n";
  42.     line += $"td_{countIdx}_bar_data=100.000000 0 \r\n";
  43.     File.AppendAllText(filename, line);
  44.    
  45.     line = "";
  46.     countIdx++;
  47.     countPlayer += td.IsPublic ? 0 : 1;
  48.     countGlobal += td.IsPublic ? 1 : 0;
  49. }
  50.  
  51. foreach (ProgressBar pb in pbArray)
  52. {
  53.     line += $"td_{countIdx}_string=PlayerProgressBar\r\n";
  54.     line += $"td_{countIdx}_data=";
  55.     line += pb.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  56.     line += pb.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  57.     line += "6 1 1 0 0.600000 2.000000 ";
  58.     line += pb.Colour + " ";
  59.     line += "255 50 1 ";
  60.     line += pb.Width.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  61.     line += pb.Height.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
  62.     line += "0 1 1 0 1 1 -10.000000 0.000000 -20.000000 1.000000 ";
  63.     line += "255 "; // Color Alpha
  64.     line += "255 "; // Background Color Alpha
  65.     line += "50 "; // Box Color Alpha
  66.     line += pb.VariableName + "\r\n";
  67.     line += $"td_{countIdx}_bar_data=100.000000 {pb.Direction} \r\n";
  68.     File.AppendAllText(filename, line);
  69.    
  70.     line = "";
  71.     countIdx++;
  72.     countProgressBar++;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement