Skip to content

Commit

Permalink
Fix spouse prompt not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
urbanyeti committed Jan 11, 2022
1 parent f437a4f commit 0af07a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions BetterFriendship/BetterFriendship/GameExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public static bool IsTownsfolk(this NPC npc)
public static bool ShouldOverrideForSpouse(this Character character, ModConfig config) =>
config.SpousePromptsOverride && character.Name == Game1.player.spouse;

public static bool IsOutOfDialog(this NPC npc) =>
npc is not Child && npc.Name != Game1.player.spouse && npc.CurrentDialogue?.Count == 0;

private static IEnumerable<(Object, int)> TakeTopPrioritized(this IEnumerable<(Object item, int taste)> items,
ModConfig config)
{
Expand Down
4 changes: 2 additions & 2 deletions BetterFriendship/BetterFriendship/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ npc is Child ||
)
{
if ((!Config.DisplayTalkPrompts && !npc.ShouldOverrideForSpouse(Config)) ||
friendship.TalkedToToday || (npc is not Child && npc.CurrentDialogue?.Count == 0)) continue;
friendship.TalkedToToday || npc.IsOutOfDialog()) continue;

BubbleDrawer.DrawBubble(Game1.spriteBatch, npc, null, false, true);
continue;
Expand All @@ -107,7 +107,7 @@ npc is Child ||
BubbleDrawer.DrawBubble(Game1.spriteBatch, npc, bestItems,
true,
(Config.DisplayTalkPrompts || npc.ShouldOverrideForSpouse(Config)) && !friendship.TalkedToToday &&
(npc.CurrentDialogue?.Count > 0 || npc is Child)
!npc.IsOutOfDialog()
);
}
}
Expand Down

0 comments on commit 0af07a4

Please sign in to comment.