Beispiel #1
0
        public void Load()
        {
            loading = true;
            Reach.CampaignSave saveData    = _saveManager.SaveData;
            Reach.BipedObject  playerBiped = saveData.Player.Biped;
            checkInvincible.IsChecked   = playerBiped.Health.IsInfinite;
            checkNoPhysics.IsEnabled    = (playerBiped.Vehicle == null);
            checkNoPhysics.IsChecked    = !playerBiped.PhysicsEnabled;
            checkNoFallDamage.IsChecked = playerBiped.NoFallDamage;

            txtPlayerXCord.Text = playerBiped.X.ToString();
            txtPlayerYCord.Text = playerBiped.Y.ToString();
            txtPlayerZCord.Text = playerBiped.Z.ToString();

            originalBipdItem         = -1;
            cBWeapTransfer.IsEnabled = false;
            cBBipeds.Items.Clear();
            HashSet <Reach.BipedObject> availableBipeds = Util.EditorSupport.FindSwappableBipeds(saveData);

            availableBipeds.Add(playerBiped);
            SortedDictionary <string, Reach.BipedObject> sortedBipeds = new SortedDictionary <string, Reach.BipedObject>();

            foreach (Reach.BipedObject obj in availableBipeds)
            {
                sortedBipeds[_taglistManager.Identify(obj)] = obj;
            }

            foreach (KeyValuePair <string, Reach.BipedObject> obj in sortedBipeds)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Content = obj.Key;
                item.Tag     = obj.Value;
                cBBipeds.Items.Add(item);

                if (obj.Value == playerBiped)
                {
                    originalBipdItem       = cBBipeds.Items.Count - 1;
                    cBBipeds.SelectedIndex = originalBipdItem;
                }
            }
            cBBipeds.IsEnabled = true;

            loading = false;
        }
Beispiel #2
0
        public listcordWindow(Reach.CampaignSave _reach, Reach.TagGroup group, Reach.TagListManager _reachTaglist)
        {
            this.InitializeComponent();

            lblTitle.Text   = "COPY COORDINATES";
            lblSubInfo.Text = "Select an object to copy coordinates from";

            GID = 4;

            foreach (Reach.GameObject obj in _reach.Objects)
            {
                if (obj != null && obj.TagGroup == group)
                {
                    ListBoxItem lbi     = new ListBoxItem();
                    string      posData = " -- [X: {0} - Y: {1} - Z: {2}]";
                    lbi.Content = _reachTaglist.Identify(obj) + string.Format(posData, obj.X.ToString(),
                                                                              obj.Y.ToString(),
                                                                              obj.Z.ToString());
                    lbi.Tag = obj;

                    listObjects.Items.Add(lbi);
                }
            }
        }
Beispiel #3
0
        public bool Save()
        {
            Reach.BipedObject playerBiped = _saveManager.SaveData.Player.Biped;
            bool weaponChanged            = false;

            // We have to do the save in two passes:
            // 1. Replace weapons and edit ammo
            // 2. Drop weapons in reverse order
            for (int i = 0; i < _weaponBoxes.Length; i++)
            {
                ComboBox box  = _weaponBoxes[i];
                Grid     grid = (Grid)box.Tag;

                // Replace the weapon if it does not match
                ComboBoxItem item = (ComboBoxItem)box.SelectedItem;
                if (item.Tag != null)
                {
                    WeaponItem weapon = (WeaponItem)item.Tag;
                    if (weapon.Object != playerBiped.GetWeapon(i))
                    {
                        weaponChanged = true;
                        playerBiped.ChangeWeapon(i, weapon.Object);
                        if (_tagList.Identify(playerBiped) == "Noble 6")
                        {
                            if (i == 0)
                            {
                                weapon.Object.ParentNode = NobleSixPrimaryWeaponNode;
                            }
                            else
                            {
                                weapon.Object.ParentNode = NobleSixSecondaryWeaponNode;
                            }

                            weapon.Object.X = 0;
                            weapon.Object.Y = 0;
                            weapon.Object.Z = 0;
                        }
                    }
                }

                if (grid.Children.Count > 0)
                {
                    // Save its ammo info
                    Util.IAmmoDisplay display = (Util.IAmmoDisplay)grid.Children[0];
                    display.Save();
                }
            }

            for (int i = _weaponBoxes.Length - 1; i >= 0; i--)
            {
                if (_weaponBoxes[i].SelectedIndex == 0)
                {
                    // (nothing) item is selected
                    playerBiped.DropWeapon(i);
                }
            }

            if (weaponChanged && playerBiped.Weapons.Count > 1)
            {
                _mainWindow.showMessage("Once your save loads, cycle through all of your weapons at least once. This will fix the carry data for your new weapons and ensure that they work properly.", "WEAPON REPLACEMENT");
            }

            return(true);
        }