From 3c3cf9cb5557b1e29eed0d33e081a3e0a09c166f Mon Sep 17 00:00:00 2001 From: FromDarkHell Date: Sat, 25 Sep 2021 13:58:25 -0500 Subject: [PATCH] v1.0.2: Release cleanup - Fix #5 - Fix #4 (Missing vault cards currently) - Fix #2 - Add in the "short stick", it appears that my JSON data is somehow a bit wrong.... :/ - Add in badges just because (: - Do some commenting for the helpers for future readers - Make the `Check for Updates` button properly work... Oops (: - Version bump of course --- BL3SaveEditor/AutoUpdater.xml | 2 +- BL3SaveEditor/Helpers/Helpers.cs | 59 +- BL3SaveEditor/MainWindow.xaml | 33 +- BL3SaveEditor/MainWindow.xaml.cs | 82 +- BL3SaveEditor/Properties/AssemblyInfo.cs | 4 +- .../Items/Mappings/balance_to_inv_data.json | 2 +- .../Items/Mappings/balance_to_inv_key.json | 2 +- .../Items/Mappings/part_name_mapping.json | 1628 +---------------- .../Items/Mappings/prefix_name_mapping.json | 2 +- .../Items/Mappings/valid_part_database.json | 8 + README.md | 2 + 11 files changed, 143 insertions(+), 1681 deletions(-) diff --git a/BL3SaveEditor/AutoUpdater.xml b/BL3SaveEditor/AutoUpdater.xml index 7260cc5..c72bd76 100644 --- a/BL3SaveEditor/AutoUpdater.xml +++ b/BL3SaveEditor/AutoUpdater.xml @@ -1,7 +1,7 @@  - 1.0.1.0 + 1.0.2.0 https://github.com/FromDarkHell/BL3SaveEditor/releases/latest/download/BL3SaveEditor-Portable.zip https://github.com/FromDarkHell/BL3SaveEditor/releases/latest false diff --git a/BL3SaveEditor/Helpers/Helpers.cs b/BL3SaveEditor/Helpers/Helpers.cs index 1366675..be24c5e 100644 --- a/BL3SaveEditor/Helpers/Helpers.cs +++ b/BL3SaveEditor/Helpers/Helpers.cs @@ -26,6 +26,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return value; } } + /// /// A WPF value converter which converts a UInt32 amount of seconds to a TimeSpan (and back and forth) /// @@ -40,6 +41,9 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu } } + /// + /// A WPF multi-value converter which will only return true if all of the variables passed can be converted ot a bool; and resolve as True. + /// public class AndConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { if (values.Any(v => ReferenceEquals(v, DependencyProperty.UnsetValue))) @@ -58,6 +62,9 @@ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, } } + /// + /// A WPF value converter which implements a simple limiting function on the passed parameter (as an integer) + /// public class IntegerLimiterConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { int limit = System.Convert.ToInt32(parameter); @@ -74,6 +81,9 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu } #region Specialized Converters + /// + /// A simple WPF converter that converts the EXP points of a player to the specified level + /// public class EXPointToLevelConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return PlayerXP.GetLevelForPoints(System.Convert.ToInt32(value)); @@ -83,6 +93,12 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return PlayerXP.GetPointsForXPLevel(System.Convert.ToInt32(value)); } } + + /// + /// A simple WPF converter that converts the XP level of a player to the specified XP points + /// + /// See also: + /// public class LevelToEXPointConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return PlayerXP.GetPointsForXPLevel(System.Convert.ToInt32(value)); @@ -92,6 +108,9 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return PlayerXP.GetLevelForPoints(System.Convert.ToInt32(value)); } } + /// + /// A WPF value converter that converts the player class () to a string based off of the path + /// public class StringToCharacterClassConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) { @@ -112,9 +131,11 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu } return null; } - - } + + /// + /// A simple WPF value converter which converts the struct to a native C# struct. + /// public class CustomPlayerColorToColorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { @@ -153,6 +174,10 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return null; } } + + /// + /// A simple WPF value converter which converts the passed in customization path to a "human safe" name + /// public class CustomizationToStringConverter : IValueConverter { private Character chx = null; public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { @@ -227,6 +252,10 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return null; } } + + /// + /// A WPF value converter which converts the given parameter ("money"/"eridium") to the integer value based off of the stored character in value + /// public class CurrencyToIntegerConverter : IValueConverter { private Character chx = null; private uint currencyHash = 0; @@ -236,18 +265,12 @@ public object Convert(object value, Type targetType, object parameter, CultureIn string param = (string)parameter; chx = (Character)value; switch (param) { - case "golden": - currencyHash = DataPathTranslations.GoldenKeyHash; - break; case "money": currencyHash = DataPathTranslations.MoneyHash; break; case "eridium": currencyHash = DataPathTranslations.EridiumHash; break; - case "diamond": - currencyHash = DataPathTranslations.DiamondKeyHash; - break; default: break; } @@ -277,6 +300,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return chx; } } + public class TravelStationConverter : IMultiValueConverter { private Character chx = null; private bool bShowDbgMaps = false; @@ -323,6 +347,10 @@ public object[] ConvertBack(object value, Type[] targetType, object parameter, C return null; } } + + /// + /// Converts the most active playthrough of the stored in value to a string (NVHM/TVHM) + /// public class PlaythroughToStringConverter : IValueConverter { private static readonly string[] indexToString = new string[] { "NVHM", @@ -346,6 +374,10 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return chx; } } + + /// + /// Converts guardian rank data to a valid data grid type ( + /// public class GuardianRankToDataGridConverter : IValueConverter { private Profile prf = null; @@ -377,12 +409,15 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return prf; } } + public class KeyToIntegerConverter : IValueConverter { private Profile prf = null; public static Dictionary stringToHash = new Dictionary() { { "GoldenKeys", DataPathTranslations.GoldenKeyHash }, - { "DiamondKeys", DataPathTranslations.DiamondKeyHash } + { "DiamondKeys", DataPathTranslations.DiamondKeyHash }, + { "VaultCard1Keys", DataPathTranslations.VaultCard1Hash }, + { "VaultCard2Keys", DataPathTranslations.VaultCard2Hash } }; public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { @@ -446,8 +481,11 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu return prf; } } + + /// + /// A WPF converter that returns the first object that is not set to null in the multiple values passed in to the multi-value converter + /// public class MultiElementObjectBinder : IMultiValueConverter { - public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture) { foreach (object obj in value) { if (obj != null && obj != DependencyProperty.UnsetValue) { @@ -462,6 +500,7 @@ public object[] ConvertBack(object value, Type[] targetType, object parameter, C return null; } } + public class IntegerToMayhemLevelConverter : IValueConverter { private Borderlands3Serial serial = null; public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { diff --git a/BL3SaveEditor/MainWindow.xaml b/BL3SaveEditor/MainWindow.xaml index 6eb321d..5ad95cc 100644 --- a/BL3SaveEditor/MainWindow.xaml +++ b/BL3SaveEditor/MainWindow.xaml @@ -57,8 +57,8 @@ + VerticalAlignment="Top" Background="{DynamicResource {x:Static adonisUi:Brushes.Layer0BackgroundBrush}}" + Height="30">