diff --git a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs index 6d248b6f..cc0219bd 100644 --- a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs +++ b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs @@ -16,6 +16,7 @@ namespace Omegasis.HappyBirthday.Framework public static EventHelper CommunityCenterBirthday() { + //TODO Junimos List conditions = new List(); conditions.Add(new FarmerBirthdayPrecondition()); conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter"))); @@ -24,12 +25,104 @@ namespace Omegasis.HappyBirthday.Framework e.globalFadeIn(); e.moveFarmerUp(6, EventHelper.FacingDirection.Up, false); e.ViewportLerpTileOffset(new Microsoft.Xna.Framework.Point(0,-6),60*6,true); - e.addObjectToPlayersInventory(64, 22,true); + //e.addObjectToPlayersInventory(64, 22,true); + + e.addTemporaryActor_NPC("Junimo", 16, 16, 32, 14, EventHelper.FacingDirection.Down, false); + e.actorJump("Junimo"); e.showMessage("Community center birthday here."); + //Notes + //Add a temporary actor (or sprite) to the screen. + //Use the attachCharacterToTempSprite command to stitch them together? + + /* + * + * + * else if (strArray[index].Equals("Junimo")) + { + List actors = this.actors; + Junimo junimo = new Junimo(new Vector2((float)(Convert.ToInt32(strArray[index + 1]) * 64), (float)(Convert.ToInt32(strArray[index + 2]) * 64 - 32)), Game1.currentLocation.Name.Equals("AbandonedJojaMart") ? 6 : -1, false); + junimo.Name = "Junimo"; + junimo.EventActor = true; + actors.Add((NPC)junimo); + } + + */ e.end(); return e; } + + /* + public static EventHelper DatingBirthday_Penny() + { + + } + public static EventHelper DatingBirthday_Maru() + { + + } + public static EventHelper DatingBirthday_Leah() + { + + } + public static EventHelper DatingBirthday_Abigail() + { + + } + public static EventHelper DatingBirthday_Emily() + { + + } + public static EventHelper DatingBirthday_Haley() + { + + } + public static EventHelper DatingBirthday_Sam() + { + + } + public static EventHelper DatingBirthday_Sebastian() + { + + } + public static EventHelper DatingBirthday_Elliott() + { + + } + public static EventHelper DatingBirthday_Shane() + { + + } + public static EventHelper DatingBirthday_Harvey() + { + + } + + public static EventHelper DatingBirthday_Alex() + { + + } + + public static EventHelper Birthday_Krobus() + { + + } + + + public static EventHelper MarriedBirthday_NoKids() + { + + } + + public static EventHelper MarriedBirthday_OneKids() + { + + } + public static EventHelper MarriedBirthday_TwoKids() + { + + } + */ + } } -} diff --git a/GeneralMods/StardustCore/Events/EventHelper.cs b/GeneralMods/StardustCore/Events/EventHelper.cs index aae99ac9..1762d584 100644 --- a/GeneralMods/StardustCore/Events/EventHelper.cs +++ b/GeneralMods/StardustCore/Events/EventHelper.cs @@ -470,12 +470,36 @@ namespace StardustCore.Events b.Append(" "); b.Append(TileY.ToString()); b.Append(" "); - b.Append(Direction); + b.Append(this.getFacingDirectionNumber(Direction)); + b.Append(" "); + b.Append(Breather); b.Append(" "); b.Append("Character"); this.add(b); } + + public virtual void addTemporaryActor_NPC(string npc, int SpriteWidth, int SpriteHeight, int TileX, int TileY, FacingDirection Direction, bool Breather) + { + StringBuilder b = new StringBuilder(); + b.Append("addTemporaryActor "); + b.Append(npc); + b.Append(" "); + b.Append(SpriteWidth.ToString()); + b.Append(" "); + b.Append(SpriteHeight.ToString()); + b.Append(" "); + b.Append(TileX.ToString()); + b.Append(" "); + b.Append(TileY.ToString()); + b.Append(" "); + b.Append(this.getFacingDirectionNumber(Direction)); + b.Append(" "); + b.Append(Breather); + b.Append(" "); + b.Append("Character"); + this.add(b); + } /// /// Add a temporary actor. 'breather' is boolean. The category determines where the texture will be loaded from, default is Character. Animal name only applies to animal. /// @@ -503,6 +527,8 @@ namespace StardustCore.Events b.Append(" "); b.Append(Direction); b.Append(" "); + b.Append(Breather); + b.Append(" "); b.Append("Animal"); b.Append(" "); b.Append(AnimalName); @@ -535,6 +561,8 @@ namespace StardustCore.Events b.Append(" "); b.Append(Direction); b.Append(" "); + b.Append(Breather); + b.Append(" "); b.Append("Monster"); this.add(b); } diff --git a/GeneralMods/StardustCore/Events/EventManager.cs b/GeneralMods/StardustCore/Events/EventManager.cs index 3217e475..0566850a 100644 --- a/GeneralMods/StardustCore/Events/EventManager.cs +++ b/GeneralMods/StardustCore/Events/EventManager.cs @@ -21,12 +21,14 @@ namespace StardustCore.Events public Dictionary> concurrentEventActions; + private Dictionary> _concurrentEventActionsGC; public EventManager() { this.events = new Dictionary(); this.customEventLogic = new Dictionary>(); this.concurrentEventActions = new Dictionary>(); + this._concurrentEventActionsGC = new Dictionary>(); this.customEventLogic.Add("Omegasis.EventFramework.AddObjectToPlayersInventory", ExtraEventActions.addObjectToPlayerInventory); this.customEventLogic.Add("Omegasis.EventFramework.ViewportLerp", ExtraEventActions.ViewportLerp); @@ -72,7 +74,13 @@ namespace StardustCore.Events string commandName = this.getGameCurrentEventCommandStringName(); //HappyBirthday.ModMonitor.Log("Current event command name is: " + commandName, StardewModdingAPI.LogLevel.Info); - foreach(KeyValuePair> pair in this.concurrentEventActions) + foreach (KeyValuePair> pair in this._concurrentEventActionsGC) + { + this.concurrentEventActions.Remove(pair.Key); + } + this._concurrentEventActionsGC.Clear(); + + foreach (KeyValuePair> pair in this.concurrentEventActions) { pair.Value.Invoke(this,pair.Key); } @@ -87,7 +95,7 @@ namespace StardustCore.Events { if (this.concurrentEventActions.ContainsKey(Key)) { - this.concurrentEventActions.Remove(Key); + this._concurrentEventActionsGC.Remove(Key); } } diff --git a/GeneralMods/StardustCore/Events/ExtraEventActions.cs b/GeneralMods/StardustCore/Events/ExtraEventActions.cs index d77cc1e1..f2a59908 100644 --- a/GeneralMods/StardustCore/Events/ExtraEventActions.cs +++ b/GeneralMods/StardustCore/Events/ExtraEventActions.cs @@ -34,6 +34,12 @@ namespace StardustCore.Events Game1.CurrentEvent.CurrentCommand++; } + + /// + /// Lerp the camera to a specified position. + /// + /// + /// public static void ViewportLerp(EventManager EventManager,string EventData) { string[] splits = EventData.Split(' ');