Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unmilled rice and translations. #1

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions UIInfoSuite2/UIElements/ShowCropAndBarrelTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ private void OnRenderingHud(object sender, RenderingHudEventArgs e)
{
int wheatCount = 0;
int beetCount = 0;
int unmilledriceCount = 0;

foreach (Item item in currentTileBuilding.buildingChests[inputKey].Items)
{
Expand All @@ -123,22 +124,29 @@ private void OnRenderingHud(object sender, RenderingHudEventArgs e)
{
switch (item.Name)
{
case "Wheat": wheatCount = item.Stack; break;
case "Beet": beetCount = item.Stack; break;
case "Wheat": wheatCount += item.Stack; break;
case "Beet": beetCount += item.Stack; break;
case "Unmilled Rice": unmilledriceCount += item.Stack; break;
}
}
}

StringBuilder builder = new StringBuilder();

if (wheatCount > 0)
builder.Append(wheatCount + " wheat");
if (wheatCount > 0)
builder.Append($"{ItemRegistry.GetData("(O)262").DisplayName}:{wheatCount}");

if (beetCount > 0)
{
if (wheatCount > 0)
builder.Append(Environment.NewLine);
builder.Append(beetCount + " beets");
builder.Append($"{ItemRegistry.GetData("(O)284").DisplayName}:{beetCount}");
}
if (unmilledriceCount > 0)
{
if (beetCount > 0 || wheatCount > 0)
builder.Append(Environment.NewLine);
builder.Append($"{ItemRegistry.GetData("(O)271").DisplayName}:{unmilledriceCount}");
}

if (builder.Length > 0)
Expand Down