/// <summary> /// Choose new music when a menu is closed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuEvents_MenuClosed(object sender, StardewModdingAPI.Events.EventArgsClickableMenuClosed e) { if (menuChangedMusic == true) { musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); } }
/// <summary>Raised after a player warps to a new location.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnPlayerWarped(object sender, WarpedEventArgs e) { if (e.IsLocalPlayer) { musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); } }
/// <summary> /// Raised every frame. Mainly used just to initiate the music packs. Probably not needed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GameEvents_UpdateTick(object sender, EventArgs e) { if (musicPacksInitialized == false) { initializeMusicPacks(); musicPacksInitialized = true; musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); } }
/// <summary>Raised after a game menu is opened, closed, or replaced.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnMenuChanged(object sender, MenuChangedEventArgs e) { // menu closed if (e.NewMenu == null) { if (menuChangedMusic) { musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); } } // menu changed else { musicManager.SelectMenuMusic(SongSpecifics.getCurrentConditionalString()); } }
/// <summary> /// Events to occur after the game has loaded in. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveEvents_AfterLoad(object sender, EventArgs e) { //Locaion initialization MUST occur after load. Anything else can occur before. SongSpecifics.initializeLocationsList(); //Gets all Game locations once the player has loaded the game, and all buildings on the player's farm and adds them to a location list. musicManager.initializeSeasonalMusic(); //Initialize the seasonal music using all locations gathered in the location list. musicManager.initializeMenuMusic(); musicManager.initializeFestivalMusic(); musicManager.initializeEventMusic(); foreach (var musicPack in musicManager.musicPacks) { musicPack.Value.readFromJson(); } SongSpecifics.menus.Sort(); SongSpecifics.locations.Sort(); SongSpecifics.festivals.Sort(); SongSpecifics.events.Sort(); musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); }
/// <summary> /// Raised when the player changes locations. This should determine the next song to play. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LocationEvents_CurrentLocationChanged(object sender, StardewModdingAPI.Events.EventArgsCurrentLocationChanged e) { musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); }
/// <summary> /// Choose new music when a menu is opened. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuEvents_MenuChanged(object sender, StardewModdingAPI.Events.EventArgsClickableMenuChanged e) { //var ok = musicManager.currentMusicPack.getNameOfCurrentSong(); musicManager.selectMenuMusic(SongSpecifics.getCurrentConditionalString()); }
/// <summary> /// Raised when the player changes locations. This should determine the next song to play. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PlayerEvents_Warped(object sender, StardewModdingAPI.Events.EventArgsPlayerWarped e) { musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); }