Skip to content

Commit

Permalink
fix(bobsbuddy): don't hide panel in shopping phase with delayed simul…
Browse files Browse the repository at this point in the history
…ation

Bob's Buddy has a mode where it waits for the end of combat before
performing simulations.

With this commit, to respect user intent, if a user has explicitly
expanded Bob's Buddy during a "Awaiting shopping phase" combat, we now
keep it expanded when transitioning to the shopping phase.
This was previously not the case if the user had the setting to hide
Bob's Buddy during the shopping phase set.

Overall this change should prevent Bob's Buddy frustratingly
disappearing just after you've explicitly expanded it waiting for the
delayed results.
  • Loading branch information
beheh committed Aug 25, 2023
1 parent 09f5b31 commit 6c36687
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Hearthstone Deck Tracker/Controls/Overlay/BobsBuddyPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ internal void SetState(BobsBuddyState state)
{
if(State == state)
return;
var lastState = State;
State = state;

if(state == BobsBuddyState.Combat)
Expand All @@ -464,7 +465,17 @@ internal void SetState(BobsBuddyState state)
ShowResults(Config.Instance.ShowBobsBuddyDuringCombat);
}
else if(state == BobsBuddyState.Shopping)
ShowResults(Config.Instance.ShowBobsBuddyDuringShopping);
{
if(!Config.Instance.ShowBobsBuddyDuringShopping) {
// If the user has disabled the "Show During Shopping" setting we would usually hide Bob's Buddy here.
// However if simulation was delayed (e.g. due to a secret) AND the user left the panel expanded during combat, keep it expanded.
ShowResults(lastState == BobsBuddyState.CombatWithoutSimulation && _resultsPanelExpanded);
}
else
{
ShowResults(true);
}
}
else if(state == BobsBuddyState.CombatWithoutSimulation)
ShowResults(false);
}
Expand Down

0 comments on commit 6c36687

Please sign in to comment.