private void UpdatePortrait() { var portraitId = _obj.GetInt32(obj_f.critter_portrait); if (_currentPortraitId == portraitId) { return; // Nothing to update } _currentPortraitId = portraitId; var normalPath = GameSystems.UiArtManager.GetPortraitPath(portraitId, PortraitVariant.Small); _normalPortrait?.Dispose(); RemoveContent(_normalPortrait); _normalPortrait = new WidgetImage(normalPath); AddContent(_normalPortrait); var greyPath = GameSystems.UiArtManager.GetPortraitPath(portraitId, PortraitVariant.SmallGrey); _greyPortrait?.Dispose(); RemoveContent(_greyPortrait); if (greyPath != null) { _greyPortrait = new WidgetImage(greyPath); } AddContent(_greyPortrait); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _downImage.Dispose(); _hoverImage.Dispose(); } }
protected override void Dispose(bool disposing) { if (disposing) { _normalLeft.Dispose(); _normalBg.Dispose(); _normalRight.Dispose(); _selectedLeft.Dispose(); _selectedBg.Dispose(); _selectedRight.Dispose(); } base.Dispose(disposing); }
void ReleaseDesignerOutlets() { if (WidgetImage != null) { WidgetImage.Dispose(); WidgetImage = null; } if (WidgetTitle != null) { WidgetTitle.Dispose(); WidgetTitle = null; } if (WidgetButton != null) { WidgetButton.Dispose(); WidgetButton = null; } }
public void Dispose() { _image?.Dispose(); }