From 5c03e6bb621c66358203f845a7b4c8086a0ced63 Mon Sep 17 00:00:00 2001 From: Sting Mcray Date: Sun, 21 Apr 2019 21:33:28 +0200 Subject: [PATCH] Update Presets.json Make Anno 1800 Farm Files and Farmbuildings have a number of Field Amount they need. --- AnnoDesigner/presets.json | 266 +++++++++++++++++++------------------- PresetParser/Program.cs | 103 ++++++++++----- 2 files changed, 204 insertions(+), 165 deletions(-) diff --git a/AnnoDesigner/presets.json b/AnnoDesigner/presets.json index 91b659ca..3db9509d 100644 --- a/AnnoDesigner/presets.json +++ b/AnnoDesigner/presets.json @@ -9759,10 +9759,10 @@ "Identifier": "Agriculture_01 (Grain Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Grain Farm", - "ger": "Getreidefarm", - "pol": "Uprawa zboża", - "rus": "Ферма" + "eng": "Grain Farm - (144)", + "ger": "Getreidefarm - (144)", + "pol": "Uprawa zboża - (144)", + "rus": "Ферма - (144)" }, "Template": "FarmBuilding" }, @@ -9778,10 +9778,10 @@ "Identifier": "Agriculture_02 (Cattle Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Cattle Farm", - "ger": "Rinderfarm", - "pol": "Farma bydła", - "rus": "Скотоферма" + "eng": "Cattle Farm - (4)", + "ger": "Rinderfarm - (4)", + "pol": "Farma bydła - (4)", + "rus": "Скотоферма - (4)" }, "Template": "FarmBuilding" }, @@ -9797,10 +9797,10 @@ "Identifier": "Agriculture_03 (Hop Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Hop Farm", - "ger": "Hopfenplantage", - "pol": "Uprawa chmielu", - "rus": "Ферма хмеля" + "eng": "Hop Farm - (96)", + "ger": "Hopfenplantage - (96)", + "pol": "Uprawa chmielu - (96)", + "rus": "Ферма хмеля - (96)" }, "Template": "FarmBuilding" }, @@ -9816,10 +9816,10 @@ "Identifier": "Agriculture_04 (Potato Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Potato Farm", - "ger": "Kartoffelhof", - "pol": "Uprawa ziemniaków", - "rus": "Картофельная ферма" + "eng": "Potato Farm - (72)", + "ger": "Kartoffelhof - (72)", + "pol": "Uprawa ziemniaków - (72)", + "rus": "Картофельная ферма - (72)" }, "Template": "FarmBuilding" }, @@ -9854,10 +9854,10 @@ "Identifier": "Agriculture_06 (Sheep Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Sheep Farm", - "ger": "Schäferei", - "pol": "Farma owiec", - "rus": "Овцеферма" + "eng": "Sheep Farm - (3)", + "ger": "Schäferei - (3)", + "pol": "Farma owiec - (3)", + "rus": "Овцеферма - (3)" }, "Template": "FarmBuilding" }, @@ -9873,10 +9873,10 @@ "Identifier": "Agriculture_08 (Pig Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Pig Farm", - "ger": "Schweinezucht", - "pol": "Farma świń", - "rus": "Свиноферма" + "eng": "Pig Farm - (5)", + "ger": "Schweinezucht - (5)", + "pol": "Farma świń - (5)", + "rus": "Свиноферма - (5)" }, "Template": "FarmBuilding" }, @@ -9911,10 +9911,10 @@ "Identifier": "Agriculture_11 (Bell Pepper Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Red Pepper Farm", - "ger": "Paprikafarm", - "pol": "Uprawa czerwonej papryki", - "rus": "Перечная ферма" + "eng": "Red Pepper Farm - (108)", + "ger": "Paprikafarm - (108)", + "pol": "Uprawa czerwonej papryki - (108)", + "rus": "Перечная ферма - (108)" }, "Template": "FarmBuilding" }, @@ -9930,10 +9930,10 @@ "Identifier": "Agriculture_10 (Vineyard)", "InfluenceRadius": 0, "Localization": { - "eng": "Vineyard", - "ger": "Weinberg", - "pol": "Winnica", - "rus": "Виноградник" + "eng": "Vineyard - (128)", + "ger": "Weinberg - (128)", + "pol": "Winnica - (128)", + "rus": "Виноградник - (128)" }, "Template": "FarmBuilding" }, @@ -10899,10 +10899,10 @@ "Identifier": "Agriculture_01_field (Grain Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Grain Field", - "ger": "Getreidefeld", - "pol": "Pole zboża", - "rus": "Поле пшеницы" + "eng": "Grain Field - (144)", + "ger": "Getreidefeld - (144)", + "pol": "Pole zboża - (144)", + "rus": "Поле пшеницы - (144)" }, "Template": "Farmfield" }, @@ -10918,10 +10918,10 @@ "Identifier": "Agriculture_02_field (Pasture)", "InfluenceRadius": 0, "Localization": { - "eng": "Pasture", - "ger": "Rindergehege", - "pol": "Pastwisko", - "rus": "Пастбище" + "eng": "Pasture - (4)", + "ger": "Rindergehege - (4)", + "pol": "Pastwisko - (4)", + "rus": "Пастбище - (4)" }, "Template": "Farmfield" }, @@ -10937,10 +10937,10 @@ "Identifier": "Agriculture_03_field (Hop Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Hop Field", - "ger": "Hopfenfeld", - "pol": "Pole chmielu", - "rus": "Поле хмеля" + "eng": "Hop Field - (96)", + "ger": "Hopfenfeld - (96)", + "pol": "Pole chmielu - (96)", + "rus": "Поле хмеля - (96)" }, "Template": "Farmfield" }, @@ -10956,10 +10956,10 @@ "Identifier": "Agriculture_04_field (Potato Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Potato Field", - "ger": "Kartoffelfeld", - "pol": "Pole ziemniaków", - "rus": "Картофельное поле" + "eng": "Potato Field - (72)", + "ger": "Kartoffelfeld - (72)", + "pol": "Pole ziemniaków - (72)", + "rus": "Картофельное поле - (72)" }, "Template": "Farmfield" }, @@ -10975,10 +10975,10 @@ "Identifier": "Agriculture_06_field (Sheepfold)", "InfluenceRadius": 0, "Localization": { - "eng": "Sheepfold", - "ger": "Schafpferch", - "pol": "Zagroda owiec", - "rus": "Овчарня" + "eng": "Sheepfold - (3)", + "ger": "Schafpferch - (3)", + "pol": "Zagroda owiec - (3)", + "rus": "Овчарня - (3)" }, "Template": "Farmfield" }, @@ -10994,10 +10994,10 @@ "Identifier": "Agriculture_08_field (Pig Sty)", "InfluenceRadius": 0, "Localization": { - "eng": "Pig Sty", - "ger": "Schweinestall", - "pol": "Zagroda świń", - "rus": "Свинарник" + "eng": "Pig Sty - (5)", + "ger": "Schweinestall - (5)", + "pol": "Zagroda świń - (5)", + "rus": "Свинарник - (5)" }, "Template": "Farmfield" }, @@ -11013,10 +11013,10 @@ "Identifier": "Agriculture_10_field (Vines)", "InfluenceRadius": 0, "Localization": { - "eng": "Vines", - "ger": "Weingut", - "pol": "Uprawa winorośli", - "rus": "Виноградники" + "eng": "Vines - (128)", + "ger": "Weingut - (128)", + "pol": "Uprawa winorośli - (128)", + "rus": "Виноградники - (128)" }, "Template": "Farmfield" }, @@ -11032,10 +11032,10 @@ "Identifier": "Agriculture_11_field (Pepper Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Pepper Crop", - "ger": "Paprikafeld", - "pol": "Uprawa papryki", - "rus": "Перец" + "eng": "Pepper Crop - (108)", + "ger": "Paprikafeld - (108)", + "pol": "Uprawa papryki - (108)", + "rus": "Перец - (108)" }, "Template": "Farmfield" }, @@ -11374,10 +11374,10 @@ "Identifier": "Agriculture_colony01_01 (Sugar Cane Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Sugar Cane Plantation", - "ger": "Zuckerrohrplantage", - "pol": "Plantacja trzciny cukrowej", - "rus": "Плантация тростника" + "eng": "Sugar Cane Plantation - (128)", + "ger": "Zuckerrohrplantage - (128)", + "pol": "Plantacja trzciny cukrowej - (128)", + "rus": "Плантация тростника - (128)" }, "Template": "FarmBuilding" }, @@ -11393,10 +11393,10 @@ "Identifier": "Agriculture_colony01_02 (Tobacco Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Tobacco Plantation", - "ger": "Tabakplantage", - "pol": "Plantacja tytoniu", - "rus": "Плантация табака" + "eng": "Tobacco Plantation - (192)", + "ger": "Tabakplantage - (192)", + "pol": "Plantacja tytoniu - (192)", + "rus": "Плантация табака - (192)" }, "Template": "FarmBuilding" }, @@ -11412,10 +11412,10 @@ "Identifier": "Agriculture_colony01_03 (Cotton Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Cotton Plantation", - "ger": "Baumwollplantage", - "pol": "Plantacja bawełny", - "rus": "Плантация хлопка" + "eng": "Cotton Plantation - (144)", + "ger": "Baumwollplantage - (144)", + "pol": "Plantacja bawełny - (144)", + "rus": "Плантация хлопка - (144)" }, "Template": "FarmBuilding" }, @@ -11431,10 +11431,10 @@ "Identifier": "Agriculture_colony01_04 (Cocoa Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Cocoa Plantation", - "ger": "Kakaoplantage", - "pol": "Plantacja kakaowców", - "rus": "Плантация какао" + "eng": "Cocoa Plantation - (128)", + "ger": "Kakaoplantage - (128)", + "pol": "Plantacja kakaowców - (128)", + "rus": "Плантация какао - (128)" }, "Template": "FarmBuilding" }, @@ -11450,10 +11450,10 @@ "Identifier": "Agriculture_colony01_05 (Caoutchouc Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Caoutchouc Plantation", - "ger": "Kautschuckplantage", - "pol": "Plantacja kauczuku", - "rus": "Плантация каучука" + "eng": "Caoutchouc Plantation - (144)", + "ger": "Kautschuckplantage - (144)", + "pol": "Plantacja kauczuku - (144)", + "rus": "Плантация каучука - (144)" }, "Template": "FarmBuilding" }, @@ -11488,10 +11488,10 @@ "Identifier": "Agriculture_colony01_07 (Coffee Beans Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Coffee Plantation", - "ger": "Kaffeeplantage", - "pol": "Plantacja kawy", - "rus": "Кофейная плантация" + "eng": "Coffee Plantation - (168)", + "ger": "Kaffeeplantage - (168)", + "pol": "Plantacja kawy - (168)", + "rus": "Кофейная плантация - (168)" }, "Template": "FarmBuilding" }, @@ -11507,10 +11507,10 @@ "Identifier": "Agriculture_colony01_08 (Banana Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Plantain Plantation", - "ger": "Bananenplantage", - "pol": "Plantacja bananów", - "rus": "Банановая плантация" + "eng": "Plantain Plantation - (128)", + "ger": "Bananenplantage - (128)", + "pol": "Plantacja bananów - (128)", + "rus": "Банановая плантация - (128)" }, "Template": "FarmBuilding" }, @@ -11545,10 +11545,10 @@ "Identifier": "Agriculture_colony01_10 (Corn Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Corn Farm", - "ger": "Maisplantage", - "pol": "Plantacja kukurydzy", - "rus": "Кукурузная ферма" + "eng": "Corn Farm - (168)", + "ger": "Maisplantage - (168)", + "pol": "Plantacja kukurydzy - (168)", + "rus": "Кукурузная ферма - (168)" }, "Template": "FarmBuilding" }, @@ -11564,10 +11564,10 @@ "Identifier": "Agriculture_colony01_11 (Alpaca Farm)", "InfluenceRadius": 0, "Localization": { - "eng": "Alpaca Farm", - "ger": "Alpakafarm", - "pol": "Farma alpak", - "rus": "Ферма альпака" + "eng": "Alpaca Farm - (4)", + "ger": "Alpakafarm - (4)", + "pol": "Farma alpak - (4)", + "rus": "Ферма альпака - (4)" }, "Template": "FarmBuilding" }, @@ -11906,10 +11906,10 @@ "Identifier": "Agriculture_colony01_01_field (Sugar Cane Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Sugar Cane Crop", - "ger": "Zuckerrohrfeld", - "pol": "Pole trzciny cukrowej", - "rus": "Поле сахарного тростника" + "eng": "Sugar Cane Crop - (128)", + "ger": "Zuckerrohrfeld - (128)", + "pol": "Pole trzciny cukrowej - (128)", + "rus": "Поле сахарного тростника - (128)" }, "Template": "Farmfield" }, @@ -11925,10 +11925,10 @@ "Identifier": "Agriculture_colony01_02_field (Tobacco Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Tobacco Field", - "ger": "Tabakfeld", - "pol": "Pole tytoniu", - "rus": "Поле табака" + "eng": "Tobacco Field - (192)", + "ger": "Tabakfeld - (192)", + "pol": "Pole tytoniu - (192)", + "rus": "Поле табака - (192)" }, "Template": "Farmfield" }, @@ -11944,10 +11944,10 @@ "Identifier": "Agriculture_colony01_03_field (Cotton Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Cotton Field", - "ger": "Baumwollfeld", - "pol": "Pole bawełny", - "rus": "Хлопковое поле" + "eng": "Cotton Field - (144)", + "ger": "Baumwollfeld - (144)", + "pol": "Pole bawełny - (144)", + "rus": "Хлопковое поле - (144)" }, "Template": "Farmfield" }, @@ -11963,10 +11963,10 @@ "Identifier": "Agriculture_colony01_04_field (Cocoa Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Cocoa Grove", - "ger": "Kakaofeld", - "pol": "Pole kakaowców", - "rus": "Деревья какао" + "eng": "Cocoa Grove - (128)", + "ger": "Kakaofeld - (128)", + "pol": "Pole kakaowców - (128)", + "rus": "Деревья какао - (128)" }, "Template": "Farmfield" }, @@ -11982,10 +11982,10 @@ "Identifier": "Agriculture_colony01_05_field (Caoutchouc Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Caoutchouc Grove", - "ger": "Kautschukfeld", - "pol": "Pole kauczuku", - "rus": "Каучуковые деревья" + "eng": "Caoutchouc Grove - (144)", + "ger": "Kautschukfeld - (144)", + "pol": "Pole kauczuku - (144)", + "rus": "Каучуковые деревья - (144)" }, "Template": "Farmfield" }, @@ -12001,10 +12001,10 @@ "Identifier": "Agriculture_colony01_07_field (Coffee Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Coffee Crop", - "ger": "Kaffeefeld", - "pol": "Uprawa kawy", - "rus": "Кофейные деревья" + "eng": "Coffee Crop - (168)", + "ger": "Kaffeefeld - (168)", + "pol": "Uprawa kawy - (168)", + "rus": "Кофейные деревья - (168)" }, "Template": "Farmfield" }, @@ -12020,10 +12020,10 @@ "Identifier": "Agriculture_colony01_08_field (Banana Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Plantain Grove", - "ger": "Bananenplantage", - "pol": "Zagajnik bananowców", - "rus": "Банановая роща" + "eng": "Plantain Grove - (128)", + "ger": "Bananenplantage - (128)", + "pol": "Zagajnik bananowców - (128)", + "rus": "Банановая роща - (128)" }, "Template": "Farmfield" }, @@ -12039,10 +12039,10 @@ "Identifier": "Agriculture_colony01_10_field (Corn Field)", "InfluenceRadius": 0, "Localization": { - "eng": "Cornfield", - "ger": "Maisfeld", - "pol": "Pole kukurydzy", - "rus": "Кукурузное поле" + "eng": "Cornfield - (168)", + "ger": "Maisfeld - (168)", + "pol": "Pole kukurydzy - (168)", + "rus": "Кукурузное поле - (168)" }, "Template": "Farmfield" }, @@ -12237,5 +12237,5 @@ "Template": "Warehouse" } ], - "Version": "0.8.4" + "Version": "0.8.5" } \ No newline at end of file diff --git a/PresetParser/Program.cs b/PresetParser/Program.cs index b0f63ce9..16918c84 100644 --- a/PresetParser/Program.cs +++ b/PresetParser/Program.cs @@ -23,7 +23,7 @@ public class Program private const string ANNO_VERSION_2205 = "2205"; private const string ANNO_VERSION_1800 = "1800"; - private const string BUILDING_PRESETS_VERSION = "0.8.4"; + private const string BUILDING_PRESETS_VERSION = "0.8.5"; // Initalisizing Language Directory's and Filenames private static readonly string[] Languages = new[] { "eng", "ger", "pol", "rus" }; private static readonly string[] LanguagesFiles2205 = new[] { "english", "german", "polish", "russian" }; @@ -35,23 +35,23 @@ public class Program #region Initalisizing Exclude IdentifierNames, FactionNames and TemplateNames for presets.json file - #region Anno 1404 + #region Anno 1404 private static readonly List ExcludeNameList1404 = new List { "ResidenceRuin", "AmbassadorRuin", "CitizenHouse", "PatricianHouse", "NoblemanHouse", "AmbassadorHouse", "Gatehouse", "StorehouseTownPart", "ImperialCathedralPart", "SultanMosquePart", "Warehouse02", "Warehouse03", "Markethouse02", "Markethouse03", "TreeBuildCost", "BanditCamp"}; private static readonly List ExcludeTemplateList1404 = new List { "OrnamentBuilding", "Wall" }; #endregion - #region Anno 2070 * Also on FactionName Excludes * - private static readonly List ExcludeNameList2070 = new List { "distillery_field" , "citizen_residenc", "executive_residence", "leader_residence", + #region Anno 2070 * Also on FactionName Excludes * + private static readonly List ExcludeNameList2070 = new List { "distillery_field" , "citizen_residenc", "executive_residence", "leader_residence", "ruin_residence" , "villager_residence" ,"builder_residence", "creator_residence" ,"scientist_residence", "genius_residence", "monument_unfinished", "town_center_variation", "underwater_energy_transmitter", "iron_mine", "nuclearpowerplant_destroyed","limestone_quarry", "markethouse2", "markethouse3", "warehouse2","warehouse3", "cybernatic_factory","vegetable_farm_field","electronic_recycler"}; - private static readonly List ExcludeTemplateList2070 = new List { "OrnamentBuilding", "OrnamentFeedbackBuilding", "Ark" }; - private static readonly List ExcludeFactionList2070 = new List { "third party" }; - #endregion + private static readonly List ExcludeTemplateList2070 = new List { "OrnamentBuilding", "OrnamentFeedbackBuilding", "Ark" }; + private static readonly List ExcludeFactionList2070 = new List { "third party" }; + #endregion - #region Anno 2205 Also a GUID Checker for excluding. Do not change any numbers below + #region Anno 2205 Also a GUID Checker for excluding. Do not change any numbers below private static readonly List ExcludeGUIDList2205 = new List { "1001178", "1000737", "7000274", "1001175", "1000736", "7000275", "1000672", "1000755", "7000273", "1001171", "1000703", "7000272", "7000420", "7000421", "7000423", "7000424", "7000425", "7000427", "7000428", "7000429", "7000430", "7000431", "12000009", "12000010", "12000011", "12000020", "12000036", "1000063", "1000170", "1000212", "1000213", "1000174", @@ -65,10 +65,11 @@ public class Program private static readonly List testGUIDNames2205 = new List { "NODOUBLES YET" }; #endregion - #region anno 1800 - /// - /// i need the IncludeBuildingsTemplateNames to get Building informaton from, as it is also the Presets Template String or Template GUID - /// + #region anno 1800 + /// + /// i need the IncludeBuildingsTemplateNames to get Building informaton from, as it is also the Presets Template String or Template GUID + /// + public static IList farmFieldList1800 = new List(); private static readonly List IncludeBuildingsTemplateNames1800 = new List { "ResidenceBuilding7", "FarmBuilding", "FreeAreaBuilding", "FactoryBuilding7", "HeavyFactoryBuilding", "SlotFactoryBuilding7", "Farmfield", "OilPumpBuilding", "PublicServiceBuilding", "CityInstitutionBuilding", "CultureBuilding", "Market", "Warehouse", "CultureModule", "PowerplantBuilding", "HarborOffice", "HarborWarehouse7", "HarborDepot","Shipyard","HarborBuildingAttacker", "RepairCrane", "HarborLandingStage7", "VisitorPier", "WorkforceConnector", "Guildhouse"}; @@ -85,21 +86,21 @@ public class Program /// OW1 (Old World - Jornaleros) and OW2 (Old World - Obreros) /// <2> wil be the Group under <1>, like Production, Public, etc /// - #endregion + #endregion + + #endregion - #endregion - #region Set Icon File Name seperations private static string GetIconFilename(XmlNode iconNode, string annoVersion) { string annoIdexNumber = ""; - if (annoVersion == ANNO_VERSION_1404) + if (annoVersion == ANNO_VERSION_1404) { annoIdexNumber = "A4_"; } /* For Anno 2070, we use the normal icon names, without the AnnoIndexNUmber ('A5_'), because anno 2070 has already the right names in previous Anno Designer versions. */ - return string.Format("{0}icon_{1}_{2}.png", annoIdexNumber , iconNode["IconFileID"].InnerText, iconNode["IconIndex"] != null ? iconNode["IconIndex"].InnerText : "0"); //TODO: check this icon format is consistent between Anno versions + return string.Format("{0}icon_{1}_{2}.png", annoIdexNumber, iconNode["IconFileID"].InnerText, iconNode["IconIndex"] != null ? iconNode["IconIndex"].InnerText : "0"); //TODO: check this icon format is consistent between Anno versions } #endregion @@ -182,7 +183,7 @@ public static void Main(string[] args) /// The RDA's should all be extracted into the same directory. /// //These should stay constant for different anno versions (hopefully!) - #region Anno 1404 xPaths + #region Anno 1404 xPaths if (annoVersion == ANNO_VERSION_1404) { VersionSpecificPaths.Add(ANNO_VERSION_1404, new Dictionary()); @@ -206,9 +207,9 @@ public static void Main(string[] args) new PathRef("addondata/config/balancing/addon_01_assets.xml", "/Group/Groups/Group/Groups/Group", "Groups/Group/Groups/Group/Assets/Asset", "PlayerBuildings") }); } - #endregion + #endregion - #region Anno 2070 xPaths + #region Anno 2070 xPaths if (annoVersion == ANNO_VERSION_2070) { VersionSpecificPaths.Add(ANNO_VERSION_2070, new Dictionary()); @@ -231,9 +232,9 @@ public static void Main(string[] args) new PathRef("addondata/config/balancing/addon_01_assets.xml", "/Group/Groups/Group", "Groups/Group/Groups/Group/Groups/Group/Assets/Asset", "Buildings") }); } - #endregion + #endregion - #region Anno 2205 xPaths + #region Anno 2205 xPaths if (annoVersion == ANNO_VERSION_2205) { VersionSpecificPaths.Add(ANNO_VERSION_2205, new Dictionary()); @@ -275,7 +276,7 @@ public static void Main(string[] args) } #endregion - #region Anno 1800 xPaths + #region Anno 1800 xPaths if (annoVersion == ANNO_VERSION_1800) { VersionSpecificPaths.Add(ANNO_VERSION_1800, new Dictionary()); @@ -324,7 +325,7 @@ public static void Main(string[] args) #endregion // parse buildings // find buildings in assets.xml - + foreach (PathRef p in assetPathRefs) { ParseAssetsFile(BASE_PATH + p.Path, p.XPath, p.YPath, buildings, iconNodes, localizations, p.InnerNameTag, annoVersion); @@ -366,7 +367,7 @@ public static void Main(string[] args) Console.WriteLine(); Console.WriteLine("DONE - press enter to exit"); Console.ReadLine(); - + } #endregion //End Prepare JSON Files @@ -715,7 +716,7 @@ private static void ParseBuilding2205(List buildings, XmlNode buil string langNodeStartPath = "/TextExport/Texts/Text"; string langNodeDepth = "Text"; int languageCount = 0; - LanguagesFiles= LanguagesFiles2205; + LanguagesFiles = LanguagesFiles2205; //Initialise the dictionary b.Localization = new SerializableDictionary(); @@ -768,7 +769,7 @@ private static void ParseBuilding2205(List buildings, XmlNode buil translation = values["Standard"]["Name"].InnerText; } b.Localization.Dict.Add(Languages[languageCount], translation); - if (testVersion==true && annoVersion==ANNO_VERSION_2205) + if (testVersion == true && annoVersion == ANNO_VERSION_2205) { if (languageCount == 0) { @@ -937,7 +938,7 @@ private static void ParseBuilding1800(List buildings, XmlNode buil { icon = values["Standard"]["IconFilename"].InnerText; } - + if (icon != null) { /// Split the Value innertext to get only the Name.png @@ -960,7 +961,7 @@ private static void ParseBuilding1800(List buildings, XmlNode buil case "Agriculture_colony01_09 (Cattle Farm)": b.IconFileName = replaceName + "meat_raw.png"; break; case "Service_colony01_01 (Marketplace)": b.IconFileName = replaceName + "market.png"; break; case "Service_colony01_02 (Chapel)": b.IconFileName = replaceName + "church.png"; break; - case "Kontor_main_01":b.IconFileName = replaceName + "harbour_buildings.png"; break; + case "Kontor_main_01": b.IconFileName = replaceName + "harbour_buildings.png"; break; } } #endregion @@ -969,7 +970,7 @@ private static void ParseBuilding1800(List buildings, XmlNode buil // read influence radius if existing try { - b.InfluenceRadius = Convert.ToInt32(values["FreeAreaProductivity"]["InfluenceRadius"].InnerText); + b.InfluenceRadius = Convert.ToInt32(values["FreeAreaProductivity"]["InfluenceRadius"].InnerText); } catch (NullReferenceException ex) { } #endregion @@ -1008,7 +1009,7 @@ private static void ParseBuilding1800(List buildings, XmlNode buil { //"[AsserData(2001009): ", //Split the taranslation text ( and ) marking the GUID, and use the second value in nextGUID[]. - string[] nextGuid = translation.Split('(',')'); + string[] nextGuid = translation.Split('(', ')'); translationNodes = langDocument.SelectNodes(langNodeStartPath) .Cast().SingleOrDefault(_ => _["GUID"].InnerText == nextGuid[1]); translation = translationNodes?.SelectNodes(langNodeDepth)?.Item(0).InnerText; @@ -1022,6 +1023,33 @@ private static void ParseBuilding1800(List buildings, XmlNode buil } translation = values["Standard"]["Name"].InnerText; } + if (templateName == "FarmBuilding" || templateName=="Farmfield") + { + string fieldAmountValue = null, fieldGuidValue = null; + switch (templateName) + { + case "FarmBuilding": { fieldGuidValue = values["ModuleOwner"]["ConstructionOptions"]["Item"]["ModuleGUID"].InnerText; fieldAmountValue = values?["ModuleOwner"]?["ModuleLimit"]?.InnerText; break; }; + case "Farmfield": { fieldGuidValue = values["Standard"]["GUID"].InnerText; fieldAmountValue = "0"; break; } + } + if (fieldAmountValue != null) + { + bool getFieldGuidBool = false; + foreach (var getFieldGuid in farmFieldList1800) + { + if (getFieldGuid.fieldGUID == fieldGuidValue) + { + getFieldGuidBool = true; + fieldAmountValue = getFieldGuid.fieldAmount; + break; + } + } + if (!getFieldGuidBool) + { + farmFieldList1800.Add(new FarmField() { fieldGUID = fieldGuidValue, fieldAmount = fieldAmountValue }); + } + translation = translation + " - (" + fieldAmountValue + ")"; + } + } b.Localization.Dict.Add(Languages[languageCount], translation); languageCount++; } @@ -1032,6 +1060,7 @@ private static void ParseBuilding1800(List buildings, XmlNode buil buildings.Add(b); } #endregion + /// Other Classes and or Internal Commands used in this program #region Retrieving BuildingBlockers from Buidings Nodes private static bool RetrieveBuildingBlocker(BuildingInfo building, string variationFilename, string annoVersion) @@ -1063,7 +1092,7 @@ private static bool RetrieveBuildingBlocker(BuildingInfo building, string variat } if (ZF > 0) { - building.BuildBlocker["z"] = Convert.ToInt32(ZF); + building.BuildBlocker["z"] = Convert.ToInt32(ZF); } else { @@ -1140,6 +1169,7 @@ private static bool RetrieveBuildingBlocker(BuildingInfo building, string variat #endregion #region ParseBuildingBlockerNumber for anno 1800 + private static int ParseBuildingBlockerNumber(string number) { string[] xz = new[] { "" }; @@ -1323,7 +1353,16 @@ private static void WriteIconNameMapping(IEnumerable iconNodes, Diction } #endregion + #region FarmField Ilist commands for Anno 1800 + public class FarmField + { + public string fieldGUID { get; set; } + public string fieldAmount { get; set; } + } + #endregion + #region PathRef Class + private class PathRef { public string Path { get; }