[Tool/Web/Other] .pwn to .tde (iPleomax TD Editor)
#1

Converts this
PHP Code:
//Global Textdraws:
new Text:Textdraw0;
new 
Text:Textdraw1;
new 
Text:Textdraw2;
Textdraw0 = TextDrawCreate(130.248977, 4.666663, "Ammuniton:");
TextDrawLetterSize(Textdraw0, 0.227920, 0.899999);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 1);
TextDrawBackgroundColor(Textdraw0, 51);
TextDrawFont(Textdraw0, 2);
TextDrawSetProportional(Textdraw0, 1);
Textdraw1 = TextDrawCreate(125.689620, -0.250007, "usebox");
TextDrawLetterSize(Textdraw1, 0.000000, 7.645375);
TextDrawTextSize(Textdraw1, 121.689605, 0.000000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, 0);
TextDrawUseBox(Textdraw1, true);
TextDrawBoxColor(Textdraw1, -2139062017);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 0);
TextDrawFont(Textdraw1, 0);
Textdraw2 = TextDrawCreate(640.594787, 73.833305, "usebox");
TextDrawLetterSize(Textdraw2, 0.000000, -0.476675);
TextDrawTextSize(Textdraw2, -1.531450, 0.000000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, 0);
TextDrawUseBox(Textdraw2, true);
TextDrawBoxColor(Textdraw2, -2139062017);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 0);
TextDrawFont(Textdraw2, 0);
//Player Textdraws:
new PlayerText:Textdraw0[MAX_PLAYERS];
new 
PlayerText:Textdraw1[MAX_PLAYERS];
new 
PlayerText:Textdraw2[MAX_PLAYERS];
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 156.549118, 19.666666, "Minigun: ~r~~h~None");
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.227920, 0.899999);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 156.612075, 33.500000, "Rocket launcher: ~g~~h~~h~3");
PlayerTextDrawLetterSize(playerid, Textdraw1[playerid], 0.227920, 0.899999);
PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw1[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw1[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw1[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw1[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw1[playerid], 1);
Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 156.675033, 47.333328, "Mine launcher: ~g~~h~~h~1");
PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.227920, 0.899999);
PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw2[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw2[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw2[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1); 
to this

PHP Code:
130.248977|4.666663|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|0|Ammuniton:
156.549118|19.666666|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|1|Minigun: ~r~~h~None
156.612075
|33.500000|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|1|Rocket launcher: ~g~~h~~h~3
156.675033
|47.333328|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|1|Ammuniton:
125.689620|-0.250007|0.000000|7.645375|121.689605|0.000000|1|0|1|-2139062017|0|0|0|0|0|0|0|usebox
640.594787
|73.833305|0.000000|-0.476675|-1.531450|0.000000|1|0|1|-2139062017|0|0|0|0|0|0|0|usebox 
Run the application
Enter the path to the file
Press 'Enter'

Source code
PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Text.RegularExpressions;
namespace 
ipleomax
{
    class 
Program
    
{
        public static 
string iPositionX = "0.000000";
        public static 
string iPositionY = "0.000000";
        public static 
string iLetterX = "0.000000";
        public static 
string iLetterY = "0.000000";
        public static 
string iTextX = "0.000000";
        public static 
string iTextY = "0.000000";
        public static 
string iAlignment = "0";
        public static 
string iColor = "0";
        public static 
string iUsebox = "0";
        public static 
string iBoxcolor = "0";
        public static 
string iShadow = "0";
        public static 
string iOutline = "0";
        public static 
string iBackgroundcolor = "0";
        public static 
string iFont = "0";
        public static 
string iProportion = "0";
        public static 
string iSelectable = "0";
        public static 
string iType = "0";
        public static 
string iText = "0";
        static 
void Main(string[] args)
        {
            
Console.WriteLine("Enter path to file");
            
string path = Console.ReadLine();
            
using (StreamReader fRead = new StreamReader(path, Encoding.GetEncoding("windows-1251")))
            {
                
using (StreamWriter fWrite = new StreamWriter(path + ".tde", false))
                {
                    
string line = string.Empty;
                    
Regex integer = new Regex(@"\b(\d+)|-\b(\d+)");
                    
Regex doubles = new Regex(@"(?:\d{1,6})?(?:\.\d{1,6})|-(?:\d{1,6})?(?:\.\d{1,6})");
                    
Regex quote = new Regex("\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"");
                    
Regex bracket = new Regex(@"\(.+\)");
                    
MatchCollection collection;
                    
bool key = false;
                    while (!
fRead.EndOfStream)
                    {
                        
line = fRead.ReadLine();
                        if (
line.Length == 0)
                        {
                            if (
key == false)
                                continue;
                            
string resultLine = string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}|{16}|{17}",
                                
iPositionX, iPositionY, iLetterX,
                                
iLetterY, iTextX, iTextY,
                                
iAlignment, iColor, iUsebox,
                                
iBoxcolor, iShadow, iOutline,
                                
iBackgroundcolor, iFont, iProportion,
                                
iSelectable, iType, iText );
                            
fWrite.WriteLine(resultLine);
                            
Console.WriteLine(resultLine);
                            
iPositionX = "0.000000";
                            
iPositionY = "0.000000";
                            
iLetterX = "0.000000";
                            
iLetterY = "0.000000";
                            
iTextX = "0.000000";
                            
iTextY = "0.000000";
                            
iAlignment = "0";
                            
iColor = "0";
                            
iUsebox = "0";
                            
iBoxcolor = "0";
                            
iShadow = "0";
                            
iOutline = "0";
                            
iBackgroundcolor = "0";
                            
iFont = "0";
                            
iProportion = "0";
                            
iSelectable = "0";
                            
iType = "0";
                            
iText = "0";
                            
key = false;
                        }
                        if (
line.Contains("TextDrawCreate") || line.Contains("CreatePlayerTextDraw"))
                        {
                            
key = true;
                            
line = bracket.Match(line).Value;
                            
iText = quote.Match(line).Value;
                            
collection = doubles.Matches(line);
                            
iPositionX = collection[0].Value;
                            
iPositionY = collection[1].Value;
                            
iType = ((line.Contains("playerid") ? "1" : "0"));
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawLetterSize") || line.Contains("PlayerTextDrawLetterSize"))
                        {
                            
line = bracket.Match(line).Value;
                            
collection = doubles.Matches(line);
                            
iLetterX = collection[0].Value;
                            
iLetterY = collection[1].Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawTextSize") || line.Contains("PlayerTextDrawTextSize"))
                        {
                            
line = bracket.Match(line).Value;
                            
collection = doubles.Matches(line);
                            
iTextX = collection[0].Value;
                            
iTextY = collection[1].Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawAlignment") || line.Contains("PlayerTextDrawAlignment"))
                        {
                            
line = bracket.Match(line).Value;
                            
iAlignment = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawColor") || line.Contains("PlayerTextDrawColor"))
                        {
                            
line = bracket.Match(line).Value;
                            
iColor = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawUseBox") || line.Contains("PlayerTextDrawUseBox"))
                        {
                            
line = bracket.Match(line).Value;
                            
iUsebox = (line.Contains("true") ? "1" : "0");//integer.Match(line).Value;
                            
continue;
                        }
                        
                        if (
line.Contains("TextDrawBoxColor") || line.Contains("PlayerTextDrawBoxColor"))
                        {
                            
line = bracket.Match(line).Value;
                            
iBoxcolor = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetShadow") || line.Contains("PlayerTextDrawSetShadow"))
                        {
                            
line = bracket.Match(line).Value;
                            
iShadow = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetOutline") || line.Contains("PlayerTextDrawSetOutline"))
                        {
                            
line = bracket.Match(line).Value;
                            
iOutline = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawBackgroundColor") || line.Contains("PlayerTextDrawBackgroundColor"))
                        {
                            
line = bracket.Match(line).Value;
                            
iBackgroundcolor = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawFont") || line.Contains("PlayerTextDrawFont"))
                        {
                            
line = bracket.Match(line).Value;
                            
iFont = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetProportional") || line.Contains("PlayerTextDrawSetProportional"))
                        {
                            
line = bracket.Match(line).Value;
                            
iProportion = integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetSelectable") || line.Contains("PlayerTextDrawSetSelectable"))
                        {
                            
line = bracket.Match(line).Value;
                            
iSelectable = integer.Match(line).Value;
                            continue;
                        }
                    }
                }
            }
            
Console.Read();
        }
    }
} 
http://rghost.ru/6hMRyPWqn
Reply
#2

Good job.
Reply
#3

OMG , can't understand anything :/
Reply
#4

Very good
Reply
#5

Ohh good
Reply
#6

Don't work. :/
Reply
#7

Will be awesome if you create a video or post screenshot how it actually works.
Reply
#8

it don't work with tdeditor. It show me error.
Reply
#9

Can you add the option to save the file somewhere? It's very boring to copy all this code
Reply
#10

good job, great work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)