Example #1
0
        public void Load(PetPlace[] selectedpets)
        {
            int slot = 1;

            while (slot <= 3)
            {
                if ((slot == 1 && PluginSettings.Instance.LockFirstSlot) ||
                    (slot == 2 && PluginSettings.Instance.LockSecondSlot) ||
                    (slot == 3 && PluginSettings.Instance.LockThirdSlot))
                {
                    Logger.Write(string.Format("Filling pet Slot {0} -- locked. Keeping {1}", slot, MyPets.Pet(slot - 1).Name));
                }
                else
                {
                    if (selectedpets[slot - 1].opened)
                    {
                        if (selectedpets[slot - 1].opened)
                        {
                            _petLua.LoadPet(slot, selectedpets[slot - 1].pet.PetId);
                            Logger.Write(string.Format("Filling pet Slot {0} with {1}", slot, selectedpets[slot - 1].pet.ToString()));
                        }
                        else
                        {
                            Logger.Write(string.Format("Filling pet Slot {0} -- nothing selected, unchanged", slot));
                        }
                    }
                    else
                    {
                        return;
                    }
                }

                slot++;
            }
        }
Example #2
0
 private void CopyCurrentPet(int slot)
 {
     _selectedpets[slot].pet.PetId = MyPets.Pet(slot).PetID;
     _selectedpets[slot].pet.SetStatsInvalid();  // Only ID is needed, but just in case.
 }