Update Artifact part labels support i18n

Update cn window title to GrasscutterTools
This commit is contained in:
2022-05-15 18:45:32 +08:00
parent 265b23f475
commit 01dc1b6f1c
6 changed files with 1361 additions and 2400 deletions

View File

@ -360,6 +360,8 @@ namespace GrasscutterTools
private Dictionary<string, List<KeyValuePair<int, string>>> subAttrs; private Dictionary<string, List<KeyValuePair<int, string>>> subAttrs;
private string[] ArtifactPartLabels;
private void InitArtifactList() private void InitArtifactList()
{ {
CmbArtifactSet.Items.Clear(); CmbArtifactSet.Items.Clear();
@ -383,6 +385,8 @@ namespace GrasscutterTools
} }
CmbSubAttribution.Items.Clear(); CmbSubAttribution.Items.Clear();
CmbSubAttribution.Items.AddRange(subAttrs.Keys.ToArray()); CmbSubAttribution.Items.AddRange(subAttrs.Keys.ToArray());
ArtifactPartLabels = Resources.ArtifactPartLabels.Split(',');
} }
private void CmbSubAttribution_SelectedIndexChanged(object sender, EventArgs e) private void CmbSubAttribution_SelectedIndexChanged(object sender, EventArgs e)
@ -428,8 +432,6 @@ namespace GrasscutterTools
ArtifactInputChanged(sender, e); ArtifactInputChanged(sender, e);
} }
private readonly string[] ArtifactPartLabels = new string[] { "空之杯", "死之羽", "理之冠", "生之花", "时之沙" };
private void CmbArtifactPart_SelectedIndexChanged(object sender, EventArgs e) private void CmbArtifactPart_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (CmbArtifactPart.SelectedIndex < 0) if (CmbArtifactPart.SelectedIndex < 0)
@ -439,8 +441,11 @@ namespace GrasscutterTools
} }
var name = CmbArtifactPart.SelectedItem as string; var name = CmbArtifactPart.SelectedItem as string;
var id = GameData.Artifacts.Ids[Array.IndexOf(GameData.Artifacts.Names, name)]; var id = GameData.Artifacts.Ids[Array.IndexOf(GameData.Artifacts.Names, name)];
LblArtifactName.Text = ArtifactPartLabels[id / 10 % 10 - 1]; var pardIndex = id / 10 % 10 - 1;
if (pardIndex < ArtifactPartLabels?.Length)
LblArtifactName.Text = ArtifactPartLabels[pardIndex];
else
LblArtifactName.Text = "";
ArtifactInputChanged(sender, e); ArtifactInputChanged(sender, e);
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -247,6 +247,15 @@ namespace GrasscutterTools.Properties {
} }
} }
/// <summary>
/// 查找类似 空之杯,死之羽,理之冠,生之花,时之沙 的本地化字符串。
/// </summary>
internal static string ArtifactPartLabels {
get {
return ResourceManager.GetString("ArtifactPartLabels", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 101021: 生命值+24 /// 查找类似 101021: 生命值+24
///101022: 生命值+30 ///101022: 生命值+30

View File

@ -130,6 +130,9 @@
<data name="ArtifactMainAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="ArtifactMainAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\ArtifactMainAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> <value>..\Resources\en-us\ArtifactMainAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data> </data>
<data name="ArtifactPartLabels" xml:space="preserve">
<value>空之杯,死之羽,理之冠,生之花,时之沙</value>
</data>
<data name="ArtifactSubAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="ArtifactSubAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\ArtifactSubAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> <value>..\Resources\en-us\ArtifactSubAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data> </data>

View File

@ -130,6 +130,9 @@
<data name="ArtifactMainAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="ArtifactMainAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\ArtifactMainAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> <value>..\Resources\zh-cn\ArtifactMainAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data> </data>
<data name="ArtifactPartLabels" xml:space="preserve">
<value>空之杯,死之羽,理之冠,生之花,时之沙</value>
</data>
<data name="ArtifactSubAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="ArtifactSubAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\ArtifactSubAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> <value>..\Resources\zh-cn\ArtifactSubAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data> </data>