Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TextDrawReader tdReader = new TextDrawReader();
- ProgressBarReader pbReader = new ProgressBarReader();
- TextDraw[] tdArray = tdReader.TextDraw(txtArquivoTD.Text);
- ProgressBar[] pbArray = pbReader.ProgressBar(txtArquivoTD.Text);
- string line = "";
- int countIdx = 0;
- int countPlayer = 0, countGlobal = 0;
- int countProgressBar = 0;
- foreach (TextDraw td in tdArray)
- {
- line += $"td_{countIdx}_string={td.Text.Replace(' ', '_')}\r\n";
- line += $"td_{countIdx}_data=";
- line += td.Position.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.Position.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.Font + " ";
- line += (td.IsPublic ? 1 : 0) + " ";
- line += td.Outline + " ";
- line += td.Shadow + " ";
- line += td.LetterSize.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.LetterSize.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.Color + " ";
- line += td.BackgroundColor + " ";
- line += td.BoxColor + " ";
- line += (td.UseBox ? 1 : 0) + " ";
- line += td.TextSize.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.TextSize.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += (td.Selectable ? 1 : 0) + " ";
- line += td.Alignment + " ";
- line += td.Proportional + " ";
- line += td.Preview.Model + " ";
- line += td.Preview.Color1 + " ";
- line += td.Preview.Color2 + " ";
- line += td.Preview.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.Preview.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.Preview.Z.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += td.Preview.Zoom.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += "255 "; // Color Alpha
- line += "255 "; // Background Color Alpha
- line += "50 "; // Box Color Alpha
- line += td.VariableName + "\r\n";
- line += $"td_{countIdx}_bar_data=100.000000 0 \r\n";
- File.AppendAllText(filename, line);
- line = "";
- countIdx++;
- countPlayer += td.IsPublic ? 0 : 1;
- countGlobal += td.IsPublic ? 1 : 0;
- }
- foreach (ProgressBar pb in pbArray)
- {
- line += $"td_{countIdx}_string=PlayerProgressBar\r\n";
- line += $"td_{countIdx}_data=";
- line += pb.X.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += pb.Y.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += "6 1 1 0 0.600000 2.000000 ";
- line += pb.Colour + " ";
- line += "255 50 1 ";
- line += pb.Width.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += pb.Height.ToString(CultureInfo.CurrentCulture).Replace(',', '.') + " ";
- line += "0 1 1 0 1 1 -10.000000 0.000000 -20.000000 1.000000 ";
- line += "255 "; // Color Alpha
- line += "255 "; // Background Color Alpha
- line += "50 "; // Box Color Alpha
- line += pb.VariableName + "\r\n";
- line += $"td_{countIdx}_bar_data=100.000000 {pb.Direction} \r\n";
- File.AppendAllText(filename, line);
- line = "";
- countIdx++;
- countProgressBar++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement