예제 #1
0
        public CreditsForm( string itemDatFilename, TSSFile TSS )
        {
            InitializeComponent();

            LoadCreditsInfoFile( itemDatFilename );
            this.TSS = TSS;

            labels = new List<Label>();
            textboxes = new List<TextBox>();

            for ( int i = 0; i < CreditsInfoSingle.Size / 4; ++i ) {
                Label l = new Label();
                l.Text = "";
                l.Size = new System.Drawing.Size( 80, 20 );
                TextBox b = new TextBox();
                b.Size = new System.Drawing.Size( 80, 20 );
                b.Text = "";

                labels.Add( l );
                textboxes.Add( b );

                FlowLayoutPanel p = new FlowLayoutPanel();
                p.Size = new System.Drawing.Size( 200, 20 );
                p.FlowDirection = FlowDirection.LeftToRight;
                p.Controls.Add( l );
                p.Controls.Add( b );

                flowLayoutPanel1.Controls.Add( p );
            }

            Reload();
        }
예제 #2
0
        public static int Execute( List<string> args )
        {
            string string_dic = args[0];
            string databasename = args[1];
            string gracesjapanese = args[2];

            TSSFile TSS;
            try {
                TSS = new TSSFile( System.IO.File.ReadAllBytes( string_dic ) );
            } catch ( System.IO.FileNotFoundException ) {
                Console.WriteLine( "Could not open STRING_DIC.SO, exiting." );
                return -1;
            }

            List<GraceNoteDatabaseEntry> entries = new List<GraceNoteDatabaseEntry>();
            foreach ( TSSEntry e in TSS.Entries ) {
                GraceNoteDatabaseEntry g = new GraceNoteDatabaseEntry( e.StringJpn, e.StringEng );
                entries.Add( g );
            }

            System.IO.File.WriteAllBytes( databasename, Properties.Resources.gndb_template );
            GraceNoteDatabaseEntry.InsertSQL( entries.ToArray(), "Data Source=" + databasename, "Data Source=" + gracesjapanese );

            return 0;
        }
예제 #3
0
        public ItemForm( GameVersion version, ItemDat itemDat, TSSFile TSS, T8BTSK.T8BTSK skills, T8BTEMST.T8BTEMST enemies, COOKDAT.COOKDAT cookdat, WRLDDAT.WRLDDAT locations )
        {
            InitializeComponent();

            this.Version = version;
            this.itemDat = itemDat;
            this.TSS = TSS;
            this.Skills = skills;
            this.Enemies = enemies;
            this.Recipes = cookdat;
            this.Locations = locations;
            this.InGameIdDict = TSS.GenerateInGameIdDictionary();

            labels = new List<Label>();
            textboxes = new List<TextBox>();

            for ( int i = 0; i < ItemDatSingle.size / 4; ++i ) {
                Label l = new Label();
                l.Text = "";
                l.Size = new System.Drawing.Size( 100, 20 );
                TextBox b = new TextBox();
                b.Size = new System.Drawing.Size( 50, 20 );
                b.Text = "";

                labels.Add( l );
                textboxes.Add( b );

                FlowLayoutPanel p = new FlowLayoutPanel();
                p.Size = new System.Drawing.Size( 200, 20 );
                p.FlowDirection = FlowDirection.LeftToRight;
                p.Controls.Add( l );
                p.Controls.Add( b );

                switch ( (ItemData)i ) {
                    case ItemData.NamePointer:
                    case ItemData.DescriptionPointer:
                    case ItemData.UnknownTextPointer:
                    case ItemData.TextIDPart1:
                    case ItemData.TextIDPart2:
                    case ItemData.TextIDPart3:
                    case ItemData.TextIDPart4:
                    case ItemData.TextIDPart5:
                    case ItemData.TextIDPart6:
                    case ItemData.TextIDPart7:
                    case ItemData.TextIDPart8:
                        break;
                    default:
                        flowLayoutPanel1.Controls.Add( p );
                        break;
                }
            }

            foreach ( ItemDatSingle i in itemDat.items ) {
                var entry = GetEntry( i.Data[(int)ItemData.NamePointer] );
                listBox1.Items.Add( entry.StringEngOrJpn );
            }
        }
예제 #4
0
 public string GetDataAsHtml( GameVersion version, ItemDat.ItemDat items, TSSFile stringDic, Dictionary<uint, TSSEntry> inGameIdDict, List<SearchPointItem> searchPointItems, bool phpLinks = false )
 {
     StringBuilder sb = new StringBuilder();
     //sb.Append( "Percentage: " ).Append( Percentage ).Append( "%" ).Append( "<br>" );
     for ( uint i = 0; i < SearchPointItemCount; ++i ) {
         //sb.Append( "Item #" ).Append( i ).Append( ":" );
         sb.Append( searchPointItems[(int)( SearchPointItemIndex + i )].GetDataAsHtml( version, items, stringDic, inGameIdDict, phpLinks: phpLinks ) );
         sb.Append( "<br>" );
     }
     return sb.ToString();
 }
예제 #5
0
        public static int Execute( List<string> args )
        {
            if ( args.Count < 7 ) {
                Console.WriteLine( "Usage: [360/PS3] ITEM.DAT STRING_DIC.SO T8BTSK T8BTEMST COOKDAT WRLDDAT" );
                return -1;
            }

            GameVersion version = GameVersion.None;
            switch ( args[0].ToUpperInvariant() ) {
                case "360":
                    version = GameVersion.X360;
                    break;
                case "PS3":
                    version = GameVersion.PS3;
                    break;
            }

            if ( version == GameVersion.None ) {
                Console.WriteLine( "First parameter must indicate game version!" );
                return -1;
            }

            ItemDat items = new ItemDat( args[1] );

            TSSFile TSS;
            try {
                TSS = new TSSFile( System.IO.File.ReadAllBytes( args[2] ) );
            } catch ( System.IO.FileNotFoundException ) {
                Console.WriteLine( "Could not open STRING_DIC.SO, exiting." );
                return -1;
            }

            T8BTSK.T8BTSK skills = new T8BTSK.T8BTSK( args[3] );
            T8BTEMST.T8BTEMST enemies = new T8BTEMST.T8BTEMST( args[4] );
            COOKDAT.COOKDAT cookdat = new COOKDAT.COOKDAT( args[5] );
            WRLDDAT.WRLDDAT locations = new WRLDDAT.WRLDDAT( args[6] );

            Console.WriteLine( "Initializing GUI..." );
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault( false );
            ItemForm itemForm = new ItemForm( version, items, TSS, skills, enemies, cookdat, locations );
            Application.Run( itemForm );
            return 0;
        }
        public static int Execute( List<string> args )
        {
            if ( args.Count < 2 ) {
                Console.WriteLine( "Usage: credits.dat STRING_DIC.SO" );
                return -1;
            }

            Console.WriteLine( "Opening STRING_DIC.SO..." );
            TSSFile TSS;
            try {
                TSS = new TSSFile( System.IO.File.ReadAllBytes( args[1] ) );
            } catch ( System.IO.FileNotFoundException ) {
                Console.WriteLine( "Could not open STRING_DIC.SO, exiting." );
                return -1;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault( false );
            CreditsForm itemForm = new CreditsForm( args[0], TSS );
            Application.Run( itemForm );
            return 0;
        }
예제 #7
0
        public static int Execute( List<string> args )
        {
            bool UseInsaneNames = false;
            bool RealMode = false;
            bool UpdateInGameId = false;
            bool GenerateGracesEnglish = false;

            if ( args.Contains( "-insane" ) ) {
                Console.WriteLine( "Wesker-Dumbledore Mode Activated!" );
                UseInsaneNames = true;
            }
            if ( args.Contains( "-real" ) ) {
                Console.WriteLine( "Real Mode activated, resulting file will contain both English and Japanese data as expected by an unmodified game." );
                RealMode = true;
            }
            if ( args.Contains( "-updateInGameId" ) ) {
                Console.WriteLine( "Updating InGameIDs in the database." );
                UpdateInGameId = true;
            }
            if ( args.Contains( "-generateGracesEnglish" ) ) {
                Console.WriteLine( "Generating English version of GracesJapanese." );
                GenerateGracesEnglish = true;
            }

            Console.WriteLine( "Opening STRING_DIC.SO..." );
            TSSFile TSS;
            try {
                TSS = new TSSFile( System.IO.File.ReadAllBytes( "STRING_DIC.SO" ) );
            } catch ( System.IO.FileNotFoundException ) {
                Console.WriteLine( "Could not open STRING_DIC.SO, exiting." );
                return -1;
            }

            if ( args.Contains( "-engorigdmp" ) ) {
                Console.WriteLine( "Exporting original text (english)..." );
                System.IO.File.WriteAllBytes( "STRING_DIC_original_eng_export.txt", TSS.ExportTextForEnglishDump() );
            }
            if ( args.Contains( "-origdmp" ) ) {
                Console.WriteLine( "Exporting original text (all)..." );
                System.IO.File.WriteAllBytes( "STRING_DIC_original_export.txt", TSS.ExportText() );
            }

            Console.WriteLine( "Importing databases..." );
            if ( !TSS.ImportSQL( placeEnglishInJpnEntry: !RealMode, updateDatabaseWithInGameStringId: UpdateInGameId, generateGracesEnglish: GenerateGracesEnglish ) ) {
                Console.WriteLine( "Could not import all databases! Exiting..." );
                return -1;
            }

            // Empty unused strings, alter names if wanted
            if ( !RealMode ) {
                foreach ( TSSEntry e in TSS.Entries ) {
                    if ( e.StringEng != null ) {
                        e.StringEng = "";
                    }

                    if ( UseInsaneNames ) {
                        e.StringJpn = HyoutaTools.Tales.Vesperia.VesperiaUtil.ReplaceWithInsaneNames( e.StringJpn );
                    }
                }
            }

            Console.WriteLine( "Writing translated file..." );
            System.IO.File.WriteAllBytes( "STRING_DIC_translated.SO", TSS.Serialize() );

            Console.WriteLine( "Writing text dump..." );
            System.IO.File.WriteAllBytes( "STRING_DIC_translated_export.txt", TSS.ExportText() );

            Console.WriteLine( "Done!" );
            return 0;
        }
예제 #8
0
        public static int Execute( string[] args )
        {
            //Console.WriteLine( "おっさん試されてる?↵新騎士団長はおっかないわ……" );
            //FindEarliestGracesJapaneseEntry( "Data Source=VSkit Text", "Data Source=GracesJapanese" );
            //return;

            Console.WriteLine( "Opening STRING_DIC.SO..." );
            TSSFile TSS;
            try {
                TSS = new TSSFile( System.IO.File.ReadAllBytes( "STRING_DIC.SO" ) );
            } catch ( System.IO.FileNotFoundException ) {
                Console.WriteLine( "Could not open STRING_DIC.SO, exiting." );
                return -1;
            }

            List<ScenarioString> npcLines = GetSQL( "Data Source=VSkit Text", "Data Source=GracesJapanese" ).ToList();
            List<ScenarioString> x360Lines = new List<ScenarioString>( TSS.Entries.Length );
            foreach ( TSSEntry e in TSS.Entries ) {
                x360Lines.Add( new ScenarioString( e.StringJpnIndex, e.StringJpn, e.StringEng ) );
            }
            List<ScenarioString> foundLinesNpc = new List<ScenarioString>();
            List<ScenarioString> foundLines360 = new List<ScenarioString>();

            Regex furi = new Regex( "\r[(][0-9]+[,][\\p{IsHiragana}\\p{IsKatakana}]+[)]" );
            Regex colortag = new Regex( "\u0003[(][0-9]+[)]" );
            Regex inn = new Regex( " 【[0-9]+ガルド】" );
            foreach ( ScenarioString s in npcLines ) {
                if ( s.Jpn.Contains( '\r' ) ) {
                    s.Jpn = furi.Replace( s.Jpn, "" );
                }
                if ( s.Jpn.Contains( '\u0003' ) ) {
                    s.Jpn = colortag.Replace( s.Jpn, "" );
                }
                if ( s.Jpn.Contains( '【' ) ) {
                    s.Jpn = inn.Replace( s.Jpn, "" );
                }
                s.Jpn = s.Jpn.Replace( "ギルド", "帝国" );
                s.Jpn = s.Jpn.Replace( "~", "〜" );
                s.Jpn = s.Jpn.TrimEnd( new char[] { '。' } );
                s.Jpn = s.Jpn.Replace( "。\f", "\f" );
                s.Jpn = s.Jpn.Replace( "ズェ", "ずぇ" );
                s.Jpn = s.Jpn.Replace( "※", "" );
                s.Jpn = s.Jpn.Replace( "卑賤", "下町" );
                s.Jpn = s.Jpn.Replace( "!", "!" );
                s.Jpn = s.Jpn.Replace( "?", "?" );
                s.Jpn = s.Jpn.Replace( "! ", "!" );
                s.Jpn = s.Jpn.Replace( "? ", "?" );
            }
            foreach ( ScenarioString s in x360Lines ) {
                if ( s.Jpn == null ) continue;
                if ( s.Jpn.Contains( '\r' ) ) {
                    s.Jpn = furi.Replace( s.Jpn, "" );
                }
                if ( s.Jpn.Contains( '\u0003' ) ) {
                    s.Jpn = colortag.Replace( s.Jpn, "" );
                }
                if ( s.Jpn.Contains( '【' ) ) {
                    s.Jpn = inn.Replace( s.Jpn, "" );
                }
                s.Jpn = s.Jpn.Replace( "ギルド", "帝国" );
                s.Jpn = s.Jpn.Replace( "~", "〜" );
                s.Jpn = s.Jpn.TrimEnd( new char[] { '。' } );
                s.Jpn = s.Jpn.Replace( "。\f", "\f" );
                s.Jpn = s.Jpn.Replace( "ズェ", "ずぇ" );
                s.Jpn = s.Jpn.Replace( "※", "" );
                s.Jpn = s.Jpn.Replace( "卑賤", "下町" );
                s.Jpn = s.Jpn.Replace( "!", "!" );
                s.Jpn = s.Jpn.Replace( "?", "?" );
                s.Jpn = s.Jpn.Replace( "! ", "!" );
                s.Jpn = s.Jpn.Replace( "? ", "?" );
            }

            for ( int i = 0; i < npcLines.Count; ++i ) {
                for ( int j = 0; j < x360Lines.Count; ++j ) {
                    if ( npcLines[i].Jpn == x360Lines[j].Jpn ) {
                        foundLinesNpc.Add( npcLines[i] );
                        foundLines360.Add( x360Lines[j] );

                        npcLines.RemoveAt( i );
                        x360Lines.RemoveAt( j );
                        --i;

                        break;
                    }
                }
            }

            int encnt = 0;
            for ( int i = 0; i < foundLines360.Count; ++i ) {
                if ( foundLinesNpc[i].Eng != foundLines360[i].Eng ) {
                    encnt++;
                }
            }
            Console.WriteLine( encnt.ToString() );

            for ( int i = 0; i < foundLines360.Count; ++i ) {
                Console.WriteLine( ( i + 1 ).ToString() + "/" + foundLines360.Count.ToString() );
                if ( foundLinesNpc[i].Eng == foundLines360[i].Eng ) {
                    UpdateEntry( "Data Source=VSkit Text", foundLinesNpc[i].Pointer, 4, foundLinesNpc[i].Eng );
                } else {
                    //if ( i < 4500 ) continue;

                    string x = foundLines360[i].Eng;
                    string d = foundLinesNpc[i].Eng;

                    {
                        x = x.Replace( "↵", "\n" );
                        d = d.Replace( "↵", "\n" );
                        x = x.Replace( "~", "〜" );
                        d = d.Replace( "~", "〜" );
                        x = x.Replace( " \n", "\n" );
                        d = d.Replace( " \n", "\n" );
                        x = x.Replace( " \n", "\n" );
                        d = d.Replace( " \n", "\n" );
                        x = x.Replace( " \f", "\f" );
                        d = d.Replace( " \f", "\f" );
                        x = x.Replace( "\n ", "\n" );
                        d = d.Replace( "\n ", "\n" );
                        x = x.Replace( "‘", "'" );
                        x = x.Replace( "’", "'" );
                        x = x.Replace( "‛", "'" );
                        d = d.Replace( "‘", "'" );
                        d = d.Replace( "’", "'" );
                        d = d.Replace( "‛", "'" );
                        x = x.TrimEnd( new char[] { ' ' } );
                        d = d.TrimEnd( new char[] { ' ' } );

                        if ( x == d ) {
                            UpdateEntry( "Data Source=VSkit Text", foundLinesNpc[i].Pointer, 4, d );
                            continue;
                        }
                    }

                    encnt = 0;
                    for ( int j = i; j < foundLines360.Count; ++j ) {
                        if ( foundLinesNpc[j].Eng != foundLines360[j].Eng ) {
                            encnt++;
                        }
                    }
                    Console.WriteLine( encnt.ToString() + " to go!" );

                    Console.WriteLine();
                    Console.WriteLine();
                    Console.WriteLine();
                    Console.WriteLine( "Ambigous Entry found:" );
                    Console.WriteLine( "Japanese:" );
                    Console.WriteLine( foundLinesNpc[i].Jpn );
                    Console.WriteLine();
                    Console.WriteLine( "English from Database:" );
                    Console.WriteLine( foundLinesNpc[i].Eng.Replace( "\n", "↵\n" ) );
                    Console.WriteLine();
                    Console.WriteLine( "English from 360:" );
                    Console.WriteLine( foundLines360[i].Eng.Replace( "\n", "↵\n" ) );
                    Console.WriteLine();

                    Console.WriteLine( "x: use from 360, mark 4" );
                    Console.WriteLine( "4: use from DB, mark 4" );
                    Console.WriteLine( "3: use from DB, mark 3" );
                    Console.WriteLine( "2: use from DB, mark 2" );
                    Console.WriteLine( "1: use from DB, mark 1" );

                    string opt = Console.ReadLine();
                    if ( opt.StartsWith( "x" ) ) {
                        UpdateEntry( "Data Source=VSkit Text", foundLinesNpc[i].Pointer, 4, foundLines360[i].Eng );
                    } else if ( opt.StartsWith( "4" ) ) {
                        UpdateEntry( "Data Source=VSkit Text", foundLinesNpc[i].Pointer, 4, foundLinesNpc[i].Eng );
                    } else if ( opt.StartsWith( "3" ) ) {
                        UpdateEntry( "Data Source=VSkit Text", foundLinesNpc[i].Pointer, 3, foundLinesNpc[i].Eng );
                    } else if ( opt.StartsWith( "2" ) ) {
                        UpdateEntry( "Data Source=VSkit Text", foundLinesNpc[i].Pointer, 2, foundLinesNpc[i].Eng );
                    } else if ( opt.StartsWith( "1" ) ) {
                        UpdateEntry( "Data Source=VSkit Text", foundLinesNpc[i].Pointer, 1, foundLinesNpc[i].Eng );
                    }
                }
            }

            return 0;
        }
예제 #9
0
 public string GetDataAsHtml( GameVersion version, ItemDat.ItemDat items, TSSFile stringDic, Dictionary<uint, TSSEntry> inGameIdDict, bool phpLinks = false )
 {
     StringBuilder sb = new StringBuilder();
     var item = items.itemIdDict[Item];
     sb.Append( "<img src=\"item-icons/ICON" + item.Data[(int)ItemData.Icon] + ".png\" height=\"16\" width=\"16\"> " );
     sb.Append( "<a href=\"" + Website.GenerateWebsite.GetUrl( Website.WebsiteSection.Item, version, phpLinks, id: (int)item.Data[(int)ItemData.ID], icon: (int)item.Data[(int)ItemData.Icon] ) + "\">" );
     sb.Append( inGameIdDict[item.NamePointer].StringEngOrJpnHtml( version ) + "</a> x" + Count );
     return sb.ToString();
 }
예제 #10
0
        public string GetDataAsHtml( GameVersion version, ItemDat.ItemDat items, TSSFile stringDic, Dictionary<uint, TSSEntry> inGameIdDict, List<SearchPointContent> searchPointContents, List<SearchPointItem> searchPointItems, int index, bool phpLinks = false )
        {
            StringBuilder sb = new StringBuilder();

            sb.Append( "<tr id=\"searchpoint").Append( Index ).Append( "\">" );
            sb.Append( "<td colspan=\"5\">" );
            sb.Append( "[#" ).Append( index ).Append( "] " );
            switch ( SearchPointType ) {
                case 0: sb.Append( "Tree Stump" ); break;
                case 1: sb.Append( "Shell" ); break;
                case 2: sb.Append( "Bones" ); break;
                case 3: sb.Append( "Seagulls" ); break;
                default: sb.Append( SearchPointType ); break;
            }
            if ( CoordY < 0 ) {
                sb.Append( " (Underwater)" );
            }
            if ( ScenarioBegin > 1000999 ) {
                switch ( ScenarioBegin ) {
                    case 3000000: sb.Append( " (Chapter 3 only)" ); break;
                    case 3590000: sb.Append( " (once Erealumen Crystallands accessible)" ); break;
                    default: sb.Append( " (Appears after scenario " ).Append( ScenarioBegin ).Append( ")" ); break;
                }
            }
            //sb.Append( "<br>" )
            //sb.Append( "9: " ).Append( Unknown9 ).Append( "<br>" );
            //sb.Append( "11: " ).Append( Unknown11 ).Append( "<br>" );
            //sb.Append( "14a: " ).Append( Unknown14a ).Append( "<br>" );

            sb.Append( "</td>" );
            sb.Append( "</tr>" );

            sb.Append( "<tr>" );
            for ( uint i = 0; i < SearchPointContentCount; ++i ) {
                sb.Append( "<td>" );
                sb.Append( searchPointContents[(int)( SearchPointContentIndex + i )].GetDataAsHtml( version, items, stringDic, inGameIdDict, searchPointItems, phpLinks: phpLinks ) );
                sb.Append( "</td>" );
            }
            for ( uint i = SearchPointContentCount; i < 5; ++i ) {
                sb.Append( "<td>" );
                sb.Append( "</td>" );
            }
            sb.Append( "</tr>" );

            return sb.ToString();
        }