mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-12 21:04:41 +01:00
feat: add handbook
This commit is contained in:
@@ -10,8 +10,8 @@ public class AvatarDataExcel : ExcelResource
|
|||||||
[JsonPropertyName("initialWeapon")] public int InitialWeapon { get; set; }
|
[JsonPropertyName("initialWeapon")] public int InitialWeapon { get; set; }
|
||||||
[JsonPropertyName("skillList")] public List<int> SkillList { get; set; } = [];
|
[JsonPropertyName("skillList")] public List<int> SkillList { get; set; } = [];
|
||||||
public string FaceAnimationGroupName { get; set; } = "";
|
public string FaceAnimationGroupName { get; set; } = "";
|
||||||
|
|
||||||
public int DefaultDressId { get; set; }
|
public int DefaultDressId { get; set; }
|
||||||
|
[JsonPropertyName("fullName")] public HashName FullName { get; set; } = new();
|
||||||
|
|
||||||
public override int GetId()
|
public override int GetId()
|
||||||
{
|
{
|
||||||
@@ -27,3 +27,8 @@ public class AvatarDataExcel : ExcelResource
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class HashName
|
||||||
|
{
|
||||||
|
public long hash { get; set; } = 0;
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ public class ElfAstraMateDataExcel : ExcelResource
|
|||||||
public int ElfID { get; set; }
|
public int ElfID { get; set; }
|
||||||
public int MaxLevel { get; set; }
|
public int MaxLevel { get; set; }
|
||||||
public int MaxRarity { get; set; }
|
public int MaxRarity { get; set; }
|
||||||
|
public HashName FullName { get; set; } = new();
|
||||||
|
|
||||||
[JsonIgnore] public List<ElfSkillDataExcel> SkillList = [];
|
[JsonIgnore] public List<ElfSkillDataExcel> SkillList = [];
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public class StigmataDataExcel : ExcelResource
|
|||||||
[JsonPropertyName("quality")] public int Quality { get; set; }
|
[JsonPropertyName("quality")] public int Quality { get; set; }
|
||||||
[JsonPropertyName("isSecurityProtect")] public bool IsSecurityProtect { get; set; }
|
[JsonPropertyName("isSecurityProtect")] public bool IsSecurityProtect { get; set; }
|
||||||
[JsonPropertyName("protect")] public bool Protect { get; set; }
|
[JsonPropertyName("protect")] public bool Protect { get; set; }
|
||||||
|
[JsonPropertyName("displayTitle")] public HashName DisplayTitle { get; set; } = new();
|
||||||
|
|
||||||
public override int GetId()
|
public override int GetId()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class WeaponDataExcel : ExcelResource
|
|||||||
[JsonPropertyName("maxRarity")] public int MaxRarity { get; set; }
|
[JsonPropertyName("maxRarity")] public int MaxRarity { get; set; }
|
||||||
[JsonPropertyName("evoID")] public int EvoID { get; set; }
|
[JsonPropertyName("evoID")] public int EvoID { get; set; }
|
||||||
[JsonPropertyName("protect")] public bool Protect { get; set; }
|
[JsonPropertyName("protect")] public bool Protect { get; set; }
|
||||||
|
[JsonPropertyName("displayTitle")] public HashName DisplayTitle { get; set; } = new();
|
||||||
|
|
||||||
public override int GetId()
|
public override int GetId()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,15 +49,19 @@ public static class HandbookGenerator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TextMapEntry> textMap = JsonConvert.DeserializeObject<List<TextMapEntry>>(File.ReadAllText(textMapPath))!;
|
List<TextMapEntry> textMapList = JsonConvert.DeserializeObject<List<TextMapEntry>>(File.ReadAllText(textMapPath))!;
|
||||||
|
|
||||||
if (textMap == null)
|
if (textMapList == null)
|
||||||
{
|
{
|
||||||
Logger.GetByClassName().Error(I18NManager.Translate("Server.ServerInfo.FailedToReadItem", textMapPath,
|
Logger.GetByClassName().Error(I18NManager.Translate("Server.ServerInfo.FailedToReadItem", textMapPath,
|
||||||
I18NManager.Translate("Word.Error")));
|
I18NManager.Translate("Word.Error")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dictionary<long, string> textMap = [];
|
||||||
|
|
||||||
|
foreach (var map in textMapList) textMap.Add(map.Value!.Hash, map.Text!);
|
||||||
|
|
||||||
var builder = new StringBuilder();
|
var builder = new StringBuilder();
|
||||||
builder.AppendLine("#Handbook generated in " + DateTime.Now.ToString("yyyy/MM/dd HH:mm"));
|
builder.AppendLine("#Handbook generated in " + DateTime.Now.ToString("yyyy/MM/dd HH:mm"));
|
||||||
builder.AppendLine();
|
builder.AppendLine();
|
||||||
@@ -65,6 +69,26 @@ public static class HandbookGenerator
|
|||||||
builder.AppendLine();
|
builder.AppendLine();
|
||||||
GenerateCmd(builder, lang);
|
GenerateCmd(builder, lang);
|
||||||
|
|
||||||
|
builder.AppendLine();
|
||||||
|
builder.AppendLine("#Valkyrie");
|
||||||
|
builder.AppendLine();
|
||||||
|
GenerateValk(builder, textMap);
|
||||||
|
|
||||||
|
builder.AppendLine();
|
||||||
|
builder.AppendLine("#Elf");
|
||||||
|
builder.AppendLine();
|
||||||
|
GenerateElf(builder, textMap);
|
||||||
|
|
||||||
|
builder.AppendLine();
|
||||||
|
builder.AppendLine("#Stigmata");
|
||||||
|
builder.AppendLine();
|
||||||
|
GenerateStigmata(builder, textMap);
|
||||||
|
|
||||||
|
builder.AppendLine();
|
||||||
|
builder.AppendLine("#Weapon");
|
||||||
|
builder.AppendLine();
|
||||||
|
GenerateWeapon(builder, textMap);
|
||||||
|
|
||||||
builder.AppendLine();
|
builder.AppendLine();
|
||||||
WriteToFile(lang, builder.ToString());
|
WriteToFile(lang, builder.ToString());
|
||||||
}
|
}
|
||||||
@@ -83,6 +107,42 @@ public static class HandbookGenerator
|
|||||||
{
|
{
|
||||||
File.WriteAllText($"{ConfigManager.Config.Path.HandbookPath}/Handbook{lang}.txt", content);
|
File.WriteAllText($"{ConfigManager.Config.Path.HandbookPath}/Handbook{lang}.txt", content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void GenerateValk(StringBuilder builder, Dictionary<long, string> map)
|
||||||
|
{
|
||||||
|
foreach (var avatar in GameData.AvatarData.Values)
|
||||||
|
{
|
||||||
|
var name = map.TryGetValue(avatar.FullName.hash, out var value) ? value : $"[{avatar.FullName.hash}]";
|
||||||
|
builder.AppendLine(avatar.AvatarID + ": " + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GenerateElf(StringBuilder builder, Dictionary<long, string> map)
|
||||||
|
{
|
||||||
|
foreach (var elf in GameData.ElfAstraMateData.Values)
|
||||||
|
{
|
||||||
|
var name = map.TryGetValue(elf.FullName.hash, out var value) ? value : $"[{elf.FullName.hash}]";
|
||||||
|
builder.AppendLine(elf.ElfID + ": " + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GenerateStigmata(StringBuilder builder, Dictionary<long, string> map)
|
||||||
|
{
|
||||||
|
foreach (var stigmata in GameData.StigmataData.Values)
|
||||||
|
{
|
||||||
|
var name = map.TryGetValue(stigmata.DisplayTitle.hash, out var value) ? value : $"[{stigmata.DisplayTitle.hash}]";
|
||||||
|
builder.AppendLine(stigmata.ID + ": " + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GenerateWeapon(StringBuilder builder, Dictionary<long, string> map)
|
||||||
|
{
|
||||||
|
foreach (var weapon in GameData.WeaponData.Values)
|
||||||
|
{
|
||||||
|
var name = map.TryGetValue(weapon.DisplayTitle.hash, out var value) ? value : $"[{weapon.DisplayTitle.hash}]";
|
||||||
|
builder.AppendLine(weapon.ID + ": " + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TextMapEntry
|
public class TextMapEntry
|
||||||
|
|||||||
Reference in New Issue
Block a user