diff --git a/QuestPaths/AssemblyQuestLoader.cs b/QuestPaths/AssemblyQuestLoader.cs index b0b8efc0..3c8b7b71 100644 --- a/QuestPaths/AssemblyQuestLoader.cs +++ b/QuestPaths/AssemblyQuestLoader.cs @@ -1,8 +1,10 @@ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Questionable.Model.V1; namespace Questionable.QuestPaths; +[SuppressMessage("ReSharper", "PartialTypeWithSinglePart", Justification = "Required for RELEASE")] public static partial class AssemblyQuestLoader { public static IReadOnlyDictionary GetQuests() => diff --git a/Questionable.Model/V1/Converter/ExcelRefConverter.cs b/Questionable.Model/V1/Converter/ExcelRefConverter.cs index 0c48e5bb..06ba3ff1 100644 --- a/Questionable.Model/V1/Converter/ExcelRefConverter.cs +++ b/Questionable.Model/V1/Converter/ExcelRefConverter.cs @@ -8,12 +8,12 @@ public sealed class ExcelRefConverter : JsonConverter { public override ExcelRef? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.String) - return new ExcelRef(reader.GetString()!); - else if (reader.TokenType == JsonTokenType.Number) - return new ExcelRef(reader.GetUInt32()); - else - return null; + return reader.TokenType switch + { + JsonTokenType.String => ExcelRef.FromKey(reader.GetString()!), + JsonTokenType.Number => ExcelRef.FromRowId(reader.GetUInt32()), + _ => null + }; } public override void Write(Utf8JsonWriter writer, ExcelRef? value, JsonSerializerOptions options) diff --git a/Questionable.Model/V1/ExcelRef.cs b/Questionable.Model/V1/ExcelRef.cs index 979a1897..295dd5ba 100644 --- a/Questionable.Model/V1/ExcelRef.cs +++ b/Questionable.Model/V1/ExcelRef.cs @@ -21,20 +21,16 @@ public class ExcelRef Type = EType.RowId; } - /// - /// Only used internally (not serialized) with specific values that have been read from the sheets already. - /// - private ExcelRef(string value, bool v) + private ExcelRef(string? stringValue, uint? rowIdValue, EType type) { - if (!v) - throw new ArgumentException(nameof(v)); - - _stringValue = value; - _rowIdValue = null; - Type = EType.RawString; + _stringValue = stringValue; + _rowIdValue = rowIdValue; + Type = type; } - public static ExcelRef FromSheetValue(string value) => new(value, true); + public static ExcelRef FromKey(string value) => new(value, null, EType.Key); + public static ExcelRef FromRowId(uint rowId) => new(null, rowId, EType.RowId); + public static ExcelRef FromSheetValue(string value) => new(value, null, EType.RawString); public EType Type { get; } diff --git a/Questionable/Controller/CombatController.cs b/Questionable/Controller/CombatController.cs index 51f48385..aada0a1a 100644 --- a/Questionable/Controller/CombatController.cs +++ b/Questionable/Controller/CombatController.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; using System.Linq; using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.ClientState.Objects; @@ -104,6 +105,7 @@ internal sealed class CombatController return _condition[ConditionFlag.InCombat]; } + [SuppressMessage("ReSharper", "RedundantJumpStatement")] private IGameObject? FindNextTarget() { if (_currentFight == null) diff --git a/Questionable/Controller/GameUiController.cs b/Questionable/Controller/GameUiController.cs index dba30ec0..efba25f0 100644 --- a/Questionable/Controller/GameUiController.cs +++ b/Questionable/Controller/GameUiController.cs @@ -146,6 +146,7 @@ internal sealed class GameUiController : IDisposable SelectIconStringPostSetup(addonSelectIconString, false); } + [SuppressMessage("ReSharper", "RedundantJumpStatement")] private unsafe void SelectIconStringPostSetup(AddonSelectIconString* addonSelectIconString, bool checkAllSteps) { string? actualPrompt = addonSelectIconString->AtkUnitBase.AtkValues[3].ReadAtkString(); diff --git a/Questionable/Windows/QuestSelectionWindow.cs b/Questionable/Windows/QuestSelectionWindow.cs index 55d81bb5..164f03b6 100644 --- a/Questionable/Windows/QuestSelectionWindow.cs +++ b/Questionable/Windows/QuestSelectionWindow.cs @@ -274,6 +274,7 @@ internal sealed class QuestSelectionWindow : LWindow { var qInfo = _questData.GetQuestInfo(q); var (iconColor, icon, _) = GetQuestStyle(q); + // ReSharper disable once UnusedVariable using (var font = _pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) { if (_questRegistry.IsKnownQuest(qInfo.QuestId)) @@ -305,6 +306,7 @@ internal sealed class QuestSelectionWindow : LWindow { var qInfo = _questData.GetQuestInfo(q); var (iconColor, icon, _) = GetQuestStyle(q); + // ReSharper disable once UnusedVariable using (var font = _pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) { if (_questRegistry.IsKnownQuest(qInfo.QuestId))