Skip to content

Commit 993bed1

Browse files
committed
Fixes
1 parent 9b09ff6 commit 993bed1

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

YAFC/Workspace/AutoPlannerView.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Reflection;
34
using YAFC.Model;
45
using YAFC.UI;
56

@@ -108,11 +109,13 @@ protected override void BuildContent(ImGui gui)
108109

109110
public override void CreateModelDropdown(ImGui gui, Type type, Project project, ref bool close)
110111
{
112+
/*
111113
if (gui.BuildContextMenuButton("Auto planner (Alpha)"))
112114
{
113115
close = true;
114116
WizardPanel.Show("New auto planner", CreateAutoPlannerWizard);
115117
}
118+
*/
116119
}
117120
}
118121
}

YAFC/Workspace/ProductionTable/ProductionTableView.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private void OpenProductDropdown(ImGui targetGui, Rect rect, Goods goods, float
124124

125125
void DropDownContent(ImGui gui, ref bool close)
126126
{
127-
if (type == ProductDropdownType.Fuel && recipe?.entity != null && recipe.entity.energy.fuels.Count > 1)
127+
if (type == ProductDropdownType.Fuel && recipe?.entity != null && (recipe.entity.energy.fuels.Count > 1 || recipe.entity.energy.fuels[0] != recipe.fuel))
128128
{
129129
close |= gui.BuildInlineObejctListAndButton(recipe.entity.energy.fuels, DataUtils.FavouriteFuel, selectFuel, "Select fuel", extra:fuelDisplayFunc);
130130
}
@@ -259,7 +259,7 @@ private void BuildGoodsIcon(ImGui gui, Goods goods, ProductionLink link, float a
259259
{
260260
var linkIsError = link != null && ((link.flags & (ProductionLink.Flags.HasProductionAndConsumption | ProductionLink.Flags.LinkRecursiveNotMatched | ProductionLink.Flags.ChildNotMatched)) != ProductionLink.Flags.HasProductionAndConsumption);
261261
var linkIsForeign = link != null && link.owner != context;
262-
if (gui.BuildFactorioObjectWithAmount(goods, amount, goods?.flowUnitOfMeasure ?? UnitOfMeasure.None, link != null ? linkIsError ? SchemeColor.Error : linkIsForeign ? SchemeColor.Secondary : SchemeColor.Primary : goods.IsSourceResource() ? SchemeColor.Green : SchemeColor.None) && goods != Database.voidEnergy)
262+
if (gui.BuildFactorioObjectWithAmount(goods, amount, goods?.flowUnitOfMeasure ?? UnitOfMeasure.None, link != null ? linkIsError ? SchemeColor.Error : linkIsForeign ? SchemeColor.Secondary : SchemeColor.Primary : goods.IsSourceResource() ? SchemeColor.Green : SchemeColor.None))
263263
{
264264
OpenProductDropdown(gui, gui.lastRect, goods, amount, link, dropdownType, recipe, context, variants);
265265
}
@@ -287,7 +287,7 @@ private void BuildRecipeEntity(ImGui gui, RecipeRow recipe)
287287
}
288288

289289
gui.AllocateSpacing(0.5f);
290-
if (recipe.fuel != Database.voidEnergy)
290+
if (recipe.fuel != Database.voidEnergy || recipe.entity == null || recipe.entity.energy.type != EntityEnergyType.Void)
291291
{
292292
BuildGoodsIcon(gui, recipe.fuel, recipe.links.fuel, (float) (recipe.parameters.fuelUsagePerSecondPerRecipe * recipe.recipesPerSecond), ProductDropdownType.Fuel, recipe, recipe.linkRoot);
293293
}

YAFCmodel/Model/ModuleFillerParameters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void AutoFillBeacons(RecipeParameters recipeParams, Recipe recipe, Entity
4141

4242
public void AutoFillModules(RecipeParameters recipeParams, Recipe recipe, Entity entity, Goods fuel, ref ModuleEffects effects, ref RecipeParameters.UsedModule used)
4343
{
44-
if (fillMiners || !recipe.flags.HasFlags(RecipeFlags.UsesMiningProductivity))
44+
if (autoFillPayback > 0 && (fillMiners || !recipe.flags.HasFlags(RecipeFlags.UsesMiningProductivity)))
4545
{
4646
var productivityEconomy = recipe.Cost() / recipeParams.recipeTime;
4747
var effectivityEconomy = recipeParams.fuelUsagePerSecondPerBuilding * fuel?.Cost() ?? 0;

0 commit comments

Comments
 (0)