NHSE/NHSE.Core/Save/Offsets/PostBoxOffsets.cs
Josh (vector_cmdr) 41841e5bfb
Feat: Post Box Editing (#744)
Feature:
Adds support for postbox.dat via Post Box Editor and accompanying components:
- Add Mail class.
- Add PostBox class and corresponding offset classes.
- Add wrap suppression option to ItemEditor.
- Add wrapping and box dictionary to ItemWrapping class.
- Add new language strings associated with forms and types.

Fix:
Resolved overwrite for bad dumps on all imports by adding UsageCompatibilityOffset and UsageCompatibility() added to Design classes. Transparent pixel check method added to PatternEditor and LoadPattern() altered to write the correct compatibility bytes based on type and transparency.
2026-02-10 01:32:16 +11:00

55 lines
1.9 KiB
C#

using System;
namespace NHSE.Core;
/// <summary>
/// Offset info and object retrieval logic for <see cref="PostBox"/>
/// </summary>
public abstract class PostBoxOffsets
{
public abstract int s_7b602b39 { get; }
public abstract int MailList { get; }
public abstract int FontTable { get; }
public abstract int LatestUniqueId { get; }
public static PostBoxOffsets GetOffsets(FileHeaderInfo Info)
{
var rev = Info.GetKnownRevisionIndex();
return rev switch
{
0 => new PostBoxOffsets10(),
1 => new PostBoxOffsets11(),
2 => new PostBoxOffsets11(),
3 => new PostBoxOffsets11(),
4 => new PostBoxOffsets11(),
5 => new PostBoxOffsets11(),
6 => new PostBoxOffsets12(),
7 => new PostBoxOffsets12(),
8 => new PostBoxOffsets13(),
9 => new PostBoxOffsets13(),
10 => new PostBoxOffsets14(),
11 => new PostBoxOffsets14(),
12 => new PostBoxOffsets14(),
13 => new PostBoxOffsets15(),
14 => new PostBoxOffsets15(),
15 => new PostBoxOffsets16(),
16 => new PostBoxOffsets17(),
17 => new PostBoxOffsets18(),
18 => new PostBoxOffsets19(),
19 => new PostBoxOffsets110(),
20 => new PostBoxOffsets111(),
21 => new PostBoxOffsets111(),
22 => new PostBoxOffsets20(),
23 => new PostBoxOffsets20(),
24 => new PostBoxOffsets20(),
25 => new PostBoxOffsets20(),
26 => new PostBoxOffsets20(),
27 => new PostBoxOffsets20(),
28 => new PostBoxOffsets20(),
29 => new PostBoxOffsets20(),
30 => new PostBoxOffsets20(),
31 => new PostBoxOffsets30(),
_ => throw new IndexOutOfRangeException("Unknown revision!" + Environment.NewLine + Info),
};
}
}