Skip to content

Commit

Permalink
Clean up old PaperdollDialogItem controls when updating paperdoll data
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed Mar 23, 2022
1 parent 97eb1e9 commit 1adb207
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions EndlessClient/Dialogs/PaperdollDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Optional;
using Optional.Unsafe;
using System;
using System.Linq;
using XNAControls;

namespace EndlessClient.Dialogs
Expand Down Expand Up @@ -199,6 +200,12 @@ private void UpdateDisplayedData(IPaperdollData paperdollData)
_guild.Text = Capitalize(paperdollData.Guild);
_rank.Text = Capitalize(paperdollData.Rank);

foreach (var control in ChildControls.OfType<PaperdollDialogItem>())
{
control.SetControlUnparented();
control.Dispose();
}

foreach (EquipLocation equipLocation in Enum.GetValues(typeof(EquipLocation)))
{
if (equipLocation == EquipLocation.PAPERDOLL_MAX)
Expand Down

0 comments on commit 1adb207

Please sign in to comment.