コード例 #1
0
ファイル: ME3PCCObject.cs プロジェクト: aquadran/ME3Explorer
        public Textures.ITexture2D CreateTexture2D(int expID, string pathBIOGame, uint hash = 0)
        {
            ITexture2D temptex2D = new ME3SaltTexture2D(this, expID, pathBIOGame);

            if (hash != 0)
            {
                temptex2D.Hash = hash;
            }
            return(temptex2D);
        }
コード例 #2
0
        private void listView1_MouseClick(object sender, MouseEventArgs e)
        {
            ListView.SelectedIndexCollection n = listView1.SelectedIndices;
            if (n.Count != 1 || pcc == null)
            {
                return;
            }
            int index = Convert.ToInt32(listView1.Items[n[0]].Name);

            if (pcc.Exports[index].ClassName == ME3SaltTexture2D.className)
            {
                tex2D = new ME3SaltTexture2D(pcc, index, ME3Directory.BIOGamePath);
            }
            else
            {
                tex2D = null;
            }

            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                switch (pcc.Exports[index].ClassName)
                {
                case "Sequence":
                    textureToolStripMenuItem.Visible = false;
                    soundsToolStripMenuItem.Visible  = false;
                    contextMenuStrip1.Show(MousePosition);
                    break;

                case "Texture2D":
                    soundsToolStripMenuItem.Visible  = false;
                    textureToolStripMenuItem.Visible = true;
                    contextMenuStrip1.Show(MousePosition);
                    break;

                //case "Level":
                //    soundsToolStripMenuItem.Visible = false;
                //    editToolStripMenuItem1.Visible = true;
                //    inSequenceEditorToolStripMenuItem.Visible = false;
                //    textureToolStripMenuItem.Visible = false;
                //    contextMenuStrip1.Show(MousePosition);
                //    break;
                case "WwiseStream":
                    textureToolStripMenuItem.Visible = false;
                    soundsToolStripMenuItem.Visible  = true;
                    contextMenuStrip1.Show(MousePosition);
                    break;

                default:
                    soundsToolStripMenuItem.Visible  = false;
                    textureToolStripMenuItem.Visible = false;
                    contextMenuStrip1.Show(MousePosition);
                    break;
                }
            }
        }
コード例 #3
0
ファイル: Misc.cs プロジェクト: solarisstar/ME3Explorer
        /// <summary>
        /// Creates a Texture2D from a bunch of stuff.
        /// </summary>
        /// <param name="texName">Name of texture to create.</param>
        /// <param name="pccs">List of PCC's containing texture.</param>
        /// <param name="ExpIDs">List of ExpID's of texture in PCC's. MUST have same number of elements as in PCC's.</param>
        /// <param name="WhichGame">Game target.</param>
        /// <param name="pathBIOGame">Path to BIOGame.</param>
        /// <param name="hash">Hash of texture.</param>
        /// <returns>Texture2D object.</returns>
        public static ITexture2D CreateTexture2D(string texName, List <string> pccs, List <int> ExpIDs, int WhichGame, string pathBIOGame, uint hash = 0)
        {
            ITexture2D temptex2D = null;

            switch (WhichGame)
            {
            case 1:
                temptex2D = new ME1Texture2D(texName, pccs, ExpIDs, pathBIOGame, WhichGame, hash);
                break;

            case 2:
                temptex2D = new ME2Texture2D(texName, pccs, ExpIDs, pathBIOGame, WhichGame, hash);
                break;

            case 3:
                temptex2D = new ME3SaltTexture2D(texName, pccs, ExpIDs, hash, pathBIOGame, WhichGame);
                break;
            }
            if (hash != 0)
            {
                temptex2D.Hash = hash;
            }
            return(temptex2D);
        }