diff --git a/src/SpaceWarp.Core/API/Assets/AssetManager.cs b/src/SpaceWarp.Core/API/Assets/AssetManager.cs index d1d956b2..52197881 100644 --- a/src/SpaceWarp.Core/API/Assets/AssetManager.cs +++ b/src/SpaceWarp.Core/API/Assets/AssetManager.cs @@ -1,13 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using JetBrains.Annotations; +using JetBrains.Annotations; using SpaceWarp.API.Lua; using UnityEngine; using Logger = BepInEx.Logging.Logger; namespace SpaceWarp.API.Assets; +/// +/// Manages all mod assets loaded by SpaceWarp +/// [SpaceWarpLuaAPI("Assets")] [PublicAPI] public static class AssetManager diff --git a/src/SpaceWarp.Core/API/Configuration/BepInExConfigEntry.cs b/src/SpaceWarp.Core/API/Configuration/BepInExConfigEntry.cs index 1901d908..2375c9da 100644 --- a/src/SpaceWarp.Core/API/Configuration/BepInExConfigEntry.cs +++ b/src/SpaceWarp.Core/API/Configuration/BepInExConfigEntry.cs @@ -1,20 +1,38 @@ -using System; -using BepInEx.Configuration; +using BepInEx.Configuration; using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// A wrapper around a BepInEx to make it compatible with the +/// interface. +/// [PublicAPI] public class BepInExConfigEntry : IConfigEntry { + /// + /// The underlying that this class wraps. + /// public readonly ConfigEntryBase EntryBase; - public event Action Callbacks; + + /// + /// The callbacks that are invoked when the value of this entry changes. + /// + public event Action Callbacks; + + /// + /// Creates a new from the given and optional + /// . + /// + /// The to wrap. + /// The to use. public BepInExConfigEntry(ConfigEntryBase entryBase, IValueConstraint constraint = null) { EntryBase = entryBase; Constraint = constraint; } + /// public object Value { get => EntryBase.BoxedValue; @@ -25,8 +43,10 @@ public object Value } } + /// public Type ValueType => EntryBase.SettingType; + /// public T Get() where T : class { if (!typeof(T).IsAssignableFrom(ValueType)) @@ -37,6 +57,7 @@ public T Get() where T : class return Value as T; } + /// public void Set(T value) { if (!ValueType.IsAssignableFrom(typeof(T))) @@ -52,8 +73,13 @@ public void Set(T value) EntryBase.BoxedValue = Convert.ChangeType(value, ValueType); } + /// public string Description => EntryBase.Description.Description; + + /// public IValueConstraint Constraint { get; } + + /// public void RegisterCallback(Action valueChangedCallback) { Callbacks += valueChangedCallback; diff --git a/src/SpaceWarp.Core/API/Configuration/BepInExConfigFile.cs b/src/SpaceWarp.Core/API/Configuration/BepInExConfigFile.cs index a1a5c60f..d43cc5bb 100644 --- a/src/SpaceWarp.Core/API/Configuration/BepInExConfigFile.cs +++ b/src/SpaceWarp.Core/API/Configuration/BepInExConfigFile.cs @@ -1,40 +1,69 @@ -using System.Collections.Generic; -using BepInEx.Configuration; +using BepInEx.Configuration; using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// A wrapper around BepInEx's to make it implement . +/// [PublicAPI] public class BepInExConfigFile : IConfigFile { - + /// + /// The underlying instance. + /// public readonly ConfigFile AdaptedConfigFile; + /// + /// Creates a new instance. + /// + /// The instance to wrap. public BepInExConfigFile(ConfigFile adaptedConfigFile) { AdaptedConfigFile = adaptedConfigFile; } + /// public void Save() { AdaptedConfigFile.Save(); } + /// public IConfigEntry this[string section, string key] => new BepInExConfigEntry(AdaptedConfigFile[section, key]); + /// public IConfigEntry Bind(string section, string key, T defaultValue = default, string description = "") { return new BepInExConfigEntry(AdaptedConfigFile.Bind(section, key, defaultValue, description)); } - public IConfigEntry Bind(string section, string key, T defaultValue, string description, IValueConstraint valueConstraint) + /// + /// Binds a new config entry to the given section and key with the given default value and description. + /// + /// Section to bind the entry to. + /// Key to bind the entry to. + /// Default value of the entry. + /// Description of the entry. + /// Value constraint of the entry. + /// Type of the entry. + /// The newly bound config entry. + public IConfigEntry Bind( + string section, + string key, + T defaultValue, + string description, + IValueConstraint valueConstraint + ) { return new BepInExConfigEntry(AdaptedConfigFile.Bind(new ConfigDefinition(section, key), defaultValue, new ConfigDescription(description, valueConstraint.ToAcceptableValueBase()))); } + /// public IReadOnlyList Sections => AdaptedConfigFile.Keys.Select(x => x.Section).Distinct().ToList(); + /// public IReadOnlyList this[string section] => AdaptedConfigFile.Keys.Where(x => x.Section == section) .Select(x => x.Key).ToList(); } \ No newline at end of file diff --git a/src/SpaceWarp.Core/API/Configuration/ConfigValue.cs b/src/SpaceWarp.Core/API/Configuration/ConfigValue.cs index b4a54278..670b1977 100644 --- a/src/SpaceWarp.Core/API/Configuration/ConfigValue.cs +++ b/src/SpaceWarp.Core/API/Configuration/ConfigValue.cs @@ -1,13 +1,26 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// A wrapper around that provides type safety. +/// +/// The type of the value. [PublicAPI] public class ConfigValue { + /// + /// The underlying . + /// public IConfigEntry Entry; + /// + /// Creates a new from an . + /// + /// The entry to wrap. + /// + /// If the type of does not match . + /// public ConfigValue(IConfigEntry entry) { Entry = entry; @@ -17,15 +30,19 @@ public ConfigValue(IConfigEntry entry) } } + /// + /// The value of the entry. + /// public T Value { get => (T)Entry.Value; - set - { - Entry.Value = value; - } + set => Entry.Value = value; } + /// + /// Registers a callback that will be invoked when the value changes. + /// + /// The callback to invoke. public void RegisterCallback(Action callback) { // Callbacks += callback; diff --git a/src/SpaceWarp.Core/API/Configuration/EmptyConfigFile.cs b/src/SpaceWarp.Core/API/Configuration/EmptyConfigFile.cs index 503d8914..85cd3bbb 100644 --- a/src/SpaceWarp.Core/API/Configuration/EmptyConfigFile.cs +++ b/src/SpaceWarp.Core/API/Configuration/EmptyConfigFile.cs @@ -1,28 +1,52 @@ -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// An empty config file that does not save anything. +/// [PublicAPI] public class EmptyConfigFile : IConfigFile { + /// public void Save() { } + /// public IConfigEntry this[string section, string key] => throw new KeyNotFoundException($"{section}/{key}"); + /// public IConfigEntry Bind(string section, string key, T defaultValue = default, string description = "") { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } - public IConfigEntry Bind(string section, string key, T defaultValue, string description, IValueConstraint valueConstraint) + /// + /// Binds a config entry to a section and key. + /// + /// Section to bind to. + /// Key to bind to. + /// Default value to use if no value is found. + /// Description of the config entry. + /// Constraint to use for the value. + /// Type of the value. + /// The config entry. + /// Always thrown. + public IConfigEntry Bind( + string section, + string key, + T defaultValue, + string description, + IValueConstraint valueConstraint + ) { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } + /// public IReadOnlyList Sections => new List(); + /// public IReadOnlyList this[string section] => throw new KeyNotFoundException($"{section}"); } \ No newline at end of file diff --git a/src/SpaceWarp.Core/API/Configuration/IConfigEntry.cs b/src/SpaceWarp.Core/API/Configuration/IConfigEntry.cs index f5f062a9..0506edea 100644 --- a/src/SpaceWarp.Core/API/Configuration/IConfigEntry.cs +++ b/src/SpaceWarp.Core/API/Configuration/IConfigEntry.cs @@ -1,23 +1,52 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// Represents a config entry +/// [PublicAPI] public interface IConfigEntry { + /// + /// The value of the config entry + /// public object Value { get; set; } + + /// + /// The type of the value of the config entry + /// public Type ValueType { get; } + + /// + /// Gets the value of the config entry as a specific type + /// + /// The type to cast to + /// The value as the specified type public T Get() where T : class; + + /// + /// Sets the value of the config entry + /// + /// The value to set + /// The type of the value public void Set(T value); + /// + /// The description of the config entry + /// public string Description { get; } + /// + /// The value constraint of the config entry + /// public IValueConstraint Constraint { get; } - + /// - /// Called when setting the value on a config file + /// Registers a callback to be called when setting the value on a config file /// - /// An action that takes te old value and the new value and calls a callback + /// + /// An action that takes the old value and the new value and calls a callback + /// public void RegisterCallback(Action valueChangedCallback); } \ No newline at end of file diff --git a/src/SpaceWarp.Core/API/Configuration/IConfigFile.cs b/src/SpaceWarp.Core/API/Configuration/IConfigFile.cs index 87aedf23..2b271e5d 100644 --- a/src/SpaceWarp.Core/API/Configuration/IConfigFile.cs +++ b/src/SpaceWarp.Core/API/Configuration/IConfigFile.cs @@ -1,18 +1,44 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// Represents a configuration file. +/// [PublicAPI] public interface IConfigFile { + /// + /// Saves the configuration file. + /// public void Save(); + /// + /// Gets the with the specified section and key. + /// + /// Section of the entry. + /// Key of the entry. public IConfigEntry this[string section, string key] { get; } + /// + /// Binds a new to the specified section and key. + /// + /// Section of the entry. + /// Key of the entry. + /// Default value of the entry. + /// Description of the entry. + /// Type of the entry. + /// The bound . public IConfigEntry Bind(string section, string key, T defaultValue = default, string description = ""); - + + /// + /// A list of all sections in the configuration file. + /// public IReadOnlyList Sections { get; } + + /// + /// A list of all keys in the specified section. + /// + /// public IReadOnlyList this[string section] { get; } } \ No newline at end of file diff --git a/src/SpaceWarp.Core/API/Configuration/IValueConstraint.cs b/src/SpaceWarp.Core/API/Configuration/IValueConstraint.cs index 4256ceba..83250785 100644 --- a/src/SpaceWarp.Core/API/Configuration/IValueConstraint.cs +++ b/src/SpaceWarp.Core/API/Configuration/IValueConstraint.cs @@ -2,8 +2,21 @@ namespace SpaceWarp.API.Configuration; +/// +/// A constraint that can be applied to a to limit the values it can take. +/// public interface IValueConstraint { + /// + /// Checks if the given object is constrained by this constraint. + /// + /// Object to check. + /// True if the object is constrained, false otherwise. public bool IsConstrained(object o); + + /// + /// Converts this constraint to an . + /// + /// An representing this constraint. public AcceptableValueBase ToAcceptableValueBase(); } \ No newline at end of file diff --git a/src/SpaceWarp.Core/API/Configuration/JsonConfigEntry.cs b/src/SpaceWarp.Core/API/Configuration/JsonConfigEntry.cs index 977f910c..e43b17ab 100644 --- a/src/SpaceWarp.Core/API/Configuration/JsonConfigEntry.cs +++ b/src/SpaceWarp.Core/API/Configuration/JsonConfigEntry.cs @@ -1,17 +1,36 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// A config entry that is stored in a JSON file. +/// [PublicAPI] public class JsonConfigEntry : IConfigEntry { private readonly JsonConfigFile _configFile; private object _value; - public event Action Callbacks; - - public JsonConfigEntry(JsonConfigFile configFile, Type type, string description, object value, IValueConstraint constraint = null) + /// + /// The callbacks that are invoked when the value of this entry changes. + /// + public event Action Callbacks; + + /// + /// Creates a new config entry. + /// + /// Config file that this entry belongs to. + /// Type of the value. + /// Description of the value. + /// Value of the entry. + /// Constraint of the value. + public JsonConfigEntry( + JsonConfigFile configFile, + Type type, + string description, + object value, + IValueConstraint constraint = null + ) { _configFile = configFile; _value = value; @@ -20,7 +39,7 @@ public JsonConfigEntry(JsonConfigFile configFile, Type type, string description, ValueType = type; } - + /// public object Value { get => _value; @@ -32,7 +51,10 @@ public object Value } } + /// public Type ValueType { get; } + + /// public T Get() where T : class { if (!typeof(T).IsAssignableFrom(ValueType)) @@ -43,6 +65,7 @@ public T Get() where T : class return Value as T; } + /// public void Set(T value) { if (!ValueType.IsAssignableFrom(typeof(T))) @@ -56,8 +79,13 @@ public void Set(T value) Value = Convert.ChangeType(value, ValueType); } + /// public string Description { get; } + + /// public IValueConstraint Constraint { get; } + + /// public void RegisterCallback(Action valueChangedCallback) { Callbacks += valueChangedCallback; diff --git a/src/SpaceWarp.Core/API/Configuration/JsonConfigFile.cs b/src/SpaceWarp.Core/API/Configuration/JsonConfigFile.cs index aafbfc8b..90d38866 100644 --- a/src/SpaceWarp.Core/API/Configuration/JsonConfigFile.cs +++ b/src/SpaceWarp.Core/API/Configuration/JsonConfigFile.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; +using System.Text; using JetBrains.Annotations; using KSP.IO; using Newtonsoft.Json; @@ -11,6 +8,9 @@ namespace SpaceWarp.API.Configuration; +/// +/// A config file that uses JSON to store its data. +/// [PublicAPI] public class JsonConfigFile : IConfigFile { @@ -19,6 +19,10 @@ public class JsonConfigFile : IConfigFile internal Dictionary> CurrentEntries = new(); private readonly string _file; + /// + /// Creates a new JSON config file object. + /// + /// The file path to use. public JsonConfigFile(string file) { // Use .cfg as this is going to have comments and that will be an issue @@ -38,6 +42,7 @@ public JsonConfigFile(string file) _file = file; } + /// public void Save() { if (!CurrentEntries.Any(value => value.Value.Count > 0)) return; @@ -72,6 +77,9 @@ private static bool DumpSection(bool hadPreviousSection, StringBuilder result, K private static List _defaultConverters; + /// + /// The default converters to use when serializing/deserializing JSON. + /// public static List DefaultConverters { get @@ -86,7 +94,11 @@ public static List DefaultConverters } } - private static bool DumpEntry(StringBuilder result, bool hadPreviousKey, KeyValuePair entry) + private static bool DumpEntry( + StringBuilder result, + bool hadPreviousKey, + KeyValuePair entry + ) { if (hadPreviousKey) { @@ -128,8 +140,10 @@ private static bool DumpEntry(StringBuilder result, bool hadPreviousKey, KeyValu return true; } + /// public IConfigEntry this[string section, string key] => CurrentEntries[section][key]; + /// public IConfigEntry Bind(string section, string key, T defaultValue = default, string description = "") { // So now we have to check if its already bound, and/or if the previous config object has it @@ -173,7 +187,9 @@ public IConfigEntry Bind(string section, string key, T defaultValue = default return previousSection[key]; } + /// public IReadOnlyList Sections => CurrentEntries.Keys.ToList(); + /// public IReadOnlyList this[string section] => CurrentEntries[section].Keys.ToList(); } \ No newline at end of file diff --git a/src/SpaceWarp.Core/API/Configuration/ListConstraint.cs b/src/SpaceWarp.Core/API/Configuration/ListConstraint.cs index b9610ee4..af5dd4b8 100644 --- a/src/SpaceWarp.Core/API/Configuration/ListConstraint.cs +++ b/src/SpaceWarp.Core/API/Configuration/ListConstraint.cs @@ -1,32 +1,48 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Text; using BepInEx.Configuration; using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// A constraint that checks if the value is in a list of acceptable values. +/// +/// The type of the value. public class ListConstraint : ValueConstraint where T : IEquatable { - [PublicAPI] - public List AcceptableValues; - + /// + /// The list of acceptable values. + /// + [PublicAPI] public List AcceptableValues; + + /// + /// Creates a new list constraint. + /// + /// The list of acceptable values. public ListConstraint(IEnumerable acceptableValues) { AcceptableValues = acceptableValues.ToList(); } + /// + /// Creates a new list constraint. + /// + /// The array of acceptable values. public ListConstraint(params T[] acceptableValues) { AcceptableValues = acceptableValues.ToList(); } + /// public override bool IsValid(T o) => AcceptableValues.Any(x => x.Equals(o)); + + /// public override AcceptableValueBase ToAcceptableValueBase() { return new AcceptableValueList(AcceptableValues.ToArray()); } + /// public override string ToString() { StringBuilder sb = new(); diff --git a/src/SpaceWarp.Core/API/Configuration/RangeConstraint.cs b/src/SpaceWarp.Core/API/Configuration/RangeConstraint.cs index 00fbc08d..18e0a4c5 100644 --- a/src/SpaceWarp.Core/API/Configuration/RangeConstraint.cs +++ b/src/SpaceWarp.Core/API/Configuration/RangeConstraint.cs @@ -1,28 +1,45 @@ -using System; -using BepInEx.Configuration; +using BepInEx.Configuration; using JetBrains.Annotations; namespace SpaceWarp.API.Configuration; +/// +/// A constraint that checks if a value is within a range. +/// +/// The type of the value. public class RangeConstraint : ValueConstraint where T : IComparable, IComparable { - [PublicAPI] - public T Minimum; - [PublicAPI] - public T Maximum; + /// + /// The minimum value. + /// + [PublicAPI] public T Minimum; + /// + /// The maximum value. + /// + [PublicAPI] public T Maximum; + + /// + /// Creates a new range constraint. + /// + /// The minimum value. + /// The maximum value. public RangeConstraint(T minimum, T maximum) { Minimum = minimum; Maximum = maximum; } + /// public override bool IsValid(T o) => Minimum.CompareTo(o) <= 0 && Maximum.CompareTo(o) >= 0; + + /// public override AcceptableValueBase ToAcceptableValueBase() { return new AcceptableValueRange(Minimum, Maximum); } + /// public override string ToString() { return $"{Minimum} - {Maximum}"; diff --git a/src/SpaceWarp.Core/API/Configuration/ValueConstraint.cs b/src/SpaceWarp.Core/API/Configuration/ValueConstraint.cs index ddabf763..4ba8da0e 100644 --- a/src/SpaceWarp.Core/API/Configuration/ValueConstraint.cs +++ b/src/SpaceWarp.Core/API/Configuration/ValueConstraint.cs @@ -2,18 +2,35 @@ namespace SpaceWarp.API.Configuration; +/// +/// Base class for value constraints. +/// +/// Type of the value. public abstract class ValueConstraint : IValueConstraint { + /// + /// Returns true if the given value is valid for this constraint. + /// + /// Value to check. + /// True if the value is valid, false otherwise. public abstract bool IsValid(T o); + + /// + /// Returns true if the given value is valid for this constraint. + /// + /// Value to check. + /// True if the value is valid, false otherwise. public bool IsValid(object o) { return IsValid((T)o); } + /// public bool IsConstrained(object o) { return IsValid((T)o); } + /// public abstract AcceptableValueBase ToAcceptableValueBase(); } \ No newline at end of file diff --git a/src/SpaceWarp.Core/API/Loading/Loading.cs b/src/SpaceWarp.Core/API/Loading/Loading.cs index e9a0a82d..e73588ae 100644 --- a/src/SpaceWarp.Core/API/Loading/Loading.cs +++ b/src/SpaceWarp.Core/API/Loading/Loading.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Game.Flow; using SpaceWarp.API.Assets; using SpaceWarp.API.Mods; @@ -10,6 +7,9 @@ namespace SpaceWarp.API.Loading; +/// +/// API for mods to register their actions for the loading of assets. +/// [PublicAPI] public static class Loading { @@ -20,7 +20,7 @@ public static class Loading internal static List> GeneralLoadingActions = new(); /// - /// Registers an asset loading function for space warp, will load assets from the subfolder. Should be added either on Awake() or Start(). + /// Registers an asset loading function for SpaceWarp, will load assets from the subfolder. Should be added either on Awake() or Start(). /// /// The subfolder under "assets" that this loader matches /// The name to be displayed for this loader, it gets displayed like the following "Mod Name: [name]" diff --git a/src/SpaceWarp.Core/API/Loading/SaveLoad.cs b/src/SpaceWarp.Core/API/Loading/SaveLoad.cs index cd617ef5..53c87799 100644 --- a/src/SpaceWarp.Core/API/Loading/SaveLoad.cs +++ b/src/SpaceWarp.Core/API/Loading/SaveLoad.cs @@ -1,17 +1,19 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Game.Flow; using SpaceWarp.Patching; namespace SpaceWarp.API.Loading; +/// +/// An API to register flow actions to be run during loading and saving. +/// [PublicAPI] public static class SaveLoad { /// /// Construct and add a FlowAction to the Game's load sequence. /// - /// FlowActionType must have a public constructor that takes either no arguments, + /// TFlowActionType must have a public constructor that takes either no arguments, /// or a single GameManager. /// /// The action will be run after the first FlowAction with a name equal to referenceAction. @@ -34,12 +36,12 @@ public static class SaveLoad /// /// /// - /// The type of FlowAction to insert - /// The name of the action to insert a FlowActionType after. Use null to insert it at the start. - /// Thrown if FlowActionType does not have a valid Constructor - public static void AddFlowActionToGameLoadAfter(string referenceAction) where FlowActionType : FlowAction + /// The type of FlowAction to insert + /// The name of the action to insert a TFlowActionType after. Use null to insert it at the start. + /// Thrown if TFlowActionType does not have a valid Constructor + public static void AddFlowActionToGameLoadAfter(string referenceAction) where TFlowActionType : FlowAction { - SequentialFlowLoadersPatcher.AddConstructor(referenceAction, typeof(FlowActionType), SequentialFlowLoadersPatcher.FlowMethodStartgame); + SequentialFlowLoadersPatcher.AddConstructor(referenceAction, typeof(TFlowActionType), SequentialFlowLoadersPatcher.FlowMethodStartgame); } /// @@ -66,17 +68,17 @@ public static void AddFlowActionToGameLoadAfter(string reference /// /// /// The FlowAction to insert - /// The name of the action to insert a FlowActionType after. Use null to insert it at the start. + /// The name of the action to insert a TFlowActionType after. Use null to insert it at the start. public static void AddFlowActionToGameLoadAfter(FlowAction flowAction, string referenceAction) { SequentialFlowLoadersPatcher.AddFlowAction(referenceAction, flowAction, SequentialFlowLoadersPatcher.FlowMethodStartgame); } /// - /// Add a FlowAction to the save file loading sequence. A new FlowActionType is constructed every load. + /// Add a FlowAction to the save file loading sequence. A new TFlowActionType is constructed every load. /// /// - /// FlowActionType must have a public constructor that at most one of each of the following types: + /// TFlowActionType must have a public constructor that at most one of each of the following types: /// /// SaveLoadManager /// LoadOrSaveCampaignTicket @@ -145,12 +147,12 @@ public static void AddFlowActionToGameLoadAfter(FlowAction flowAction, string re /// /// /// - /// The type of FlowAction to insert - /// The name of the action to insert a FlowActionType after. Use null to insert it at the start. - /// Thrown if FlowActionType does not have a valid Constructor - public static void AddFlowActionToCampaignLoadAfter(string referenceAction) where FlowActionType : FlowAction + /// The type of FlowAction to insert + /// The name of the action to insert a TFlowActionType after. Use null to insert it at the start. + /// Thrown if TFlowActionType does not have a valid Constructor + public static void AddFlowActionToCampaignLoadAfter(string referenceAction) where TFlowActionType : FlowAction { - SequentialFlowLoadersPatcher.AddConstructor(referenceAction, typeof(FlowActionType), SequentialFlowLoadersPatcher.FlowMethodPrivateloadcommon); + SequentialFlowLoadersPatcher.AddConstructor(referenceAction, typeof(TFlowActionType), SequentialFlowLoadersPatcher.FlowMethodPrivateloadcommon); } /// @@ -225,10 +227,10 @@ public static void AddFlowActionToCampaignLoadAfter(FlowAction flowAction, strin } /// - /// Add a FlowAction to the save file writing sequence. A new FlowActionType is constructed every load. + /// Add a FlowAction to the save file writing sequence. A new TFlowActionType is constructed every load. /// /// - /// FlowActionType must have a public constructor that at most one of each of the following types: + /// TFlowActionType must have a public constructor that at most one of each of the following types: /// /// SaveLoadManager /// LoadOrSaveCampaignTicket @@ -258,12 +260,12 @@ public static void AddFlowActionToCampaignLoadAfter(FlowAction flowAction, strin /// /// /// - /// The type of FlowAction to insert - /// The name of the action to insert a FlowActionType after. Use null to insert it at the start. - /// Thrown if FlowActionType does not have a valid Constructor - public static void AddFlowActionToCampaignSaveAfter(string referenceAction) where FlowActionType : FlowAction + /// The type of FlowAction to insert + /// The name of the action to insert a TFlowActionType after. Use null to insert it at the start. + /// Thrown if TFlowActionType does not have a valid Constructor + public static void AddFlowActionToCampaignSaveAfter(string referenceAction) where TFlowActionType : FlowAction { - SequentialFlowLoadersPatcher.AddConstructor(referenceAction, typeof(FlowActionType), SequentialFlowLoadersPatcher.FlowMethodPrivatesavecommon); + SequentialFlowLoadersPatcher.AddConstructor(referenceAction, typeof(TFlowActionType), SequentialFlowLoadersPatcher.FlowMethodPrivatesavecommon); } /// diff --git a/src/SpaceWarp.Core/API/Lua/LuaMod.cs b/src/SpaceWarp.Core/API/Lua/LuaMod.cs index 14960196..8ce38acf 100644 --- a/src/SpaceWarp.Core/API/Lua/LuaMod.cs +++ b/src/SpaceWarp.Core/API/Lua/LuaMod.cs @@ -1,15 +1,20 @@ -using System; -using BepInEx.Logging; +using BepInEx.Logging; using JetBrains.Annotations; using KSP.Game; using MoonSharp.Interpreter; namespace SpaceWarp.API.Lua; +/// +/// A Lua mod, this is the base class for all mods that are written in Lua. +/// [MoonSharpUserData] [PublicAPI] public class LuaMod : KerbalMonoBehaviour { + /// + /// The table that contains the mod's functions. + /// public Table ModTable; // TODO: Add more than just this to the behaviour but for now @@ -33,9 +38,15 @@ public class LuaMod : KerbalMonoBehaviour private Closure _reset; #endregion + /// + /// The logger for this mod. + /// public ManualLogSource Logger; - // First a pass through to the wrapped table + /// + /// A pass through to the wrapped table + /// + /// The index of the name. public DynValue this[DynValue idx] { get => ModTable.Get(idx); @@ -55,17 +66,17 @@ private void TryCallMethod(Closure closure, params object[] args) } #region Message Handlers - private void TryRegister(string name, out Closure method) + private void TryRegister(string methodName, out Closure method) { - if (ModTable.Get(name) != null && ModTable.Get(name).Type == DataType.Function) + if (ModTable.Get(methodName) != null && ModTable.Get(methodName).Type == DataType.Function) { - method = ModTable.Get(name).Function; + method = ModTable.Get(methodName).Function; return; } method = null; } - public void Awake() + private void Awake() { if (ModTable.Get("Awake") != null && ModTable.Get("Awake").Type == DataType.Function) { @@ -92,7 +103,7 @@ public void Awake() } // Start - public void Start() + private void Start() { if (_start != null) { @@ -102,7 +113,7 @@ public void Start() // Update Functions - public void Update() + private void Update() { if (_update != null) { @@ -110,7 +121,7 @@ public void Update() } } - public void FixedUpdate() + private void FixedUpdate() { if (_fixedUpdate != null) { @@ -118,7 +129,7 @@ public void FixedUpdate() } } - public void LateUpdate() + private void LateUpdate() { if (_lateUpdate != null) { @@ -128,7 +139,7 @@ public void LateUpdate() // Enable/Disable - public void OnEnable() + private void OnEnable() { if (_onEnable != null) { @@ -136,7 +147,7 @@ public void OnEnable() } } - public void OnDisable() + private void OnDisable() { if (_onDisable != null) { @@ -146,7 +157,7 @@ public void OnDisable() // Destruction - public void OnDestroy() + private void OnDestroy() { if (_onDestroy != null) { @@ -155,7 +166,7 @@ public void OnDestroy() } // Reset - public void Reset() + private void Reset() { if (_reset != null) { diff --git a/src/SpaceWarp.Core/API/Lua/SpaceWarpLuaAPIAttribute.cs b/src/SpaceWarp.Core/API/Lua/SpaceWarpLuaAPIAttribute.cs index 91fc288f..7c346fa3 100644 --- a/src/SpaceWarp.Core/API/Lua/SpaceWarpLuaAPIAttribute.cs +++ b/src/SpaceWarp.Core/API/Lua/SpaceWarpLuaAPIAttribute.cs @@ -1,13 +1,23 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Lua; +/// +/// Marks a class as a Lua API class, allowing it to be used in Lua. +/// [AttributeUsage(AttributeTargets.Class)] [MeansImplicitUse] public class SpaceWarpLuaAPIAttribute : Attribute { + /// + /// The name of the class in Lua. + /// public string LuaName; + + /// + /// Marks a class as a Lua API class, allowing it to be used in Lua. + /// + /// public SpaceWarpLuaAPIAttribute(string luaName) { LuaName = luaName; diff --git a/src/SpaceWarp.Core/API/Mods/GlobalModDefines.cs b/src/SpaceWarp.Core/API/Mods/GlobalModDefines.cs index 4c36ad8e..16f660f9 100644 --- a/src/SpaceWarp.Core/API/Mods/GlobalModDefines.cs +++ b/src/SpaceWarp.Core/API/Mods/GlobalModDefines.cs @@ -1,5 +1,4 @@ -using System.IO; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Mods; diff --git a/src/SpaceWarp.Core/API/Mods/JSON/Converters/SpecVersionConverter.cs b/src/SpaceWarp.Core/API/Mods/JSON/Converters/SpecVersionConverter.cs index 0b742864..ac658668 100644 --- a/src/SpaceWarp.Core/API/Mods/JSON/Converters/SpecVersionConverter.cs +++ b/src/SpaceWarp.Core/API/Mods/JSON/Converters/SpecVersionConverter.cs @@ -1,5 +1,4 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; namespace SpaceWarp.API.Mods.JSON.Converters; diff --git a/src/SpaceWarp.Core/API/Mods/JSON/ModInfo.cs b/src/SpaceWarp.Core/API/Mods/JSON/ModInfo.cs index 9a971929..78fe1290 100644 --- a/src/SpaceWarp.Core/API/Mods/JSON/ModInfo.cs +++ b/src/SpaceWarp.Core/API/Mods/JSON/ModInfo.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; using Newtonsoft.Json; namespace SpaceWarp.API.Mods.JSON; diff --git a/src/SpaceWarp.Core/API/Mods/JSON/SpecVersion.cs b/src/SpaceWarp.Core/API/Mods/JSON/SpecVersion.cs index aa4c00dc..bc732898 100644 --- a/src/SpaceWarp.Core/API/Mods/JSON/SpecVersion.cs +++ b/src/SpaceWarp.Core/API/Mods/JSON/SpecVersion.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using Newtonsoft.Json; using SpaceWarp.API.Mods.JSON.Converters; diff --git a/src/SpaceWarp.Core/API/Mods/JSON/VersionCheckType.cs b/src/SpaceWarp.Core/API/Mods/JSON/VersionCheckType.cs index bfa1b6db..d6c0bb40 100644 --- a/src/SpaceWarp.Core/API/Mods/JSON/VersionCheckType.cs +++ b/src/SpaceWarp.Core/API/Mods/JSON/VersionCheckType.cs @@ -1,5 +1,4 @@ -using System; -using System.Runtime.Serialization; +using System.Runtime.Serialization; using JetBrains.Annotations; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/src/SpaceWarp.Core/API/Mods/PluginList.cs b/src/SpaceWarp.Core/API/Mods/PluginList.cs index 73c7f22d..b5c994a3 100644 --- a/src/SpaceWarp.Core/API/Mods/PluginList.cs +++ b/src/SpaceWarp.Core/API/Mods/PluginList.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; -using BepInEx; +using BepInEx; using BepInEx.Bootstrap; using JetBrains.Annotations; using SpaceWarp.API.Mods.JSON; using SpaceWarp.API.Versions; using SpaceWarpPatcher; -using UnityEngine.InputSystem; -using UnityEngine.InputSystem.Switch.LowLevel; // Disable obsolete warning for Chainloader.Plugins #pragma warning disable CS0618 diff --git a/src/SpaceWarp.Core/API/Mods/SpaceWarpErrorDescription.cs b/src/SpaceWarp.Core/API/Mods/SpaceWarpErrorDescription.cs index 22456c09..6afadc33 100644 --- a/src/SpaceWarp.Core/API/Mods/SpaceWarpErrorDescription.cs +++ b/src/SpaceWarp.Core/API/Mods/SpaceWarpErrorDescription.cs @@ -1,8 +1,6 @@ -using System.Collections.Generic; -using BepInEx; +using BepInEx; using JetBrains.Annotations; using SpaceWarp.Patching; -using UnityEngine; namespace SpaceWarp.API.Mods; diff --git a/src/SpaceWarp.Core/API/Mods/SpaceWarpPluginDescriptor.cs b/src/SpaceWarp.Core/API/Mods/SpaceWarpPluginDescriptor.cs index fdf7edfb..1f2eca88 100644 --- a/src/SpaceWarp.Core/API/Mods/SpaceWarpPluginDescriptor.cs +++ b/src/SpaceWarp.Core/API/Mods/SpaceWarpPluginDescriptor.cs @@ -1,5 +1,4 @@ -using System.IO; -using JetBrains.Annotations; +using JetBrains.Annotations; using SpaceWarp.API.Configuration; using SpaceWarp.API.Mods.JSON; diff --git a/src/SpaceWarp.Core/API/Parts/Colors.cs b/src/SpaceWarp.Core/API/Parts/Colors.cs index 752bb847..8bfa17e7 100644 --- a/src/SpaceWarp.Core/API/Parts/Colors.cs +++ b/src/SpaceWarp.Core/API/Parts/Colors.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; using SpaceWarp.API.Lua; using SpaceWarp.Patching; using UnityEngine; diff --git a/src/SpaceWarp.Core/API/SaveGameManager/ModSaves.cs b/src/SpaceWarp.Core/API/SaveGameManager/ModSaves.cs index 792d0ee1..432a134c 100644 --- a/src/SpaceWarp.Core/API/SaveGameManager/ModSaves.cs +++ b/src/SpaceWarp.Core/API/SaveGameManager/ModSaves.cs @@ -1,7 +1,5 @@ using JetBrains.Annotations; using SpaceWarp.Backend.SaveGameManager; -using System; -using System.Collections.Generic; using SpaceWarp.API.Logging; namespace SpaceWarp.API.SaveGameManager; diff --git a/src/SpaceWarp.Core/API/Versions/SemanticVersion.cs b/src/SpaceWarp.Core/API/Versions/SemanticVersion.cs index ea45be74..bb51a7e9 100644 --- a/src/SpaceWarp.Core/API/Versions/SemanticVersion.cs +++ b/src/SpaceWarp.Core/API/Versions/SemanticVersion.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; + // Disable warnings for missing Equals and GetHashCode implementations #pragma warning disable CS0660, CS0661 diff --git a/src/SpaceWarp.Core/API/Versions/VersionUtility.cs b/src/SpaceWarp.Core/API/Versions/VersionUtility.cs index b6f9b2a3..dc0b0928 100644 --- a/src/SpaceWarp.Core/API/Versions/VersionUtility.cs +++ b/src/SpaceWarp.Core/API/Versions/VersionUtility.cs @@ -1,5 +1,4 @@ -using System; -using System.Text.RegularExpressions; +using System.Text.RegularExpressions; using JetBrains.Annotations; namespace SpaceWarp.API.Versions; diff --git a/src/SpaceWarp.Core/Backend/Modding/Ksp2ModInfo.cs b/src/SpaceWarp.Core/Backend/Modding/Ksp2ModInfo.cs index d8615dd9..fd1732de 100644 --- a/src/SpaceWarp.Core/Backend/Modding/Ksp2ModInfo.cs +++ b/src/SpaceWarp.Core/Backend/Modding/Ksp2ModInfo.cs @@ -1,5 +1,4 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace SpaceWarp.Backend.Modding; diff --git a/src/SpaceWarp.Core/Backend/Modding/PluginRegister.cs b/src/SpaceWarp.Core/Backend/Modding/PluginRegister.cs index 88d24c1c..6b1b2aac 100644 --- a/src/SpaceWarp.Core/Backend/Modding/PluginRegister.cs +++ b/src/SpaceWarp.Core/Backend/Modding/PluginRegister.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text.RegularExpressions; -using BepInEx; +using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using Newtonsoft.Json; diff --git a/src/SpaceWarp.Core/Backend/SaveGameManager/PluginSaveData.cs b/src/SpaceWarp.Core/Backend/SaveGameManager/PluginSaveData.cs index 768e5bf3..a439d088 100644 --- a/src/SpaceWarp.Core/Backend/SaveGameManager/PluginSaveData.cs +++ b/src/SpaceWarp.Core/Backend/SaveGameManager/PluginSaveData.cs @@ -1,6 +1,4 @@ -using System; - -namespace SpaceWarp.Backend.SaveGameManager; +namespace SpaceWarp.Backend.SaveGameManager; internal delegate void SaveGameCallbackFunctionDelegate(object data); diff --git a/src/SpaceWarp.Core/Backend/SaveGameManager/SpaceWarpSerializedSavedGame.cs b/src/SpaceWarp.Core/Backend/SaveGameManager/SpaceWarpSerializedSavedGame.cs index a777997c..e5501d7f 100644 --- a/src/SpaceWarp.Core/Backend/SaveGameManager/SpaceWarpSerializedSavedGame.cs +++ b/src/SpaceWarp.Core/Backend/SaveGameManager/SpaceWarpSerializedSavedGame.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using UnityEngine.Serialization; - -namespace SpaceWarp.Backend.SaveGameManager; +namespace SpaceWarp.Backend.SaveGameManager; /// /// Extension of game's save/load data class diff --git a/src/SpaceWarp.Core/InternalUtilities/AssetHelpers.cs b/src/SpaceWarp.Core/InternalUtilities/AssetHelpers.cs index 5eeeaac3..5d365243 100644 --- a/src/SpaceWarp.Core/InternalUtilities/AssetHelpers.cs +++ b/src/SpaceWarp.Core/InternalUtilities/AssetHelpers.cs @@ -1,4 +1,3 @@ -using System.IO; using I2.Loc; using KSP.Game; using UnityEngine.AddressableAssets; diff --git a/src/SpaceWarp.Core/InternalUtilities/InternalExtensions.cs b/src/SpaceWarp.Core/InternalUtilities/InternalExtensions.cs index 55accc73..e6aeb81d 100644 --- a/src/SpaceWarp.Core/InternalUtilities/InternalExtensions.cs +++ b/src/SpaceWarp.Core/InternalUtilities/InternalExtensions.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System; using UnityEngine; using System.Collections; diff --git a/src/SpaceWarp.Core/InternalUtilities/PathHelpers.cs b/src/SpaceWarp.Core/InternalUtilities/PathHelpers.cs index 49eb5e80..1f69801d 100644 --- a/src/SpaceWarp.Core/InternalUtilities/PathHelpers.cs +++ b/src/SpaceWarp.Core/InternalUtilities/PathHelpers.cs @@ -1,7 +1,4 @@ -using System; -using System.IO; - -namespace SpaceWarp.InternalUtilities; +namespace SpaceWarp.InternalUtilities; internal static class PathHelpers { diff --git a/src/SpaceWarp.Core/Modules/ModuleManager.cs b/src/SpaceWarp.Core/Modules/ModuleManager.cs index 29876ccd..0b7a843e 100644 --- a/src/SpaceWarp.Core/Modules/ModuleManager.cs +++ b/src/SpaceWarp.Core/Modules/ModuleManager.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; +using System.Reflection; using HarmonyLib; using SpaceWarp.API.Configuration; using SpaceWarp.API.Logging; diff --git a/src/SpaceWarp.Core/Modules/SpaceWarpModule.cs b/src/SpaceWarp.Core/Modules/SpaceWarpModule.cs index d2f89bd0..9f08d28b 100644 --- a/src/SpaceWarp.Core/Modules/SpaceWarpModule.cs +++ b/src/SpaceWarp.Core/Modules/SpaceWarpModule.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using SpaceWarp.API.Configuration; +using SpaceWarp.API.Configuration; using SpaceWarp.API.Logging; namespace SpaceWarp.Modules; diff --git a/src/SpaceWarp.Core/Patching/BootstrapPatch.cs b/src/SpaceWarp.Core/Patching/BootstrapPatch.cs index 29a080fa..39219b31 100644 --- a/src/SpaceWarp.Core/Patching/BootstrapPatch.cs +++ b/src/SpaceWarp.Core/Patching/BootstrapPatch.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using HarmonyLib; using KSP.Game; using KSP.Game.Flow; diff --git a/src/SpaceWarp.Core/Patching/ColorsPatch.cs b/src/SpaceWarp.Core/Patching/ColorsPatch.cs index c2d8b52e..1c7bb4a3 100644 --- a/src/SpaceWarp.Core/Patching/ColorsPatch.cs +++ b/src/SpaceWarp.Core/Patching/ColorsPatch.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Reflection; +using System.Reflection; using BepInEx.Logging; using Castle.Core.Internal; using HarmonyLib; diff --git a/src/SpaceWarp.Core/Patching/FixGetTypes.cs b/src/SpaceWarp.Core/Patching/FixGetTypes.cs index 19ddcf90..0ebee94d 100644 --- a/src/SpaceWarp.Core/Patching/FixGetTypes.cs +++ b/src/SpaceWarp.Core/Patching/FixGetTypes.cs @@ -1,4 +1,3 @@ -using System; using System.Reflection; using BepInEx.Logging; using HarmonyLib; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/AddressableAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/AddressableAction.cs index cfb2dbce..cd588b5c 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/AddressableAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/AddressableAction.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Game; using KSP.Game.Flow; using UnityEngine; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/DescriptorLoadingAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/DescriptorLoadingAction.cs index b1ab21d0..e7c79580 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/DescriptorLoadingAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/DescriptorLoadingAction.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Game.Flow; using SpaceWarp.API.Mods; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/FunctionalLoadingActions.cs b/src/SpaceWarp.Core/Patching/LoadingActions/FunctionalLoadingActions.cs index 59e68969..bb98a708 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/FunctionalLoadingActions.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/FunctionalLoadingActions.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using UnityEngine; +using UnityEngine; namespace SpaceWarp.Patching.LoadingActions; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/InitializeModAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/InitializeModAction.cs index 04ad68eb..25ab8347 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/InitializeModAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/InitializeModAction.cs @@ -1,4 +1,3 @@ -using System; using KSP.Game.Flow; using SpaceWarp.API.Mods; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/LoadAddressablesAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/LoadAddressablesAction.cs index 3e7376b3..b4c50e91 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/LoadAddressablesAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/LoadAddressablesAction.cs @@ -1,6 +1,4 @@ -using System; -using System.IO; -using BepInEx.Logging; +using BepInEx.Logging; using KSP.Game.Flow; using SpaceWarp.API.Mods; using SpaceWarp.InternalUtilities; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/LoadLocalizationAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/LoadLocalizationAction.cs index 69646912..bf00eba9 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/LoadLocalizationAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/LoadLocalizationAction.cs @@ -1,6 +1,4 @@ -using System; -using System.IO; -using KSP.Game.Flow; +using KSP.Game.Flow; using SpaceWarp.API.Mods; using SpaceWarp.InternalUtilities; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/LoadLuaAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/LoadLuaAction.cs index 0403bc07..bd8f0969 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/LoadLuaAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/LoadLuaAction.cs @@ -1,6 +1,4 @@ -using System; -using System.IO; -using KSP.Game.Flow; +using KSP.Game.Flow; using SpaceWarp.API.Mods; namespace SpaceWarp.Patching.LoadingActions; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/LoadingAddressablesLocalizationsAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/LoadingAddressablesLocalizationsAction.cs index dc0e075b..cecd0449 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/LoadingAddressablesLocalizationsAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/LoadingAddressablesLocalizationsAction.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using I2.Loc; +using I2.Loc; using KSP.Game; using KSP.Game.Flow; using UnityEngine; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/ModLoadingAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/ModLoadingAction.cs index e595db71..d9ec2d41 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/ModLoadingAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/ModLoadingAction.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Game.Flow; using SpaceWarp.API.Mods; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/PostInitializeModAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/PostInitializeModAction.cs index e8c5894d..d582183d 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/PostInitializeModAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/PostInitializeModAction.cs @@ -1,5 +1,4 @@ -using System; -using KSP.Game.Flow; +using KSP.Game.Flow; using SpaceWarp.API.Mods; namespace SpaceWarp.Patching.LoadingActions; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/PreInitializeModAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/PreInitializeModAction.cs index a8aac19c..ae5d97eb 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/PreInitializeModAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/PreInitializeModAction.cs @@ -1,4 +1,3 @@ -using System; using KSP.Game.Flow; using SpaceWarp.API.Mods; diff --git a/src/SpaceWarp.Core/Patching/LoadingActions/ResolvingPatchOrderAction.cs b/src/SpaceWarp.Core/Patching/LoadingActions/ResolvingPatchOrderAction.cs index 76926cd3..acd23752 100644 --- a/src/SpaceWarp.Core/Patching/LoadingActions/ResolvingPatchOrderAction.cs +++ b/src/SpaceWarp.Core/Patching/LoadingActions/ResolvingPatchOrderAction.cs @@ -1,5 +1,4 @@ -using System; -using KSP.Game.Flow; +using KSP.Game.Flow; namespace SpaceWarp.Patching.LoadingActions; diff --git a/src/SpaceWarp.Core/Patching/ModLoaderPatch.cs b/src/SpaceWarp.Core/Patching/ModLoaderPatch.cs index 98d10a64..eed68206 100644 --- a/src/SpaceWarp.Core/Patching/ModLoaderPatch.cs +++ b/src/SpaceWarp.Core/Patching/ModLoaderPatch.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; +using System.Reflection; using HarmonyLib; using KSP.Modding; using Newtonsoft.Json; diff --git a/src/SpaceWarp.Core/Patching/SaveGameManager/SaveGamePatches.cs b/src/SpaceWarp.Core/Patching/SaveGameManager/SaveGamePatches.cs index 5dad1816..ff85ffae 100644 --- a/src/SpaceWarp.Core/Patching/SaveGameManager/SaveGamePatches.cs +++ b/src/SpaceWarp.Core/Patching/SaveGameManager/SaveGamePatches.cs @@ -5,7 +5,6 @@ using SpaceWarp.API.SaveGameManager; using SpaceWarp.Backend.SaveGameManager; using SpaceWarp.InternalUtilities; -using System; namespace SpaceWarp.Patching.SaveGameManager; diff --git a/src/SpaceWarp.Core/Patching/SequentialFlowLoadersPatcher.cs b/src/SpaceWarp.Core/Patching/SequentialFlowLoadersPatcher.cs index e84a7067..34864b48 100644 --- a/src/SpaceWarp.Core/Patching/SequentialFlowLoadersPatcher.cs +++ b/src/SpaceWarp.Core/Patching/SequentialFlowLoadersPatcher.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reflection; +using System.Reflection; using System.Reflection.Emit; using BepInEx.Logging; using HarmonyLib; diff --git a/src/SpaceWarp.Core/Patching/SettingsManagerPatcher.cs b/src/SpaceWarp.Core/Patching/SettingsManagerPatcher.cs index 93864fe9..5ff50e86 100644 --- a/src/SpaceWarp.Core/Patching/SettingsManagerPatcher.cs +++ b/src/SpaceWarp.Core/Patching/SettingsManagerPatcher.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using HarmonyLib; +using HarmonyLib; using KSP.UI; namespace SpaceWarp.Patching; diff --git a/src/SpaceWarp.Core/SpaceWarpPlugin.cs b/src/SpaceWarp.Core/SpaceWarpPlugin.cs index cb66ee99..8fd340d6 100644 --- a/src/SpaceWarp.Core/SpaceWarpPlugin.cs +++ b/src/SpaceWarp.Core/SpaceWarpPlugin.cs @@ -1,7 +1,5 @@ global using UnityObject = UnityEngine.Object; global using System.Linq; -using System; -using System.IO; using System.Reflection; using BepInEx; using BepInEx.Logging; diff --git a/src/SpaceWarp.Game/API/Game/Extensions/PartProviderExtensions.cs b/src/SpaceWarp.Game/API/Game/Extensions/PartProviderExtensions.cs index d77af419..e939bf76 100644 --- a/src/SpaceWarp.Game/API/Game/Extensions/PartProviderExtensions.cs +++ b/src/SpaceWarp.Game/API/Game/Extensions/PartProviderExtensions.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Game; using KSP.Sim.Definitions; diff --git a/src/SpaceWarp.Game/API/Game/Messages/StateChanges.cs b/src/SpaceWarp.Game/API/Game/Messages/StateChanges.cs index c0f5768f..308268e9 100644 --- a/src/SpaceWarp.Game/API/Game/Messages/StateChanges.cs +++ b/src/SpaceWarp.Game/API/Game/Messages/StateChanges.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Game; using KSP.Messages; diff --git a/src/SpaceWarp.Game/API/Game/Messages/StateLoadings.cs b/src/SpaceWarp.Game/API/Game/Messages/StateLoadings.cs index 94df110c..2ea1ce11 100644 --- a/src/SpaceWarp.Game/API/Game/Messages/StateLoadings.cs +++ b/src/SpaceWarp.Game/API/Game/Messages/StateLoadings.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using KSP.Messages; namespace SpaceWarp.API.Game.Messages; diff --git a/src/SpaceWarp.Messaging/API/Messaging/MessageBus.cs b/src/SpaceWarp.Messaging/API/Messaging/MessageBus.cs index dc220ba3..2a5b426b 100644 --- a/src/SpaceWarp.Messaging/API/Messaging/MessageBus.cs +++ b/src/SpaceWarp.Messaging/API/Messaging/MessageBus.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; -using UnityEngine; +using JetBrains.Annotations; namespace SpaceWarp.API.Messaging; diff --git a/src/SpaceWarp.Messaging/API/Messaging/MessageBusBase.cs b/src/SpaceWarp.Messaging/API/Messaging/MessageBusBase.cs index f8ae2782..0fe45c26 100644 --- a/src/SpaceWarp.Messaging/API/Messaging/MessageBusBase.cs +++ b/src/SpaceWarp.Messaging/API/Messaging/MessageBusBase.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.Messaging; diff --git a/src/SpaceWarp.Messaging/API/Messaging/MessageBusManager.cs b/src/SpaceWarp.Messaging/API/Messaging/MessageBusManager.cs index 8b256e92..cc68732e 100644 --- a/src/SpaceWarp.Messaging/API/Messaging/MessageBusManager.cs +++ b/src/SpaceWarp.Messaging/API/Messaging/MessageBusManager.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; -using UnityEngine; +using JetBrains.Annotations; namespace SpaceWarp.API.Messaging; diff --git a/src/SpaceWarp.Sound/API/Sound/Soundbank.cs b/src/SpaceWarp.Sound/API/Sound/Soundbank.cs index 50a40657..d95e3762 100644 --- a/src/SpaceWarp.Sound/API/Sound/Soundbank.cs +++ b/src/SpaceWarp.Sound/API/Sound/Soundbank.cs @@ -1,5 +1,4 @@ -using System; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using JetBrains.Annotations; namespace SpaceWarp.API.Sound; diff --git a/src/SpaceWarp.Sound/API/Sound/SoundbankManager.cs b/src/SpaceWarp.Sound/API/Sound/SoundbankManager.cs index 7e1466f0..0f3ea606 100644 --- a/src/SpaceWarp.Sound/API/Sound/SoundbankManager.cs +++ b/src/SpaceWarp.Sound/API/Sound/SoundbankManager.cs @@ -1,5 +1,4 @@ using JetBrains.Annotations; -using System.Collections.Generic; namespace SpaceWarp.API.Sound; diff --git a/src/SpaceWarp.Sound/Modules/Sound.cs b/src/SpaceWarp.Sound/Modules/Sound.cs index 1497d6a2..6d4b3b63 100644 --- a/src/SpaceWarp.Sound/Modules/Sound.cs +++ b/src/SpaceWarp.Sound/Modules/Sound.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using JetBrains.Annotations; +using JetBrains.Annotations; using SpaceWarp.API.Loading; using SpaceWarp.API.Sound; using UnityObject = UnityEngine.Object; diff --git a/src/SpaceWarp.UI/API/Lua/AppBarInterop.cs b/src/SpaceWarp.UI/API/Lua/AppBarInterop.cs index 6fe42aa6..b830a3b8 100644 --- a/src/SpaceWarp.UI/API/Lua/AppBarInterop.cs +++ b/src/SpaceWarp.UI/API/Lua/AppBarInterop.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using MoonSharp.Interpreter; using SpaceWarp.API.Assets; using SpaceWarp.API.UI.Appbar; diff --git a/src/SpaceWarp.UI/API/UI/Appbar/Appbar.cs b/src/SpaceWarp.UI/API/UI/Appbar/Appbar.cs index af009f94..cc441bf0 100644 --- a/src/SpaceWarp.UI/API/UI/Appbar/Appbar.cs +++ b/src/SpaceWarp.UI/API/UI/Appbar/Appbar.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using BepInEx.Bootstrap; using JetBrains.Annotations; using KSP.UI.Binding; diff --git a/src/SpaceWarp.UI/API/UI/Appbar/AppbarMenu.cs b/src/SpaceWarp.UI/API/UI/Appbar/AppbarMenu.cs index 2e130c1a..081b76bb 100644 --- a/src/SpaceWarp.UI/API/UI/Appbar/AppbarMenu.cs +++ b/src/SpaceWarp.UI/API/UI/Appbar/AppbarMenu.cs @@ -1,4 +1,3 @@ -using System; using JetBrains.Annotations; using KSP.Game; using KSP.Sim.impl; diff --git a/src/SpaceWarp.UI/API/UI/MainMenu.cs b/src/SpaceWarp.UI/API/UI/MainMenu.cs index 5667fd4b..9e72d6f5 100644 --- a/src/SpaceWarp.UI/API/UI/MainMenu.cs +++ b/src/SpaceWarp.UI/API/UI/MainMenu.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; namespace SpaceWarp.API.UI; diff --git a/src/SpaceWarp.UI/API/UI/ModList.cs b/src/SpaceWarp.UI/API/UI/ModList.cs index 884652b1..46c5d491 100644 --- a/src/SpaceWarp.UI/API/UI/ModList.cs +++ b/src/SpaceWarp.UI/API/UI/ModList.cs @@ -1,6 +1,4 @@ -using System; -using JetBrains.Annotations; -using SpaceWarp.UI.ModList; +using JetBrains.Annotations; using UnityEngine.UIElements; namespace SpaceWarp.API.UI; diff --git a/src/SpaceWarp.UI/API/UI/Settings/ModsPropertyDrawers.cs b/src/SpaceWarp.UI/API/UI/Settings/ModsPropertyDrawers.cs index e78c2796..b1058ff8 100644 --- a/src/SpaceWarp.UI/API/UI/Settings/ModsPropertyDrawers.cs +++ b/src/SpaceWarp.UI/API/UI/Settings/ModsPropertyDrawers.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; +using System.ComponentModel; using System.Reflection; using BepInEx.Configuration; using I2.Loc; diff --git a/src/SpaceWarp.UI/API/UI/Skins.cs b/src/SpaceWarp.UI/API/UI/Skins.cs index b281628b..f8b35bbb 100644 --- a/src/SpaceWarp.UI/API/UI/Skins.cs +++ b/src/SpaceWarp.UI/API/UI/Skins.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using SpaceWarp.API.Assets; using UnityEngine; diff --git a/src/SpaceWarp.UI/Backend/UI/Appbar/AppbarBackend.cs b/src/SpaceWarp.UI/Backend/UI/Appbar/AppbarBackend.cs index abdd99ca..495f1fd8 100644 --- a/src/SpaceWarp.UI/Backend/UI/Appbar/AppbarBackend.cs +++ b/src/SpaceWarp.UI/Backend/UI/Appbar/AppbarBackend.cs @@ -1,7 +1,6 @@ // Attribution Notice To Lawrence/HatBat of https://github.com/Halbann/LazyOrbit // This file is licensed under https://creativecommons.org/licenses/by-sa/4.0/ -using System; using System.Collections; using System.Reflection; using BepInEx.Logging; diff --git a/src/SpaceWarp.UI/Backend/UI/Loading/LoadingScreenManager.cs b/src/SpaceWarp.UI/Backend/UI/Loading/LoadingScreenManager.cs index f3178504..22c0118b 100644 --- a/src/SpaceWarp.UI/Backend/UI/Loading/LoadingScreenManager.cs +++ b/src/SpaceWarp.UI/Backend/UI/Loading/LoadingScreenManager.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.IO; -using KSP.Game; -using SpaceWarp.API.Mods; +using SpaceWarp.API.Mods; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; diff --git a/src/SpaceWarp.UI/Backend/UI/Settings/CustomSettingsElementDescriptionController.cs b/src/SpaceWarp.UI/Backend/UI/Settings/CustomSettingsElementDescriptionController.cs index 347f74f8..709f0bd8 100644 --- a/src/SpaceWarp.UI/Backend/UI/Settings/CustomSettingsElementDescriptionController.cs +++ b/src/SpaceWarp.UI/Backend/UI/Settings/CustomSettingsElementDescriptionController.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using KSP.Game; +using KSP.Game; using UnityEngine.EventSystems; using DG.Tweening; diff --git a/src/SpaceWarp.UI/Modules/UI.cs b/src/SpaceWarp.UI/Modules/UI.cs index 9ec81c5e..b2f2e714 100644 --- a/src/SpaceWarp.UI/Modules/UI.cs +++ b/src/SpaceWarp.UI/Modules/UI.cs @@ -1,17 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using BepInEx.Bootstrap; +using BepInEx.Bootstrap; using JetBrains.Annotations; -using KSP.Assets; -using KSP.Game; -using KSP.Game.Flow; using SpaceWarp.API.Assets; using SpaceWarp.API.Configuration; -using SpaceWarp.API.Loading; using SpaceWarp.API.UI.Appbar; using SpaceWarp.Backend.UI.Appbar; -using SpaceWarp.Backend.UI.Loading; using SpaceWarp.InternalUtilities; using SpaceWarp.UI.AvcDialog; using SpaceWarp.UI.Console; diff --git a/src/SpaceWarp.UI/Patching/CurtainPatch.cs b/src/SpaceWarp.UI/Patching/CurtainPatch.cs index 853abefb..eb1f8ff7 100644 --- a/src/SpaceWarp.UI/Patching/CurtainPatch.cs +++ b/src/SpaceWarp.UI/Patching/CurtainPatch.cs @@ -1,8 +1,5 @@ -using System; -using HarmonyLib; -using KSP.Networking.MP.Utils; +using HarmonyLib; using SpaceWarp.Backend.UI.Loading; -using UnityEngine; namespace SpaceWarp.Patching; diff --git a/src/SpaceWarp.UI/Patching/LoadingFlowPatch.cs b/src/SpaceWarp.UI/Patching/LoadingFlowPatch.cs index 15cbe4f0..9549fdf1 100644 --- a/src/SpaceWarp.UI/Patching/LoadingFlowPatch.cs +++ b/src/SpaceWarp.UI/Patching/LoadingFlowPatch.cs @@ -1,9 +1,7 @@ -using System; -using HarmonyLib; +using HarmonyLib; using KSP.Game; using KSP.Game.Flow; using KSP.Startup; -using UnityEngine; namespace SpaceWarp.Patching; diff --git a/src/SpaceWarp.UI/Patching/LoadingScreenDeserializationPatch.cs b/src/SpaceWarp.UI/Patching/LoadingScreenDeserializationPatch.cs index 5a75d466..9adf711f 100644 --- a/src/SpaceWarp.UI/Patching/LoadingScreenDeserializationPatch.cs +++ b/src/SpaceWarp.UI/Patching/LoadingScreenDeserializationPatch.cs @@ -1,5 +1,4 @@ -using System.Linq; -using HarmonyLib; +using HarmonyLib; using KSP.Game; using KSP.Game.StartupFlow; diff --git a/src/SpaceWarp.UI/Patching/MainMenuPatcher.cs b/src/SpaceWarp.UI/Patching/MainMenuPatcher.cs index 58261589..7a17a523 100644 --- a/src/SpaceWarp.UI/Patching/MainMenuPatcher.cs +++ b/src/SpaceWarp.UI/Patching/MainMenuPatcher.cs @@ -1,5 +1,4 @@ -using System; -using HarmonyLib; +using HarmonyLib; using I2.Loc; using KSP.Api.CoreTypes; using KSP.Game.StartupFlow; diff --git a/src/SpaceWarp.UI/UI/Console/LogEntry.cs b/src/SpaceWarp.UI/UI/Console/LogEntry.cs index 5239a4d9..64a18bd3 100644 --- a/src/SpaceWarp.UI/UI/Console/LogEntry.cs +++ b/src/SpaceWarp.UI/UI/Console/LogEntry.cs @@ -1,5 +1,4 @@ -using System; -using BepInEx.Logging; +using BepInEx.Logging; using UnityEngine; using UnityEngine.UIElements; using static SpaceWarp.UI.Console.SpaceWarpConsoleLogListener; diff --git a/src/SpaceWarp.UI/UI/Console/SpaceWarpConsoleLogListener.cs b/src/SpaceWarp.UI/UI/Console/SpaceWarpConsoleLogListener.cs index 4fc09ca3..eaaab506 100644 --- a/src/SpaceWarp.UI/UI/Console/SpaceWarpConsoleLogListener.cs +++ b/src/SpaceWarp.UI/UI/Console/SpaceWarpConsoleLogListener.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using BepInEx.Logging; +using BepInEx.Logging; namespace SpaceWarp.UI.Console; diff --git a/src/SpaceWarp.UI/UI/ModList/ModListController.cs b/src/SpaceWarp.UI/UI/ModList/ModListController.cs index c57f5a7a..6dd2c856 100644 --- a/src/SpaceWarp.UI/UI/ModList/ModListController.cs +++ b/src/SpaceWarp.UI/UI/ModList/ModListController.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; +using System.Diagnostics; using BepInEx; using I2.Loc; using SpaceWarp.API.Assets; diff --git a/src/SpaceWarp.UI/UI/ModList/ModListItemController.cs b/src/SpaceWarp.UI/UI/ModList/ModListItemController.cs index d3703d65..baa19fca 100644 --- a/src/SpaceWarp.UI/UI/ModList/ModListItemController.cs +++ b/src/SpaceWarp.UI/UI/ModList/ModListItemController.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using SpaceWarp.API.Mods; +using SpaceWarp.API.Mods; using UnityEngine.UIElements; namespace SpaceWarp.UI.ModList; diff --git a/src/SpaceWarp.UI/UI/Settings/ModsSubMenu.cs b/src/SpaceWarp.UI/UI/Settings/ModsSubMenu.cs index 392fcacb..c9d2cbb1 100644 --- a/src/SpaceWarp.UI/UI/Settings/ModsSubMenu.cs +++ b/src/SpaceWarp.UI/UI/Settings/ModsSubMenu.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using BepInEx; -using BepInEx.Configuration; +using BepInEx.Configuration; using KSP.UI; using SpaceWarp.API.Configuration; using SpaceWarp.API.Mods; diff --git a/src/SpaceWarpPatcher/AssemblyCSharpPatcher.cs b/src/SpaceWarpPatcher/AssemblyCSharpPatcher.cs index 91318da2..40a9b142 100644 --- a/src/SpaceWarpPatcher/AssemblyCSharpPatcher.cs +++ b/src/SpaceWarpPatcher/AssemblyCSharpPatcher.cs @@ -1,6 +1,4 @@ -using BepInEx; -using BepInEx.Logging; -using JetBrains.Annotations; +using JetBrains.Annotations; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Collections.Generic; diff --git a/src/SpaceWarpPatcher/Patcher.cs b/src/SpaceWarpPatcher/Patcher.cs index 5579713d..7685ae5d 100644 --- a/src/SpaceWarpPatcher/Patcher.cs +++ b/src/SpaceWarpPatcher/Patcher.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using BepInEx; @@ -15,7 +11,6 @@ using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; -using Newtonsoft.Json.Linq; [assembly: InternalsVisibleTo("SpaceWarp.Core")] diff --git a/src/SpaceWarpPatcher/PathsGenerator.cs b/src/SpaceWarpPatcher/PathsGenerator.cs index 465b2323..b248c27a 100644 --- a/src/SpaceWarpPatcher/PathsGenerator.cs +++ b/src/SpaceWarpPatcher/PathsGenerator.cs @@ -1,7 +1,4 @@ -using System; -using System.IO; -using System.Linq; -using System.Reflection; +using System.Reflection; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Logging; diff --git a/src/SpaceWarpPatcher/SwinfoTransformer.cs b/src/SpaceWarpPatcher/SwinfoTransformer.cs index 2df4b07d..f765bf70 100644 --- a/src/SpaceWarpPatcher/SwinfoTransformer.cs +++ b/src/SpaceWarpPatcher/SwinfoTransformer.cs @@ -1,6 +1,4 @@ -using System.IO; -using System.Linq; -using System.Security.Cryptography; +using System.Security.Cryptography; using System.Text; using BepInEx; using Newtonsoft.Json.Linq;