forked from ACEmulator/ACE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLanguageInfo.cs
126 lines (111 loc) · 4.42 KB
/
LanguageInfo.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
using System.Collections.Generic;
using System.IO;
using ACE.DatLoader.Entity;
using ACE.Entity.Enum;
namespace ACE.DatLoader.FileTypes
{
/// <summary>
/// This is in client_local_English.dat with the ID of 0x41000000.
///
/// Contains some very basic language and formatting rules.
/// </summary>
[DatFileType(DatFileType.StringState)]
public class LanguageInfo : FileType
{
internal const uint FILE_ID = 0x41000000;
public int Version;
public short Base;
public short NumDecimalDigits;
public bool LeadingZero;
public short GroupingSize;
public List<char> Numerals;
public List<char> DecimalSeperator;
public List<char> GroupingSeperator;
public List<char> NegativeNumberFormat;
public bool IsZeroSingular;
public bool IsOneSingular;
public bool IsNegativeOneSingular;
public bool IsTwoOrMoreSingular;
public bool IsNegativeTwoOrLessSingular;
public List<char> TreasurePrefixLetters;
public List<char> TreasureMiddleLetters;
public List<char> TreasureSuffixLetters;
public List<char> MalePlayerLetters;
public List<char> FemalePlayerLetters;
public uint ImeEnabledSetting;
public uint SymbolColor;
public uint SymbolColorText;
public uint SymbolHeight;
public uint SymbolTranslucence;
public uint SymbolPlacement;
public uint CandColorBase;
public uint CandColorBorder;
public uint CandColorText;
public uint CompColorInput;
public uint CompColorTargetConv;
public uint CompColorConverted;
public uint CompColorTargetNotConv;
public uint CompColorInputErr;
public uint CompTranslucence;
public uint CompColorText;
public uint OtherIME;
public int WordWrapOnSpace;
public List<char> AdditionalSettings;
public uint AdditionalFlags;
public override void Unpack(BinaryReader reader)
{
Version = reader.ReadInt32();
Base = reader.ReadInt16();
NumDecimalDigits = reader.ReadInt16();
LeadingZero = reader.ReadBoolean();
GroupingSize = reader.ReadInt16();
Numerals = UnpackList(reader);
DecimalSeperator = UnpackList(reader);
GroupingSeperator = UnpackList(reader);
NegativeNumberFormat = UnpackList(reader);
IsZeroSingular = reader.ReadBoolean();
IsOneSingular = reader.ReadBoolean();
IsNegativeOneSingular = reader.ReadBoolean();
IsTwoOrMoreSingular = reader.ReadBoolean();
IsNegativeTwoOrLessSingular = reader.ReadBoolean();
reader.AlignBoundary();
TreasurePrefixLetters = UnpackList(reader);
TreasureMiddleLetters = UnpackList(reader);
TreasureSuffixLetters = UnpackList(reader);
MalePlayerLetters = UnpackList(reader);
FemalePlayerLetters = UnpackList(reader);
ImeEnabledSetting = reader.ReadUInt32();
SymbolColor = reader.ReadUInt32();
SymbolColorText = reader.ReadUInt32();
SymbolHeight = reader.ReadUInt32();
SymbolTranslucence = reader.ReadUInt32();
SymbolPlacement = reader.ReadUInt32();
CandColorBase = reader.ReadUInt32();
CandColorBorder = reader.ReadUInt32();
CandColorText = reader.ReadUInt32();
CompColorInput = reader.ReadUInt32();
CompColorTargetConv = reader.ReadUInt32();
CompColorConverted = reader.ReadUInt32();
CompColorTargetNotConv = reader.ReadUInt32();
CompColorInputErr = reader.ReadUInt32();
CompTranslucence = reader.ReadUInt32();
CompColorText = reader.ReadUInt32();
OtherIME = reader.ReadUInt32();
WordWrapOnSpace = reader.ReadInt32();
AdditionalSettings = UnpackList(reader);
AdditionalFlags = reader.ReadUInt32();
}
// just a little helper function...
private List<char> UnpackList(BinaryReader reader)
{
List<char> l = new List<char>();
byte numElements = reader.ReadByte();
for (int i = 0; i < numElements; i++)
{
ushort c = reader.ReadUInt16();
l.Add((char)c);
}
return l;
}
}
}