Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed May 7, 2023
1 parent 170ce36 commit 7ca4b53
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions FarmerPortraits/CodePatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
11 changes: 7 additions & 4 deletions FarmerPortraits/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -43,15 +46,15 @@ private static void ReloadTextures()
{
try
{
portraitTexture = Game1.content.Load<Texture2D>("aedenthorn.FarmerPortraits/portrait");
portraitTexture = SHelper.GameContent.Load<Texture2D>("aedenthorn.FarmerPortraits/portrait");
}
catch
{
portraitTexture = null;
}
try
{
backgroundTexture = Game1.content.Load<Texture2D>("aedenthorn.FarmerPortraits/background");
backgroundTexture = SHelper.GameContent.Load<Texture2D>("aedenthorn.FarmerPortraits/background");
}
catch
{
Expand Down
2 changes: 1 addition & 1 deletion MapEdit/ModActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Tile>();
ModEntry.currentLayer.Value = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion MapEdit/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Binary file added _releases/FarmerPortraits 0.4.0.zip
Binary file not shown.

0 comments on commit 7ca4b53

Please sign in to comment.