//When the day starts. So we can populate the shit. private void DayStarted(object sender, DayStartedEventArgs e) { if (!Context.IsWorldReady) { return; } //Run population code FarmHouse farm = null; Cabin cabin = null; bool isFarmHouse = Game1.player.currentLocation.GetType() == typeof(FarmHouse); bool isCabin = Game1.player.currentLocation.GetType() == typeof(Cabin); if (isFarmHouse) { farm = Game1.player.currentLocation as FarmHouse; DoWallpaperSave(farm); } if (isCabin) { cabin = Game1.player.currentLocation as Cabin; DoWallpaperSave(cabin); } DecorationFacade curWall = isFarmHouse ? farm?.wallPaper : cabin?.wallPaper; if (curWall != null) { for (int i = 0; i < curWall.Count; i++) { if (!_wallPaper[i].Equals(curWall[i])) { Monitor.Log($"Current Wallpaper: {curWall[i]}", LogLevel.Alert); } } } //Populate flooring DecorationFacade curFloor = isFarmHouse ? farm?.floor : cabin?.floor; if (curFloor != null) { _floor = new DecorationFacade(); foreach (int i in curFloor) { _floor.Add(i); if (Debugging) { Monitor.Log($"Current Floor: {i}", LogLevel.Alert); } } } }
//DoFloorSave method for Cabin's. private void DoFloorSave(Cabin house) { DecorationFacade curFloor = house.floor; _floor = new DecorationFacade(); foreach (int i in curFloor) { _floor.Add(i); if (Debugging) { Monitor.Log($"Current Floor: {i}", LogLevel.Alert); } } }
//DoWallpaperSave method for Cabin's private void DoWallpaperSave(Cabin house) { DecorationFacade curWallpaper = house.wallPaper; _wallPaper = new DecorationFacade(); foreach (int i in curWallpaper) { _wallPaper.Add(i); if (Debugging) { Monitor.Log($"Current Wallpaper: {i}", LogLevel.Alert); } } }