Ejemplo n.º 1
0
        public PackageCreatez(MainForm xParent, PackType xThisType)
        {
            this.MdiParent = xParent;
            xparent        = xParent;
            InitializeComponent();
            List <PackageType> y = new List <PackageType>();

            if (xThisType == PackType.STFS)
            {
                xsession = new CreateSTFS();
                PackageType[] x = (PackageType[])Enum.GetValues(typeof(PackageType));
                y.AddRange(x);
                y.RemoveAll(new Predicate <PackageType>(ptcheck));
                node1.DataKey             = (ushort)0xFFFF;
                node1.NodeClick          += new EventHandler(xReturn_NodeClick);
                comboBoxEx1.SelectedIndex = 0;
                comboBoxEx4.DataSource    = Enum.GetValues(typeof(SphereColor));
                comboBoxEx4.SelectedIndex = 0;
                comboBoxEx5.DataSource    = Enum.GetValues(typeof(DashStyle));
                comboBoxEx5.SelectedIndex = 0;
                numericUpDown4.Value      = xsession.ThemeSettings.AvatarLightingAmbient;
                numericUpDown7.Value      = xsession.ThemeSettings.AvatarLightingDirectional3;
                numericUpDown8.Value      = xsession.ThemeSettings.AvatarLightingDirectional0;
                numericUpDown9.Value      = xsession.ThemeSettings.AvatarLightingDirectional1;
                numericUpDown10.Value     = xsession.ThemeSettings.AvatarLightingDirectional2;
                advTree1.SelectedIndex    = 0;
                tabItem7.Visible          = false;
            }
            else
            {
                y.Add(PackageType.OriginalXboxGame);
                y.Add(PackageType.HDDInstalledGame);
                y.Add(PackageType.GamesOnDemand);
                y.Add(PackageType.SocialTitle);
                tabItem6.Visible    = false;
                xhead               = new HeaderData();
                tabItem5.Visible    = false;
                tabItem4.Visible    = false;
                comboBoxEx1.Visible = false;
            }
            xtype = xThisType;
            comboBoxEx2.DataSource    = y.ToArray();
            comboBoxEx2.SelectedIndex = 0;
            comboBoxEx3.DataSource    = Enum.GetValues(typeof(Languages));
            comboBoxEx3.SelectedIndex = 0;
            SetText();
        }
Ejemplo n.º 2
0
        private bool PackageCreate(string con, CreateSTFS xsession)
        {
            var signature = new RSAParams(Application.StartupPath + "\\bin\\KV.bin");

            try
            {
                xsession.HeaderData.Title_Display = artistSongTool.Checked ? (SongArtist + " - " + SongTitle) : ("\"" + SongTitle + "\"" + (songByArtistTool.Checked ? " by " + SongArtist : ""));
                xsession.HeaderData.Description   = "Converted to CON using C3 CON Tools";
                var xy = new STFSPackage(xsession, signature, con);
                xy.CloseIO();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        private bool makeCON(string rba)
        {
            if (backgroundWorker1.CancellationPending)
            {
                return(false);
            }
            var con = txtFolder.Text + "\\" + Path.GetFileNameWithoutExtension(rba).Replace("_rb3con", "") + "_rb3con";

            Tools.DeleteFile(con);
            var xsession = new CreateSTFS {
                HeaderData = { TitleID = 0x45410914 }
            };

            xsession.HeaderData.Title_Package = "Rock Band 3";
            xsession.HeaderData.SetLanguage(Languages.English);
            xsession.HeaderData.Publisher          = "";
            xsession.STFSType                      = STFSType.Type0;
            xsession.HeaderData.ThisType           = PackageType.SavedGame;
            xsession.HeaderData.PackageImageBinary = rB3IconTool.Checked || string.IsNullOrWhiteSpace(thumbnail) || !File.Exists(thumbnail) ?
                                                     Resources.RB3.ImageToBytes(ImageFormat.Png) : Tools.NemoLoadImage(thumbnail).ImageToBytes(ImageFormat.Png);
            xsession.HeaderData.ContentImageBinary = Resources.RB3.ImageToBytes(ImageFormat.Png);
            xsession.HeaderData.MakeAnonymous();
            var bOk = PackageCheckFiles(xsession);

            if (bOk)
            {
                bOk = PackageCreate(con, xsession);
            }
            if (bOk)
            {
                bOk = Tools.UnlockCON(con);
            }
            if (!bOk)
            {
                return(false);
            }
            Tools.SignCON(con);
            return(true);
        }
Ejemplo n.º 4
0
        public CONCreator(Color ButtonBackColor, Color ButtonTextColor)
        {
            InitializeComponent();

            Tools = new NemoTools();
            var y = new List <PackageType>();

            picContent.AllowDrop = true;
            picPackage.AllowDrop = true;

            btnCreate.BackColor = ButtonBackColor;
            btnCreate.ForeColor = ButtonTextColor;
            btnCreate.FlatAppearance.MouseOverBackColor = btnCreate.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(btnCreate.BackColor);

            moggs    = new List <string>();
            xsession = new CreateSTFS();
            var x = (PackageType[])Enum.GetValues(typeof(PackageType));

            y.AddRange(x);
            node1.DataKey            = (ushort)0xFFFF;
            node1.NodeClick         += xReturn_NodeClick;
            folderTree.SelectedIndex = 0;

            cboGameID.SelectedIndex = 2;
            toolTip1.SetToolTip(picContent, "Click here to select the Content Image (visible in here)");
            toolTip1.SetToolTip(picPackage, "Click here to select the Package Image (visible in the Xbox dashboard)");
            toolTip1.SetToolTip(btnCreate, "Click here to create the song package");
            toolTip1.SetToolTip(radioCON, "Click here for use with retail consoles");
            toolTip1.SetToolTip(radioLIVE, "Click here for use with modded consoles");
            toolTip1.SetToolTip(txtDisplay, "Enter a title for your pack (visible in the Xbox dashboard)");
            toolTip1.SetToolTip(txtDescription, "Enter a description for your pack (visible in here)");
            toolTip1.SetToolTip(folderTree, "Add folders here");
            toolTip1.SetToolTip(fileList, "Add files here");
            toolTip1.SetToolTip(groupBox1, "Choose the format for your pack - default is CON");
            AddFolder("songs");
        }
Ejemplo n.º 5
0
        private bool PackageCheckFiles(CreateSTFS xsession)
        {
            var fnamedta = tempfolder + "songs.dta";

            if (File.Exists(fnamedta))
            {
                xsession.AddFolder("songs");
                xsession.AddFolder("songs/" + basesongname);
                xsession.AddFolder("songs/" + basesongname + "/gen");
                if (!xsession.AddFile(fnamedta, "songs/songs.dta"))
                {
                    Log("ERROR: Could not add " + fnamedta + " to CON");
                    return(false);
                }
            }
            else
            {
                Log("FAIL: " + fnamedta + " is not present");
                return(false);
            }
            var files = Directory.GetFiles(tempfolder, "*.mid");

            if (files.Count() != 0)
            {
                if (!xsession.AddFile(files[0], "songs/" + basesongname + "/" + basesongname + ".mid"))
                {
                    Log("ERROR: Could not add MIDI file to CON");
                    return(false);
                }
            }
            files = Directory.GetFiles(tempfolder, "*.mogg");
            if (files.Count() != 0)
            {
                if (!xsession.AddFile(files[0], "songs/" + basesongname + "/" + basesongname + ".mogg"))
                {
                    Log("ERROR: Could not add mogg file to CON");
                    return(false);
                }
            }
            files = Directory.GetFiles(tempfolder, "*.milo_xbox");
            if (files.Count() != 0)
            {
                if (!xsession.AddFile(files[0], "songs/" + basesongname + "/gen/" + basesongname + ".milo_xbox"))
                {
                    Log("ERROR: Could not add milo file to CON");
                    return(false);
                }
            }
            files = Directory.GetFiles(tempfolder, "*.png_xbox");
            if (files.Count() != 0)
            {
                if (!xsession.AddFile(files[0], "songs/" + basesongname + "/gen/" + basesongname + "_keep.png_xbox"))
                {
                    Log("ERROR: Could not add album art to CON");
                    return(false);
                }
            }
            files = Directory.GetFiles(tempfolder, "*.bin");
            if (!files.Any())
            {
                return(true);
            }
            if (xsession.AddFile(files[0], "songs/" + basesongname + "/gen/" + basesongname + "_weights.bin"))
            {
                return(true);
            }
            Log("ERROR: Could not add weights file to CON");
            return(false);
        }