Пример #1
0
        public void LoadPlayZone()
        {
            if (Version <= DefinitionSet.Halo2Vista)
            {
                return;
            }

            foreach (IndexItem item in IndexItems)
            {
                if (item.ClassCode == "play")
                {
                    if (item.Offset > Reader.Length)
                    {
                        foreach (IndexItem item2 in IndexItems)
                        {
                            if (item2.ClassCode == "zone")
                            {
                                //fix for H4 prologue, play address is out of
                                //bounds and data is held inside the zone tag
                                //instead so make a fake play tag using zone data
                                item.Offset = item2.Offset + 28;
                                break;
                            }
                        }
                    }

                    play = DefinitionsManager.play(this, item);
                    break;
                }
            }

            foreach (IndexItem item in IndexItems)
            {
                if (item.ClassCode == "zone")
                {
                    zone = DefinitionsManager.zone(this, item);
                    break;
                }
            }

            foreach (IndexItem item in IndexItems)
            {
                if (item.ClassCode == "ugh!")
                {
                    ugh_ = DefinitionsManager.ugh_(this, item);
                    break;
                }
            }
        }
Пример #2
0
 public virtual void Close()
 {
     Reader.Close();
     Reader.Dispose();
     LocaleTables.Clear();
     Strings.Clear();
     IndexItems.Clear();
     play        = null;
     zone        = null;
     ugh_        = null;
     buildNode   = null;
     versionNode = null;
     vertexNode  = null;
     Header      = null;
     IndexHeader = null;
 }
Пример #3
0
        public void LoadSoundTag(CacheBase Cache, CacheBase.IndexItem Tag)
        {
            cache = Cache;
            tag   = Tag;

            snd = DefinitionsManager.snd_(cache, tag);

            if (cache.ugh_ == null)
            {
                lstPerms.Items.Clear();
                Enabled = false;
                return;
            }
            else
            {
                Enabled = true;
            }

            ugh      = cache.ugh_;
            playback = ugh.PlayBacks[snd.PlaybackIndex];

            Perms = new List <ugh_.SoundPermutation>();

            for (int i = 0; i < playback.PermutationCount; i++)
            {
                Perms.Add(ugh.SoundPermutations[playback.FirstPermutation + i]);
            }

            lstPerms.Items.Clear();

            foreach (var perm in Perms)
            {
                lstPerms.Items.Add(ugh.SoundNames[perm.NameIndex]);
            }

            lstPerms.SelectedIndex = 0;
        }