chore: add readme
This commit is contained in:
parent
49262093d6
commit
e1624d4cf4
|
@ -0,0 +1,35 @@
|
|||
# Siggingway
|
||||
|
||||
Signature attribute for making working with signatures in Dalamud plugins super
|
||||
braindead.
|
||||
|
||||
## Usage
|
||||
|
||||
```c#
|
||||
public class Plugin : IDalamudPlugin {
|
||||
[Signature("DE AD ?? EF", DetourName = nameof(MyDetour)]
|
||||
private Hook<MyDelegate>? MyHook { get; init; }
|
||||
|
||||
[Signature("CA ?? BA BE")]
|
||||
private SomeGameFunctionDelegate? _someGameFunction;
|
||||
private delegate void SomeGameFunctionDelegate();
|
||||
|
||||
public Plugin(SigScanner scanner) {
|
||||
Siggingway.Siggingway.Initialise(scanner, this);
|
||||
|
||||
// you still have to enable the hook
|
||||
// be sure to check if it's null
|
||||
this.MyHook?.Enable();
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
this.MyHook?.Dispose();
|
||||
}
|
||||
|
||||
private void MyDetour() {
|
||||
// this is called by the hook!
|
||||
|
||||
this._someGameFunction?.Invoke();
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue