Minor warnings/lints
This commit is contained in:
@@ -356,7 +356,7 @@ internal static class ImGuiUtils
|
||||
|
||||
public SearchableComboData(IEnumerable<T> items, T selectedItem, Func<T, string> getString)
|
||||
{
|
||||
this.items = items.ToImmutableArray();
|
||||
this.items = [.. items];
|
||||
filteredItems = [selectedItem];
|
||||
this.selectedItem = selectedItem;
|
||||
this.getString = getString;
|
||||
|
||||
@@ -19,7 +19,7 @@ public sealed class MacroClipboard : Window, IDisposable
|
||||
|
||||
public MacroClipboard(IEnumerable<string> macros) : base("Macro Clipboard", WindowFlags)
|
||||
{
|
||||
Macros = new(macros);
|
||||
Macros = [.. macros];
|
||||
|
||||
IsOpen = true;
|
||||
AllowPinning = false;
|
||||
|
||||
@@ -719,9 +719,19 @@ public sealed class MacroEditor : Window, IDisposable
|
||||
|
||||
public bool Equals(RecipeWrapper other) =>
|
||||
Recipe.RowId == other.Recipe.RowId;
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is RecipeWrapper other && Equals(other);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return unchecked((int)Recipe.RowId);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<RecipeWrapper> searchableRecipes = LuminaSheets.RecipeSheet.Where(r => r.RecipeLevelTable.RowId != 0 && r.ItemResult.RowId != 0).Select(r => new RecipeWrapper(r)).ToList();
|
||||
private readonly List<RecipeWrapper> searchableRecipes = [.. LuminaSheets.RecipeSheet.Where(r => r.RecipeLevelTable.RowId != 0 && r.ItemResult.RowId != 0).Select(r => new RecipeWrapper(r))];
|
||||
|
||||
private bool DrawRecipeParams()
|
||||
{
|
||||
|
||||
@@ -343,7 +343,7 @@ public sealed class MacroList : Window, IDisposable
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(searchText))
|
||||
{
|
||||
sortedMacros = new(Macros);
|
||||
sortedMacros = [.. Macros];
|
||||
isUnsorted = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1191,7 +1191,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
||||
config = config.FilterSpecialistActions();
|
||||
var mctsConfig = new MCTSConfig(config);
|
||||
var simulator = new SimulatorNoRandom();
|
||||
List<Macro> macros = new(Service.Configuration.Macros);
|
||||
List<Macro> macros = [.. Service.Configuration.Macros];
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ public sealed class Settings : Window, IDisposable
|
||||
{
|
||||
ImGui.SetNextItemWidth(OptionWidth);
|
||||
var text = value.ToString();
|
||||
ArgumentNullException.ThrowIfNull(text, nameof(value));
|
||||
if (ImGui.InputText(label, ref text, 8, ImGuiInputTextFlags.AutoSelectAll | ImGuiInputTextFlags.CharsDecimal))
|
||||
{
|
||||
if (T.TryParse(text, null, out var newValue))
|
||||
@@ -791,7 +792,7 @@ public sealed class Settings : Window, IDisposable
|
||||
isDirty = false;
|
||||
|
||||
var recipeData = Service.Plugin.GetDefaultStats().Recipe;
|
||||
HashSet<ActionType> pool = new(actionPool);
|
||||
HashSet<ActionType> pool = [.. actionPool];
|
||||
|
||||
var imageSize = ImGui.GetFrameHeight() * 2;
|
||||
var spacing = ImGui.GetStyle().ItemSpacing.Y;
|
||||
|
||||
Reference in New Issue
Block a user