summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-08-09 01:18:05 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 19:08:06 -0400
commitfd77ae93d59222d70c86aebfc044f3af11063372 (patch)
tree76fac6ffc0cac70fb44f8b9ffc72471a2796a02f /src/SMAPI/Framework
parent3f6865e8301535c8fbe83bc0f931a116adac0636 (diff)
downloadSMAPI-fd77ae93d59222d70c86aebfc044f3af11063372.tar.gz
SMAPI-fd77ae93d59222d70c86aebfc044f3af11063372.tar.bz2
SMAPI-fd77ae93d59222d70c86aebfc044f3af11063372.zip
fix typos and inconsistent spelling
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/CommandManager.cs14
-rw-r--r--src/SMAPI/Framework/Content/AssetData.cs10
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForDictionary.cs10
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForImage.cs10
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForObject.cs20
-rw-r--r--src/SMAPI/Framework/Content/AssetInfo.cs22
-rw-r--r--src/SMAPI/Framework/Content/ContentCache.cs30
-rw-r--r--src/SMAPI/Framework/ContentCoordinator.cs8
-rw-r--r--src/SMAPI/Framework/ContentManagers/BaseContentManager.cs34
-rw-r--r--src/SMAPI/Framework/ContentManagers/GameContentManager.cs58
-rw-r--r--src/SMAPI/Framework/ContentManagers/IContentManager.cs10
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs28
-rw-r--r--src/SMAPI/Framework/ContentPack.cs10
-rw-r--r--src/SMAPI/Framework/Events/EventManager.cs18
-rw-r--r--src/SMAPI/Framework/Events/ModEvents.cs6
-rw-r--r--src/SMAPI/Framework/Events/ModGameLoopEvents.cs2
-rw-r--r--src/SMAPI/Framework/Events/ModSpecialisedEvents.cs6
-rw-r--r--src/SMAPI/Framework/GameVersion.cs2
-rw-r--r--src/SMAPI/Framework/InternalExtensions.cs2
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentHelper.cs14
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentPackHelper.cs4
-rw-r--r--src/SMAPI/Framework/ModHelpers/DataHelper.cs12
-rw-r--r--src/SMAPI/Framework/ModHelpers/ModHelper.cs4
-rw-r--r--src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs4
-rw-r--r--src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyLoader.cs10
-rw-r--r--src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs4
-rw-r--r--src/SMAPI/Framework/ModLoading/ModDependencyStatus.cs4
-rw-r--r--src/SMAPI/Framework/ModLoading/ModResolver.cs8
-rw-r--r--src/SMAPI/Framework/ModLoading/TypeReferenceComparer.cs2
-rw-r--r--src/SMAPI/Framework/ModRegistry.cs6
-rw-r--r--src/SMAPI/Framework/Monitor.cs2
-rw-r--r--src/SMAPI/Framework/Networking/MessageType.cs2
-rw-r--r--src/SMAPI/Framework/Reflection/Reflector.cs2
-rw-r--r--src/SMAPI/Framework/SCore.cs56
-rw-r--r--src/SMAPI/Framework/SGame.cs50
-rw-r--r--src/SMAPI/Framework/SGameConstructorHack.cs4
-rw-r--r--src/SMAPI/Framework/SMultiplayer.cs20
-rw-r--r--src/SMAPI/Framework/Serialization/ColorConverter.cs (renamed from src/SMAPI/Framework/Serialisation/ColorConverter.cs)8
-rw-r--r--src/SMAPI/Framework/Serialization/PointConverter.cs (renamed from src/SMAPI/Framework/Serialisation/PointConverter.cs)8
-rw-r--r--src/SMAPI/Framework/Serialization/RectangleConverter.cs (renamed from src/SMAPI/Framework/Serialisation/RectangleConverter.cs)8
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/ComparableListWatcher.cs2
43 files changed, 269 insertions, 269 deletions
diff --git a/src/SMAPI/Framework/CommandManager.cs b/src/SMAPI/Framework/CommandManager.cs
index fdaafff1..ceeb6f93 100644
--- a/src/SMAPI/Framework/CommandManager.cs
+++ b/src/SMAPI/Framework/CommandManager.cs
@@ -29,7 +29,7 @@ namespace StardewModdingAPI.Framework
/// <exception cref="ArgumentException">There's already a command with that name.</exception>
public void Add(IModMetadata mod, string name, string documentation, Action<string, string[]> callback, bool allowNullCallback = false)
{
- name = this.GetNormalisedName(name);
+ name = this.GetNormalizedName(name);
// validate format
if (string.IsNullOrWhiteSpace(name))
@@ -52,7 +52,7 @@ namespace StardewModdingAPI.Framework
/// <returns>Returns the matching command, or <c>null</c> if not found.</returns>
public Command Get(string name)
{
- name = this.GetNormalisedName(name);
+ name = this.GetNormalizedName(name);
this.Commands.TryGetValue(name, out Command command);
return command;
}
@@ -84,7 +84,7 @@ namespace StardewModdingAPI.Framework
// parse input
args = this.ParseArgs(input);
- name = this.GetNormalisedName(args[0]);
+ name = this.GetNormalizedName(args[0]);
args = args.Skip(1).ToArray();
// get command
@@ -97,8 +97,8 @@ namespace StardewModdingAPI.Framework
/// <returns>Returns whether a matching command was triggered.</returns>
public bool Trigger(string name, string[] arguments)
{
- // get normalised name
- name = this.GetNormalisedName(name);
+ // get normalized name
+ name = this.GetNormalizedName(name);
if (name == null)
return false;
@@ -140,9 +140,9 @@ namespace StardewModdingAPI.Framework
return args.Where(item => !string.IsNullOrWhiteSpace(item)).ToArray();
}
- /// <summary>Get a normalised command name.</summary>
+ /// <summary>Get a normalized command name.</summary>
/// <param name="name">The command name.</param>
- private string GetNormalisedName(string name)
+ private string GetNormalizedName(string name)
{
name = name?.Trim().ToLower();
return !string.IsNullOrWhiteSpace(name)
diff --git a/src/SMAPI/Framework/Content/AssetData.cs b/src/SMAPI/Framework/Content/AssetData.cs
index 553404d3..cacc6078 100644
--- a/src/SMAPI/Framework/Content/AssetData.cs
+++ b/src/SMAPI/Framework/Content/AssetData.cs
@@ -24,13 +24,13 @@ namespace StardewModdingAPI.Framework.Content
** Public methods
*********/
/// <summary>Construct an instance.</summary>
- /// <param name="locale">The content's locale code, if the content is localised.</param>
- /// <param name="assetName">The normalised asset name being read.</param>
+ /// <param name="locale">The content's locale code, if the content is localized.</param>
+ /// <param name="assetName">The normalized asset name being read.</param>
/// <param name="data">The content data being read.</param>
- /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
/// <param name="onDataReplaced">A callback to invoke when the data is replaced (if any).</param>
- public AssetData(string locale, string assetName, TValue data, Func<string, string> getNormalisedPath, Action<TValue> onDataReplaced)
- : base(locale, assetName, data.GetType(), getNormalisedPath)
+ public AssetData(string locale, string assetName, TValue data, Func<string, string> getNormalizedPath, Action<TValue> onDataReplaced)
+ : base(locale, assetName, data.GetType(), getNormalizedPath)
{
this.Data = data;
this.OnDataReplaced = onDataReplaced;
diff --git a/src/SMAPI/Framework/Content/AssetDataForDictionary.cs b/src/SMAPI/Framework/Content/AssetDataForDictionary.cs
index a331f38a..26cbff5a 100644
--- a/src/SMAPI/Framework/Content/AssetDataForDictionary.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForDictionary.cs
@@ -10,12 +10,12 @@ namespace StardewModdingAPI.Framework.Content
** Public methods
*********/
/// <summary>Construct an instance.</summary>
- /// <param name="locale">The content's locale code, if the content is localised.</param>
- /// <param name="assetName">The normalised asset name being read.</param>
+ /// <param name="locale">The content's locale code, if the content is localized.</param>
+ /// <param name="assetName">The normalized asset name being read.</param>
/// <param name="data">The content data being read.</param>
- /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
/// <param name="onDataReplaced">A callback to invoke when the data is replaced (if any).</param>
- public AssetDataForDictionary(string locale, string assetName, IDictionary<TKey, TValue> data, Func<string, string> getNormalisedPath, Action<IDictionary<TKey, TValue>> onDataReplaced)
- : base(locale, assetName, data, getNormalisedPath, onDataReplaced) { }
+ public AssetDataForDictionary(string locale, string assetName, IDictionary<TKey, TValue> data, Func<string, string> getNormalizedPath, Action<IDictionary<TKey, TValue>> onDataReplaced)
+ : base(locale, assetName, data, getNormalizedPath, onDataReplaced) { }
}
}
diff --git a/src/SMAPI/Framework/Content/AssetDataForImage.cs b/src/SMAPI/Framework/Content/AssetDataForImage.cs
index f2d21b5e..4ae2ad68 100644
--- a/src/SMAPI/Framework/Content/AssetDataForImage.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForImage.cs
@@ -19,13 +19,13 @@ namespace StardewModdingAPI.Framework.Content
** Public methods
*********/
/// <summary>Construct an instance.</summary>
- /// <param name="locale">The content's locale code, if the content is localised.</param>
- /// <param name="assetName">The normalised asset name being read.</param>
+ /// <param name="locale">The content's locale code, if the content is localized.</param>
+ /// <param name="assetName">The normalized asset name being read.</param>
/// <param name="data">The content data being read.</param>
- /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
/// <param name="onDataReplaced">A callback to invoke when the data is replaced (if any).</param>
- public AssetDataForImage(string locale, string assetName, Texture2D data, Func<string, string> getNormalisedPath, Action<Texture2D> onDataReplaced)
- : base(locale, assetName, data, getNormalisedPath, onDataReplaced) { }
+ public AssetDataForImage(string locale, string assetName, Texture2D data, Func<string, string> getNormalizedPath, Action<Texture2D> onDataReplaced)
+ : base(locale, assetName, data, getNormalizedPath, onDataReplaced) { }
/// <summary>Overwrite part of the image.</summary>
/// <param name="source">The image to patch into the content.</param>
diff --git a/src/SMAPI/Framework/Content/AssetDataForObject.cs b/src/SMAPI/Framework/Content/AssetDataForObject.cs
index 90f9e2d4..4dbc988c 100644
--- a/src/SMAPI/Framework/Content/AssetDataForObject.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForObject.cs
@@ -11,19 +11,19 @@ namespace StardewModdingAPI.Framework.Content
** Public methods
*********/
/// <summary>Construct an instance.</summary>
- /// <param name="locale">The content's locale code, if the content is localised.</param>
- /// <param name="assetName">The normalised asset name being read.</param>
+ /// <param name="locale">The content's locale code, if the content is localized.</param>
+ /// <param name="assetName">The normalized asset name being read.</param>
/// <param name="data">The content data being read.</param>
- /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
- public AssetDataForObject(string locale, string assetName, object data, Func<string, string> getNormalisedPath)
- : base(locale, assetName, data, getNormalisedPath, onDataReplaced: null) { }
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
+ public AssetDataForObject(string locale, string assetName, object data, Func<string, string> getNormalizedPath)
+ : base(locale, assetName, data, getNormalizedPath, onDataReplaced: null) { }
/// <summary>Construct an instance.</summary>
/// <param name="info">The asset metadata.</param>
/// <param name="data">The content data being read.</param>
- /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
- public AssetDataForObject(IAssetInfo info, object data, Func<string, string> getNormalisedPath)
- : this(info.Locale, info.AssetName, data, getNormalisedPath) { }
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
+ public AssetDataForObject(IAssetInfo info, object data, Func<string, string> getNormalizedPath)
+ : this(info.Locale, info.AssetName, data, getNormalizedPath) { }
/// <summary>Get a helper to manipulate the data as a dictionary.</summary>
/// <typeparam name="TKey">The expected dictionary key.</typeparam>
@@ -31,14 +31,14 @@ namespace StardewModdingAPI.Framework.Content
/// <exception cref="InvalidOperationException">The content being read isn't a dictionary.</exception>
public IAssetDataForDictionary<TKey, TValue> AsDictionary<TKey, TValue>()
{
- return new AssetDataForDictionary<TKey, TValue>(this.Locale, this.AssetName, this.GetData<IDictionary<TKey, TValue>>(), this.GetNormalisedPath, this.ReplaceWith);
+ return new AssetDataForDictionary<TKey, TValue>(this.Locale, this.AssetName, this.GetData<IDictionary<TKey, TValue>>(), this.GetNormalizedPath, this.ReplaceWith);
}
/// <summary>Get a helper to manipulate the data as an image.</summary>
/// <exception cref="InvalidOperationException">The content being read isn't an image.</exception>
public IAssetDataForImage AsImage()
{
- return new AssetDataForImage(this.Locale, this.AssetName, this.GetData<Texture2D>(), this.GetNormalisedPath, this.ReplaceWith);
+ return new AssetDataForImage(this.Locale, this.AssetName, this.GetData<Texture2D>(), this.GetNormalizedPath, this.ReplaceWith);
}
/// <summary>Get the data as a given type.</summary>
diff --git a/src/SMAPI/Framework/Content/AssetInfo.cs b/src/SMAPI/Framework/Content/AssetInfo.cs
index e5211290..9b685e72 100644
--- a/src/SMAPI/Framework/Content/AssetInfo.cs
+++ b/src/SMAPI/Framework/Content/AssetInfo.cs
@@ -9,17 +9,17 @@ namespace StardewModdingAPI.Framework.Content
/*********
** Fields
*********/
- /// <summary>Normalises an asset key to match the cache key.</summary>
- protected readonly Func<string, string> GetNormalisedPath;
+ /// <summary>Normalizes an asset key to match the cache key.</summary>
+ protected readonly Func<string, string> GetNormalizedPath;
/*********
** Accessors
*********/
- /// <summary>The content's locale code, if the content is localised.</summary>
+ /// <summary>The content's locale code, if the content is localized.</summary>
public string Locale { get; }
- /// <summary>The normalised asset name being read. The format may change between platforms; see <see cref="AssetNameEquals"/> to compare with a known path.</summary>
+ /// <summary>The normalized asset name being read. The format may change between platforms; see <see cref="AssetNameEquals"/> to compare with a known path.</summary>
public string AssetName { get; }
/// <summary>The content data type.</summary>
@@ -30,23 +30,23 @@ namespace StardewModdingAPI.Framework.Content
** Public methods
*********/
/// <summary>Construct an instance.</summary>
- /// <param name="locale">The content's locale code, if the content is localised.</param>
- /// <param name="assetName">The normalised asset name being read.</param>
+ /// <param name="locale">The content's locale code, if the content is localized.</param>
+ /// <param name="assetName">The normalized asset name being read.</param>
/// <param name="type">The content type being read.</param>
- /// <param name="getNormalisedPath">Normalises an asset key to match the cache key.</param>
- public AssetInfo(string locale, string assetName, Type type, Func<string, string> getNormalisedPath)
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
+ public AssetInfo(string locale, string assetName, Type type, Func<string, string> getNormalizedPath)
{
this.Locale = locale;
this.AssetName = assetName;
this.DataType = type;
- this.GetNormalisedPath = getNormalisedPath;
+ this.GetNormalizedPath = getNormalizedPath;
}
- /// <summary>Get whether the asset name being loaded matches a given name after normalisation.</summary>
+ /// <summary>Get whether the asset name being loaded matches a given name after normalization.</summary>
/// <param name="path">The expected asset path, relative to the game's content folder and without the .xnb extension or locale suffix (like 'Data\ObjectInformation').</param>
public bool AssetNameEquals(string path)
{
- path = this.GetNormalisedPath(path);
+ path = this.GetNormalizedPath(path);
return this.AssetName.Equals(path, StringComparison.InvariantCultureIgnoreCase);
}
diff --git a/src/SMAPI/Framework/Content/ContentCache.cs b/src/SMAPI/Framework/Content/ContentCache.cs
index 55a96ed2..4178b663 100644
--- a/src/SMAPI/Framework/Content/ContentCache.cs
+++ b/src/SMAPI/Framework/Content/ContentCache.cs
@@ -10,7 +10,7 @@ using StardewValley;
namespace StardewModdingAPI.Framework.Content
{
- /// <summary>A low-level wrapper around the content cache which handles reading, writing, and invalidating entries in the cache. This doesn't handle any higher-level logic like localisation, loading content, etc. It assumes all keys passed in are already normalised.</summary>
+ /// <summary>A low-level wrapper around the content cache which handles reading, writing, and invalidating entries in the cache. This doesn't handle any higher-level logic like localization, loading content, etc. It assumes all keys passed in are already normalized.</summary>
internal class ContentCache
{
/*********
@@ -19,8 +19,8 @@ namespace StardewModdingAPI.Framework.Content
/// <summary>The underlying asset cache.</summary>
private readonly IDictionary<string, object> Cache;
- /// <summary>Applies platform-specific asset key normalisation so it's consistent with the underlying cache.</summary>
- private readonly Func<string, string> NormaliseAssetNameForPlatform;
+ /// <summary>Applies platform-specific asset key normalization so it's consistent with the underlying cache.</summary>
+ private readonly Func<string, string> NormalizeAssetNameForPlatform;
/*********
@@ -52,14 +52,14 @@ namespace StardewModdingAPI.Framework.Content
// init
this.Cache = reflection.GetField<Dictionary<string, object>>(contentManager, "loadedAssets").GetValue();
- // get key normalisation logic
+ // get key normalization logic
if (Constants.Platform == Platform.Windows)
{
IReflectedMethod method = reflection.GetMethod(typeof(TitleContainer), "GetCleanPath");
- this.NormaliseAssetNameForPlatform = path => method.Invoke<string>(path);
+ this.NormalizeAssetNameForPlatform = path => method.Invoke<string>(path);
}
else
- this.NormaliseAssetNameForPlatform = key => key.Replace('\\', '/'); // based on MonoGame's ContentManager.Load<T> logic
+ this.NormalizeAssetNameForPlatform = key => key.Replace('\\', '/'); // based on MonoGame's ContentManager.Load<T> logic
}
/****
@@ -74,25 +74,25 @@ namespace StardewModdingAPI.Framework.Content
/****
- ** Normalise
+ ** Normalize
****/
- /// <summary>Normalise path separators in a file path. For asset keys, see <see cref="NormaliseKey"/> instead.</summary>
- /// <param name="path">The file path to normalise.</param>
+ /// <summary>Normalize path separators in a file path. For asset keys, see <see cref="NormalizeKey"/> instead.</summary>
+ /// <param name="path">The file path to normalize.</param>
[Pure]
- public string NormalisePathSeparators(string path)
+ public string NormalizePathSeparators(string path)
{
- return PathUtilities.NormalisePathSeparators(path);
+ return PathUtilities.NormalizePathSeparators(path);
}
- /// <summary>Normalise a cache key so it's consistent with the underlying cache.</summary>
+ /// <summary>Normalize a cache key so it's consistent with the underlying cache.</summary>
/// <param name="key">The asset key.</param>
[Pure]
- public string NormaliseKey(string key)
+ public string NormalizeKey(string key)
{
- key = this.NormalisePathSeparators(key);
+ key = this.NormalizePathSeparators(key);
return key.EndsWith(".xnb", StringComparison.InvariantCultureIgnoreCase)
? key.Substring(0, key.Length - 4)
- : this.NormaliseAssetNameForPlatform(key);
+ : this.NormalizeAssetNameForPlatform(key);
}
/****
diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs
index 39bebdd1..08ebe6a5 100644
--- a/src/SMAPI/Framework/ContentCoordinator.cs
+++ b/src/SMAPI/Framework/ContentCoordinator.cs
@@ -9,7 +9,7 @@ using StardewModdingAPI.Framework.Content;
using StardewModdingAPI.Framework.ContentManagers;
using StardewModdingAPI.Framework.Reflection;
using StardewModdingAPI.Metadata;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
@@ -74,7 +74,7 @@ namespace StardewModdingAPI.Framework
/// <summary>Construct an instance.</summary>
/// <param name="serviceProvider">The service provider to use to locate services.</param>
/// <param name="rootDirectory">The root directory to search for content.</param>
- /// <param name="currentCulture">The current culture for which to localise content.</param>
+ /// <param name="currentCulture">The current culture for which to localize content.</param>
/// <param name="monitor">Encapsulates monitoring and logging.</param>
/// <param name="reflection">Simplifies access to private code.</param>
/// <param name="jsonHelper">Encapsulates SMAPI's JSON file parsing.</param>
@@ -89,7 +89,7 @@ namespace StardewModdingAPI.Framework
this.ContentManagers.Add(
this.MainContentManager = new GameContentManager("Game1.content", serviceProvider, rootDirectory, currentCulture, this, monitor, reflection, this.OnDisposing, onLoadingFirstAsset)
);
- this.CoreAssets = new CoreAssetPropagator(this.MainContentManager.AssertAndNormaliseAssetName, reflection, monitor);
+ this.CoreAssets = new CoreAssetPropagator(this.MainContentManager.AssertAndNormalizeAssetName, reflection, monitor);
}
/// <summary>Get a new content manager which handles reading files from the game content folder with support for interception.</summary>
@@ -250,7 +250,7 @@ namespace StardewModdingAPI.Framework
string locale = this.GetLocale();
return this.InvalidateCache((assetName, type) =>
{
- IAssetInfo info = new AssetInfo(locale, assetName, type, this.MainContentManager.AssertAndNormaliseAssetName);
+ IAssetInfo info = new AssetInfo(locale, assetName, type, this.MainContentManager.AssertAndNormalizeAssetName);
return predicate(info);
}, dispose);
}
diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
index fc558eb9..de39dbae 100644
--- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
@@ -64,7 +64,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="name">A name for the mod manager. Not guaranteed to be unique.</param>
/// <param name="serviceProvider">The service provider to use to locate services.</param>
/// <param name="rootDirectory">The root directory to search for content.</param>
- /// <param name="currentCulture">The current culture for which to localise content.</param>
+ /// <param name="currentCulture">The current culture for which to localize content.</param>
/// <param name="coordinator">The central coordinator which manages content managers.</param>
/// <param name="monitor">Encapsulates monitoring and logging.</param>
/// <param name="reflection">Simplifies access to private code.</param>
@@ -109,7 +109,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="useCache">Whether to read/write the loaded asset to the asset cache.</param>
public abstract T Load<T>(string assetName, LocalizedContentManager.LanguageCode language, bool useCache);
- /// <summary>Load the base asset without localisation.</summary>
+ /// <summary>Load the base asset without localization.</summary>
/// <typeparam name="T">The type of asset to load.</typeparam>
/// <param name="assetName">The asset path relative to the loader root directory, not including the <c>.xnb</c> extension.</param>
[Obsolete("This method is implemented for the base game and should not be used directly. To load an asset from the underlying content manager directly, use " + nameof(BaseContentManager.RawLoad) + " instead.")]
@@ -121,19 +121,19 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <summary>Perform any cleanup needed when the locale changes.</summary>
public virtual void OnLocaleChanged() { }
- /// <summary>Normalise path separators in a file path. For asset keys, see <see cref="AssertAndNormaliseAssetName"/> instead.</summary>
- /// <param name="path">The file path to normalise.</param>
+ /// <summary>Normalize path separators in a file path. For asset keys, see <see cref="AssertAndNormalizeAssetName"/> instead.</summary>
+ /// <param name="path">The file path to normalize.</param>
[Pure]
- public string NormalisePathSeparators(string path)
+ public string NormalizePathSeparators(string path)
{
- return this.Cache.NormalisePathSeparators(path);
+ return this.Cache.NormalizePathSeparators(path);
}
- /// <summary>Assert that the given key has a valid format and return a normalised form consistent with the underlying cache.</summary>
+ /// <summary>Assert that the given key has a valid format and return a normalized form consistent with the underlying cache.</summary>
/// <param name="assetName">The asset key to check.</param>
/// <exception cref="SContentLoadException">The asset key is empty or contains invalid characters.</exception>
[SuppressMessage("ReSharper", "ParameterOnlyUsedForPreconditionCheck.Local", Justification = "Parameter is only used for assertion checks by design.")]
- public string AssertAndNormaliseAssetName(string assetName)
+ public string AssertAndNormalizeAssetName(string assetName)
{
// NOTE: the game checks for ContentLoadException to handle invalid keys, so avoid
// throwing other types like ArgumentException here.
@@ -142,7 +142,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
if (assetName.Intersect(Path.GetInvalidPathChars()).Any())
throw new SContentLoadException("The asset key or local path contains invalid characters.");
- return this.Cache.NormaliseKey(assetName);
+ return this.Cache.NormalizeKey(assetName);
}
/****
@@ -165,8 +165,8 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="assetName">The asset path relative to the loader root directory, not including the <c>.xnb</c> extension.</param>
public bool IsLoaded(string assetName)
{
- assetName = this.Cache.NormaliseKey(assetName);
- return this.IsNormalisedKeyLoaded(assetName);
+ assetName = this.Cache.NormalizeKey(assetName);
+ return this.IsNormalizedKeyLoaded(assetName);
}
/// <summary>Get the cached asset keys.</summary>
@@ -248,7 +248,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
*********/
/// <summary>Load an asset file directly from the underlying content manager.</summary>
/// <typeparam name="T">The type of asset to load.</typeparam>
- /// <param name="assetName">The normalised asset key.</param>
+ /// <param name="assetName">The normalized asset key.</param>
/// <param name="useCache">Whether to read/write the loaded asset to the asset cache.</param>
protected virtual T RawLoad<T>(string assetName, bool useCache)
{
@@ -264,17 +264,17 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="language">The language code for which to inject the asset.</param>
protected virtual void Inject<T>(string assetName, T value, LanguageCode language)
{
- assetName = this.AssertAndNormaliseAssetName(assetName);
+ assetName = this.AssertAndNormalizeAssetName(assetName);
this.Cache[assetName] = value;
}
/// <summary>Parse a cache key into its component parts.</summary>
/// <param name="cacheKey">The input cache key.</param>
/// <param name="assetName">The original asset name.</param>
- /// <param name="localeCode">The asset locale code (or <c>null</c> if not localised).</param>
+ /// <param name="localeCode">The asset locale code (or <c>null</c> if not localized).</param>
protected void ParseCacheKey(string cacheKey, out string assetName, out string localeCode)
{
- // handle localised key
+ // handle localized key
if (!string.IsNullOrWhiteSpace(cacheKey))
{
int lastSepIndex = cacheKey.LastIndexOf(".", StringComparison.InvariantCulture);
@@ -296,8 +296,8 @@ namespace StardewModdingAPI.Framework.ContentManagers
}
/// <summary>Get whether an asset has already been loaded.</summary>
- /// <param name="normalisedAssetName">The normalised asset name.</param>
- protected abstract bool IsNormalisedKeyLoaded(string normalisedAssetName);
+ /// <param name="normalizedAssetName">The normalized asset name.</param>
+ protected abstract bool IsNormalizedKeyLoaded(string normalizedAssetName);
/// <summary>Get the locale codes (like <c>ja-JP</c>) used in asset keys.</summary>
private IDictionary<LanguageCode, string> GetKeyLocales()
diff --git a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
index 488ec245..c64e9ba9 100644
--- a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
@@ -26,8 +26,8 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <summary>Interceptors which edit matching assets after they're loaded.</summary>
private IDictionary<IModMetadata, IList<IAssetEditor>> Editors => this.Coordinator.Editors;
- /// <summary>A lookup which indicates whether the asset is localisable (i.e. the filename contains the locale), if previously loaded.</summary>
- private readonly IDictionary<string, bool> IsLocalisableLookup;
+ /// <summary>A lookup which indicates whether the asset is localizable (i.e. the filename contains the locale), if previously loaded.</summary>
+ private readonly IDictionary<string, bool> IsLocalizableLookup;
/// <summary>Whether the next load is the first for any game content manager.</summary>
private static bool IsFirstLoad = true;
@@ -43,7 +43,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="name">A name for the mod manager. Not guaranteed to be unique.</param>
/// <param name="serviceProvider">The service provider to use to locate services.</param>
/// <param name="rootDirectory">The root directory to search for content.</param>
- /// <param name="currentCulture">The current culture for which to localise content.</param>
+ /// <param name="currentCulture">The current culture for which to localize content.</param>
/// <param name="coordinator">The central coordinator which manages content managers.</param>
/// <param name="monitor">Encapsulates monitoring and logging.</param>
/// <param name="reflection">Simplifies access to private code.</param>
@@ -52,7 +52,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
public GameContentManager(string name, IServiceProvider serviceProvider, string rootDirectory, CultureInfo currentCulture, ContentCoordinator coordinator, IMonitor monitor, Reflector reflection, Action<BaseContentManager> onDisposing, Action onLoadingFirstAsset)
: base(name, serviceProvider, rootDirectory, currentCulture, coordinator, monitor, reflection, onDisposing, isNamespaced: false)
{
- this.IsLocalisableLookup = reflection.GetField<IDictionary<string, bool>>(this, "_localizedAsset").GetValue();
+ this.IsLocalizableLookup = reflection.GetField<IDictionary<string, bool>>(this, "_localizedAsset").GetValue();
this.OnLoadingFirstAsset = onLoadingFirstAsset;
}
@@ -70,8 +70,8 @@ namespace StardewModdingAPI.Framework.ContentManagers
this.OnLoadingFirstAsset();
}
- // normalise asset name
- assetName = this.AssertAndNormaliseAssetName(assetName);
+ // normalize asset name
+ assetName = this.AssertAndNormalizeAssetName(assetName);
if (this.TryParseExplicitLanguageAssetKey(assetName, out string newAssetName, out LanguageCode newLanguage))
return this.Load<T>(newAssetName, newLanguage, useCache);
@@ -101,10 +101,10 @@ namespace StardewModdingAPI.Framework.ContentManagers
data = this.AssetsBeingLoaded.Track(assetName, () =>
{
string locale = this.GetLocale(language);
- IAssetInfo info = new AssetInfo(locale, assetName, typeof(T), this.AssertAndNormaliseAssetName);
+ IAssetInfo info = new AssetInfo(locale, assetName, typeof(T), this.AssertAndNormalizeAssetName);
IAssetData asset =
this.ApplyLoader<T>(info)
- ?? new AssetDataForObject(info, this.RawLoad<T>(assetName, language, useCache), this.AssertAndNormaliseAssetName);
+ ?? new AssetDataForObject(info, this.RawLoad<T>(assetName, language, useCache), this.AssertAndNormalizeAssetName);
asset = this.ApplyEditors<T>(info, asset);
return (T)asset.Data;
});
@@ -122,7 +122,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
// find assets for which a translatable version was loaded
HashSet<string> removeAssetNames = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
- foreach (string key in this.IsLocalisableLookup.Where(p => p.Value).Select(p => p.Key))
+ foreach (string key in this.IsLocalizableLookup.Where(p => p.Value).Select(p => p.Key))
removeAssetNames.Add(this.TryParseExplicitLanguageAssetKey(key, out string assetName, out _) ? assetName : key);
// invalidate translatable assets
@@ -149,20 +149,20 @@ namespace StardewModdingAPI.Framework.ContentManagers
** Private methods
*********/
/// <summary>Get whether an asset has already been loaded.</summary>
- /// <param name="normalisedAssetName">The normalised asset name.</param>
- protected override bool IsNormalisedKeyLoaded(string normalisedAssetName)
+ /// <param name="normalizedAssetName">The normalized asset name.</param>
+ protected override bool IsNormalizedKeyLoaded(string normalizedAssetName)
{
// default English
- if (this.Language == LocalizedContentManager.LanguageCode.en || this.Coordinator.IsManagedAssetKey(normalisedAssetName))
- return this.Cache.ContainsKey(normalisedAssetName);
+ if (this.Language == LocalizedContentManager.LanguageCode.en || this.Coordinator.IsManagedAssetKey(normalizedAssetName))
+ return this.Cache.ContainsKey(normalizedAssetName);
// translated
- string keyWithLocale = $"{normalisedAssetName}.{this.GetLocale(this.GetCurrentLanguage())}";
- if (this.IsLocalisableLookup.TryGetValue(keyWithLocale, out bool localisable))
+ string keyWithLocale = $"{normalizedAssetName}.{this.GetLocale(this.GetCurrentLanguage())}";
+ if (this.IsLocalizableLookup.TryGetValue(keyWithLocale, out bool localizable))
{
- return localisable
+ return localizable
? this.Cache.ContainsKey(keyWithLocale)
- : this.Cache.ContainsKey(normalisedAssetName);
+ : this.Cache.ContainsKey(normalizedAssetName);
}
// not loaded yet
@@ -190,13 +190,13 @@ namespace StardewModdingAPI.Framework.ContentManagers
string keyWithLocale = $"{assetName}.{this.GetLocale(language)}";
if (this.Cache.ContainsKey(keyWithLocale))
{
- this.IsLocalisableLookup[assetName] = true;
- this.IsLocalisableLookup[keyWithLocale] = true;
+ this.IsLocalizableLookup[assetName] = true;
+ this.IsLocalizableLookup[keyWithLocale] = true;
}
else if (this.Cache.ContainsKey(assetName))
{
- this.IsLocalisableLookup[assetName] = false;
- this.IsLocalisableLookup[keyWithLocale] = false;
+ this.IsLocalizableLookup[assetName] = false;
+ this.IsLocalizableLookup[keyWithLocale] = false;
}
else
this.Monitor.Log($"Asset '{assetName}' could not be found in the cache immediately after injection.", LogLevel.Error);
@@ -204,7 +204,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <summary>Load an asset file directly from the underlying content manager.</summary>
/// <typeparam name="T">The type of asset to load.</typeparam>
- /// <param name="assetName">The normalised asset key.</param>
+ /// <param name="assetName">The normalized asset key.</param>
/// <param name="language">The language code for which to load content.</param>
/// <param name="useCache">Whether to read/write the loaded asset to the asset cache.</param>
/// <remarks>Derived from <see cref="LocalizedContentManager.Load{T}(string, LocalizedContentManager.LanguageCode)"/>.</remarks>
@@ -214,19 +214,19 @@ namespace StardewModdingAPI.Framework.ContentManagers
if (language != LocalizedContentManager.LanguageCode.en)
{
string translatedKey = $"{assetName}.{this.GetLocale(language)}";
- if (!this.IsLocalisableLookup.TryGetValue(translatedKey, out bool isTranslatable) || isTranslatable)
+ if (!this.IsLocalizableLookup.TryGetValue(translatedKey, out bool isTranslatable) || isTranslatable)
{
try
{
T obj = base.RawLoad<T>(translatedKey, useCache);
- this.IsLocalisableLookup[assetName] = true;
- this.IsLocalisableLookup[translatedKey] = true;
+ this.IsLocalizableLookup[assetName] = true;
+ this.IsLocalizableLookup[translatedKey] = true;
return obj;
}
catch (ContentLoadException)
{
- this.IsLocalisableLookup[assetName] = false;
- this.IsLocalisableLookup[translatedKey] = false;
+ this.IsLocalizableLookup[assetName] = false;
+ this.IsLocalizableLookup[translatedKey] = false;
}
}
}
@@ -313,7 +313,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
}
// return matched asset
- return new AssetDataForObject(info, data, this.AssertAndNormaliseAssetName);
+ return new AssetDataForObject(info, data, this.AssertAndNormalizeAssetName);
}
/// <summary>Apply any <see cref="Editors"/> to a loaded asset.</summary>
@@ -322,7 +322,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="asset">The loaded asset.</param>
private IAssetData ApplyEditors<T>(IAssetInfo info, IAssetData asset)
{
- IAssetData GetNewData(object data) => new AssetDataForObject(info, data, this.AssertAndNormaliseAssetName);
+ IAssetData GetNewData(object data) => new AssetDataForObject(info, data, this.AssertAndNormalizeAssetName);
// edit asset
foreach (var entry in this.GetInterceptors(this.Editors))
diff --git a/src/SMAPI/Framework/ContentManagers/IContentManager.cs b/src/SMAPI/Framework/ContentManagers/IContentManager.cs
index 78211821..12c01352 100644
--- a/src/SMAPI/Framework/ContentManagers/IContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/IContentManager.cs
@@ -39,15 +39,15 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <summary>Perform any cleanup needed when the locale changes.</summary>
void OnLocaleChanged();
- /// <summary>Normalise path separators in a file path. For asset keys, see <see cref="AssertAndNormaliseAssetName"/> instead.</summary>
- /// <param name="path">The file path to normalise.</param>
+ /// <summary>Normalize path separators in a file path. For asset keys, see <see cref="AssertAndNormalizeAssetName"/> instead.</summary>
+ /// <param name="path">The file path to normalize.</param>
[Pure]
- string NormalisePathSeparators(string path);
+ string NormalizePathSeparators(string path);
- /// <summary>Assert that the given key has a valid format and return a normalised form consistent with the underlying cache.</summary>
+ /// <summary>Assert that the given key has a valid format and return a normalized form consistent with the underlying cache.</summary>
/// <param name="assetName">The asset key to check.</param>
/// <exception cref="SContentLoadException">The asset key is empty or contains invalid characters.</exception>
- string AssertAndNormaliseAssetName(string assetName);
+ string AssertAndNormalizeAssetName(string assetName);
/// <summary>Get the current content locale.</summary>
string GetLocale();
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
index 34cabefc..b88bd71e 100644
--- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
@@ -7,7 +7,7 @@ using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI.Framework.Exceptions;
using StardewModdingAPI.Framework.Reflection;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
using xTile;
@@ -41,7 +41,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="gameContentManager">The game content manager used for map tilesheets not provided by the mod.</param>
/// <param name="serviceProvider">The service provider to use to locate services.</param>
/// <param name="rootDirectory">The root directory to search for content.</param>
- /// <param name="currentCulture">The current culture for which to localise content.</param>
+ /// <param name="currentCulture">The current culture for which to localize content.</param>
/// <param name="coordinator">The central coordinator which manages content managers.</param>
/// <param name="monitor">Encapsulates monitoring and logging.</param>
/// <param name="reflection">Simplifies access to private code.</param>
@@ -78,7 +78,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="useCache">Whether to read/write the loaded asset to the asset cache.</param>
public override T Load<T>(string assetName, LanguageCode language, bool useCache)
{
- assetName = this.AssertAndNormaliseAssetName(assetName);
+ assetName = this.AssertAndNormalizeAssetName(assetName);
// disable caching
// This is necessary to avoid assets being shared between content managers, which can
@@ -91,7 +91,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
// disable language handling
// Mod files don't support automatic translation logic, so this should never happen.
if (language != this.DefaultLanguage)
- throw new InvalidOperationException("Localised assets aren't supported by the mod content manager.");
+ throw new InvalidOperationException("Localized assets aren't supported by the mod content manager.");
// resolve managed asset key
{
@@ -121,7 +121,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
T data = this.RawLoad<T>(assetName, useCache: false);
if (data is Map map)
{
- this.NormaliseTilesheetPaths(map);
+ this.NormalizeTilesheetPaths(map);
this.FixCustomTilesheetPaths(map, relativeMapPath: assetName);
}
return data;
@@ -161,7 +161,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
// fetch & cache
FormatManager formatManager = FormatManager.Instance;
Map map = formatManager.LoadMap(file.FullName);
- this.NormaliseTilesheetPaths(map);
+ this.NormalizeTilesheetPaths(map);
this.FixCustomTilesheetPaths(map, relativeMapPath: assetName);
return (T)(object)map;
}
@@ -199,10 +199,10 @@ namespace StardewModdingAPI.Framework.ContentManagers
** Private methods
*********/
/// <summary>Get whether an asset has already been loaded.</summary>
- /// <param name="normalisedAssetName">The normalised asset name.</param>
- protected override bool IsNormalisedKeyLoaded(string normalisedAssetName)
+ /// <param name="normalizedAssetName">The normalized asset name.</param>
+ protected override bool IsNormalizedKeyLoaded(string normalizedAssetName)
{
- return this.Cache.ContainsKey(normalisedAssetName);
+ return this.Cache.ContainsKey(normalizedAssetName);
}
/// <summary>Get a file from the mod folder.</summary>
@@ -245,12 +245,12 @@ namespace StardewModdingAPI.Framework.ContentManagers
return texture;
}
- /// <summary>Normalise map tilesheet paths for the current platform.</summary>
+ /// <summary>Normalize map tilesheet paths for the current platform.</summary>
/// <param name="map">The map whose tilesheets to fix.</param>
- private void NormaliseTilesheetPaths(Map map)
+ private void NormalizeTilesheetPaths(Map map)
{
foreach (TileSheet tilesheet in map.TileSheets)
- tilesheet.ImageSource = this.NormalisePathSeparators(tilesheet.ImageSource);
+ tilesheet.ImageSource = this.NormalizePathSeparators(tilesheet.ImageSource);
}
/// <summary>Fix custom map tilesheet paths so they can be found by the content manager.</summary>
@@ -258,7 +258,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <param name="relativeMapPath">The relative map path within the mod folder.</param>
/// <exception cref="ContentLoadException">A map tilesheet couldn't be resolved.</exception>
/// <remarks>
- /// The game's logic for tilesheets in <see cref="Game1.setGraphicsForSeason"/> is a bit specialised. It boils
+ /// The game's logic for tilesheets in <see cref="Game1.setGraphicsForSeason"/> is a bit specialized. It boils
/// down to this:
/// * If the location is indoors or the desert, or the image source contains 'path' or 'object', it's loaded
/// as-is relative to the <c>Content</c> folder.
@@ -276,7 +276,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
// get map info
if (!map.TileSheets.Any())
return;
- relativeMapPath = this.AssertAndNormaliseAssetName(relativeMapPath); // Mono's Path.GetDirectoryName doesn't handle Windows dir separators
+ relativeMapPath = this.AssertAndNormalizeAssetName(relativeMapPath); // Mono's Path.GetDirectoryName doesn't handle Windows dir separators
string relativeMapFolder = Path.GetDirectoryName(relativeMapPath) ?? ""; // folder path containing the map, relative to the mod folder
bool isOutdoors = map.Properties.TryGetValue("Outdoors", out PropertyValue outdoorsProperty) && outdoorsProperty != null;
diff --git a/src/SMAPI/Framework/ContentPack.cs b/src/SMAPI/Framework/ContentPack.cs
index 829a7dc1..9c0bb9d1 100644
--- a/src/SMAPI/Framework/ContentPack.cs
+++ b/src/SMAPI/Framework/ContentPack.cs
@@ -2,7 +2,7 @@ using System;
using System.IO;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewModdingAPI.Toolkit.Utilities;
using xTile;
@@ -63,14 +63,14 @@ namespace StardewModdingAPI.Framework
/// <summary>Read a JSON file from the content pack folder.</summary>
/// <typeparam name="TModel">The model type.</typeparam>
- /// <param name="path">The file path relative to the contnet directory.</param>
- /// <returns>Returns the deserialised model, or <c>null</c> if the file doesn't exist or is empty.</returns>
+ /// <param name="path">The file path relative to the content directory.</param>
+ /// <returns>Returns the deserialized model, or <c>null</c> if the file doesn't exist or is empty.</returns>
/// <exception cref="InvalidOperationException">The <paramref name="path"/> is not relative or contains directory climbing (../).</exception>
public TModel ReadJsonFile<TModel>(string path) where TModel : class
{
this.AssertRelativePath(path, nameof(this.ReadJsonFile));
- path = Path.Combine(this.DirectoryPath, PathUtilities.NormalisePathSeparators(path));
+ path = Path.Combine(this.DirectoryPath, PathUtilities.NormalizePathSeparators(path));
return this.JsonHelper.ReadJsonFileIfExists(path, out TModel model)
? model
: null;
@@ -85,7 +85,7 @@ namespace StardewModdingAPI.Framework
{
this.AssertRelativePath(path, nameof(this.WriteJsonFile));
- path = Path.Combine(this.DirectoryPath, PathUtilities.NormalisePathSeparators(path));
+ path = Path.Combine(this.DirectoryPath, PathUtilities.NormalizePathSeparators(path));
this.JsonHelper.WriteJsonFile(path, data);
}
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs
index 23879f1d..18b00f69 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -73,7 +73,7 @@ namespace StardewModdingAPI.Framework.Events
/// <summary>Raised after the game finishes writing data to the save file (except the initial save creation).</summary>
public readonly ManagedEvent<SavedEventArgs> Saved;
- /// <summary>Raised after the player loads a save slot and the world is initialised.</summary>
+ /// <summary>Raised after the player loads a save slot and the world is initialized.</summary>
public readonly ManagedEvent<SaveLoadedEventArgs> SaveLoaded;
/// <summary>Raised after the game begins a new day, including when loading a save.</summary>
@@ -152,15 +152,15 @@ namespace StardewModdingAPI.Framework.Events
public readonly ManagedEvent<TerrainFeatureListChangedEventArgs> TerrainFeatureListChanged;
/****
- ** Specialised
+ ** Specialized
****/
- /// <summary>Raised when the low-level stage in the game's loading process has changed. See notes on <see cref="ISpecialisedEvents.LoadStageChanged"/>.</summary>
+ /// <summary>Raised when the low-level stage in the game's loading process has changed. See notes on <see cref="ISpecializedEvents.LoadStageChanged"/>.</summary>
public readonly ManagedEvent<LoadStageChangedEventArgs> LoadStageChanged;
- /// <summary>Raised before the game performs its overall update tick (≈60 times per second). See notes on <see cref="ISpecialisedEvents.UnvalidatedUpdateTicking"/>.</summary>
+ /// <summary>Raised before the game performs its overall update tick (≈60 times per second). See notes on <see cref="ISpecializedEvents.UnvalidatedUpdateTicking"/>.</summary>
public readonly ManagedEvent<UnvalidatedUpdateTickingEventArgs> UnvalidatedUpdateTicking;
- /// <summary>Raised after the game performs its overall update tick (≈60 times per second). See notes on <see cref="ISpecialisedEvents.UnvalidatedUpdateTicked"/>.</summary>
+ /// <summary>Raised after the game performs its overall update tick (≈60 times per second). See notes on <see cref="ISpecializedEvents.UnvalidatedUpdateTicked"/>.</summary>
public readonly ManagedEvent<UnvalidatedUpdateTickedEventArgs> UnvalidatedUpdateTicked;
@@ -172,7 +172,7 @@ namespace StardewModdingAPI.Framework.Events
/// <param name="modRegistry">The mod registry with which to identify mods.</param>
public EventManager(IMonitor monitor, ModRegistry modRegistry)
{
- // create shortcut initialisers
+ // create shortcut initializers
ManagedEvent<TEventArgs> ManageEventOf<TEventArgs>(string typeName, string eventName) => new ManagedEvent<TEventArgs>($"{typeName}.{eventName}", monitor, modRegistry);
// init events (new)
@@ -223,9 +223,9 @@ namespace StardewModdingAPI.Framework.Events
this.ObjectListChanged = ManageEventOf<ObjectListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.ObjectListChanged));
this.TerrainFeatureListChanged = ManageEventOf<TerrainFeatureListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.TerrainFeatureListChanged));
- this.LoadStageChanged = ManageEventOf<LoadStageChangedEventArgs>(nameof(IModEvents.Specialised), nameof(ISpecialisedEvents.LoadStageChanged));
- this.UnvalidatedUpdateTicking = ManageEventOf<UnvalidatedUpdateTickingEventArgs>(nameof(IModEvents.Specialised), nameof(ISpecialisedEvents.UnvalidatedUpdateTicking));
- this.UnvalidatedUpdateTicked = ManageEventOf<UnvalidatedUpdateTickedEventArgs>(nameof(IModEvents.Specialised), nameof(ISpecialisedEvents.UnvalidatedUpdateTicked));
+ this.LoadStageChanged = ManageEventOf<LoadStageChangedEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.LoadStageChanged));
+ this.UnvalidatedUpdateTicking = ManageEventOf<UnvalidatedUpdateTickingEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.UnvalidatedUpdateTicking));
+ this.UnvalidatedUpdateTicked = ManageEventOf<UnvalidatedUpdateTickedEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.UnvalidatedUpdateTicked));
}
}
}
diff --git a/src/SMAPI/Framework/Events/ModEvents.cs b/src/SMAPI/Framework/Events/ModEvents.cs
index 8ad3936c..1d1c92c6 100644
--- a/src/SMAPI/Framework/Events/ModEvents.cs
+++ b/src/SMAPI/Framework/Events/ModEvents.cs
@@ -26,8 +26,8 @@ namespace StardewModdingAPI.Framework.Events
/// <summary>Events raised when something changes in the world.</summary>
public IWorldEvents World { get; }
- /// <summary>Events serving specialised edge cases that shouldn't be used by most mods.</summary>
- public ISpecialisedEvents Specialised { get; }
+ /// <summary>Events serving specialized edge cases that shouldn't be used by most mods.</summary>
+ public ISpecializedEvents Specialized { get; }
/*********
@@ -44,7 +44,7 @@ namespace StardewModdingAPI.Framework.Events
this.Multiplayer = new ModMultiplayerEvents(mod, eventManager);
this.Player = new ModPlayerEvents(mod, eventManager);
this.World = new ModWorldEvents(mod, eventManager);
- this.Specialised = new ModSpecialisedEvents(mod, eventManager);
+ this.Specialized = new ModSpecializedEvents(mod, eventManager);
}
}
}
diff --git a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
index 0177c22e..c15460fa 100644
--- a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
+++ b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
@@ -72,7 +72,7 @@ namespace StardewModdingAPI.Framework.Events
remove => this.EventManager.Saved.Remove(value);
}
- /// <summary>Raised after the player loads a save slot and the world is initialised.</summary>
+ /// <summary>Raised after the player loads a save slot and the world is initialized.</summary>
public event EventHandler<SaveLoadedEventArgs> SaveLoaded
{
add => this.EventManager.SaveLoaded.Add(value);
diff --git a/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs b/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
index 7c3e9dee..9388bdb2 100644
--- a/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
+++ b/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
@@ -3,8 +3,8 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events serving specialised edge cases that shouldn't be used by most mods.</summary>
- internal class ModSpecialisedEvents : ModEventsBase, ISpecialisedEvents
+ /// <summary>Events serving specialized edge cases that shouldn't be used by most mods.</summary>
+ internal class ModSpecializedEvents : ModEventsBase, ISpecializedEvents
{
/*********
** Accessors
@@ -37,7 +37,7 @@ namespace StardewModdingAPI.Framework.Events
/// <summary>Construct an instance.</summary>
/// <param name="mod">The mod which uses this instance.</param>
/// <param name="eventManager">The underlying event manager.</param>
- internal ModSpecialisedEvents(IModMetadata mod, EventManager eventManager)
+ internal ModSpecializedEvents(IModMetadata mod, EventManager eventManager)
: base(mod, eventManager) { }
}
}
diff --git a/src/SMAPI/Framework/GameVersion.cs b/src/SMAPI/Framework/GameVersion.cs
index 261de374..b9ef12c8 100644
--- a/src/SMAPI/Framework/GameVersion.cs
+++ b/src/SMAPI/Framework/GameVersion.cs
@@ -18,7 +18,7 @@ namespace StardewModdingAPI.Framework
["1.04"] = "1.0.4",
["1.05"] = "1.0.5",
["1.051"] = "1.0.6-prerelease1", // not a very good mapping, but good enough for SMAPI's purposes.
- ["1.051b"] = "1.0.6-prelease2",
+ ["1.051b"] = "1.0.6-prerelease2",
["1.06"] = "1.0.6",
["1.07"] = "1.0.7",
["1.07a"] = "1.0.8-prerelease1",
diff --git a/src/SMAPI/Framework/InternalExtensions.cs b/src/SMAPI/Framework/InternalExtensions.cs
index f52bfe2b..c3155b1c 100644
--- a/src/SMAPI/Framework/InternalExtensions.cs
+++ b/src/SMAPI/Framework/InternalExtensions.cs
@@ -55,7 +55,7 @@ namespace StardewModdingAPI.Framework
** Exceptions
****/
/// <summary>Get a string representation of an exception suitable for writing to the error log.</summary>
- /// <param name="exception">The error to summarise.</param>
+ /// <param name="exception">The error to summarize.</param>
public static string GetLogSummary(this Exception exception)
{
switch (exception)
diff --git a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
index 15b164b1..043ae376 100644
--- a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
@@ -87,7 +87,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
{
try
{
- this.AssertAndNormaliseAssetName(key);
+ this.AssertAndNormalizeAssetName(key);
switch (source)
{
case ContentSource.GameContent:
@@ -106,12 +106,12 @@ namespace StardewModdingAPI.Framework.ModHelpers
}
}
- /// <summary>Normalise an asset name so it's consistent with those generated by the game. This is mainly useful for string comparisons like <see cref="string.StartsWith(string)"/> on generated asset names, and isn't necessary when passing asset names into other content helper methods.</summary>
+ /// <summary>Normalize an asset name so it's consistent with those generated by the game. This is mainly useful for string comparisons like <see cref="string.StartsWith(string)"/> on generated asset names, and isn't necessary when passing asset names into other content helper methods.</summary>
/// <param name="assetName">The asset key.</param>
[Pure]
- public string NormaliseAssetName(string assetName)
+ public string NormalizeAssetName(string assetName)
{
- return this.ModContentManager.AssertAndNormaliseAssetName(assetName);
+ return this.ModContentManager.AssertAndNormalizeAssetName(assetName);
}
/// <summary>Get the underlying key in the game's content cache for an asset. This can be used to load custom map tilesheets, but should be avoided when you can use the content API instead. This does not validate whether the asset exists.</summary>
@@ -123,7 +123,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
switch (source)
{
case ContentSource.GameContent:
- return this.GameContentManager.AssertAndNormaliseAssetName(key);
+ return this.GameContentManager.AssertAndNormalizeAssetName(key);
case ContentSource.ModFolder:
return this.ModContentManager.GetInternalAssetKey(key);
@@ -170,9 +170,9 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <param name="key">The asset key to check.</param>
/// <exception cref="ArgumentException">The asset key is empty or contains invalid characters.</exception>
[SuppressMessage("ReSharper", "ParameterOnlyUsedForPreconditionCheck.Local", Justification = "Parameter is only used for assertion checks by design.")]
- private void AssertAndNormaliseAssetName(string key)
+ private void AssertAndNormalizeAssetName(string key)
{
- this.ModContentManager.AssertAndNormaliseAssetName(key);
+ this.ModContentManager.AssertAndNormalizeAssetName(key);
if (Path.IsPathRooted(key))
throw new ArgumentException("The asset key must not be an absolute path.");
}
diff --git a/src/SMAPI/Framework/ModHelpers/ContentPackHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentPackHelper.cs
index 34f24d65..acdd82a0 100644
--- a/src/SMAPI/Framework/ModHelpers/ContentPackHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ContentPackHelper.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
-using StardewModdingAPI.Toolkit.Serialisation.Models;
+using StardewModdingAPI.Toolkit.Serialization.Models;
namespace StardewModdingAPI.Framework.ModHelpers
{
@@ -38,7 +38,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
return this.ContentPacks.Value;
}
- /// <summary>Create a temporary content pack to read files from a directory, using randomised manifest fields. This will generate fake manifest data; any <c>manifest.json</c> in the directory will be ignored. Temporary content packs will not appear in the SMAPI log and update checks will not be performed.</summary>
+ /// <summary>Create a temporary content pack to read files from a directory, using randomized manifest fields. This will generate fake manifest data; any <c>manifest.json</c> in the directory will be ignored. Temporary content packs will not appear in the SMAPI log and update checks will not be performed.</summary>
/// <param name="directoryPath">The absolute directory path containing the content pack files.</param>
public IContentPack CreateFake(string directoryPath)
{
diff --git a/src/SMAPI/Framework/ModHelpers/DataHelper.cs b/src/SMAPI/Framework/ModHelpers/DataHelper.cs
index 3b5c1752..cc08c42b 100644
--- a/src/SMAPI/Framework/ModHelpers/DataHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/DataHelper.cs
@@ -1,7 +1,7 @@
using System;
using System.IO;
using Newtonsoft.Json;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
@@ -40,14 +40,14 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <summary>Read data from a JSON file in the mod's folder.</summary>
/// <typeparam name="TModel">The model type. This should be a plain class that has public properties for the data you want. The properties can be complex types.</typeparam>
/// <param name="path">The file path relative to the mod folder.</param>
- /// <returns>Returns the deserialised model, or <c>null</c> if the file doesn't exist or is empty.</returns>
+ /// <returns>Returns the deserialized model, or <c>null</c> if the file doesn't exist or is empty.</returns>
/// <exception cref="InvalidOperationException">The <paramref name="path"/> is not relative or contains directory climbing (../).</exception>
public TModel ReadJsonFile<TModel>(string path) where TModel : class
{
if (!PathUtilities.IsSafeRelativePath(path))
throw new InvalidOperationException($"You must call {nameof(IModHelper.Data)}.{nameof(this.ReadJsonFile)} with a relative path.");
- path = Path.Combine(this.ModFolderPath, PathUtilities.NormalisePathSeparators(path));
+ path = Path.Combine(this.ModFolderPath, PathUtilities.NormalizePathSeparators(path));
return this.JsonHelper.ReadJsonFileIfExists(path, out TModel data)
? data
: null;
@@ -63,7 +63,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
if (!PathUtilities.IsSafeRelativePath(path))
throw new InvalidOperationException($"You must call {nameof(IMod.Helper)}.{nameof(IModHelper.Data)}.{nameof(this.WriteJsonFile)} with a relative path (without directory climbing).");
- path = Path.Combine(this.ModFolderPath, PathUtilities.NormalisePathSeparators(path));
+ path = Path.Combine(this.ModFolderPath, PathUtilities.NormalizePathSeparators(path));
this.JsonHelper.WriteJsonFile(path, data);
}
@@ -83,7 +83,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
throw new InvalidOperationException($"Can't use {nameof(IMod.Helper)}.{nameof(IModHelper.Data)}.{nameof(this.ReadSaveData)} because this isn't the main player. (Save files are stored on the main player's computer.)");
return Game1.CustomData.TryGetValue(this.GetSaveFileKey(key), out string value)
- ? this.JsonHelper.Deserialise<TModel>(value)
+ ? this.JsonHelper.Deserialize<TModel>(value)
: null;
}
@@ -101,7 +101,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
string internalKey = this.GetSaveFileKey(key);
if (data != null)
- Game1.CustomData[internalKey] = this.JsonHelper.Serialise(data, Formatting.None);
+ Game1.CustomData[internalKey] = this.JsonHelper.Serialize(data, Formatting.None);
else
Game1.CustomData.Remove(internalKey);
}
diff --git a/src/SMAPI/Framework/ModHelpers/ModHelper.cs b/src/SMAPI/Framework/ModHelpers/ModHelper.cs
index 86e8eb28..25401e23 100644
--- a/src/SMAPI/Framework/ModHelpers/ModHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ModHelper.cs
@@ -2,7 +2,7 @@ using System;
using System.IO;
using StardewModdingAPI.Events;
using StardewModdingAPI.Framework.Input;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
namespace StardewModdingAPI.Framework.ModHelpers
{
@@ -73,7 +73,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
if (!Directory.Exists(modDirectory))
throw new InvalidOperationException("The specified mod directory does not exist.");
- // initialise
+ // initialize
this.DirectoryPath = modDirectory;
this.Content = contentHelper ?? throw new ArgumentNullException(nameof(contentHelper));
this.ContentPacks = contentPackHelper ?? throw new ArgumentNullException(nameof(contentPackHelper));
diff --git a/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs b/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs
index 8330e078..24bed3bb 100644
--- a/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs
@@ -75,9 +75,9 @@ namespace StardewModdingAPI.Framework.ModHelpers
public TInterface GetApi<TInterface>(string uniqueID) where TInterface : class
{
// validate
- if (!this.Registry.AreAllModsInitialised)
+ if (!this.Registry.AreAllModsInitialized)
{
- this.Monitor.Log("Tried to access a mod-provided API before all mods were initialised.", LogLevel.Error);
+ this.Monitor.Log("Tried to access a mod-provided API before all mods were initialized.", LogLevel.Error);
return null;
}
if (!typeof(TInterface).IsInterface)
diff --git a/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs
index 0ce72a9e..86c327ed 100644
--- a/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs
@@ -5,7 +5,7 @@ using StardewModdingAPI.Framework.Reflection;
namespace StardewModdingAPI.Framework.ModHelpers
{
/// <summary>Provides helper methods for accessing private game code.</summary>
- /// <remarks>This implementation searches up the type hierarchy, and caches the reflected fields and methods with a sliding expiry (to optimise performance without unnecessary memory usage).</remarks>
+ /// <remarks>This implementation searches up the type hierarchy, and caches the reflected fields and methods with a sliding expiry (to optimize performance without unnecessary memory usage).</remarks>
internal class ReflectionHelper : BaseHelper, IReflectionHelper
{
/*********
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
index 8dfacc33..7670eb3a 100644
--- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
+++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
@@ -317,7 +317,7 @@ namespace StardewModdingAPI.Framework.ModLoading
}
/// <summary>Process the result from an instruction handler.</summary>
- /// <param name="mod">The mod being analysed.</param>
+ /// <param name="mod">The mod being analyzed.</param>
/// <param name="handler">The instruction handler.</param>
/// <param name="result">The result returned by the handler.</param>
/// <param name="loggedMessages">The messages already logged for the current mod.</param>
@@ -341,9 +341,9 @@ namespace StardewModdingAPI.Framework.ModLoading
mod.SetWarning(ModWarning.PatchesGame);
break;
- case InstructionHandleResult.DetectedSaveSerialiser:
- this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Detected possible save serialiser change ({handler.NounPhrase}) in assembly {filename}.");
- mod.SetWarning(ModWarning.ChangesSaveSerialiser);
+ case InstructionHandleResult.DetectedSaveSerializer:
+ this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Detected possible save serializer change ({handler.NounPhrase}) in assembly {filename}.");
+ mod.SetWarning(ModWarning.ChangesSaveSerializer);
break;
case InstructionHandleResult.DetectedUnvalidatedUpdateTick:
@@ -370,7 +370,7 @@ namespace StardewModdingAPI.Framework.ModLoading
break;
default:
- throw new NotSupportedException($"Unrecognised instruction handler result '{result}'.");
+ throw new NotSupportedException($"Unrecognized instruction handler result '{result}'.");
}
}
diff --git a/src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs b/src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs
index 79045241..701b15f2 100644
--- a/src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs
+++ b/src/SMAPI/Framework/ModLoading/Finders/TypeFinder.cs
@@ -73,7 +73,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Finders
** Protected methods
*********/
/// <summary>Get whether a CIL instruction matches.</summary>
- /// <param name="method">The method deifnition.</param>
+ /// <param name="method">The method definition.</param>
protected bool IsMatch(MethodDefinition method)
{
if (this.IsMatch(method.ReturnType))
diff --git a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs
index 6592760e..d93b603d 100644
--- a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs
+++ b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs
@@ -18,12 +18,12 @@ namespace StardewModdingAPI.Framework.ModLoading
DetectedGamePatch,
/// <summary>The instruction is compatible, but affects the save serializer in a way that may make saves unloadable without the mod.</summary>
- DetectedSaveSerialiser,
+ DetectedSaveSerializer,
/// <summary>The instruction is compatible, but uses the <c>dynamic</c> keyword which won't work on Linux/Mac.</summary>
DetectedDynamic,
- /// <summary>The instruction is compatible, but references <see cref="ISpecialisedEvents.UnvalidatedUpdateTicking"/> or <see cref="ISpecialisedEvents.UnvalidatedUpdateTicked"/> which may impact stability.</summary>
+ /// <summary>The instruction is compatible, but references <see cref="ISpecializedEvents.UnvalidatedUpdateTicking"/> or <see cref="ISpecializedEvents.UnvalidatedUpdateTicked"/> which may impact stability.</summary>
DetectedUnvalidatedUpdateTick,
/// <summary>The instruction accesses the filesystem directly.</summary>
diff --git a/src/SMAPI/Framework/ModLoading/ModDependencyStatus.cs b/src/SMAPI/Framework/ModLoading/ModDependencyStatus.cs
index 0774b487..dd855d2f 100644
--- a/src/SMAPI/Framework/ModLoading/ModDependencyStatus.cs
+++ b/src/SMAPI/Framework/ModLoading/ModDependencyStatus.cs
@@ -1,4 +1,4 @@
-namespace StardewModdingAPI.Framework.ModLoading
+namespace StardewModdingAPI.Framework.ModLoading
{
/// <summary>The status of a given mod in the dependency-sorting algorithm.</summary>
internal enum ModDependencyStatus
@@ -6,7 +6,7 @@
/// <summary>The mod hasn't been visited yet.</summary>
Queued,
- /// <summary>The mod is currently being analysed as part of a dependency chain.</summary>
+ /// <summary>The mod is currently being analyzed as part of a dependency chain.</summary>
Checking,
/// <summary>The mod has already been sorted.</summary>
diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs
index 20941a5f..5ea21710 100644
--- a/src/SMAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs
@@ -5,7 +5,7 @@ using System.Linq;
using StardewModdingAPI.Toolkit;
using StardewModdingAPI.Toolkit.Framework.ModData;
using StardewModdingAPI.Toolkit.Framework.ModScanning;
-using StardewModdingAPI.Toolkit.Serialisation.Models;
+using StardewModdingAPI.Toolkit.Serialization.Models;
using StardewModdingAPI.Toolkit.Utilities;
namespace StardewModdingAPI.Framework.ModLoading
@@ -143,11 +143,11 @@ namespace StardewModdingAPI.Framework.ModLoading
continue;
}
- // invalid capitalisation
+ // invalid capitalization
string actualFilename = new DirectoryInfo(mod.DirectoryPath).GetFiles(mod.Manifest.EntryDll).FirstOrDefault()?.Name;
if (actualFilename != mod.Manifest.EntryDll)
{
- mod.SetStatus(ModMetadataStatus.Failed, $"its {nameof(IManifest.EntryDll)} value '{mod.Manifest.EntryDll}' doesn't match the actual file capitalisation '{actualFilename}'. The capitalisation must match for crossplatform compatibility.");
+ mod.SetStatus(ModMetadataStatus.Failed, $"its {nameof(IManifest.EntryDll)} value '{mod.Manifest.EntryDll}' doesn't match the actual file capitalization '{actualFilename}'. The capitalization must match for crossplatform compatibility.");
continue;
}
}
@@ -216,7 +216,7 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <param name="modDatabase">Handles access to SMAPI's internal mod metadata list.</param>
public IEnumerable<IModMetadata> ProcessDependencies(IEnumerable<IModMetadata> mods, ModDatabase modDatabase)
{
- // initialise metadata
+ // initialize metadata
mods = mods.ToArray();
var sortedMods = new Stack<IModMetadata>();
var states = mods.ToDictionary(mod => mod, mod => ModDependencyStatus.Queued);
diff --git a/src/SMAPI/Framework/ModLoading/TypeReferenceComparer.cs b/src/SMAPI/Framework/ModLoading/TypeReferenceComparer.cs
index f7497789..a4ac54e2 100644
--- a/src/SMAPI/Framework/ModLoading/TypeReferenceComparer.cs
+++ b/src/SMAPI/Framework/ModLoading/TypeReferenceComparer.cs
@@ -54,7 +54,7 @@ namespace StardewModdingAPI.Framework.ModLoading
{
bool HeuristicallyEquals(string typeNameA, string typeNameB, IDictionary<string, string> tokenMap)
{
- // analyse type names
+ // analyze type names
bool hasTokensA = typeNameA.Contains("!");
bool hasTokensB = typeNameB.Contains("!");
bool isTokenA = hasTokensA && typeNameA[0] == '!';
diff --git a/src/SMAPI/Framework/ModRegistry.cs b/src/SMAPI/Framework/ModRegistry.cs
index 5be33cb4..ef389337 100644
--- a/src/SMAPI/Framework/ModRegistry.cs
+++ b/src/SMAPI/Framework/ModRegistry.cs
@@ -21,8 +21,8 @@ namespace StardewModdingAPI.Framework
/// <summary>Whether all mod assemblies have been loaded.</summary>
public bool AreAllModsLoaded { get; set; }
- /// <summary>Whether all mods have been initialised and their <see cref="IMod.Entry"/> method called.</summary>
- public bool AreAllModsInitialised { get; set; }
+ /// <summary>Whether all mods have been initialized and their <see cref="IMod.Entry"/> method called.</summary>
+ public bool AreAllModsInitialized { get; set; }
/*********
@@ -62,7 +62,7 @@ namespace StardewModdingAPI.Framework
/// <returns>Returns the matching mod's metadata, or <c>null</c> if not found.</returns>
public IModMetadata Get(string uniqueID)
{
- // normalise search ID
+ // normalize search ID
if (string.IsNullOrWhiteSpace(uniqueID))
return null;
uniqueID = uniqueID.Trim();
diff --git a/src/SMAPI/Framework/Monitor.cs b/src/SMAPI/Framework/Monitor.cs
index 3771f114..1fa55a9e 100644
--- a/src/SMAPI/Framework/Monitor.cs
+++ b/src/SMAPI/Framework/Monitor.cs
@@ -58,7 +58,7 @@ namespace StardewModdingAPI.Framework
if (string.IsNullOrWhiteSpace(source))
throw new ArgumentException("The log source cannot be empty.");
- // initialise
+ // initialize
this.Source = source;
this.LogFile = logFile ?? throw new ArgumentNullException(nameof(logFile), "The log file manager cannot be null.");
this.ConsoleWriter = new ColorfulConsoleWriter(Constants.Platform, colorScheme);
diff --git a/src/SMAPI/Framework/Networking/MessageType.cs b/src/SMAPI/Framework/Networking/MessageType.cs
index bd9acfa9..4e1388ca 100644
--- a/src/SMAPI/Framework/Networking/MessageType.cs
+++ b/src/SMAPI/Framework/Networking/MessageType.cs
@@ -2,7 +2,7 @@ using StardewValley;
namespace StardewModdingAPI.Framework.Networking
{
- /// <summary>Network message types recognised by SMAPI and Stardew Valley.</summary>
+ /// <summary>Network message types recognized by SMAPI and Stardew Valley.</summary>
internal enum MessageType : byte
{
/*********
diff --git a/src/SMAPI/Framework/Reflection/Reflector.cs b/src/SMAPI/Framework/Reflection/Reflector.cs
index ed1a4381..d4904878 100644
--- a/src/SMAPI/Framework/Reflection/Reflector.cs
+++ b/src/SMAPI/Framework/Reflection/Reflector.cs
@@ -6,7 +6,7 @@ using System.Runtime.Caching;
namespace StardewModdingAPI.Framework.Reflection
{
/// <summary>Provides helper methods for accessing inaccessible code.</summary>
- /// <remarks>This implementation searches up the type hierarchy, and caches the reflected fields and methods with a sliding expiry (to optimise performance without unnecessary memory usage).</remarks>
+ /// <remarks>This implementation searches up the type hierarchy, and caches the reflected fields and methods with a sliding expiry (to optimize performance without unnecessary memory usage).</remarks>
internal class Reflector
{
/*********
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index 0aae3b84..c5dede01 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -24,13 +24,13 @@ using StardewModdingAPI.Framework.ModHelpers;
using StardewModdingAPI.Framework.ModLoading;
using StardewModdingAPI.Framework.Patching;
using StardewModdingAPI.Framework.Reflection;
-using StardewModdingAPI.Framework.Serialisation;
+using StardewModdingAPI.Framework.Serialization;
using StardewModdingAPI.Internal;
using StardewModdingAPI.Patches;
using StardewModdingAPI.Toolkit;
using StardewModdingAPI.Toolkit.Framework.Clients.WebApi;
using StardewModdingAPI.Toolkit.Framework.ModData;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
using Object = StardewValley.Object;
@@ -38,7 +38,7 @@ using ThreadState = System.Threading.ThreadState;
namespace StardewModdingAPI.Framework
{
- /// <summary>The core class which initialises and manages SMAPI.</summary>
+ /// <summary>The core class which initializes and manages SMAPI.</summary>
internal class SCore : IDisposable
{
/*********
@@ -56,7 +56,7 @@ namespace StardewModdingAPI.Framework
/// <summary>The core logger and monitor on behalf of the game.</summary>
private readonly Monitor MonitorForGame;
- /// <summary>Tracks whether the game should exit immediately and any pending initialisation should be cancelled.</summary>
+ /// <summary>Tracks whether the game should exit immediately and any pending initialization should be cancelled.</summary>
private readonly CancellationTokenSource CancellationToken = new CancellationTokenSource();
/// <summary>Simplifies access to private game code.</summary>
@@ -72,7 +72,7 @@ namespace StardewModdingAPI.Framework
private ContentCoordinator ContentCore => this.GameInstance.ContentCore;
/// <summary>Tracks the installed mods.</summary>
- /// <remarks>This is initialised after the game starts.</remarks>
+ /// <remarks>This is initialized after the game starts.</remarks>
private readonly ModRegistry ModRegistry = new ModRegistry();
/// <summary>Manages SMAPI events for mods.</summary>
@@ -120,7 +120,7 @@ namespace StardewModdingAPI.Framework
** Accessors
*********/
/// <summary>Manages deprecation warnings.</summary>
- /// <remarks>This is initialised after the game starts. This is accessed directly because it's not part of the normal class model.</remarks>
+ /// <remarks>This is initialized after the game starts. This is accessed directly because it's not part of the normal class model.</remarks>
internal static DeprecationManager DeprecationManager { get; private set; }
@@ -187,7 +187,7 @@ namespace StardewModdingAPI.Framework
[HandleProcessCorruptedStateExceptions, SecurityCritical] // let try..catch handle corrupted state exceptions
public void RunInteractively()
{
- // initialise SMAPI
+ // initialize SMAPI
try
{
JsonConverter[] converters = {
@@ -205,14 +205,14 @@ namespace StardewModdingAPI.Framework
#endif
AppDomain.CurrentDomain.UnhandledException += (sender, e) => this.Monitor.Log($"Critical app domain exception: {e.ExceptionObject}", LogLevel.Error);
- // add more leniant assembly resolvers
+ // add more lenient assembly resolvers
AppDomain.CurrentDomain.AssemblyResolve += (sender, e) => AssemblyLoader.ResolveAssembly(e.Name);
// hook locale event
LocalizedContentManager.OnLanguageChange += locale => this.OnLocaleChanged();
// override game
- SGame.ConstructorHack = new SGameConstructorHack(this.Monitor, this.Reflection, this.Toolkit.JsonHelper, this.InitialiseBeforeFirstAssetLoaded);
+ SGame.ConstructorHack = new SGameConstructorHack(this.Monitor, this.Reflection, this.Toolkit.JsonHelper, this.InitializeBeforeFirstAssetLoaded);
this.GameInstance = new SGame(
monitor: this.Monitor,
monitorForGame: this.MonitorForGame,
@@ -221,7 +221,7 @@ namespace StardewModdingAPI.Framework
jsonHelper: this.Toolkit.JsonHelper,
modRegistry: this.ModRegistry,
deprecationManager: SCore.DeprecationManager,
- onGameInitialised: this.InitialiseAfterGameStart,
+ onGameInitialized: this.InitializeAfterGameStart,
onGameExiting: this.Dispose,
cancellationToken: this.CancellationToken,
logNetworkTraffic: this.Settings.LogNetworkTraffic
@@ -262,7 +262,7 @@ namespace StardewModdingAPI.Framework
}
catch (Exception ex)
{
- this.Monitor.Log($"SMAPI failed to initialise: {ex.GetLogSummary()}", LogLevel.Error);
+ this.Monitor.Log($"SMAPI failed to initialize: {ex.GetLogSummary()}", LogLevel.Error);
this.PressAnyKeyToExit();
return;
}
@@ -377,12 +377,12 @@ namespace StardewModdingAPI.Framework
/*********
** Private methods
*********/
- /// <summary>Initialise mods before the first game asset is loaded. At this point the core content managers are loaded (so mods can load their own assets), but the game is mostly uninitialised.</summary>
- private void InitialiseBeforeFirstAssetLoaded()
+ /// <summary>Initialize mods before the first game asset is loaded. At this point the core content managers are loaded (so mods can load their own assets), but the game is mostly uninitialized.</summary>
+ private void InitializeBeforeFirstAssetLoaded()
{
if (this.CancellationToken.IsCancellationRequested)
{
- this.Monitor.Log("SMAPI shutting down: aborting initialisation.", LogLevel.Warn);
+ this.Monitor.Log("SMAPI shutting down: aborting initialization.", LogLevel.Warn);
return;
}
@@ -432,8 +432,8 @@ namespace StardewModdingAPI.Framework
Console.Title = $"SMAPI {Constants.ApiVersion} - running Stardew Valley {Constants.GameVersion} with {modsLoaded} mods";
}
- /// <summary>Initialise SMAPI and mods after the game starts.</summary>
- private void InitialiseAfterGameStart()
+ /// <summary>Initialize SMAPI and mods after the game starts.</summary>
+ private void InitializeAfterGameStart()
{
// validate XNB integrity
if (!this.ValidateContentIntegrity())
@@ -696,7 +696,7 @@ namespace StardewModdingAPI.Framework
/// <summary>Get whether a given version should be offered to the user as an update.</summary>
/// <param name="currentVersion">The current semantic version.</param>
/// <param name="newVersion">The target semantic version.</param>
- /// <param name="useBetaChannel">Whether the user enabled the beta channel and should be offered pre-release updates.</param>
+ /// <param name="useBetaChannel">Whether the user enabled the beta channel and should be offered prerelease updates.</param>
private bool IsValidUpdate(ISemanticVersion currentVersion, ISemanticVersion newVersion, bool useBetaChannel)
{
return
@@ -716,7 +716,7 @@ namespace StardewModdingAPI.Framework
}
catch (Exception ex)
{
- // note: this happens before this.Monitor is initialised
+ // note: this happens before this.Monitor is initialized
Console.WriteLine($"Couldn't create a path: {path}\n\n{ex.GetLogSummary()}");
}
}
@@ -795,10 +795,10 @@ namespace StardewModdingAPI.Framework
// log mod warnings
this.LogModWarnings(loaded, skippedMods);
- // initialise translations
+ // initialize translations
this.ReloadTranslations(loaded);
- // initialise loaded non-content-pack mods
+ // initialize loaded non-content-pack mods
foreach (IModMetadata metadata in loadedMods)
{
// add interceptors
@@ -847,7 +847,7 @@ namespace StardewModdingAPI.Framework
}
// invalidate cache entries when needed
- // (These listeners are registered after Entry to avoid repeatedly reloading assets as mods initialise.)
+ // (These listeners are registered after Entry to avoid repeatedly reloading assets as mods initialize.)
foreach (IModMetadata metadata in loadedMods)
{
if (metadata.Mod.Helper.Content is ContentHelper helper)
@@ -881,7 +881,7 @@ namespace StardewModdingAPI.Framework
}
// unlock mod integrations
- this.ModRegistry.AreAllModsInitialised = true;
+ this.ModRegistry.AreAllModsInitialized = true;
}
/// <summary>Load a given mod.</summary>
@@ -924,7 +924,7 @@ namespace StardewModdingAPI.Framework
}
// validate dependencies
- // Although dependences are validated before mods are loaded, a dependency may have failed to load.
+ // Although dependencies are validated before mods are loaded, a dependency may have failed to load.
if (mod.Manifest.Dependencies?.Any() == true)
{
foreach (IManifestDependency dependency in mod.Manifest.Dependencies.Where(p => p.IsRequired))
@@ -988,7 +988,7 @@ namespace StardewModdingAPI.Framework
return false;
}
- // initialise mod
+ // initialize mod
try
{
// get mod instance
@@ -1045,7 +1045,7 @@ namespace StardewModdingAPI.Framework
}
catch (Exception ex)
{
- errorReasonPhrase = $"initialisation failed:\n{ex.GetLogSummary()}";
+ errorReasonPhrase = $"initialization failed:\n{ex.GetLogSummary()}";
return false;
}
}
@@ -1120,8 +1120,8 @@ namespace StardewModdingAPI.Framework
"These mods have broken code, but you configured SMAPI to load them anyway. This may cause bugs,",
"errors, or crashes in-game."
);
- LogWarningGroup(ModWarning.ChangesSaveSerialiser, LogLevel.Warn, "Changed save serialiser",
- "These mods change the save serialiser. They may corrupt your save files, or make them unusable if",
+ LogWarningGroup(ModWarning.ChangesSaveSerializer, LogLevel.Warn, "Changed save serializer",
+ "These mods change the save serializer. They may corrupt your save files, or make them unusable if",
"you uninstall these mods."
);
if (this.Settings.ParanoidWarnings)
@@ -1285,7 +1285,7 @@ namespace StardewModdingAPI.Framework
break;
default:
- throw new NotSupportedException($"Unrecognise core SMAPI command '{name}'.");
+ throw new NotSupportedException($"Unrecognized core SMAPI command '{name}'.");
}
}
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index 376368d6..e6d91fc3 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -18,7 +18,7 @@ using StardewModdingAPI.Framework.Networking;
using StardewModdingAPI.Framework.Reflection;
using StardewModdingAPI.Framework.StateTracking.Snapshots;
using StardewModdingAPI.Framework.Utilities;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewValley;
using StardewValley.BellsAndWhistles;
using StardewValley.Events;
@@ -60,7 +60,7 @@ namespace StardewModdingAPI.Framework
private readonly Countdown UpdateCrashTimer = new Countdown(60); // 60 ticks = roughly one second
/// <summary>The number of ticks until SMAPI should notify mods that the game has loaded.</summary>
- /// <remarks>Skipping a few frames ensures the game finishes initialising the world before mods try to change it.</remarks>
+ /// <remarks>Skipping a few frames ensures the game finishes initializing the world before mods try to change it.</remarks>
private readonly Countdown AfterLoadTimer = new Countdown(5);
/// <summary>Whether the game is saving and SMAPI has already raised <see cref="IGameLoopEvents.Saving"/>.</summary>
@@ -72,8 +72,8 @@ namespace StardewModdingAPI.Framework
/// <summary>A callback to invoke the first time *any* game content manager loads an asset.</summary>
private readonly Action OnLoadingFirstAsset;
- /// <summary>A callback to invoke after the game finishes initialising.</summary>
- private readonly Action OnGameInitialised;
+ /// <summary>A callback to invoke after the game finishes initializing.</summary>
+ private readonly Action OnGameInitialized;
/// <summary>A callback to invoke when the game exits.</summary>
private readonly Action OnGameExiting;
@@ -93,8 +93,8 @@ namespace StardewModdingAPI.Framework
/// <summary>A snapshot of the current <see cref="Watchers"/> state.</summary>
private WatcherSnapshot WatcherSnapshot = new WatcherSnapshot();
- /// <summary>Whether post-game-startup initialisation has been performed.</summary>
- private bool IsInitialised;
+ /// <summary>Whether post-game-startup initialization has been performed.</summary>
+ private bool IsInitialized;
/// <summary>Whether the next content manager requested by the game will be for <see cref="Game1.content"/>.</summary>
private bool NextContentManagerIsMain;
@@ -103,7 +103,7 @@ namespace StardewModdingAPI.Framework
/*********
** Accessors
*********/
- /// <summary>Static state to use while <see cref="Game1"/> is initialising, which happens before the <see cref="SGame"/> constructor runs.</summary>
+ /// <summary>Static state to use while <see cref="Game1"/> is initializing, which happens before the <see cref="SGame"/> constructor runs.</summary>
internal static SGameConstructorHack ConstructorHack { get; set; }
/// <summary>The number of update ticks which have already executed. This is similar to <see cref="Game1.ticks"/>, but incremented more consistently for every tick.</summary>
@@ -137,18 +137,18 @@ namespace StardewModdingAPI.Framework
/// <param name="jsonHelper">Encapsulates SMAPI's JSON file parsing.</param>
/// <param name="modRegistry">Tracks the installed mods.</param>
/// <param name="deprecationManager">Manages deprecation warnings.</param>
- /// <param name="onGameInitialised">A callback to invoke after the game finishes initialising.</param>
+ /// <param name="onGameInitialized">A callback to invoke after the game finishes initializing.</param>
/// <param name="onGameExiting">A callback to invoke when the game exits.</param>
/// <param name="cancellationToken">Propagates notification that SMAPI should exit.</param>
/// <param name="logNetworkTraffic">Whether to log network traffic.</param>
- internal SGame(Monitor monitor, IMonitor monitorForGame, Reflector reflection, EventManager eventManager, JsonHelper jsonHelper, ModRegistry modRegistry, DeprecationManager deprecationManager, Action onGameInitialised, Action onGameExiting, CancellationTokenSource cancellationToken, bool logNetworkTraffic)
+ internal SGame(Monitor monitor, IMonitor monitorForGame, Reflector reflection, EventManager eventManager, JsonHelper jsonHelper, ModRegistry modRegistry, DeprecationManager deprecationManager, Action onGameInitialized, Action onGameExiting, CancellationTokenSource cancellationToken, bool logNetworkTraffic)
{
this.OnLoadingFirstAsset = SGame.ConstructorHack.OnLoadingFirstAsset;
SGame.ConstructorHack = null;
// check expectations
if (this.ContentCore == null)
- throw new InvalidOperationException($"The game didn't initialise its first content manager before SMAPI's {nameof(SGame)} constructor. This indicates an incompatible lifecycle change.");
+ throw new InvalidOperationException($"The game didn't initialize its first content manager before SMAPI's {nameof(SGame)} constructor. This indicates an incompatible lifecycle change.");
// init XNA
Game1.graphics.GraphicsProfile = GraphicsProfile.HiDef;
@@ -160,7 +160,7 @@ namespace StardewModdingAPI.Framework
this.ModRegistry = modRegistry;
this.Reflection = reflection;
this.DeprecationManager = deprecationManager;
- this.OnGameInitialised = onGameInitialised;
+ this.OnGameInitialized = onGameInitialized;
this.OnGameExiting = onGameExiting;
Game1.input = new SInputState();
Game1.multiplayer = new SMultiplayer(monitor, eventManager, jsonHelper, modRegistry, reflection, this.OnModMessageReceived, logNetworkTraffic);
@@ -171,8 +171,8 @@ namespace StardewModdingAPI.Framework
Game1.locations = new ObservableCollection<GameLocation>();
}
- /// <summary>Initialise just before the game's first update tick.</summary>
- private void InitialiseAfterGameStarted()
+ /// <summary>Initialize just before the game's first update tick.</summary>
+ private void InitializeAfterGameStarted()
{
// set initial state
this.Input.TrueUpdate();
@@ -181,7 +181,7 @@ namespace StardewModdingAPI.Framework
this.Watchers = new WatcherCore(this.Input);
// raise callback
- this.OnGameInitialised();
+ this.OnGameInitialized();
}
/// <summary>Perform cleanup logic when the game exits.</summary>
@@ -238,8 +238,8 @@ namespace StardewModdingAPI.Framework
/// <param name="rootDirectory">The root directory to search for content.</param>
protected override LocalizedContentManager CreateContentManager(IServiceProvider serviceProvider, string rootDirectory)
{
- // Game1._temporaryContent initialising from SGame constructor
- // NOTE: this method is called before the SGame constructor runs. Don't depend on anything being initialised at this point.
+ // Game1._temporaryContent initializing from SGame constructor
+ // NOTE: this method is called before the SGame constructor runs. Don't depend on anything being initialized at this point.
if (this.ContentCore == null)
{
this.ContentCore = new ContentCoordinator(serviceProvider, rootDirectory, Thread.CurrentThread.CurrentUICulture, SGame.ConstructorHack.Monitor, SGame.ConstructorHack.Reflection, SGame.ConstructorHack.JsonHelper, this.OnLoadingFirstAsset ?? SGame.ConstructorHack?.OnLoadingFirstAsset);
@@ -247,7 +247,7 @@ namespace StardewModdingAPI.Framework
return this.ContentCore.CreateGameContentManager("Game1._temporaryContent");
}
- // Game1.content initialising from LoadContent
+ // Game1.content initializing from LoadContent
if (this.NextContentManagerIsMain)
{
this.NextContentManagerIsMain = false;
@@ -269,12 +269,12 @@ namespace StardewModdingAPI.Framework
this.DeprecationManager.PrintQueued();
/*********
- ** First-tick initialisation
+ ** First-tick initialization
*********/
- if (!this.IsInitialised)
+ if (!this.IsInitialized)
{
- this.IsInitialised = true;
- this.InitialiseAfterGameStarted();
+ this.IsInitialized = true;
+ this.InitializeAfterGameStarted();
}
/*********
@@ -302,7 +302,7 @@ namespace StardewModdingAPI.Framework
bool saveParsed = false;
if (Game1.currentLoader != null)
{
- this.Monitor.Log("Game loader synchronising...", LogLevel.Trace);
+ this.Monitor.Log("Game loader synchronizing...", LogLevel.Trace);
while (Game1.currentLoader?.MoveNext() == true)
{
// raise load stage changed
@@ -333,7 +333,7 @@ namespace StardewModdingAPI.Framework
}
if (Game1._newDayTask?.Status == TaskStatus.Created)
{
- this.Monitor.Log("New day task synchronising...", LogLevel.Trace);
+ this.Monitor.Log("New day task synchronizing...", LogLevel.Trace);
Game1._newDayTask.RunSynchronously();
this.Monitor.Log("New day task done.", LogLevel.Trace);
}
@@ -346,7 +346,7 @@ namespace StardewModdingAPI.Framework
// Therefore we can just run Game1.Update here without raising any SMAPI events. There's
// a small chance that the task will finish after we defer but before the game checks,
// which means technically events should be raised, but the effects of missing one
- // update tick are neglible and not worth the complications of bypassing Game1.Update.
+ // update tick are negligible and not worth the complications of bypassing Game1.Update.
if (Game1._newDayTask != null || Game1.gameMode == Game1.loadingMode)
{
events.UnvalidatedUpdateTicking.RaiseEmpty();
@@ -436,7 +436,7 @@ namespace StardewModdingAPI.Framework
}
else if (Context.IsSaveLoaded && this.AfterLoadTimer.Current > 0 && Game1.currentLocation != null)
{
- if (Game1.dayOfMonth != 0) // wait until new-game intro finishes (world not fully initialised yet)
+ if (Game1.dayOfMonth != 0) // wait until new-game intro finishes (world not fully initialized yet)
this.AfterLoadTimer.Decrement();
Context.IsWorldReady = this.AfterLoadTimer.Current == 0;
}
diff --git a/src/SMAPI/Framework/SGameConstructorHack.cs b/src/SMAPI/Framework/SGameConstructorHack.cs
index c3d22197..f70dec03 100644
--- a/src/SMAPI/Framework/SGameConstructorHack.cs
+++ b/src/SMAPI/Framework/SGameConstructorHack.cs
@@ -1,11 +1,11 @@
using System;
using StardewModdingAPI.Framework.Reflection;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewValley;
namespace StardewModdingAPI.Framework
{
- /// <summary>The static state to use while <see cref="Game1"/> is initialising, which happens before the <see cref="SGame"/> constructor runs.</summary>
+ /// <summary>The static state to use while <see cref="Game1"/> is initializing, which happens before the <see cref="SGame"/> constructor runs.</summary>
internal class SGameConstructorHack
{
/*********
diff --git a/src/SMAPI/Framework/SMultiplayer.cs b/src/SMAPI/Framework/SMultiplayer.cs
index 531c229e..e04205c8 100644
--- a/src/SMAPI/Framework/SMultiplayer.cs
+++ b/src/SMAPI/Framework/SMultiplayer.cs
@@ -9,7 +9,7 @@ using StardewModdingAPI.Events;
using StardewModdingAPI.Framework.Events;
using StardewModdingAPI.Framework.Networking;
using StardewModdingAPI.Framework.Reflection;
-using StardewModdingAPI.Toolkit.Serialisation;
+using StardewModdingAPI.Toolkit.Serialization;
using StardewValley;
using StardewValley.Network;
using StardewValley.SDKs;
@@ -94,8 +94,8 @@ namespace StardewModdingAPI.Framework
this.HostPeer = null;
}
- /// <summary>Initialise a client before the game connects to a remote server.</summary>
- /// <param name="client">The client to initialise.</param>
+ /// <summary>Initialize a client before the game connects to a remote server.</summary>
+ /// <param name="client">The client to initialize.</param>
public override Client InitClient(Client client)
{
switch (client)
@@ -118,8 +118,8 @@ namespace StardewModdingAPI.Framework
}
}
- /// <summary>Initialise a server before the game connects to an incoming player.</summary>
- /// <param name="server">The server to initialise.</param>
+ /// <summary>Initialize a server before the game connects to an incoming player.</summary>
+ /// <param name="server">The server to initialize.</param>
public override Server InitServer(Server server)
{
switch (server)
@@ -423,7 +423,7 @@ namespace StardewModdingAPI.Framework
private RemoteContextModel ReadContext(BinaryReader reader)
{
string data = reader.ReadString();
- RemoteContextModel model = this.JsonHelper.Deserialise<RemoteContextModel>(data);
+ RemoteContextModel model = this.JsonHelper.Deserialize<RemoteContextModel>(data);
return model.ApiVersion != null
? model
: null; // no data available for unmodded players
@@ -435,7 +435,7 @@ namespace StardewModdingAPI.Framework
{
// parse message
string json = message.Reader.ReadString();
- ModMessageModel model = this.JsonHelper.Deserialise<ModMessageModel>(json);
+ ModMessageModel model = this.JsonHelper.Deserialize<ModMessageModel>(json);
HashSet<long> playerIDs = new HashSet<long>(model.ToPlayerIDs ?? this.GetKnownPlayerIDs());
if (this.LogNetworkTraffic)
this.Monitor.Log($"Received message: {json}.", LogLevel.Trace);
@@ -454,7 +454,7 @@ namespace StardewModdingAPI.Framework
{
newModel.ToPlayerIDs = new[] { peer.PlayerID };
this.Monitor.VerboseLog($" Forwarding message to player {peer.PlayerID}.");
- peer.SendMessage(new OutgoingMessage((byte)MessageType.ModMessage, peer.PlayerID, this.JsonHelper.Serialise(newModel, Formatting.None)));
+ peer.SendMessage(new OutgoingMessage((byte)MessageType.ModMessage, peer.PlayerID, this.JsonHelper.Serialize(newModel, Formatting.None)));
}
}
}
@@ -488,7 +488,7 @@ namespace StardewModdingAPI.Framework
.ToArray()
};
- return new object[] { this.JsonHelper.Serialise(model, Formatting.None) };
+ return new object[] { this.JsonHelper.Serialize(model, Formatting.None) };
}
/// <summary>Get the fields to include in a context sync message sent to other players.</summary>
@@ -514,7 +514,7 @@ namespace StardewModdingAPI.Framework
.ToArray()
};
- return new object[] { this.JsonHelper.Serialise(model, Formatting.None) };
+ return new object[] { this.JsonHelper.Serialize(model, Formatting.None) };
}
}
}
diff --git a/src/SMAPI/Framework/Serialisation/ColorConverter.cs b/src/SMAPI/Framework/Serialization/ColorConverter.cs
index c27065bf..19979981 100644
--- a/src/SMAPI/Framework/Serialisation/ColorConverter.cs
+++ b/src/SMAPI/Framework/Serialization/ColorConverter.cs
@@ -1,12 +1,12 @@
using System;
using Microsoft.Xna.Framework;
using Newtonsoft.Json.Linq;
-using StardewModdingAPI.Toolkit.Serialisation;
-using StardewModdingAPI.Toolkit.Serialisation.Converters;
+using StardewModdingAPI.Toolkit.Serialization;
+using StardewModdingAPI.Toolkit.Serialization.Converters;
-namespace StardewModdingAPI.Framework.Serialisation
+namespace StardewModdingAPI.Framework.Serialization
{
- /// <summary>Handles deserialisation of <see cref="Color"/> for crossplatform compatibility.</summary>
+ /// <summary>Handles deserialization of <see cref="Color"/> for crossplatform compatibility.</summary>
/// <remarks>
/// - Linux/Mac format: { "B": 76, "G": 51, "R": 25, "A": 102 }
/// - Windows format: "26, 51, 76, 102"
diff --git a/src/SMAPI/Framework/Serialisation/PointConverter.cs b/src/SMAPI/Framework/Serialization/PointConverter.cs
index fbc857d2..8c2f3396 100644
--- a/src/SMAPI/Framework/Serialisation/PointConverter.cs
+++ b/src/SMAPI/Framework/Serialization/PointConverter.cs
@@ -1,12 +1,12 @@
using System;
using Microsoft.Xna.Framework;
using Newtonsoft.Json.Linq;
-using StardewModdingAPI.Toolkit.Serialisation;
-using StardewModdingAPI.Toolkit.Serialisation.Converters;
+using StardewModdingAPI.Toolkit.Serialization;
+using StardewModdingAPI.Toolkit.Serialization.Converters;
-namespace StardewModdingAPI.Framework.Serialisation
+namespace StardewModdingAPI.Framework.Serialization
{
- /// <summary>Handles deserialisation of <see cref="PointConverter"/> for crossplatform compatibility.</summary>
+ /// <summary>Handles deserialization of <see cref="PointConverter"/> for crossplatform compatibility.</summary>
/// <remarks>
/// - Linux/Mac format: { "X": 1, "Y": 2 }
/// - Windows format: "1, 2"
diff --git a/src/SMAPI/Framework/Serialisation/RectangleConverter.cs b/src/SMAPI/Framework/Serialization/RectangleConverter.cs
index 4f55cc32..fbb2e253 100644
--- a/src/SMAPI/Framework/Serialisation/RectangleConverter.cs
+++ b/src/SMAPI/Framework/Serialization/RectangleConverter.cs
@@ -2,12 +2,12 @@ using System;
using System.Text.RegularExpressions;
using Microsoft.Xna.Framework;
using Newtonsoft.Json.Linq;
-using StardewModdingAPI.Toolkit.Serialisation;
-using StardewModdingAPI.Toolkit.Serialisation.Converters;
+using StardewModdingAPI.Toolkit.Serialization;
+using StardewModdingAPI.Toolkit.Serialization.Converters;
-namespace StardewModdingAPI.Framework.Serialisation
+namespace StardewModdingAPI.Framework.Serialization
{
- /// <summary>Handles deserialisation of <see cref="Rectangle"/> for crossplatform compatibility.</summary>
+ /// <summary>Handles deserialization of <see cref="Rectangle"/> for crossplatform compatibility.</summary>
/// <remarks>
/// - Linux/Mac format: { "X": 1, "Y": 2, "Width": 3, "Height": 4 }
/// - Windows format: "{X:1 Y:2 Width:3 Height:4}"
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/ComparableListWatcher.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/ComparableListWatcher.cs
index 6550f950..32ec8c7e 100644
--- a/src/SMAPI/Framework/StateTracking/FieldWatchers/ComparableListWatcher.cs
+++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/ComparableListWatcher.cs
@@ -53,7 +53,7 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers
{
this.AssertNotDisposed();
- // optimise for zero items
+ // optimize for zero items
if (this.CurrentValues.Count == 0)
{
if (this.LastValues.Count > 0)