Esempio n. 1
0
        /// <summary>
        /// Attempts to identify an object in the campaign save.
        /// </summary>
        /// <param name="obj">The object to identify</param>
        /// <returns>The object's name</returns>
        public string Identify(Reach.GameObject obj)
        {
            string mapName = _saveManager.SaveData.Map;

            mapName = mapName.Substring(mapName.LastIndexOf('\\') + 1);

            // Generic taglists + name guessing
            foreach (Util.TagList tagList in _genericTaglists)
            {
                string name = tagList.Translate(mapName, obj.MapID);
                if (!string.IsNullOrEmpty(name))
                {
                    return(name);
                }
            }

            // Map-specific taglists
            foreach (Util.TagList tagList in _mapTaglists)
            {
                string name = tagList.Translate(mapName, obj.MapID);
                if (!string.IsNullOrEmpty(name))
                {
                    return(name);
                }
            }

            // Nothing found, just convert the ID to hex
            return("0x" + obj.MapID.ToString("X"));
        }
Esempio n. 2
0
        public void Update(SaveIO.SaveWriter writer, GameObject parent)
        {
            if (_relative)
            {
                // Find the parent object's position in world space
                float            parentX = parent.X, parentY = parent.Y, parentZ = parent.Z;
                Reach.GameObject obj = parent.Carrier;
                while (obj != null)
                {
                    parentX += obj.X;
                    parentY += obj.Y;
                    parentZ += obj.Z;
                    obj      = obj.Carrier;
                }

                // Transform the coords to world space and write them
                writer.WriteFloat(Scale * parent.Scale);
                writer.WriteFloat(Right.X);
                writer.WriteFloat(-Right.Y);
                writer.WriteFloat(Right.Z);
                writer.WriteFloat(-Forward.X);
                writer.WriteFloat(Forward.Y);
                writer.WriteFloat(-Forward.Z);
                writer.WriteFloat(Up.X);
                writer.WriteFloat(-Up.Y);
                writer.WriteFloat(Up.Z);
                writer.WriteFloat(X + parentX);
                writer.WriteFloat(Y + parentY);
                writer.WriteFloat(Z + parentZ);
            }
            else
            {
                // The coords are already absolute, just write them
                writer.WriteFloat(Scale);
                writer.WriteFloat(Right.X);
                writer.WriteFloat(-Right.Y);
                writer.WriteFloat(Right.Z);
                writer.WriteFloat(-Forward.X);
                writer.WriteFloat(Forward.Y);
                writer.WriteFloat(-Forward.Z);
                writer.WriteFloat(Up.X);
                writer.WriteFloat(-Up.Y);
                writer.WriteFloat(Up.Z);
                writer.WriteFloat(X);
                writer.WriteFloat(Y);
                writer.WriteFloat(Z);
            }
        }
Esempio n. 3
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            _selectedItem = (ListBoxItem)listObjects.SelectedItem;

            switch (GID)
            {
            case 0:
                hcex = (HCEX.GameObject)_selectedItem.Tag;
                break;

            case 2:
                halo3 = (Halo3.GameObject)_selectedItem.Tag;
                break;

            case 4:
                hreach = (Reach.GameObject)_selectedItem.Tag;
                break;
            }

            FormFadeOut.Begin();
            classInfo.applicationExtra.disableInput(this);
        }