Skip to content

Commit f39d9b0

Browse files
committed
Bug fixes
1 parent cc5df62 commit f39d9b0

File tree

7 files changed

+13
-4
lines changed

7 files changed

+13
-4
lines changed

YAFC/Utils/Preferences.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ public class Preferences
1515
public static readonly string appDataFolder;
1616
private static readonly string fileName;
1717

18+
public static readonly string autosaveFilename;
19+
1820
static Preferences()
1921
{
2022
appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
2123
if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
2224
appDataFolder = Path.Combine(appDataFolder, "YAFC");
2325
if (!string.IsNullOrEmpty(appDataFolder) && !Directory.Exists(appDataFolder))
2426
Directory.CreateDirectory(appDataFolder);
25-
27+
28+
autosaveFilename = Path.Combine(appDataFolder, "autosave.yafc");
2629
fileName = Path.Combine(appDataFolder, "yafc.config");
2730
if (File.Exists(fileName))
2831
{

YAFC/Windows/DependencyExplorer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ public override void Build(ImGui gui)
134134
{
135135
if (gui.BuildLink("Mark as inaccessible"))
136136
SetFlag(ProjectPerItemFlags.MarkedInaccessible, true);
137+
if (gui.BuildLink("Mark as accessible without milestones"))
138+
SetFlag(ProjectPerItemFlags.MarkedAccessible, true);
137139
}
138140
}
139141
else

YAFC/Workspace/ProjectPageView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public MemoryDrawingSurface GenerateFullPageScreenshot()
8686
var hsize = headerContent.contentSize;
8787
var bsize = bodyContent.contentSize;
8888
var fsize = new Vector2(CalculateWidth(), hsize.Y + bsize.Y);
89-
var surface = new MemoryDrawingSurface(fsize, 20);
89+
var surface = new MemoryDrawingSurface(fsize, 22);
9090
headerContent.Present(surface, new Rect(default, hsize), new Rect(default, hsize), null);
9191
var bodyRect = new Rect(0f, hsize.Y, bsize.X, bsize.Y);
9292
var prevOffset = bodyContent.offset;

YAFCmodel/Analysis/AutomationAnalysis.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ public override void Compute(Project project, ErrorCollector warnings)
110110
var oldState = state[revDep];
111111
if (oldState == Unknown || oldState == AutomationStatus.AutomatableLater && automationState == AutomationStatus.AutomatableNow)
112112
{
113+
if (oldState == AutomationStatus.AutomatableLater)
114+
unknowns++;
113115
processingQueue.Enqueue(revDep);
114116
state[revDep] = UnknownInQueue;
115117
}

YAFCparser/Data/FactorioDataDeserializer_Context.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ private void RegisterSpecial()
8484
reactorProduction.flags |= RecipeFlags.ScaleProductionWithPower;
8585
reactorProduction.ingredients = Array.Empty<Ingredient>();
8686

87-
voidEntityEnergy = new EntityEnergy {type = EntityEnergyType.Void};
88-
laborEntityEnergy = new EntityEnergy {type = EntityEnergyType.Labor};
87+
voidEntityEnergy = new EntityEnergy {type = EntityEnergyType.Void, effectivity = float.PositiveInfinity};
88+
laborEntityEnergy = new EntityEnergy {type = EntityEnergyType.Labor, effectivity = float.PositiveInfinity};
8989
}
9090

9191
private T GetObject<T>(string name) where T : FactorioObject, new() => GetObject<T, T>(name);

YAFCui/Core/DrawingSurface.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Numerics;
34
using SDL2;
45

YAFCui/Core/Window.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ internal void WindowMoved()
7474
surface.pixelsPerUnit = pixelsPerUnit;
7575
repaintRequired = true;
7676
rootGui.MarkEverythingForRebuild();
77+
WindowResize();
7778
}
7879
}
7980

0 commit comments

Comments
 (0)