diff --git a/LibX4/Xml/XAttributeExtension.cs b/LibX4/Xml/XAttributeExtension.cs index 931ba792..c0ccda8e 100644 --- a/LibX4/Xml/XAttributeExtension.cs +++ b/LibX4/Xml/XAttributeExtension.cs @@ -29,6 +29,25 @@ public static double GetDouble(this XAttribute? attr) } + /// + /// XML 属性の値を double として取得する。変換できない場合は default と見なす。 + /// + /// 値を取得する XML 属性 + /// 変換済みの属性値又は 0.0 + public static double GetDoubleOrDefault(this XAttribute? attr) + { + try + { + var value = attr?.Value ?? throw XmlFormatException.CreateFrom(attr); + return double.Parse(value, CultureInfo.InvariantCulture); + } + catch + { + return default; + } + } + + /// /// XML 属性の値を int として取得する /// diff --git a/X4_ComplexCalculator/Localization/Lang.csv b/X4_ComplexCalculator/Localization/Lang.csv index 62c29925..f3e8730b 100644 --- a/X4_ComplexCalculator/Localization/Lang.csv +++ b/X4_ComplexCalculator/Localization/Lang.csv @@ -149,7 +149,7 @@ CheckUpdate_NowDownloading;Downloading the update... # Station Calculator import/export dialog # ------------------------------------------------------ StationCalculatorExport_Title;Export to Station Calculator -StationCalculatorExport_Description;Please copy the URL.\r\nNote: The following modules are excluded.\r\n・Venture module +StationCalculatorExport_Description;Please copy the URL.\r\nNote: The following modules are excluded.\r\n・Venture module\r\n・Paranid Faction Capital\r\n・Condensate Containment Facility StationCalculatorImport_Title;Importing from Station Calculator StationCalculatorImport_Description;Please enter the URL displayed when you click the \r\nShare button at the top of Station Calculator. diff --git a/X4_ComplexCalculator/Localization/Lang.ja-JP.csv b/X4_ComplexCalculator/Localization/Lang.ja-JP.csv index e9bcf96b..8d877b47 100644 --- a/X4_ComplexCalculator/Localization/Lang.ja-JP.csv +++ b/X4_ComplexCalculator/Localization/Lang.ja-JP.csv @@ -149,7 +149,7 @@ CheckUpdate_NowDownloading;ダウンロード中... # Station Calculator import/export dialog # ------------------------------------------------------ StationCalculatorExport_Title;Station Calculatorへエクスポート -StationCalculatorExport_Description;URLをコピーして下さい\r\n注) 以下のモジュールは除外しています。\r\n・探検モジュール +StationCalculatorExport_Description;URLをコピーして下さい\r\n注) 以下のモジュールは除外しています。\r\n・探検モジュール\r\n・パラニド 派閥首都\r\n・凝縮物質格納施設 StationCalculatorImport_Title;Station Calculatorからインポート StationCalculatorImport_Description;Station Calculator上部のShareボタンをクリックした時に\r\n表示されるURLを入力してください diff --git a/X4_ComplexCalculator/Main/Menu/File/Export/StationCalculatorExport.cs b/X4_ComplexCalculator/Main/Menu/File/Export/StationCalculatorExport.cs index fd1fa824..ff9537cb 100644 --- a/X4_ComplexCalculator/Main/Menu/File/Export/StationCalculatorExport.cs +++ b/X4_ComplexCalculator/Main/Menu/File/Export/StationCalculatorExport.cs @@ -1,4 +1,5 @@ using Prism.Mvvm; +using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Input; @@ -49,9 +50,19 @@ public bool Export(IWorkArea WorkArea) // モジュール情報を追加 sb.Append("l=@"); + + var ignoreModuleTypeIds = new HashSet() { + "ventureplatform", + }; + + var ignoreModuleIds = new HashSet() { + "module_gen_dock_m_venturer_01", + "module_par_def_claim_story_01", + "module_pir_stor_condensate_s_01", + }; + var modules = WorkArea.StationData.ModulesInfo.Modules - .Where(x => x.Module.ModuleType.ModuleTypeID != "ventureplatform" - && x.Module.ID != "module_gen_dock_m_venturer_01"); + .Where(x => !ignoreModuleTypeIds.Contains(x.Module.ModuleType.ModuleTypeID) && !ignoreModuleIds.Contains(x.Module.ID)); foreach (var module in modules) { diff --git a/X4_ComplexCalculator/Main/WorkArea/UI/ModulesGrid/SelectModule/SelectModuleModel.cs b/X4_ComplexCalculator/Main/WorkArea/UI/ModulesGrid/SelectModule/SelectModuleModel.cs index b7d88b51..149349a4 100644 --- a/X4_ComplexCalculator/Main/WorkArea/UI/ModulesGrid/SelectModule/SelectModuleModel.cs +++ b/X4_ComplexCalculator/Main/WorkArea/UI/ModulesGrid/SelectModule/SelectModuleModel.cs @@ -134,7 +134,7 @@ private void UpdateModulesMain() var newModules = X4Database.Instance.Ware.GetAll() .Where(x => - !x.Tags.Contains("noplayerblueprint") && + !(x.Tags.Contains("noplayerblueprint") || x.Tags.Contains("noblueprint")) && checkedModuleTypes.Contains(x.ModuleType.ModuleTypeID) && checkedOwners.Intersect(x.Owners.Select(y => y.FactionID)).Any()) .Select(x => new ModulesListItem(x)); diff --git a/X4_ComplexCalculator/Main/WorkArea/UI/StationSettings/StationSettings.xaml b/X4_ComplexCalculator/Main/WorkArea/UI/StationSettings/StationSettings.xaml index 697c649e..12f0297a 100644 --- a/X4_ComplexCalculator/Main/WorkArea/UI/StationSettings/StationSettings.xaml +++ b/X4_ComplexCalculator/Main/WorkArea/UI/StationSettings/StationSettings.xaml @@ -89,7 +89,7 @@ DefaultValue="100" FormatString="{}{0:F3} %" Increment="0.001" - Maximum="1000" + Maximum="100000" Minimum="0" Value="{Binding Sunlight, Mode=TwoWay, Converter={StaticResource DoubleUpDownConverter}}" /> diff --git a/X4_DataExporterWPF/Export/Ware/WareEffectExporter.cs b/X4_DataExporterWPF/Export/Ware/WareEffectExporter.cs index ab7d213e..b84a5074 100644 --- a/X4_DataExporterWPF/Export/Ware/WareEffectExporter.cs +++ b/X4_DataExporterWPF/Export/Ware/WareEffectExporter.cs @@ -94,10 +94,7 @@ internal IEnumerable GetRecords(IProgress<(int currentStep, int maxS var effectID = effect.Attribute("type")?.Value; if (string.IsNullOrEmpty(effectID)) continue; - if (!double.TryParse(effect.Attribute("product")?.Value, out var product)) - { - product = 0.0; - } + var product = effect.Attribute("product")?.GetDoubleOrDefault() ?? 0.0; yield return new WareEffect(wareID, method, effectID, product); }