Skip to content

Commit

Permalink
properly clear background image in action bar icons
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelday008 committed Oct 18, 2021
1 parent ab1c5e4 commit 1a912a9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Assets/AnyRPG/Core/System/Scripts/UI/Buttons/ActionButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,21 @@ public void UpdateVisual(bool removeStaleActions = false) {

if (Useable == null) {
//Debug.Log("ActionButton.UpdateVisual(): useable is null. clearing stack count and setting icon to empty");

// clear stack count
uIManager.ClearStackCount(this);

// clear icon
Icon.sprite = null;
Icon.color = icon.color = new Color32(0, 0, 0, 0);

// clear background image
backgroundImage.color = new Color32(0, 0, 0, 0);
backgroundImage.sprite = null;

// clear cooldown icon
DisableCoolDownIcon();

return;
}

Expand Down Expand Up @@ -394,8 +405,6 @@ public void ClearUseable() {
}
Useable = null;
DisableCoolDownIcon();
backgroundImage.color = new Color32(0, 0, 0, 0);
backgroundImage.sprite = null;
UpdateVisual();
}
}
Expand Down

0 comments on commit 1a912a9

Please sign in to comment.