From 7c8d0bc6bde5c542b62c2d98c4cb202ab3acd7c7 Mon Sep 17 00:00:00 2001 From: JoshuaNavarro Date: Wed, 4 Dec 2019 22:08:00 -0800 Subject: [PATCH] Added in fade commands for event helper. --- .../HappyBirthday/Framework/BirthdayEvents.cs | 3 ++- .../Framework/Events/EventHelper.cs | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs index bc68afdd..d16ff1d5 100644 --- a/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs +++ b/GeneralMods/HappyBirthday/Framework/BirthdayEvents.cs @@ -21,7 +21,8 @@ namespace Omegasis.HappyBirthday.Framework conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter"))); conditions.Add(new TimePrecondition(600, 2600)); EventHelper e = new EventHelper("CommunityCenterBirthday",19950, conditions, new EventStartData(EventStartData.MusicToPlayType.Continue, 10, 10, new EventStartData.FarmerData(10, 10, EventHelper.FacingDirection.Up),new List())); - + e.setViewportPosition(10, 10); + e.globalFadeIn(); e.showMessage("Community center birthday here."); e.end(); diff --git a/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs b/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs index 1b0440e8..584b280c 100644 --- a/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs +++ b/GeneralMods/HappyBirthday/Framework/Events/EventHelper.cs @@ -1024,6 +1024,13 @@ namespace Omegasis.HappyBirthday.Framework.Events this.add(b); } + public virtual void fadeIn() + { + StringBuilder b = new StringBuilder(); + b.Append("fade"); + this.add(b); + } + /// /// Makes the farmer eat an object. /// @@ -1057,13 +1064,21 @@ namespace Omegasis.HappyBirthday.Framework.Events /// Fade to black at a particular speed (default 0.007). If no speed is specified, the event will continue immediately; otherwise, it will continue after the fade is finished. The fade effect disappears when this command is done; to avoid that, use the viewport command to move the camera off-screen. /// /// - public virtual void globalFade(double speed) + public virtual void globalFadeOut(double speed=0.007) { StringBuilder b = new StringBuilder(); b.Append("globalFade "); b.Append(speed); this.add(b); } + + public virtual void globalFadeIn(double speed=0.007) + { + StringBuilder b = new StringBuilder(); + b.Append("globalFadeToClear "); + b.Append(speed); + this.add(b); + } /// /// Fade to clear (unfade?) at a particular speed (default 0.007). If no speed is specified, the event will continue immediately; otherwise, it will continue after the fade is finished. /// @@ -1619,6 +1634,8 @@ namespace Omegasis.HappyBirthday.Framework.Events b.Append(XPosition); b.Append(" "); b.Append(YPosition); + b.Append(" "); + b.Append("true"); this.add(b); }