Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowTheAge committed Jul 25, 2021
1 parent cc5df62 commit f39d9b0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion YAFC/Utils/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ public class Preferences
public static readonly string appDataFolder;
private static readonly string fileName;

public static readonly string autosaveFilename;

static Preferences()
{
appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
appDataFolder = Path.Combine(appDataFolder, "YAFC");
if (!string.IsNullOrEmpty(appDataFolder) && !Directory.Exists(appDataFolder))
Directory.CreateDirectory(appDataFolder);


autosaveFilename = Path.Combine(appDataFolder, "autosave.yafc");
fileName = Path.Combine(appDataFolder, "yafc.config");
if (File.Exists(fileName))
{
Expand Down
2 changes: 2 additions & 0 deletions YAFC/Windows/DependencyExplorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ public override void Build(ImGui gui)
{
if (gui.BuildLink("Mark as inaccessible"))
SetFlag(ProjectPerItemFlags.MarkedInaccessible, true);
if (gui.BuildLink("Mark as accessible without milestones"))
SetFlag(ProjectPerItemFlags.MarkedAccessible, true);
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion YAFC/Workspace/ProjectPageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public MemoryDrawingSurface GenerateFullPageScreenshot()
var hsize = headerContent.contentSize;
var bsize = bodyContent.contentSize;
var fsize = new Vector2(CalculateWidth(), hsize.Y + bsize.Y);
var surface = new MemoryDrawingSurface(fsize, 20);
var surface = new MemoryDrawingSurface(fsize, 22);
headerContent.Present(surface, new Rect(default, hsize), new Rect(default, hsize), null);
var bodyRect = new Rect(0f, hsize.Y, bsize.X, bsize.Y);
var prevOffset = bodyContent.offset;
Expand Down
2 changes: 2 additions & 0 deletions YAFCmodel/Analysis/AutomationAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public override void Compute(Project project, ErrorCollector warnings)
var oldState = state[revDep];
if (oldState == Unknown || oldState == AutomationStatus.AutomatableLater && automationState == AutomationStatus.AutomatableNow)
{
if (oldState == AutomationStatus.AutomatableLater)
unknowns++;
processingQueue.Enqueue(revDep);
state[revDep] = UnknownInQueue;
}
Expand Down
4 changes: 2 additions & 2 deletions YAFCparser/Data/FactorioDataDeserializer_Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ private void RegisterSpecial()
reactorProduction.flags |= RecipeFlags.ScaleProductionWithPower;
reactorProduction.ingredients = Array.Empty<Ingredient>();

voidEntityEnergy = new EntityEnergy {type = EntityEnergyType.Void};
laborEntityEnergy = new EntityEnergy {type = EntityEnergyType.Labor};
voidEntityEnergy = new EntityEnergy {type = EntityEnergyType.Void, effectivity = float.PositiveInfinity};
laborEntityEnergy = new EntityEnergy {type = EntityEnergyType.Labor, effectivity = float.PositiveInfinity};
}

private T GetObject<T>(string name) where T : FactorioObject, new() => GetObject<T, T>(name);
Expand Down
1 change: 1 addition & 0 deletions YAFCui/Core/DrawingSurface.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using SDL2;

Expand Down
1 change: 1 addition & 0 deletions YAFCui/Core/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ internal void WindowMoved()
surface.pixelsPerUnit = pixelsPerUnit;
repaintRequired = true;
rootGui.MarkEverythingForRebuild();
WindowResize();
}
}

Expand Down

0 comments on commit f39d9b0

Please sign in to comment.