/// <summary>Creates a Stray instance</summary> internal void PlaceStray(object sender, UpdateTickedEventArgs e) { if (!Game1.hasLoadedGame || !ModEntry.AssetsLoaded) { return; } StrayInfo = new Stray(); ModEntry.SHelper.Events.GameLoop.UpdateTicked -= this.PlaceStray; }
/// <summary>Adopts and names the stray being interacted with. Called in the CheckStray event handler.</summary> internal void PetNamer(string petName) { // Name Pet and add to Adopt & Skin database StrayInfo.PetInstance.Name = petName; StrayInfo.PetInstance.displayName = petName; Earth.AddCreature(StrayInfo.PetInstance, StrayInfo.SkinID); // Warp the new Pet to the farmhouse StrayInfo.PetInstance.warpToFarmHouse(Game1.player); // Set walk-through pet configuration if (!ModEntry.Config.WalkThroughPets) { StrayInfo.PetInstance.farmerPassesThrough = false; } // Pet is no longer a Stray to keep track of StrayInfo = null; // Exit the naming menu Game1.drawObjectDialogue($"{petName} was brought home."); }