-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mod.cs
80 lines (67 loc) · 2.36 KB
/
Mod.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using Reloaded.Mod.Interfaces;
using nights.test.jacklescapefix.Template;
using nights.test.jacklescapefix.Configuration;
namespace nights.test.jacklescapefix;
/// <summary>
/// Your mod logic goes here.
/// </summary>
public class Mod : ModBase // <= Do not Remove.
{
/// <summary>
/// Provides access to the mod loader API.
/// </summary>
private readonly IModLoader _modLoader;
/// <summary>
/// Provides access to the Reloaded logger.
/// </summary>
private readonly ILogger _logger;
/// <summary>
/// Entry point into the mod, instance that created this class.
/// </summary>
private readonly IMod _owner;
/// <summary>
/// Provides access to this mod's configuration.
/// </summary>
private Config _configuration;
/// <summary>
/// The configuration of the currently executing mod.
/// </summary>
private readonly IModConfig _modConfig;
public Mod(ModContext context)
{
_modLoader = context.ModLoader;
_logger = context.Logger;
_owner = context.Owner;
_configuration = context.Configuration;
_modConfig = context.ModConfig;
// For more information about this template, please see
// https://reloaded-project.github.io/Reloaded-II/ModTemplate/
// If you want to implement e.g. unload support in your mod,
// and some other neat features, override the methods in ModBase.
unsafe {
const int new_size = 512288;
const int orig_size = 510464;
int delta = new_size - orig_size; // 0x720;
int* texture_ptr = (int*)0x8A2BD0;
*texture_ptr += delta;
int* rigging_ptr = (int*)(0x8A2BD0 + 4);
*rigging_ptr += delta;
int* animation_ptr = (int*)(0x8A2BD0 + 8);
*animation_ptr += delta;
}
}
#region Standard Overrides
public override void ConfigurationUpdated(Config configuration)
{
// Apply settings from configuration.
// ... your code here.
_configuration = configuration;
_logger.WriteLine($"[{_modConfig.ModId}] Config Updated: Applying");
}
#endregion
#region For Exports, Serialization etc.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public Mod() { }
#pragma warning restore CS8618
#endregion
}