-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathExpressions.cs
350 lines (301 loc) · 11.7 KB
/
Expressions.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
using JetBrains.Annotations;
namespace BannerLib.Gameplay.Dialogs
{
/// <summary>
/// Represents expression animations tags.
/// </summary>
public class Expressions
{
/// <summary>
/// Tags group
/// </summary>
public enum Key
{
/// <summary>
/// Tags starting with "ib:"
/// </summary>
IdleBody,
/// <summary>
/// Tags starting with "if:"
/// </summary>
IdleFace,
/// <summary>
/// Tags starting with "rb:"
/// </summary>
ReactionBody,
/// <summary>
/// Tags starting with "rf:"
/// </summary>
ReactionFace,
}
/// <summary>
/// Expressions from tags group "ib:"
/// </summary>
public static class IdleBody
{
/// <summary>
/// [ib:aggressive]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions Aggressive = new Expressions(Key.IdleBody, "aggressive");
/// <summary>
/// [ib:closed]
/// </summary>
[PublicAPI] [NotNull] public static readonly Expressions Closed = new Expressions(Key.IdleBody, "closed");
/// <summary>
/// [ib:normal]
/// </summary>
[PublicAPI] [NotNull] public static readonly Expressions Normal = new Expressions(Key.IdleBody, "normal");
/// <summary>
/// [ib:warrior]
/// </summary>
[PublicAPI] [NotNull] public static readonly Expressions Warrior = new Expressions(Key.IdleBody, "warrior");
/// <summary>
/// [ib:demure]
/// </summary>
[PublicAPI] [NotNull] public static readonly Expressions Demure = new Expressions(Key.IdleBody, "demure");
}
/// <summary>
/// Expressions from tags group "if:"
/// </summary>
public static class IdleFace
{
/// <summary>
/// [if:idle_angry]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdleAngry = new Expressions(Key.IdleFace, "idle_angry");
/// <summary>
/// [if:idle_happy]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdleHappy = new Expressions(Key.IdleFace, "idle_happy");
/// <summary>
/// [if:idle_insulted]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdleInsulted = new Expressions(Key.IdleFace, "idle_insulted");
/// <summary>
/// [if:idle_pleased]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdlePleased = new Expressions(Key.IdleFace, "idle_pleased");
/// <summary>
/// [if:idle_despise]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdleDespise = new Expressions(Key.IdleFace, "idle_despise");
/// <summary>
/// [if:idle_cheering1]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdleCheering1 = new Expressions(Key.IdleFace, "idle_cheering1");
/// <summary>
/// [if:idle_cheering2]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdleCheering2 = new Expressions(Key.IdleFace, "idle_cheering2");
/// <summary>
/// [if:idle_sick]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions IdleSick = new Expressions(Key.IdleFace, "idle_sick");
/// <summary>
/// [if:convo_composed]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoComposed = new Expressions(Key.IdleFace, "convo_composed");
/// <summary>
/// [if:convo_nonchalant]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoNonchalant = new Expressions(Key.IdleFace, "convo_nonchalant");
/// <summary>
/// [if:convo_delighted]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoDelighted = new Expressions(Key.IdleFace, "convo_delighted");
/// <summary>
/// [if:convo_happy]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoHappy = new Expressions(Key.IdleFace, "convo_happy");
/// <summary>
/// [if:convo_stonefaced]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoStonefaced = new Expressions(Key.IdleFace, "convo_stonefaced");
/// <summary>
/// [if:convo_grave]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoGrave = new Expressions(Key.IdleFace, "convo_grave");
/// <summary>
/// [if:convo_irritable]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoIrritable = new Expressions(Key.IdleFace, "convo_irritable");
/// <summary>
/// [if:convo_mocking]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoMocking = new Expressions(Key.IdleFace, "convo_mocking");
/// <summary>
/// [if:convo_insidious]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoInsidious = new Expressions(Key.IdleFace, "convo_insidious");
/// <summary>
/// [if:convo_bent]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoBent = new Expressions(Key.IdleFace, "convo_bent");
/// <summary>
/// [if:convo_grim]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoGrim = new Expressions(Key.IdleFace, "convo_grim");
/// <summary>
/// [if:convo_charitable]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoCharitable = new Expressions(Key.IdleFace, "convo_charitable");
/// <summary>
/// [if:convo_merry]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoMerry = new Expressions(Key.IdleFace, "convo_merry");
/// <summary>
/// [if:convo_friendly]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions ConvoFriendly = new Expressions(Key.IdleFace, "convo_friendly");
/// <summary>
/// [if:talking_happy]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions TalkingHappy = new Expressions(Key.IdleFace, "talking_happy");
/// <summary>
/// [if:happy]
/// </summary>
[PublicAPI] [NotNull] public static readonly Expressions Happy = new Expressions(Key.IdleFace, "happy");
}
/// <summary>
/// Expressions from tags group "rb:"
/// </summary>
public static class ReactionBody
{
/// <summary>
/// [rb:very_negative]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions VeryNegative = new Expressions(Key.ReactionBody, "very_negative");
/// <summary>
/// [rb:negative]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions Negative = new Expressions(Key.ReactionBody, "negative");
/// <summary>
/// [rb:positive]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions Positive = new Expressions(Key.ReactionBody, "positive");
/// <summary>
/// [rb:very_positive]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions VeryPositive = new Expressions(Key.ReactionBody, "very_positive");
/// <summary>
/// [rb:unsure]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions Unsure = new Expressions(Key.ReactionBody, "unsure");
/// <summary>
/// [rb:trivial]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions Trivial = new Expressions(Key.ReactionBody, "trivial");
}
/// <summary>
/// Expressions from tags group "rf:"
/// </summary>
public static class ReactionFace
{
/// <summary>
/// [rf:happy]
/// </summary>
[PublicAPI] [NotNull] public static readonly Expressions Happy = new Expressions(Key.ReactionFace, "happy");
/// <summary>
/// [rf:very_negative]
/// </summary>
[PublicAPI] [NotNull]
public static readonly Expressions VeryNegative = new Expressions(Key.ReactionFace, "very_negative");
}
/// <summary>
/// Empty string (no expressions)
/// </summary>
[PublicAPI] public static readonly Expressions None = new Expressions("");
/// <summary>
/// This tags string.
/// </summary>
[PublicAPI]
public string Tag { get; }
/// <summary>
/// Creates new tag (with custom tag group and tag name)
/// </summary>
/// <param name="key"></param>
/// <param name="animationName"></param>
[PublicAPI]
public Expressions(string key, string animationName)
{
Tag = $"[{(string.IsNullOrEmpty(key) ? key + ':' : "")}{animationName}]";
}
/// <summary>
/// Creates new tag (with predefined tag group and custom tag name)
/// </summary>
/// <param name="key"></param>
/// <param name="animationName"></param>
[PublicAPI]
public Expressions(Key key, string animationName)
{
string keyText;
switch (key)
{
case Key.IdleBody:
keyText = "ib";
break;
case Key.IdleFace:
keyText = "if";
break;
case Key.ReactionBody:
keyText = "rb";
break;
case Key.ReactionFace:
keyText = "rf";
break;
default:
keyText = null;
break;
}
Tag = $"[{(string.IsNullOrEmpty(keyText) ? keyText + ':' : "")}{animationName}]";
}
private Expressions(string tag)
{
Tag = tag;
}
/// <summary>
/// Combines two tags together.
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
public static Expressions operator |(Expressions a, Expressions b)
{
return new Expressions((a?.Tag ?? "") + (b?.Tag ?? ""));
}
// ib is idle animations (body, I guess?)
// if is facial idle
// rb is idle reaction
// rf ???
}
}