Skip to content

Commit

Permalink
small doc fixes
Browse files Browse the repository at this point in the history
- Injections to Services
- linting in AddonEventManager
- remove dead plugin templates
  • Loading branch information
KazWolfe committed Aug 12, 2024
1 parent 5a0108d commit 1228ef4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
13 changes: 6 additions & 7 deletions docs/plugin-development/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ that your plugin is approved into the official plugin repository, and to
minimise the risk of action by Square Enix. You can read more about this
[here](restrictions#why-do-you-discourage-certain-types-of-plugins).

We recommend that you start by cloning one of the following templates, and then
customising it to your requirements. While `SamplePlugin` is the most actively
maintained, the others are updated as required:

- [@goatcorp/SamplePlugin](https://github.com/goatcorp/SamplePlugin)
- [@karashiiro/DalamudPluginProjectTemplate](https://github.com/karashiiro/DalamudPluginProjectTemplate)
- [@lmcintyre/PluginTemplate](https://github.com/lmcintyre/PluginTemplate)
We recommend that you start by cloning the

Check failure on line 10 in docs/plugin-development/getting-started.md

View workflow job for this annotation

GitHub Actions / Run linters

Replace `⏎[`SamplePlugin`·repository][sample-plugin]·and·then·customizing·it·to·your⏎specific·requirements.·This·plugin·template·contains·many·common·settings·as⏎well·as·` with `·[`SamplePlugin`⏎repository][sample-plugin]·and·then·customizing·it·to·your·specific⏎requirements.·This·plugin·template·contains·many·common·settings·as·well·as⏎`
[`SamplePlugin` repository][sample-plugin] and then customizing it to your
specific requirements. This plugin template contains many common settings as
well as frequently-used sample code to help bootstrap plugin creation.

To distribute a plugin, it needs to be packaged correctly. This can be done
manually or [with DalamudPackager](https://github.com/goatcorp/DalamudPackager).

When your plugin is ready for testing/release, you should make a pull request to
the [DalamudPluginsD17](https://github.com/goatcorp/DalamudPluginsD17) repo.
**Please place testing plugins in the testing/live folder**.

[sample-plugin]: https://github.com/goatcorp/SamplePlugin

Check failure on line 22 in docs/plugin-development/getting-started.md

View workflow job for this annotation

GitHub Actions / Run linters

Insert `⏎`
4 changes: 2 additions & 2 deletions docs/plugin-development/how-tos/AddonEventManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public interface IAddonEventManager

## Node and Components

_You must register a `Node` for events, you can not register a `Component`,
attempting to register the address of a `Component` will result in a crash._
You must register a `Node` for events, you can not register a `Component`,
attempting to register the address of a `Component` will result in a crash.

Valid Node types will have their type names ending in `Node`.

Expand Down
8 changes: 4 additions & 4 deletions docs/plugin-development/interaction/expanding-game-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public class HealthWatcher : IDisposable {
}

private void OnFrameworkTick(IFramework framework) {
var player = Injections.ClientState.LocalPlayer;
var player = Services.ClientState.LocalPlayer;

if (player == null) return; // Player is not logged in, nothing we can do.
var currentHealth = player.CurrentHp;

if (currentHealth == this._lastHealth) return; // Nothing happened we care about, return.
this._lastHealth = currentHealth;
Expand Down Expand Up @@ -148,7 +148,7 @@ public unsafe class MySiggedHook : IDisposable {

public MySiggedHook() {
Services.GameInteropProvider.InitializeFromAttributes(this);

// Nullable because this might not have been initialized from IFA above, e.g. the sig was invalid.
this._macroUpdateHook?.Enable();
}
Expand All @@ -163,7 +163,7 @@ public unsafe class MySiggedHook : IDisposable {
try {
// your plugin logic goes here.
} catch (Exception ex) {
Injections.PluginLog.Error(ex, "An error occured when handling a macro save event.");
Services.PluginLog.Error(ex, "An error occured when handling a macro save event.");
}

this._macroUpdateHook!.Original(self, needsSave, set);
Expand Down

0 comments on commit 1228ef4

Please sign in to comment.