Ejemplo n.º 1
0
        public void SaveSTBLObjectInPackage(bool isSaveAs, MainUI mainUI)
        {
            List <uint>   textResourceID = new List <uint>();
            List <string> textString     = new List <string>();

            ArrayList tempList = new ArrayList();

            if (dataGridView1.Rows.Count > 0)
            {
                uint   convert = 0;
                string hexText;

                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    hexText = ((string)dataGridView1.Rows[i].Cells[0].Value).Replace("0x", "");
                    convert = Convert.ToUInt32(hexText, 16);
                    textResourceID.Add(convert);
                    textString.Add(dataGridView1.Rows[i].Cells[1].Value.ToString());
                }
            }

            tempList.Add(textResourceID);
            tempList.Add(textString);

            MainUI.lrie = MainUI.imppkg.FindAll(x =>
            {
                return(x.ResourceType == 0x220557DA);
            });


            var el = MainUI.lrie.Find(x =>
            {
                return(x.Instance == MainUI.packageElId);
            });

            if (el != null)
            {
                var res = WrapperDealer.GetResource(0, imppkg, el, true);
                WriteSTBLStream(tempList, res.Stream);

                MainUI.imppkg.ReplaceResource(el, res);
            }

            filenameLabel.Text = publicPath;
            pathOpened         = true;
        }
 public CreateNewSTBLInPackage(MainUI mainUI)
 {
     InitializeComponent();
     this.mainUI = mainUI;
 }