diff --git a/FarmerPortraits/CodePatches.cs b/FarmerPortraits/CodePatches.cs index 0fdd4606..a0c17f8c 100644 --- a/FarmerPortraits/CodePatches.cs +++ b/FarmerPortraits/CodePatches.cs @@ -30,7 +30,6 @@ public static void Postfix(DialogueBox __instance) return; if ((__instance.isPortraitBox() && Config.ShowWithNPCPortrait) || (__instance.isQuestion && Config.ShowWithQuestions)) { - ReloadTextures(); __instance.x += 224; __instance.friendshipJewel.X += 224; } @@ -67,8 +66,10 @@ private static void drawBox(SpriteBatch b, int xPos, int yPos, int boxWidth, int int portraitBoxX = xPos + 76; int portraitBoxY = yPos + boxHeight / 2 - 148 - 36; int frame = Config.FacingFront ? 0 : 6; - if(portraitTexture != null && Config.UseCustomPortrait) + if (portraitTexture != null && Config.UseCustomPortrait) + { b.Draw(portraitTexture, new Rectangle(portraitBoxX + 20, portraitBoxY + 24, 256, 256), null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.88f); + } else { FarmerRenderer.isDrawingForUI = true; diff --git a/FarmerPortraits/ModEntry.cs b/FarmerPortraits/ModEntry.cs index adc70b6c..0076d124 100644 --- a/FarmerPortraits/ModEntry.cs +++ b/FarmerPortraits/ModEntry.cs @@ -30,11 +30,14 @@ public override void Entry(IModHelper helper) SHelper = helper; helper.Events.GameLoop.GameLaunched += GameLoop_GameLaunched; - helper.Events.GameLoop.DayStarted += GameLoop_DayStarted; + + helper.Events.Display.MenuChanged += Display_MenuChanged; + var harmony = new Harmony(ModManifest.UniqueID); harmony.PatchAll(); } - private void GameLoop_DayStarted(object sender, DayStartedEventArgs e) + + private void Display_MenuChanged(object sender, MenuChangedEventArgs e) { ReloadTextures(); } @@ -43,7 +46,7 @@ private static void ReloadTextures() { try { - portraitTexture = Game1.content.Load("aedenthorn.FarmerPortraits/portrait"); + portraitTexture = SHelper.GameContent.Load("aedenthorn.FarmerPortraits/portrait"); } catch { @@ -51,7 +54,7 @@ private static void ReloadTextures() } try { - backgroundTexture = Game1.content.Load("aedenthorn.FarmerPortraits/background"); + backgroundTexture = SHelper.GameContent.Load("aedenthorn.FarmerPortraits/background"); } catch { diff --git a/MapEdit/ModActions.cs b/MapEdit/ModActions.cs index 7d687fa0..5888d9be 100644 --- a/MapEdit/ModActions.cs +++ b/MapEdit/ModActions.cs @@ -163,7 +163,7 @@ public static void DeactivateMod() ModEntry.modActive.Value = false; ModEntry.copiedTileLoc.Value = new Vector2(-1, -1); ModEntry.pastedTileLoc.Value = new Vector2(-1, -1); - ModEntry.currentTileDict.Value.Clear(); + ModEntry.currentTileDict.Value = new Dictionary(); ModEntry.currentLayer.Value = 0; } diff --git a/MapEdit/manifest.json b/MapEdit/manifest.json index 12fcc6bb..4300b071 100644 --- a/MapEdit/manifest.json +++ b/MapEdit/manifest.json @@ -1,7 +1,7 @@ { "Name": "Map Edit", "Author": "aedenthorn", - "Version": "0.8.1", + "Version": "0.8.2", "Description": "Enables in-game editing of map tiles.", "UniqueID": "aedenthorn.MapEdit", "EntryDll": "MapEdit.dll", diff --git a/_releases/FarmerPortraits 0.4.0.zip b/_releases/FarmerPortraits 0.4.0.zip new file mode 100644 index 00000000..5b817d49 Binary files /dev/null and b/_releases/FarmerPortraits 0.4.0.zip differ