Skip to content

Commit

Permalink
chore(style): Fix or ignore some more spelling complaints.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaleStan committed Feb 14, 2025
1 parent fc91551 commit 9851f25
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Yafc.Model/Model/ProductionTableContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ internal void GetModulesInfo(RecipeRow row, EntityCrafter entity, ref ModuleEffe
}

if (beacon != null) {
int beaconCount = CalcBeaconCount();
int beaconCount = CalculateBeaconCount();
if (beaconCount > 0) {
float beaconEfficiency = beacon.GetBeaconEfficiency() * beacon.target.GetProfile(beaconCount);
foreach (var module in beaconList) {
Expand All @@ -159,9 +159,9 @@ internal void GetModulesInfo(RecipeRow row, EntityCrafter entity, ref ModuleEffe
used.modules = [.. buffer];
}

public int CalcBeaconCount() {
public int CalculateBeaconCount() {
if (beacon is null) {
throw new InvalidOperationException($"Must not call {nameof(CalcBeaconCount)} when {nameof(beacon)} is null.");
throw new InvalidOperationException($"Must not call {nameof(CalculateBeaconCount)} when {nameof(beacon)} is null.");
}

int moduleCount = 0;
Expand Down
4 changes: 2 additions & 2 deletions Yafc.Parser/Data/FactorioDataDeserializer_Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ void parseEffect(LuaTable effect) {
else if (generation.Get("coverage", out float coverage)) {
float richBase = generation.Get("richness_base", 0f);
float richMultiplier = generation.Get("richness_multiplier", 0f);
float richMultiplierDist = generation.Get("richness_multiplier_distance_bonus", 0f);
float estimatedAmount = coverage * (richBase + richMultiplier + (richMultiplierDist * EstimationDistanceFromCenter));
float richMultiplierDistance = generation.Get("richness_multiplier_distance_bonus", 0f);
float estimatedAmount = coverage * (richBase + richMultiplier + (richMultiplierDistance * EstimationDistanceFromCenter));
entity.mapGenDensity = estimatedAmount;
}
if (generation.Get("control", out string? control)) {
Expand Down
4 changes: 2 additions & 2 deletions Yafc.Parser/LuaContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ private int Require(IntPtr lua) {
}

file = file.Replace('\\', '/');
string origFile = file;
string originalFile = file;
file = file.Replace('.', '/');
string fileExt = file + ".lua";
Pop(1);
Expand All @@ -430,7 +430,7 @@ private int Require(IntPtr lua) {
(string mod, string path) requiredFile = (mod, fileExt);

if (file.StartsWith("__")) {
requiredFile = FactorioDataSource.ResolveModPath(mod, origFile, true);
requiredFile = FactorioDataSource.ResolveModPath(mod, originalFile, true);
}
else if (mod == "*") {
byte[] localFile = File.ReadAllBytes("Data/" + fileExt);
Expand Down
4 changes: 2 additions & 2 deletions Yafc.UI/Rendering/RenderingUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ static unsafe RenderingUtils() {
for (int y = 0; y < 32; y++) {
float dx = (center - x) / center;
float dy = (center - y) / center;
float dist = MathF.Sqrt((dx * dx) + (dy * dy));
*pixels++ = 0xFFFFFF00 | (dist >= 1f ? 0 : (uint)MathUtils.Round(38 * (1f - dist)));
float distance = MathF.Sqrt((dx * dx) + (dy * dy));
*pixels++ = 0xFFFFFF00 | (distance >= 1f ? 0 : (uint)MathUtils.Round(38 * (1f - distance)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Yafc/Workspace/ProductionTable/ProductionTableView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ private void ShowModuleTemplateTooltip(ImGui gui, ModuleTemplate template) => gu

if (template.beacon != null) {
grid.Next();
_ = imGui.BuildFactorioObjectWithAmount(template.beacon, template.CalcBeaconCount(), ButtonDisplayStyle.ProductionTableUnscaled);
_ = imGui.BuildFactorioObjectWithAmount(template.beacon, template.CalculateBeaconCount(), ButtonDisplayStyle.ProductionTableUnscaled);
foreach (var module in template.beaconList) {
grid.Next();
_ = imGui.BuildFactorioObjectWithAmount(module.module, module.fixedCount, ButtonDisplayStyle.ProductionTableUnscaled);
Expand Down
9 changes: 9 additions & 0 deletions exclusion.dic
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
autoplace
Awaitable
Awaiter
blit
Deserialize
deserialized
Deserializer
Deserializing
dylib
Factorio
Factorio's
Floodfill
foreach
Fulgoran
imgui
Kovarex
liblua
localised
modded
naive
Nauvis
placeable
renderable
Serializer
shaders
shpaass
spawner
spawners
unbarreling
Unlockers
Utils
Yafc

0 comments on commit 9851f25

Please sign in to comment.