erri120.UtilityLibrary
1.0.0
See the version list below for details.
dotnet add package erri120.UtilityLibrary --version 1.0.0
NuGet\Install-Package erri120.UtilityLibrary -Version 1.0.0
<PackageReference Include="erri120.UtilityLibrary" Version="1.0.0" />
paket add erri120.UtilityLibrary --version 1.0.0
#r "nuget: erri120.UtilityLibrary, 1.0.0"
// Install erri120.UtilityLibrary as a Cake Addin #addin nuget:?package=erri120.UtilityLibrary&version=1.0.0 // Install erri120.UtilityLibrary as a Cake Tool #tool nuget:?package=erri120.UtilityLibrary&version=1.0.0
Utility Library
Utility Library for developing .NET Script Framework Plugins. This adds additional events, functions, extensions and more for you to work with so you can create plugins more efficient.
Requirements
The JetBrains.Annotations package is used mostly for the [NotNull]
attribute because NetScriptFramework is still on .NET Framework 4.x and does not use C# 8.0 that has the new nullable feature. Null checking in the NetScriptFramework is important and this library will not null check most inputs. So when using a function from this library make sure to null check beforehand.
Using the Library
Aside from adding a reference to this in your project, you also need to make sure that the library loads before your plugin. Make sure your Plugin.Initialize
function looks like this:
protected override bool Initialize(bool loadedAny)
{
var utilityLibrary = NetScriptFramework.PluginManager.GetPlugin("utility.library");
if (utilityLibrary == null) return false;
if (!utilityLibrary.IsInitialized) return false;
if (!loadedAny) return false;
// other stuff...
}
This ensures that your plugin only loads after the library initialized and it will error out when the library is not loaded or initialized.
Functions
The UtilityLibrary
class has multiple convenience functions like UtilityLibrary.IsInGame
or UtilityLibrary.TryGetFormFromFile<T>
to reduce the amount of duplicate code you often write.
Events
The UtilityLibrary.Events
class contains new events that are (not yet) in the main framework.
Extensions
Extensions are static functions that have a this T
argument, this library features multiple extensions for Actor
and ItemEntry
objects.
AddressLibrary
The Address Library UtilityLibrary.AddressLibrary
is a collection of addresses that you can use without having to do any reverse engineering.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net48 is compatible. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.