Skip to content

Commit

Permalink
Fix #122: Provide a consistent display for disabled recipes.
Browse files Browse the repository at this point in the history
Specifically, always show empty boxes for both ingredients and products.
  • Loading branch information
DaleStan authored and shpaass committed May 14, 2024
1 parent f80331b commit 35806d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Yafc/Workspace/ProductionTable/ProductionTableView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ public override void BuildElement(ImGui gui, RecipeRow recipe) {
else {
for (int i = 0; i < recipe.recipe.ingredients.Length; i++) {
var ingredient = recipe.recipe.ingredients[i];
var link = recipe.links.ingredients[i];
var goods = recipe.links.ingredientGoods[i];
var link = recipe.hierarchyEnabled ? recipe.links.ingredients[i] : null;
var goods = recipe.hierarchyEnabled ? ingredient.goods : null;
grid.Next();
view.BuildGoodsIcon(gui, goods, link, (float)(ingredient.amount * recipe.recipesPerSecond), ProductDropdownType.Ingredient, recipe, recipe.linkRoot, ingredient.variants);
}
Expand All @@ -420,8 +420,10 @@ public override void BuildElement(ImGui gui, RecipeRow recipe) {
else {
for (int i = 0; i < recipe.recipe.products.Length; i++) {
var product = recipe.recipe.products[i];
var link = recipe.hierarchyEnabled ? recipe.links.products[i] : null;
var goods = recipe.hierarchyEnabled ? product.goods : null;
grid.Next();
view.BuildGoodsIcon(gui, product.goods, recipe.links.products[i], (float)(recipe.recipesPerSecond * product.GetAmount(recipe.parameters.productivity)), ProductDropdownType.Product,
view.BuildGoodsIcon(gui, goods, link, (float)(recipe.recipesPerSecond * product.GetAmount(recipe.parameters.productivity)), ProductDropdownType.Product,
recipe, recipe.linkRoot);
}
}
Expand Down

0 comments on commit 35806d6

Please sign in to comment.