Skip to content

Commit

Permalink
whiles were unecessary + fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychpsyo committed Aug 2, 2022
1 parent 9acab3f commit 07bc110
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tooltippery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class ButtonTooltipOpen
{
static void Postfix(Button __instance, ButtonEventData eventData)
{
if (openTooltips.ContainsKey(__instance)) return;

string label = determineLabel(__instance, eventData);
if (label != null)
{
Expand All @@ -85,7 +87,7 @@ class ButtonTooltipClose
static void Postfix(Button __instance)
{
Tooltip toClose;
while (openTooltips.TryGetValue(__instance, out toClose))
if (openTooltips.TryGetValue(__instance, out toClose))
{
openTooltips.Remove(__instance);
hideTooltip(toClose);
Expand All @@ -100,7 +102,7 @@ class ButtonTooltipDispose
static void Postfix(Button __instance)
{
Tooltip toClose;
while (openTooltips.TryGetValue(__instance, out toClose))
if (openTooltips.TryGetValue(__instance, out toClose))
{
openTooltips.Remove(__instance);
hideTooltip(toClose);
Expand Down

0 comments on commit 07bc110

Please sign in to comment.