-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathStrings.cs
More file actions
2841 lines (2180 loc) · 120 KB
/
Copy pathStrings.cs
File metadata and controls
2841 lines (2180 loc) · 120 KB
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System.Reflection;
using Intersect.Client.Core.Controls;
using Intersect.Client.Framework.Content;
using Intersect.Client.Framework.Input;
using Intersect.Client.Interface.Shared;
using Intersect.Configuration;
using Intersect.Core;
using Intersect.Enums;
using Intersect.Framework.Core.Security;
using Intersect.Framework.Reflection;
using Intersect.Localization;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Intersect.Client.Localization;
public static partial class Strings
{
private const string StringsFileName = "client_strings.json";
private static char[] mQuantityTrimChars = new char[] { '.', '0' };
private static string[] _unitsBits = [string.Empty, "Ki", "Mi", "Gi", "Ti"];
private static string[] _unitsBytes = [string.Empty, "K", "M", "G", "T"];
public static string FormatBits(long quantity)
{
var log = quantity < 2 ? 0 : Math.Log2(quantity);
var offsetLog = Math.Max(0, Math.Floor(log - 3.3));
var unitIndex = (int)Math.Clamp(Math.Floor(offsetLog / 10), 0, _unitsBits.Length - 1);
var divisor = Math.Pow(2, unitIndex * 10);
var quotient = quantity / divisor;
var unitPrefix = _unitsBits[unitIndex];
return $"{quotient:0.##}{unitPrefix}B";
}
public static string FormatBytes(long quantity)
{
var log = quantity < 10 ? 0 : Math.Floor(Math.Log10(quantity));
var offsetLog = Math.Max(0, log - 1);
var unitIndex = (int)Math.Clamp(Math.Floor(offsetLog / 3), 0, _unitsBytes.Length - 1);
var divisor = Math.Pow(10, unitIndex * 3);
var quotient = quantity / divisor;
var unitPrefix = _unitsBytes[unitIndex];
return $"{quotient:0.##}{unitPrefix}B";
}
public static string FormatQuantityAbbreviated(long value)
{
if (value == 0)
{
return "";
}
else
{
double returnVal = 0;
var postfix = string.Empty;
// hundreds
if (value <= 999)
{
returnVal = value;
}
// thousands
else if (value >= 1000 && value <= 999999)
{
returnVal = value / 1000.0;
postfix = Numbers.Thousands;
}
// millions
else if (value >= 1000000 && value <= 999999999)
{
returnVal = value / 1000000.0;
postfix = Numbers.Millions;
}
// billions
else if (value >= 1000000000 && value <= 999999999999)
{
returnVal = value / 1000000000.0;
postfix = Numbers.Billions;
}
else
{
return "OOB";
}
if (returnVal >= 10)
{
returnVal = Math.Floor(returnVal);
return returnVal.ToString() + postfix;
}
else
{
returnVal = Math.Floor(returnVal * 10) / 10.0;
return returnVal.ToString("F1")
.TrimEnd(mQuantityTrimChars)
.ToString()
.Replace(".", Numbers.Decimal) +
postfix;
}
}
}
private static void SynchronizeConfigurableStrings()
{
if (Options.Instance == default)
{
return;
}
var keyedRarityTiers = Options.Instance.Items.RarityTiers.Select((rarityName, rarity) => (rarity, rarityName));
foreach (var (rarity, rarityName) in keyedRarityTiers)
{
if (!ItemDescription.Rarity.ContainsKey(rarityName))
{
ItemDescription.Rarity[rarityName] = $"{rarity}:{rarityName}";
}
}
}
private static void PostLoad()
{
Core.Program.OpenGLLink = Errors.OpenGlLink.ToString();
Core.Program.OpenALLink = Errors.OpenAllLink.ToString();
}
private class OrdinalComparer : IComparer<string>
{
public int Compare(string? x, string? y) => string.CompareOrdinal(x, y);
}
private class OrdinalComparer<T> : IComparer<T>
{
public int Compare(T? x, T? y) => string.CompareOrdinal(x?.ToString(), y?.ToString());
}
public static void Load()
{
SynchronizeConfigurableStrings();
try
{
var serialized = new Dictionary<string, Dictionary<string, object>>();
serialized = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, object>>>(
File.ReadAllText(Path.Combine(ClientConfiguration.ResourcesDirectory, StringsFileName))
);
var rootType = typeof(Strings);
var groupTypes = rootType.GetNestedTypes(BindingFlags.Static | BindingFlags.Public);
List<string> missingStrings = [];
List<string> argumentCountMismatch = [];
foreach (var groupType in groupTypes.OrderBy(t => t.Name, new OrdinalComparer()))
{
if (!serialized.TryGetValue(groupType.Name, out var serializedGroup))
{
missingStrings.Add($"{groupType.Name}");
serialized[groupType.Name] = SerializeGroup(groupType);
continue;
}
foreach (var fieldInfo in groupType.GetFields(BindingFlags.Public | BindingFlags.Static))
{
var fieldValue = fieldInfo.GetValue(null);
if (!serializedGroup.TryGetValue(fieldInfo.Name, out var serializedValue))
{
var foundKey = serializedGroup.Keys.FirstOrDefault(key => string.Equals(fieldInfo.Name, key, StringComparison.OrdinalIgnoreCase));
if (foundKey != default)
{
_ = serializedGroup.TryGetValue(foundKey, out serializedValue);
}
}
switch (fieldValue)
{
case LocalizedString localizedString:
var jsonString = (string)serializedValue;
if (jsonString == default)
{
ApplicationContext.Context.Value?.Logger.LogWarning($"{groupType.Name}.{fieldInfo.Name} is null.");
missingStrings.Add($"{groupType.Name}.{fieldInfo.Name} (string)");
serializedGroup[fieldInfo.Name] = (string)localizedString;
}
else
{
LocalizedString? existingLocalizedString = null;
try
{
existingLocalizedString = fieldInfo.GetValue(null) as LocalizedString;
}
catch
{
// Ignore
}
LocalizedString newLocalizedString = new(jsonString);
if (existingLocalizedString?.ArgumentCount != newLocalizedString.ArgumentCount)
{
argumentCountMismatch.Add(
$"{groupType.Name}.{fieldInfo.Name} expected {existingLocalizedString?.ArgumentCount.ToString() ?? "ERROR"} argument(s) but the loaded string had {newLocalizedString.ArgumentCount}"
);
}
fieldInfo.SetValue(null, newLocalizedString);
}
break;
case Dictionary<int, LocalizedString> intDictionary:
DeserializeDictionary(missingStrings, groupType, fieldInfo, fieldValue, serializedGroup, serializedValue, intDictionary);
break;
case Dictionary<string, LocalizedString> stringDictionary:
DeserializeDictionary(missingStrings, groupType, fieldInfo, fieldValue, serializedGroup, serializedValue, stringDictionary);
break;
default:
{
var fieldType = fieldInfo.FieldType;
if (!fieldType.IsGenericType || typeof(Dictionary<,>) != fieldType.GetGenericTypeDefinition())
{
ApplicationContext.Context.Value?.Logger.LogError(
new NotSupportedException(
$"Unsupported localization type for {groupType.Name}.{fieldInfo.Name}: {fieldInfo.FieldType.FullName}"
),
"Invalid field type {Type}",
fieldType
);
break;
}
var parameters = fieldType.GenericTypeArguments;
var localizedParameterType = parameters.Last();
if (localizedParameterType != typeof(LocalizedString))
{
ApplicationContext.Context.Value?.Logger.LogError(
new NotSupportedException(
$"Unsupported localization dictionary value type for {groupType.Name}.{fieldInfo.Name}: {localizedParameterType.FullName}"
),
"Unsupported localization dictionary value type for {GroupName}.{FieldName}: {ParameterTypeName}",
groupType.Name,
fieldInfo.Name,
localizedParameterType.FullName
);
break;
}
var genericDeserializeDictionary = _methodInfoDeserializeDictionary.MakeGenericMethod(parameters.First());
_ = genericDeserializeDictionary
.Invoke(
default,
[
missingStrings,
groupType,
fieldInfo,
fieldValue,
serializedGroup,
serializedValue,
fieldValue,
]
);
break;
}
}
}
}
if (missingStrings.Count > 0)
{
ApplicationContext.Context.Value?.Logger.LogWarning(
"Missing strings, overwriting strings file:\n\t{Strings}",
string.Join(",\n\t", missingStrings)
);
SaveSerialized(serialized);
}
if (argumentCountMismatch.Count > 0)
{
ApplicationContext.Context.Value?.Logger.LogWarning(
"Argument count mismatch on {MismatchCount} strings:\n\t{Strings}",
argumentCountMismatch.Count,
string.Join(",\n\t", argumentCountMismatch)
);
}
}
catch (Exception exception)
{
ApplicationContext.Context.Value?.Logger.LogWarning(exception, "Error occurred while loading strings");
Save();
}
PostLoad();
}
private static readonly MethodInfo _methodInfoDeserializeDictionary = typeof(Strings).GetMethod(
nameof(DeserializeDictionary),
BindingFlags.NonPublic | BindingFlags.Static
) ?? throw new InvalidOperationException();
private static readonly MethodInfo _methodInfoSerializeDictionary = typeof(Strings).GetMethod(
nameof(SerializeDictionary),
BindingFlags.NonPublic | BindingFlags.Static
) ?? throw new InvalidOperationException();
private static void DeserializeDictionary<TKey>(
List<string> missingStrings,
Type groupType,
FieldInfo fieldInfo,
object? fieldValue,
Dictionary<string, object> serializedGroup,
object? serializedValue,
Dictionary<TKey, LocalizedString> dictionary
)
{
switch (serializedValue)
{
case null:
missingStrings.Add($"{groupType.Name}.{fieldInfo.Name} (string dictionary)");
serializedGroup[fieldInfo.Name] = fieldValue is null ? JValue.CreateNull() : JToken.FromObject(fieldValue);
break;
case JObject serializedDictionary:
{
var keys = dictionary.Keys.ToList();
foreach (var key in keys)
{
var stringKey = key?.ToString() ??
throw new InvalidOperationException(
$"{key}.{nameof(key.ToString)}() returned null"
);
if (!serializedDictionary.TryGetValue(stringKey, out var token) || token?.Type != JTokenType.String)
{
missingStrings.Add($"{groupType.Name}.{fieldInfo.Name}[{key}]");
serializedDictionary[stringKey] = (string)dictionary[key];
continue;
}
dictionary[key] = token.Value<string>();
}
break;
}
}
}
private static Dictionary<string, string> SerializeDictionary<TKey>(Dictionary<TKey, LocalizedString> localizedDictionary) where TKey : notnull
{
return localizedDictionary.OrderBy(pair => pair.Key, new OrdinalComparer<TKey>()).ToDictionary(
pair => pair.Key.ToString() ?? throw new InvalidOperationException($"Failed to use {pair.Key} as a key"),
pair => pair.Value.ToString()
);
}
private static Dictionary<string, object> SerializeGroup(Type groupType)
{
var serializedGroup = new Dictionary<string, object>();
foreach (var fieldInfo in groupType.GetFields(BindingFlags.Static | BindingFlags.Public).OrderBy(f => f.Name, new OrdinalComparer()))
{
var fieldValue = fieldInfo.GetValue(null);
switch (fieldValue)
{
case LocalizedString localizedString:
serializedGroup.Add(fieldInfo.Name, localizedString.ToString());
break;
case Dictionary<int, LocalizedString> localizedIntKeyDictionary:
serializedGroup.Add(fieldInfo.Name, SerializeDictionary(localizedIntKeyDictionary));
break;
case Dictionary<string, LocalizedString> localizedStringKeyDictionary:
serializedGroup.Add(fieldInfo.Name, SerializeDictionary(localizedStringKeyDictionary));
break;
case Dictionary<ChatboxTab, LocalizedString> localizedChatboxTabKeyDictionary:
serializedGroup.Add(fieldInfo.Name, SerializeDictionary(localizedChatboxTabKeyDictionary));
break;
default:
if (fieldValue?.GetType() is {} fieldType && typeof(Dictionary<,>).ExtendedBy(fieldType))
{
var typeArguments = fieldType.GenericTypeArguments;
var keyType = typeArguments.First();
if (keyType == typeof(LocalizedString))
{
throw new InvalidOperationException(
$"Expected a type that is not a {typeof(LocalizedString).GetName(qualified: true)}"
);
}
var genericMethod = _methodInfoSerializeDictionary.MakeGenericMethod(keyType);
var serializationResult = genericMethod.Invoke(null, [fieldValue]);
if (serializationResult is Dictionary<string, string> serializedGenericDictionary)
{
serializedGroup.Add(fieldInfo.Name, serializedGenericDictionary);
}
}
break;
}
}
return serializedGroup;
}
private static void SaveSerialized(Dictionary<string, Dictionary<string, object>> serialized)
{
var languageDirectory = Path.Combine(ClientConfiguration.ResourcesDirectory);
if (Directory.Exists(languageDirectory))
{
File.WriteAllText(
Path.Combine(languageDirectory, StringsFileName),
JsonConvert.SerializeObject(serialized, Formatting.Indented)
);
}
}
public static void Save()
{
var serialized = new Dictionary<string, Dictionary<string, object>>();
var rootType = typeof(Strings);
var groupTypes = rootType.GetNestedTypes(BindingFlags.Static | BindingFlags.Public);
foreach (var groupType in groupTypes.OrderBy(g => g.Name, new OrdinalComparer()))
{
var serializedGroup = SerializeGroup(groupType);
serialized.Add(groupType.Name, serializedGroup);
}
SaveSerialized(serialized);
}
public partial struct AdminWindow
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Access = @"Access";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Access1 = @"Moderator";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Access2 = @"Admin";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Ban = @"Ban";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString BanCaption = @"Ban {00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString BanPrompt = @"Banning {00} will not allow them to access this game for the duration you set!";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SortMapList = @"Sort map list";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SortMapListTooltip = @"Order maps in a flat hierarchy in alphanumeric order according to the computer locale.";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Face = @"Face";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString KickPlayer = @"Kick";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString KillPlayer = @"Kill";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString MapList = @"Map List";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Mute = @"Mute";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString MuteCaption = @"Mute {00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString MutePrompt = @"Muting {00} will not allow them to chat in game for the duration you set!";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Name = @"Name";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString NamePlaceholder = @"Player Name";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString None = @"None";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString LeaveInstance = @"Leave Instance";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SetFace = @"Set Face";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SetPower = @"Set Power";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SetSprite = @"Set Sprite";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Sprite = @"Sprite:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Administration";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Unban = @"Unban";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString UnbanCaption = @"Unban {00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString UnbanPrompt = @"Are you sure that you want to unban {00}?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Unmute = @"Unmute";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString UnmuteCaption = @"Unmute {00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString UnmutePrompt = @"Are you sure that you want to unmute {00}?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WarpPlayerToMe = @"Warp To Me";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WarpMeToPlayer = @"Warp Me To";
}
public partial struct Bags
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString RetrieveItem = @"Retrieve Item";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString RetrieveItemPrompt = @"How many/much {00} would you like to retrieve?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString StoreItem = @"Store Item";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString StoreItemPrompt = @"How many/much {00} would you like to store?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Bag";
}
public partial struct Bank
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString DepositItem = @"Deposit Item";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString DepositItemPrompt = @"How many/much {00} would you like to deposit?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString NoSpace = @"There is no space left in your bank for that item!";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Bank";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WithdrawItem = @"Withdraw Item";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WithdrawItemPrompt = @"How many/much {00} would you like to withdraw?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WithdrawItemNoSpace = @"There is no space left in your inventory for that item!";
}
public partial struct BanMute
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Cancel = @"Cancel";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Duration = @"Duration:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString FiveDays = @"5 days";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString FourDays = @"4 days";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Forever = @"Indefinitely";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString IncludeIp = @"Include IP:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString OneDay = @"1 day";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString OneMonth = @"1 month";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString OneWeek = @"1 week";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString OneYear = @"1 year";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Okay = @"Okay";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Reason = @"Reason:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SixMonths = @"6 months";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ThreeDays = @"3 days";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TwoDays = @"2 days";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TwoMonths = @"2 months";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TwoWeeks = @"2 weeks";
}
public partial struct Character
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString AttackSpeed = @"Attack Speed: {00}s";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString CooldownReduction = @"Cooldown Reduction: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Equipment = @"Equipment:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ExtraBuffDetails = @"Details";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ExtraExp = @"Bonus EXP: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString HealthRegen = @"Health Regen: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString LevelAndClass = @"Level: {00}, Class: {01}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Lifesteal = @"Lifesteal: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Luck = @"Luck: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ManaRegen = @"Mana Regen: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Manasteal = @"Manasteal: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Points = @"Points: {00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString StatLabelValue = @"{00}: {01}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Stats = @"Stats:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Tenacity = @"Tenacity: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Character Information";
}
public partial struct CharacterCreation
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Back = @"Back";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Class = @"Class";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Create = @"Create";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Female = @"Female";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Gender = @"Gender";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Hint = @"Customize";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Hint2 = @"Your Character";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString InvalidName = @"Character name is invalid. Please use alphanumeric characters with a length between 2 and 20.";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Male = @"Male";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Name = @"Name";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Create a New Character";
}
public partial struct CharacterSelection
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Delete = @"Delete";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString DeletePrompt = @"Are you sure you want to delete {00}? This action is irreversible!";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString DeleteTitle = @"Delete {00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Empty = @"Empty Character Slot";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Info = @"Level: {00}, Class: {01}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Logout = @"Logout";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ChangePassword = @"Change Password";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Name = @"{00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString New = @"New";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Play = @"Play";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Select a Character to Play";
}
public partial struct Chatbox
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Channel = @"Channel:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ChannelAdmin = @"admin";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static Dictionary<int, LocalizedString> Channels = new Dictionary<int, LocalizedString>
{
{0, @"local"},
{1, @"global"},
{2, @"party"},
{3, @"guild"}
};
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ClearLogButtonToolTip = @"Clear chat log messages";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static Dictionary<ChatboxTab, LocalizedString> ChatTabButtons = new Dictionary<ChatboxTab, LocalizedString>() {
{ ChatboxTab.All, @"All" },
{ ChatboxTab.Local, @"Local" },
{ ChatboxTab.Party, @"Party" },
{ ChatboxTab.Global, @"Global" },
{ ChatboxTab.Guild, @"Guild" },
{ ChatboxTab.System, @"System" },
};
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString EnterChat = @"Click here to chat.";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString EnterChat1 = @"Press '{00}' to chat.";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString EnterChat2 = @"Press '{00}' or '{01}' to chat.";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Send = @"Send";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Chat";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString ToggleLogButtonToolTip = @"Toggle chat log visibility";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TooFast = @"You are chatting too fast!";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString UnableToCopy = @"It appears you are not able to copy/paste on this platform. Please make sure you have either the 'xclip' or 'wl-clipboard' packages installed if you are running Linux.";
}
public partial struct Combat
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString AttackWhileCastingDeny = @"You cannot attack while casting a spell.";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static Dictionary<Stat, LocalizedString> Stats = new() {
{ Stat.Attack, @"Attack" },
{ Stat.AbilityPower, @"Ability Power" },
{ Stat.Defense, @"Defense" },
{ Stat.MagicResist, @"Magic Resist" },
{ Stat.Speed, @"Speed" },
};
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WarningCharacterSelect = @"You are attempting to logout while in combat! Your character will remain in-game until combat has ended. Are you sure you want to logout now?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WarningExitDesktop = @"You are attempting to exit while in combat! Your character will remain in-game until combat has ended. Are you sure you want to quit now?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WarningLogout = @"You are attempting to logout while in combat! Your character will remain in-game until combat has ended. Are you sure you want to logout now?";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString WarningTitle = @"Combat Warning!";
}
public partial struct Content
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static Dictionary<ContentType, LocalizedString> Types = new()
{
{ ContentType.Animation, @"Animation" },
{ ContentType.Entity, @"Entity" },
{ ContentType.Face, @"Face" },
{ ContentType.Fog, @"Fog" },
{ ContentType.Font, @"Font" },
{ ContentType.Image, @"Image" },
{ ContentType.Interface, @"Interface (gui)" },
{ ContentType.Item, @"Item" },
{ ContentType.Miscellaneous, @"Miscellaneous" },
{ ContentType.Music, @"Music" },
{ ContentType.Paperdoll, @"Paperdoll" },
{ ContentType.Resource, @"Resource" },
{ ContentType.Shader, @"Shader" },
{ ContentType.Sound, @"Sound" },
{ ContentType.Spell, @"Spell" },
{ ContentType.TextureAtlas, @"Texture Atlas" },
{ ContentType.Tileset, @"Tileset" },
};
}
public partial struct Controls
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString HotkeyXLabel = @"Hot Key {00}:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static Dictionary<string, LocalizedString> KeyDictionary = new()
{
{"attackinteract", @"Attack/Interact:"},
{"block", @"Block:"},
{"autotarget", @"Auto Target:"},
{"enter", @"Chat:"},
{nameof(Control.HoldToSoftRetargetOnSelfCast).ToLowerInvariant(), @"Hold to Soft-Retarget on Self-Cast:"},
{"hotkey1", @"Hot Key 1:"},
{"hotkey2", @"Hot Key 2:"},
{"hotkey3", @"Hot Key 3:"},
{"hotkey4", @"Hot Key 4:"},
{"hotkey5", @"Hot Key 5:"},
{"hotkey6", @"Hot Key 6:"},
{"hotkey7", @"Hot Key 7:"},
{"hotkey8", @"Hot Key 8:"},
{"hotkey9", @"Hot Key 9:"},
{"hotkey10", @"Hot Key 10:"},
{"movedown", @"Down:"},
{"moveleft", @"Left:"},
{"moveright", @"Right:"},
{"moveup", @"Up:"},
{"pickup", @"Pick Up:"},
{"screenshot", @"Screenshot:"},
{"openmenu", @"Open Menu:"},
{"openinventory", @"Open Inventory:"},
{"openquests", @"Open Quests:"},
{"opencharacterinfo", @"Open Character Info:"},
{"openparties", @"Open Parties:"},
{"openspells", @"Open Spells:"},
{"openfriends", @"Open Friends:"},
{"openguild", @"Open Guild:"},
{"opensettings", @"Open Settings:"},
{"opendebugger", @"Open Debugger:"},
{"openadminpanel", @"Open Admin Panel:"},
{"togglegui", @"Toggle Interface:"},
{"turnaround", @"Hold to turn around:"},
{"togglezoomin", "Toggle Zoom In:"},
{"holdtozoomin", "Hold to Zoom In:"},
{"togglezoomout", "Toggle Zoom Out:"},
{"holdtozoomout", "Hold to Zoom Out:"},
{"togglefullscreen", "Toggle Fullscreen:"},
{nameof(Control.ToggleAutoSoftRetargetOnSelfCast).ToLowerInvariant(), "Toggle Auto Soft-Retarget on Self-Cast:"},
};
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Listening = @"Listening";
}
public partial struct Crafting
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Craft = @"Craft 1";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString CraftAll = @"Craft {00}";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString CraftChance = @"Chance of failure: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString CraftingTime = "Crafting time: {00}s";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString CraftStop = "Stop";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString DestroyMaterialsChance = @"Chance to destroy materials: {00}%";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString IncorrectResources = @"You do not have the necessary resources to craft this item.";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Ingredients = @"Required:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Product = @"Crafting:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Recipes = @"Recipes:";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString RecipeListEntry = @"{00}) {01}";
}
public partial struct Credits
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Back = @"Back to Main Menu";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Title = @"Credits";
}
public partial struct Debug
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SectionGPUStatistics = @"GPU Statistics";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SectionGPUAllocations = @"GPU Allocations";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString SectionSystemStatistics = @"System Statistics";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString RenderTargetAllocations = @"Render Target Allocations";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TextureAllocations = @"Texture Allocations";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TextureCount = @"Texture Assets";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString UsedVRAM = @"Used VRAM";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString FreeVRAM = @"Free VRAM";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TotalVRAM = @"Total VRAM";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString FreeVirtualRAM = @"Free RAM (Virtual)";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TotalVirtualRAM = @"Total RAM (Virtual)";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString FreePhysicalRAM = @"Free RAM (Physical)";
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString TotalPhysicalRAM = @"Total RAM (Physical)";