示例#1
0
        /// <summary>
        ///     Load a single bundle
        /// </summary>
        /// <param name="filename"></param>
        public void LoadBundle(string filename)
        {
            try
            {
                if (Speeches.ContainsKey(filename))
                {
                    return;
                }

                var speech = Coder.Decode(new W3Speech(filename), new System.IO.BinaryReader(new FileStream(filename, FileMode.Open)));

                foreach (var item in speech.item_infos)
                {
                    if (!Items.ContainsKey(item.Name))
                    {
                        Items.Add(item.Name, new List <IWitcherFile>());
                    }

                    Items[item.Name].Add(item);
                }

                Speeches.Add(filename, speech);
            }
            catch (Exception e)
            {
                //TODO: Log
            }
        }
示例#2
0
        /// <summary>
        ///     Load a single bundle
        /// </summary>
        /// <param name="filename"></param>
        private void LoadBundle(string filename)
        {
            try
            {
                if (Speeches.ContainsKey(filename))
                {
                    return;
                }

                var speech = Coder.Decode(new W3Speech(filename), new System.IO.BinaryReader(new FileStream(filename, FileMode.Open)));

                foreach (var item in speech.item_infos)
                {
                    if (!Items.ContainsKey(item.Name))
                    {
                        Items.Add(item.Name, new List <IWitcherFile>());
                    }

                    Items[item.Name].Add(item);
                }

                Speeches.Add(filename, speech);
            }
#pragma warning disable CS0169 // ~~~[[maybe_unused]] c++ compiler attribute
#pragma warning disable CS0168
#pragma warning disable IDE0051
            catch (Exception ex)
#pragma warning restore CS0169 // ~~~[[maybe_unused]] c++ compiler attribute
#pragma warning restore CS0168
#pragma warning restore IDE0051
            {
                //TODO: Log
            }
        }
示例#3
0
        /// <summary>
        ///     Load a single mod bundle
        /// </summary>
        /// <param name="filename">
        ///     file to process
        /// </param>
        public void LoadModBundle(string filename)
        {
            if (Speeches.ContainsKey(filename))
            {
                return;
            }

            var speech = Coder.Decode(new W3Speech(filename), new System.IO.BinaryReader(new FileStream(filename, FileMode.Open)));

            foreach (var item in speech.item_infos)
            {
                if (!Items.ContainsKey(GetModFolder(filename) + "\\" + item.Name))
                {
                    Items.Add(GetModFolder(filename) + "\\" + item.Name, new List <IWitcherFile>());
                }

                Items[GetModFolder(filename) + "\\" + item.Name].Add(item);
            }

            Speeches.Add(filename, speech);
        }