public static int Execute( List<string> args )
 {
     Nonstop items = new Nonstop( args[0] );
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault( false );
     NonstopForm itemForm = new NonstopForm( items );
     Application.Run( itemForm );
     return 0;
 }
Exemple #2
0
        public static int Execute(List <string> args)
        {
            Nonstop items = new Nonstop(args[0]);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            NonstopForm itemForm = new NonstopForm(items);

            Application.Run(itemForm);
            return(0);
        }
Exemple #3
0
        public NonstopForm(Nonstop itemDat)
        {
            InitializeComponent();

            this.itemDat = itemDat;

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

            for (int i = 0; i < itemDat.BytesPerEntry / 2; ++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 ((NonstopSingleStructure)i)
                {
                default:
                    flowLayoutPanel1.Controls.Add(p);
                    break;
                }
            }

            foreach (NonstopSingle i in itemDat.items)
            {
                listBox1.Items.Add(i.ToString());
            }
        }
        public NonstopForm( Nonstop itemDat )
        {
            InitializeComponent();

            this.itemDat = itemDat;

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

            for ( int i = 0; i < itemDat.BytesPerEntry / 2; ++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 ( (NonstopSingleStructure)i ) {
                    default:
                        flowLayoutPanel1.Controls.Add(p);
                        break;
                }
            }

            foreach (NonstopSingle i in itemDat.items)
            {
                listBox1.Items.Add( i.ToString() );
            }
        }
        public static int AutoImport( List<string> args )
        {
            string dir = @"d:\_svn\GraceNote\GraceNote\DanganRonpaBestOfRebuild\umdimage.dat.ex\";
            string voicedir = @"d:\_svn\GraceNote\GraceNote\Voices\";
            string[] files = System.IO.Directory.GetFiles( dir );

            List<String> dbsToUp = new List<string>();

            foreach ( var x in nonstopDict ) {
                string nonstopFile = GetFromSubstring( files, x.Key );
                string scriptFile = GetFromSubstring( files, x.Value );
                string scriptFileFilename = new System.IO.FileInfo( scriptFile ).Name;
                string databaseId = scriptFileFilename.Substring( 0, 4 );
                string databaseFile = @"d:\_svn\GraceNote\GraceNote\DanganRonpaBestOfDB\DRBO" + databaseId;
                dbsToUp.Add( "DRBO" + databaseId );
                //continue;

                LIN lin = new LIN( scriptFile );
                Nonstop nonstop = new Nonstop( nonstopFile );

                int lastScriptEntry = 0;
                foreach ( var item in nonstop.items ) {
                    int stringId = item.data[(int)NonstopSingleStructure.StringID] + 1;
                    int correspondingTextEntry = stringId * 2;
                    int correspondingScriptEntry = correspondingTextEntry - 1;
                    if ( item.data[(int)NonstopSingleStructure.Type] == 0 ) {
                        lastScriptEntry = correspondingTextEntry;
                    }

                    // --- insert comment info ---
                    string comment = (string)SqliteUtil.SelectScalar(
                        "Data Source=" + databaseFile,
                        "SELECT comment FROM Text WHERE id = ?",
                        new object[] { correspondingTextEntry } );

                    bool weakpt = item.data[(int)NonstopSingleStructure.HasWeakPoint] > 0;
                    comment = ( comment == "" ? "" : comment + "\n\n" )
                        + "Autogenerated Info:\n"
                        + ( lastScriptEntry == 0 ? "Corresponds to file: " + scriptFileFilename : "" )
                        + ( item.data[(int)NonstopSingleStructure.Type] == 0 ? "Normal Line\n" : "Background Noise\n" )
                        + ( weakpt ? "Has a Weak Point\n" : "No Weakpoint\n" )
                        + ( weakpt && ( item.data[(int)NonstopSingleStructure.ShootWithEvidence] & 0xFF ) != 255 ? "Shot with Evidence Bullet: " + item.data[(int)NonstopSingleStructure.ShootWithEvidence] + "\n" : "" )
                        + ( weakpt && ( item.data[(int)NonstopSingleStructure.ShootWithWeakpoint] & 0xFF ) != 255 ? "Shot with Weak Point: " + item.data[(int)NonstopSingleStructure.ShootWithWeakpoint] + "\n" : "" )
                        + ( weakpt && ( item.data[(int)NonstopSingleStructure.ShootWithWeakpoint] & 0xFF ) == 255 && ( item.data[(int)NonstopSingleStructure.ShootWithEvidence] & 0xFF ) == 255 ? "Can't be shot\n" : "" )
                        + ( item.data[(int)NonstopSingleStructure.Type] == 0 ? "" : "Appears around Entry #" + lastScriptEntry + "\n" )
                        + ( item.data[(int)NonstopSingleStructure.Type] == 0 ? "Sprite: " + DanganUtil.CharacterIdToName( (byte)item.data[(int)NonstopSingleStructure.Character] ) + " " + item.data[(int)NonstopSingleStructure.Sprite] + "\n" : "" )
                        ;
                    SqliteUtil.Update(
                        "Data Source=" + databaseFile,
                        "UPDATE Text SET comment = ?, updated = 1 WHERE id = ?",
                        new object[] { comment, correspondingTextEntry } );

                    // --- insert voice info ---
                    string script = (string)SqliteUtil.SelectScalar(
                        "Data Source=" + databaseFile,
                        "SELECT english FROM Text WHERE id = ?",
                        new object[] { correspondingScriptEntry } );
                    string voicename;
                    string voicefilecheck;

                    byte charid = (byte)item.data[(int)NonstopSingleStructure.Character];
                    if ( item.data[(int)NonstopSingleStructure.Type] == 0 ) {
                        while ( true ) {
                            string charac = DanganUtil.CharacterIdToName( charid );
                            if ( charac == "Naegi" ) { charac = "Neagi"; }
                            voicename = "[" + charac + "] " + item.data[(int)NonstopSingleStructure.Chapter] + " "
                                + ( item.data[(int)NonstopSingleStructure.AudioSampleId] >> 8 ) + " " + ( item.data[(int)NonstopSingleStructure.AudioSampleId] & 0xFF ) + " 100";
                            voicefilecheck = voicedir + voicename + ".mp3";
                            if ( System.IO.File.Exists( voicefilecheck ) ) {
                                break;
                            }
                            charid = 0x12;
                        }

                        script += "<__END__>\n"
                            + "<Voice: " + voicename + ">"
                            ;
                        SqliteUtil.Update(
                            "Data Source=" + databaseFile,
                            "UPDATE Text SET english = ?, updated = 1 WHERE id = ?",
                            new object[] { script, correspondingScriptEntry } );

                        // update the header name thingy
                        string header = DanganUtil.CharacterIdToName( charid );
                        SqliteUtil.Update(
                            "Data Source=" + databaseFile,
                            "UPDATE Text SET IdentifyString = ?, updated = 1 WHERE id = ?",
                            new object[] { header, correspondingTextEntry } );
                    } else {
                        string header = "Background Noise";
                        SqliteUtil.Update(
                            "Data Source=" + databaseFile,
                            "UPDATE Text SET IdentifyString = ?, updated = 1 WHERE id = ?",
                            new object[] { header, correspondingTextEntry } );
                    }

                }
            }

            System.IO.File.WriteAllLines(
                @"d:\_svn\GraceNote\GraceNote\temp.txt", dbsToUp.ToArray());
            return 0;
        }