Skip to content

Commit

Permalink
Update ReplacementImages to be nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
MattEqualsCoder committed Dec 9, 2024
1 parent 01534d7 commit 1d411bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ public UIGridLocation() { }
/// <summary>
/// Map of identifier to images to use
/// </summary>
public Dictionary<string, string> ReplacementImages { get; set; } = new();
public Dictionary<string, string>? ReplacementImages { get; set; } = new();
}
5 changes: 3 additions & 2 deletions src/TrackerCouncil.Smz3.UI/Services/TrackerWindowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,9 @@ private TrackerWindowPanelViewModel GetItemPanelViewModel(UIGridLocation gridLoc
items[item] = fileName;
}

var replacementImages =
gridLocation.ReplacementImages.ToDictionary(x => x.Key,
var replacementImages = gridLocation.ReplacementImages == null
? []
: gridLocation.ReplacementImages.ToDictionary(x => x.Key,
x => uiService.GetSpritePath("Items", x.Value, out _));

var model = new TrackerWindowItemPanelViewModel()
Expand Down

0 comments on commit 1d411bf

Please sign in to comment.