Skip to content

Commit

Permalink
modify xml attach
Browse files Browse the repository at this point in the history
  • Loading branch information
valorad committed Mar 23, 2021
1 parent 6d9091b commit daa4d56
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/data/proto-addition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<unit id="2000" name="WCBxfjsyh">
<dbid>2000</dbid>
<displaynameid>200000</displaynameid>
<displaynameid>210000</displaynameid>
<editornameid>220000</editornameid>
<obstructionradiusx>6.0000</obstructionradiusx>
<obstructionradiusz>6.0000</obstructionradiusz>
Expand Down
2 changes: 1 addition & 1 deletion src/data/stringTable/stringtabley-cn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<nedStrings>
<!--> 附加到决定版 Data/strings/SimplifiedChinese/stringtabley.xml中 <!-->
<!--NativeED String Starts-->
<string _locid="200000">西方军事议会</string>
<string _locid="210000">西方军事议会</string>
<string _locid="220000">WCB 西方军事议会</string>
<string _locid="240000">西方国家的军事联盟机构,派遣精英或特工执行不同的任务。【请注意:如果您要申请海军援助,请将议会建在紧挨海边的位置!】</string>
<string _locid="260000">西方国家的军事联盟机构,派遣精英或特工执行不同的任务。</string>
Expand Down
2 changes: 1 addition & 1 deletion src/data/stringTable/stringtabley-en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!--> 附加到决定版 Data/strings/SimplifiedChinese/stringtabley.xml中 <!-->

<!--NativeED String Starts-->
<string _locid="200000">Western Military Council</string>
<string _locid="210000">Western Military Council</string>
<string _locid="220000">WCB Western Military Council</string>
<string _locid="240000">西方国家的军事联盟机构,派遣精英或特工执行不同的任务。【请注意:如果您要申请海军援助,请将议会建在紧挨海边的位置!】</string>
<string _locid="260000">西方国家的军事联盟机构,派遣精英或特工执行不同的任务。</string>
Expand Down
9 changes: 5 additions & 4 deletions tools/xml-inject/App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void InjectXMLToBottom(InjectXMLParams settings) {

foreach(var node in source.SelectSingleNode(settings.SourceParentTagName).ChildNodes) {
XmlNode importedNode = parentNode.OwnerDocument.ImportNode(node as XmlNode, true);
parentNode.AppendChild(importedNode);
}

Directory.CreateDirectory(settings.OutputFolder);
Expand Down Expand Up @@ -148,8 +149,8 @@ public void InjectProtos() {
foreach (XmlNode explorer in storeExplorers.ChildNodes) {
string id = explorer.Attributes["id"].Value;
XmlNode targetExplorer = target.SelectSingleNode($"/proto/unit[@id='{id}']");
targetExplorer.OwnerDocument.ImportNode(explorer.ChildNodes[0], true);
// targetExplorer.AppendChild(explorer.ChildNodes[0]);
XmlNode importedExplorer = targetExplorer.OwnerDocument.ImportNode(explorer.ChildNodes[0], true);
targetExplorer.AppendChild(importedExplorer);
}

// Town Center can build wagons to deploy the Hero Structures
Expand Down Expand Up @@ -208,8 +209,8 @@ public void InjectTechtrees() {
XmlNode effects = targetCountry.SelectSingleNode("effects");

foreach (XmlNode effect in faction.ChildNodes) {
effects.OwnerDocument.ImportNode(effect, true);
// effects.AppendChild(effect);
XmlNode importedEffect = effects.OwnerDocument.ImportNode(effect, true);
effects.AppendChild(importedEffect);
}

}
Expand Down

0 comments on commit daa4d56

Please # to comment.