Remove redundant data

This commit is contained in:
Gustas
2025-03-28 14:10:36 +02:00
committed by Paul Chote
parent bd590dfcf4
commit 83bbb357d1

View File

@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Widgets
if (mi.Button == MouseButton.Left && mi.Event != MouseInputEvent.Up && resourceLayer.CanAddResource(ResourceType, cell))
{
action.Add(new CellResource(cell, resourceLayer.GetResource(cell), ResourceType));
action.Add(new CellResource(cell, resourceLayer.GetResource(cell)));
resourceAdded = true;
}
else if (resourceAdded && mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up)
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Common.Widgets
public void Dispose() { }
}
readonly record struct CellResource(CPos Cell, ResourceLayerContents OldResourceTile, string NewResourceType);
readonly record struct CellResource(CPos Cell, ResourceLayerContents OldResourceTile);
sealed class AddResourcesEditorAction : IEditorAction
{
@@ -138,7 +138,7 @@ namespace OpenRA.Mods.Common.Widgets
foreach (var resourceCell in cellResources)
{
resourceLayer.ClearResources(resourceCell.Cell);
resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType));
resourceLayer.AddResource(resourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceType));
}
}
@@ -155,7 +155,7 @@ namespace OpenRA.Mods.Common.Widgets
public void Add(CellResource resourceCell)
{
resourceLayer.ClearResources(resourceCell.Cell);
resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType));
resourceLayer.AddResource(resourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceType));
cellResources.Add(resourceCell);
Text = FluentProvider.GetMessage(AddedResource, "count", cellResources.Count, "type", resourceType);
}