Skip to content

Commit 3c3cf9c

Browse files
committed
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
1 parent 942d8ee commit 3c3cf9c

File tree

11 files changed

+143
-1681
lines changed

11 files changed

+143
-1681
lines changed

BL3SaveEditor/AutoUpdater.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<item>
4-
<version>1.0.1.0</version>
4+
<version>1.0.2.0</version>
55
<url>https://github.com/FromDarkHell/BL3SaveEditor/releases/latest/download/BL3SaveEditor-Portable.zip</url>
66
<changelog>https://github.com/FromDarkHell/BL3SaveEditor/releases/latest</changelog>
77
<mandatory>false</mandatory>

BL3SaveEditor/Helpers/Helpers.cs

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
2626
return value;
2727
}
2828
}
29+
2930
/// <summary>
3031
/// A WPF value converter which converts a UInt32 amount of seconds to a TimeSpan (and back and forth)
3132
/// </summary>
@@ -40,6 +41,9 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
4041
}
4142
}
4243

44+
/// <summary>
45+
/// 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.
46+
/// </summary>
4347
public class AndConverter : IMultiValueConverter {
4448
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
4549
if (values.Any(v => ReferenceEquals(v, DependencyProperty.UnsetValue)))
@@ -58,6 +62,9 @@ public object[] ConvertBack(object value, Type[] targetTypes, object parameter,
5862
}
5963
}
6064

65+
/// <summary>
66+
/// A WPF value converter which implements a simple limiting function on the passed parameter (as an integer)
67+
/// </summary>
6168
public class IntegerLimiterConverter : IValueConverter {
6269
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
6370
int limit = System.Convert.ToInt32(parameter);
@@ -74,6 +81,9 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
7481
}
7582

7683
#region Specialized Converters
84+
/// <summary>
85+
/// A simple WPF converter that converts the EXP points of a player to the specified level
86+
/// </summary>
7787
public class EXPointToLevelConverter : IValueConverter {
7888
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
7989
return PlayerXP.GetLevelForPoints(System.Convert.ToInt32(value));
@@ -83,6 +93,12 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
8393
return PlayerXP.GetPointsForXPLevel(System.Convert.ToInt32(value));
8494
}
8595
}
96+
97+
/// <summary>
98+
/// A simple WPF converter that converts the XP level of a player to the specified XP points
99+
/// <para></para>
100+
/// See also: <seealso cref="EXPointToLevelConverter"/>
101+
/// </summary>
86102
public class LevelToEXPointConverter : IValueConverter {
87103
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
88104
return PlayerXP.GetPointsForXPLevel(System.Convert.ToInt32(value));
@@ -92,6 +108,9 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
92108
return PlayerXP.GetLevelForPoints(System.Convert.ToInt32(value));
93109
}
94110
}
111+
/// <summary>
112+
/// A WPF value converter that converts the player class (<see cref="PlayerClassSaveGameData"/>) to a string based off of the path
113+
/// </summary>
95114
public class StringToCharacterClassConverter : IValueConverter {
96115
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
97116
if (value != null) {
@@ -112,9 +131,11 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
112131
}
113132
return null;
114133
}
115-
116-
117134
}
135+
136+
/// <summary>
137+
/// A simple WPF value converter which converts the <see cref="CustomPlayerColorSaveGameData"/> struct to a native C# <see cref="Color"/> struct.
138+
/// </summary>
118139
public class CustomPlayerColorToColorConverter : IValueConverter {
119140
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
120141

@@ -153,6 +174,10 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
153174
return null;
154175
}
155176
}
177+
178+
/// <summary>
179+
/// A simple WPF value converter which converts the passed in customization path to a "human safe" name
180+
/// </summary>
156181
public class CustomizationToStringConverter : IValueConverter {
157182
private Character chx = null;
158183
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
227252
return null;
228253
}
229254
}
255+
256+
/// <summary>
257+
/// A WPF value converter which converts the given <c>parameter</c> ("money"/"eridium") to the integer value based off of the stored character in <c>value</c>
258+
/// </summary>
230259
public class CurrencyToIntegerConverter : IValueConverter {
231260
private Character chx = null;
232261
private uint currencyHash = 0;
@@ -236,18 +265,12 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
236265
string param = (string)parameter;
237266
chx = (Character)value;
238267
switch (param) {
239-
case "golden":
240-
currencyHash = DataPathTranslations.GoldenKeyHash;
241-
break;
242268
case "money":
243269
currencyHash = DataPathTranslations.MoneyHash;
244270
break;
245271
case "eridium":
246272
currencyHash = DataPathTranslations.EridiumHash;
247273
break;
248-
case "diamond":
249-
currencyHash = DataPathTranslations.DiamondKeyHash;
250-
break;
251274
default:
252275
break;
253276
}
@@ -277,6 +300,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
277300
return chx;
278301
}
279302
}
303+
280304
public class TravelStationConverter : IMultiValueConverter {
281305
private Character chx = null;
282306
private bool bShowDbgMaps = false;
@@ -323,6 +347,10 @@ public object[] ConvertBack(object value, Type[] targetType, object parameter, C
323347
return null;
324348
}
325349
}
350+
351+
/// <summary>
352+
/// Converts the most active playthrough of the <see cref="Character"/> stored in <c>value</c> to a string (NVHM/TVHM)
353+
/// </summary>
326354
public class PlaythroughToStringConverter : IValueConverter {
327355
private static readonly string[] indexToString = new string[] {
328356
"NVHM",
@@ -346,6 +374,10 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
346374
return chx;
347375
}
348376
}
377+
378+
/// <summary>
379+
/// Converts guardian rank data to a valid data grid type (<see cref="ObservableCollection{T}"/>
380+
/// </summary>
349381
public class GuardianRankToDataGridConverter : IValueConverter {
350382
private Profile prf = null;
351383

@@ -377,12 +409,15 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
377409
return prf;
378410
}
379411
}
412+
380413
public class KeyToIntegerConverter : IValueConverter {
381414
private Profile prf = null;
382415

383416
public static Dictionary<string, uint> stringToHash = new Dictionary<string, uint>() {
384417
{ "GoldenKeys", DataPathTranslations.GoldenKeyHash },
385-
{ "DiamondKeys", DataPathTranslations.DiamondKeyHash }
418+
{ "DiamondKeys", DataPathTranslations.DiamondKeyHash },
419+
{ "VaultCard1Keys", DataPathTranslations.VaultCard1Hash },
420+
{ "VaultCard2Keys", DataPathTranslations.VaultCard2Hash }
386421
};
387422

388423
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
446481
return prf;
447482
}
448483
}
484+
485+
/// <summary>
486+
/// 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
487+
/// </summary>
449488
public class MultiElementObjectBinder : IMultiValueConverter {
450-
451489
public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture) {
452490
foreach (object obj in value) {
453491
if (obj != null && obj != DependencyProperty.UnsetValue) {
@@ -462,6 +500,7 @@ public object[] ConvertBack(object value, Type[] targetType, object parameter, C
462500
return null;
463501
}
464502
}
503+
465504
public class IntegerToMayhemLevelConverter : IValueConverter {
466505
private Borderlands3Serial serial = null;
467506
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {

BL3SaveEditor/MainWindow.xaml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
</adonisControls:AdonisWindow.TitleBarContent>
5858
<Grid>
5959
<ToolBar x:Uid="ToolWindowToolbar" AllowDrop="False" Focusable="False" HorizontalAlignment="Left"
60-
VerticalAlignment="Top" Width="792"
61-
Background="{DynamicResource {x:Static adonisUi:Brushes.Layer0BackgroundBrush}}" Height="30">
60+
VerticalAlignment="Top" Background="{DynamicResource {x:Static adonisUi:Brushes.Layer0BackgroundBrush}}"
61+
Height="30">
6262
<!-- I'm hiding this button for now because I find it to be a pain to work on -->
6363
<Button Visibility="Collapsed" Name="NewSaveBtn" Click="NewSaveBtn_Click">
6464
<StackPanel Orientation="Horizontal">
@@ -155,7 +155,8 @@
155155
<ComboBox IsEnabled="{Binding Path=bSaveLoaded}"
156156
ItemsSource="{Binding Path=ValidPlayerClasses}"
157157
SelectedValue="{Binding Path=saveGame.Character.PlayerClassData, Mode=TwoWay, Converter={StaticResource CharacterClassConverter1}}"
158-
HorizontalAlignment="Stretch" Margin="155,11,20,0" VerticalAlignment="Top" />
158+
SelectionChanged="CharacterClass_SelectionChanged" HorizontalAlignment="Stretch"
159+
Margin="155,11,20,0" VerticalAlignment="Top" />
159160

160161
<Label FontWeight="Normal" Content="XP Level: " Margin="10,40,0,0"
161162
VerticalContentAlignment="Center" HorizontalContentAlignment="Left"
@@ -849,38 +850,44 @@
849850
<xctk:LongUpDown Value="{Binding profile.Profile.GuardianRank.NewGuardianExperience, Mode=TwoWay}"
850851
HorizontalAlignment="Right" Margin="0,175,10,0" VerticalAlignment="Top"
851852
ToolTip="Amount of XP associated with your guardian rank level" Width="254" />
852-
<Label FontWeight="Normal" Content="Bank SDUs: " HorizontalAlignment="Right" Margin="0,260,309,0"
853+
<Label FontWeight="Normal" Content="Bank SDUs: " HorizontalAlignment="Right" Margin="0,287,309,0"
853854
VerticalAlignment="Top" Width="100" Height="20" />
854855
<xctk:IntegerUpDown
855856
Value="{Binding profile.Profile, Mode=TwoWay, Converter={StaticResource SDUConverter1}, ConverterParameter=Bank}"
856857
Minimum="0" Maximum="{Binding MaximumBankSDUs}" HorizontalAlignment="Right"
857-
Margin="0,260,10,0" VerticalAlignment="Top" ToolTip="Amount of Bank SDUs on your character"
858+
Margin="0,287,10,0" VerticalAlignment="Top" ToolTip="Amount of Bank SDUs on your character"
858859
Width="254" />
859860

860861
<Label FontWeight="Normal" Content="Lost Loot SDUs: " HorizontalAlignment="Right"
861-
Margin="0,285,309,0" VerticalAlignment="Top" Width="100" Height="20" />
862+
Margin="0,312,309,0" VerticalAlignment="Top" Width="100" Height="20" />
862863
<xctk:IntegerUpDown
863864
Value="{Binding profile.Profile, Mode=TwoWay, Converter={StaticResource SDUConverter1}, ConverterParameter=LostLoot}"
864865
Minimum="0" Maximum="{Binding MaximumLostLootSDUs}" HorizontalAlignment="Right"
865-
Margin="0,285,10,0" VerticalAlignment="Top"
866+
Margin="0,312,10,0" VerticalAlignment="Top"
866867
ToolTip="Amount of Lost Loot SDUs on your profile" Width="254" />
867868
<Label FontWeight="Normal" Content="Citizen Science Bucks: " HorizontalAlignment="Right"
868869
Margin="0,210,284,0" VerticalAlignment="Top" Width="125" Height="20" />
869870
<xctk:IntegerUpDown Value="{Binding profile.Profile.CitizenScienceCSBucksAmount, Mode=TwoWay}"
870871
HorizontalAlignment="Right" Margin="0,210,10,0" VerticalAlignment="Top"
871-
ToolTip="Amount of XP associated with your guardian rank level" Width="254" />
872+
ToolTip="Amount of citizen science dollars you've got" Width="254" />
872873
<Label FontWeight="Normal" Content="Golden Keys: " HorizontalAlignment="Right" Margin="0,235,284,0"
873874
VerticalAlignment="Top" Width="125" Height="20" />
874875
<xctk:IntegerUpDown
875876
Value="{Binding profile.Profile, Mode=TwoWay, Converter={StaticResource KeyToIntegerConverter1}, ConverterParameter=GoldenKeys}"
876877
HorizontalAlignment="Right" Margin="0,235,10,0" VerticalAlignment="Top"
877-
ToolTip="Amount of XP associated with your guardian rank level" Width="254" />
878-
<Button Content="Clear Lost Loot" HorizontalAlignment="Right" Margin="0,320,304,0" Width="105"
878+
ToolTip="Amount of golden keys on your profile" Width="254" />
879+
<Button Content="Clear Lost Loot" HorizontalAlignment="Right" Margin="0,347,304,0" Width="105"
879880
Height="24" VerticalAlignment="Top" Name="ClearLLBtn" Click="ClearLLBtn_Click" />
880-
<Button Content="Clear Bank" HorizontalAlignment="Right" Margin="0,320,159,0" Width="105"
881+
<Button Content="Clear Bank" HorizontalAlignment="Right" Margin="0,347,159,0" Width="105"
881882
Height="24" VerticalAlignment="Top" Name="ClearBankBtn" Click="ClearBankBtn_Click" />
882-
<Button Content="Inject Guardian Rank" HorizontalAlignment="Right" Margin="0,320,10,0" Width="125"
883+
<Button Content="Inject Guardian Rank" HorizontalAlignment="Right" Margin="0,347,10,0" Width="125"
883884
Height="24" VerticalAlignment="Top" Click="InjectGRBtn_Click" />
885+
<Label FontWeight="Normal" Content="Diamond Keys: " HorizontalAlignment="Right" Margin="0,260,284,0"
886+
VerticalAlignment="Top" Width="125" Height="20" />
887+
<xctk:IntegerUpDown
888+
Value="{Binding profile.Profile, ConverterParameter=DiamondKeys, Converter={StaticResource KeyToIntegerConverter1}, Mode=TwoWay}"
889+
HorizontalAlignment="Right" Margin="0,260,10,0" VerticalAlignment="Top"
890+
ToolTip="Amount of diamond keys for your profile" Width="254" />
884891
</Grid>
885892
</TabItem>
886893
<TabItem HorizontalAlignment="Left">
@@ -956,7 +963,7 @@
956963
<Run Foreground="MediumPurple" Text="In memory of Baysix. Fly high." />
957964
</TextBlock>
958965
<Button Content="Check For Updates" VerticalAlignment="Top" HorizontalAlignment="Right"
959-
Margin="0,22,6,0" Width="120" />
966+
Margin="0,22,6,0" Width="120" Click="UpdateButton_Click" />
960967
<CheckBox Name="DarkModeBox" Content="Enable Dark Mode" HorizontalAlignment="Right"
961968
Margin="0,51,6,0" VerticalAlignment="Top" IsChecked="True" Height="20"
962969
Checked="DarkModeBox_Checked" Unchecked="DarkModeBox_Checked" Width="120" />

0 commit comments

Comments
 (0)