Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 committed May 18, 2020
1 parent cba5194 commit b6bd030
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
# Plugin Template
# Utility Library

Project template for developing [.NET Script Framework](https://www.nexusmods.com/skyrimspecialedition/mods/21294) Plugins.
Utility Library for developing [.NET Script Framework](https://www.nexusmods.com/skyrimspecialedition/mods/21294) Plugins. This adds additional events, functions, extensions and more for you to work with so you can create plugins more efficient.

## Requirements

* [Visual Studio 2019](https://visualstudio.microsoft.com/)
* [.NET Script Framework](https://www.nexusmods.com/skyrimspecialedition/mods/21294)

## 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:

```csharp
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.

0 comments on commit b6bd030

Please sign in to comment.