Skip to content

Commit f031838

Browse files
committed
update to support aodk
1 parent dc20950 commit f031838

File tree

9 files changed

+130
-14
lines changed

9 files changed

+130
-14
lines changed

Enums.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public enum Game {
3030
BL1E,
3131
BL2,
3232
TPS,
33+
AoDK,
3334
}
3435

3536
public enum BARRewardStat {

FileFormat.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,21 @@ Note that if the decompressed data size goes over 9000 bytes, the games intepret
2424
corrupt. Practically, this will never happen, it's only a concern when creating your own files.
2525

2626
## Decompressed Data
27-
The decompressed data consits of a number of entries. The first four bytes hold the entry count.
27+
The decompressed data is formatted as follows.
2828

2929
| Size | Description |
3030
|---:|:---|
3131
| 4 | The amount of profile entries in the file |
32+
| Variable | Profile entries |
33+
| 1 | AoDK Magic - 0x01 |
3234

33-
Each entry is then appended one after the other. There may be padding after the stored amount of
34-
entries, but this is ignored.
35+
AoDK requires the byte after the last profile entry to be 0x01, and for there to be no further
36+
trailing data. All the other games accept any trailing data after the last entry, simply ignoring
37+
it (and trimming it on next write). Writing the 0x01 in all cases guarenteeds your file will work
38+
with all games.
3539

36-
Each entry has the following format.
40+
Within the entries section, each entry is simply appended one after the other. Each entry has the
41+
following format.
3742

3843
| Size | Description |
3944
|---:|:---|

KnownSettings.cs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,79 @@ static class KnownSettings {
278278
{ 178, new KnownSettingInfo(178, "OakUpsellViewed", SettingsDataType.Empty) },
279279
{ 300, UnlockedCustomizations },
280280
} },
281+
{ Game.AoDK, new Dictionary<int, KnownSettingInfo>() {
282+
{ 2, new KnownSettingInfo(2, "InvertGamepadLook", SettingsDataType.Int32) },
283+
{ 16, new KnownSettingInfo(16, "AutoAim", SettingsDataType.Int32) },
284+
{ 26, new KnownSettingInfo(26, "VersionNumber", SettingsDataType.Int32) },
285+
{ 27, new KnownSettingInfo(27, "WriteCount", SettingsDataType.Int32) },
286+
{ 101, new KnownSettingInfo(101, "MasterVolume", SettingsDataType.Int32) },
287+
{ 102, new KnownSettingInfo(102, "ControllerSensitivityX", SettingsDataType.Int32) },
288+
{ 103, new KnownSettingInfo(103, "ControllerSensitivityY", SettingsDataType.Int32) },
289+
{ 104, new KnownSettingInfo(104, "ViewAccel", SettingsDataType.Int32) },
290+
{ 105, new KnownSettingInfo(105, "InvertMouseLook", SettingsDataType.Int32) },
291+
{ 106, new KnownSettingInfo(106, "IntroMovieViewed", SettingsDataType.Byte) },
292+
{ 107, new KnownSettingInfo(107, "MusicVolume", SettingsDataType.Int32) },
293+
{ 108, new KnownSettingInfo(108, "SFXVolume", SettingsDataType.Int32) },
294+
{ 109, new KnownSettingInfo(109, "AcceptDuels", SettingsDataType.Int32) },
295+
{ 110, new KnownSettingInfo(110, "AcceptTrades", SettingsDataType.Int32) },
296+
{ 111, new KnownSettingInfo(111, "EnableSubtitles", SettingsDataType.Int32) },
297+
{ 112, new KnownSettingInfo(112, "Brightness", SettingsDataType.Int32) },
298+
{ 113, new KnownSettingInfo(113, "AutoAim", SettingsDataType.Int32) },
299+
{ 114, new KnownSettingInfo(114, "HasUnlockedViralAchievement", SettingsDataType.Int32) },
300+
{ 115, new KnownSettingInfo(115, "ControllerPreset", SettingsDataType.String) },
301+
{ 116, new KnownSettingInfo(116, "LastSavedId", SettingsDataType.Int32) },
302+
{ 117, new KnownSettingInfo(117, "DisableOptionalVO", SettingsDataType.Int32) },
303+
{ 118, new KnownSettingInfo(118, "DisableTrainingMessages", SettingsDataType.Int32) },
304+
{ 119, new KnownSettingInfo(119, "AmbientOcclusion", SettingsDataType.Int32) },
305+
{ 120, new KnownSettingInfo(120, "HUDScaleE", SettingsDataType.Int32) },
306+
{ 121, new KnownSettingInfo(121, "MouseSensitivity", SettingsDataType.Int32) },
307+
{ 122, new KnownSettingInfo(122, "DlcNotifications", SettingsDataType.Int32) },
308+
{ 124, new KnownSettingInfo(124, "VoiceVolume", SettingsDataType.Int32) },
309+
{ 125, new KnownSettingInfo(125, "PushToTalk", SettingsDataType.Int32) },
310+
{ 127, new KnownSettingInfo(127, "VOVolume", SettingsDataType.Int32) },
311+
{ 128, new KnownSettingInfo(128, "PerShotForceFeedback", SettingsDataType.Int32) },
312+
{ 129, new KnownSettingInfo(129, "PlayerFOV", SettingsDataType.Int32) },
313+
{ 130, StashSlot0 },
314+
{ 131, StashSlot1 },
315+
{ 132, StashSlot2 },
316+
{ 133, StashSlot3 },
317+
{ 134, new KnownSettingInfo(134, "CrouchToggle", SettingsDataType.Int32) },
318+
{ 135, new KnownSettingInfo(135, "ZoomToggle", SettingsDataType.Int32) },
319+
{ 136, BadassPoints },
320+
{ 137, BadassPointsSpent },
321+
{ 138, BadassTokens },
322+
{ 139, new KnownSettingInfo(139, "BadassTokensEarned", SettingsDataType.Int32) },
323+
{ 140, new KnownSettingInfo(140, "AbsoluteMinimap", SettingsDataType.Int32) },
324+
{ 141, new KnownSettingInfo(141, "HUDScaleX", SettingsDataType.Int32) },
325+
{ 142, new KnownSettingInfo(142, "HUDScaleY", SettingsDataType.Int32) },
326+
{ 143, BadassRewardsEarned },
327+
{ 145, new KnownSettingInfo(145, "DriftCameraLock", SettingsDataType.Int32) },
328+
{ 147, new KnownSettingInfo(147, "SplitDirection", SettingsDataType.Int32) },
329+
{ 148, new KnownSettingInfo(148, "TradingDisabled", SettingsDataType.Int32) },
330+
{ 149, new KnownSettingInfo(149, "KeyRebinding", SettingsDataType.String) },
331+
{ 150, new KnownSettingInfo(150, "CheckedForPreviousGame", SettingsDataType.Int32) },
332+
{ 151, new KnownSettingInfo(151, "LastNewOfferVersion", SettingsDataType.Int32) },
333+
{ 152, new KnownSettingInfo(152, "MouseSmoothing", SettingsDataType.Int32) },
334+
{ 153, new KnownSettingInfo(153, "ItemRotationNew", SettingsDataType.Int32) },
335+
{ 154, new KnownSettingInfo(154, "GamepadInvertTurn", SettingsDataType.Byte) },
336+
{ 155, new KnownSettingInfo(155, "GamepadInvertMove", SettingsDataType.Byte) },
337+
{ 156, new KnownSettingInfo(156, "GamepadInvertStrafe", SettingsDataType.Byte) },
338+
{ 157, new KnownSettingInfo(157, "ShouldCensorContent", SettingsDataType.Byte) },
339+
{ 158, new KnownSettingInfo(158, "ControllerRebinding", SettingsDataType.String) },
340+
{ 159, new KnownSettingInfo(159, "GunzerkingAutoSwitch", SettingsDataType.Byte) },
341+
{ 160, new KnownSettingInfo(160, "EasterEggOption", SettingsDataType.Byte) },
342+
{ 161, new KnownSettingInfo(161, "RewardedForPlayingPreviousGame", SettingsDataType.Byte) },
343+
{ 162, GoldenKeysEarned },
344+
{ 163, new KnownSettingInfo(163, "DisableUISway", SettingsDataType.Byte) },
345+
{ 164, new KnownSettingInfo(164, "BadassRewardsToOfferNext", SettingsDataType.String) },
346+
{ 165, new KnownSettingInfo(165, "InvertedReverseSteering", SettingsDataType.Byte) },
347+
{ 166, new KnownSettingInfo(166, "BackpackSortPreference", SettingsDataType.Int32) },
348+
{ 167, new KnownSettingInfo(167, "MouseAutoAim", SettingsDataType.Int32) },
349+
{ 169, new KnownSettingInfo(169, "OakUpsellViewed", SettingsDataType.Int32) },
350+
{ 170, new KnownSettingInfo(170, "ShowSubtitleBackground", SettingsDataType.Int32) },
351+
{ 171, new KnownSettingInfo(171, "EasyMode", SettingsDataType.Int32) },
352+
{ 300, UnlockedCustomizations},
353+
} }
281354
};
282355
}
283356
}

MainWindow.xaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,18 @@
199199
IsEnabled="{Binding HasCustomizations}"
200200
Click="LockCustomizations_Click" />
201201

202-
<TextBlock Grid.Row="1" Grid.Column="0"
203-
Text="Golden Keys" />
202+
<TextBlock Grid.Row="1" Grid.Column="0">
203+
<TextBlock.Style>
204+
<Style TargetType="TextBlock" BasedOn="{mah:StaticResource MahApps.Styles.TextBlock}">
205+
<Setter Property="Text" Value="Golden Keys" />
206+
<Style.Triggers>
207+
<DataTrigger Binding="{Binding DisplayGame}" Value="{x:Static local:Game.AoDK}">
208+
<Setter Property="Text" Value="Skeleton Keys" />
209+
</DataTrigger>
210+
</Style.Triggers>
211+
</Style>
212+
</TextBlock.Style>
213+
</TextBlock>
204214
<mah:NumericUpDown Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
205215
Margin="0,0,0,6"
206216
Minimum="0"

Profile.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,23 @@ public bool Load(string path) {
134134
}
135135

136136
if (ms.Position != ms.Length) {
137-
// Allow trailing zero padding, warn on anything else
138-
if (ms.ReadByteArray((int)(ms.Length - ms.Position)).Any(x => x != 0)) {
137+
bool allowed = false;
138+
139+
// Allow a single trailing 1 (AoDK magic)
140+
if (ms.Length - ms.Position == 1) {
141+
int val = ms.ReadByte();
142+
if (val == 1) {
143+
allowed = true;
144+
// Don't reset position so the zero padding check doesn't include it
145+
} else {
146+
ms.Position--;
147+
}
148+
}
149+
150+
// Allow trailing zero padding
151+
allowed |= ms.ReadByteArray((int)(ms.Length - ms.Position)).All(x => x == 0);
152+
153+
if (!allowed) {
139154
unknownData = true;
140155
}
141156
}
@@ -213,7 +228,9 @@ void WriteInt64(long val) {
213228
ms.WriteByte((byte)entry.AdvertisementType);
214229
}
215230

216-
return ms.GetBuffer();
231+
ms.WriteByte(1);
232+
233+
return ms.ToArray();
217234
}
218235
}
219236

ProfileViewModel.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public void GuessDisplayGame(string path) {
6767
DisplayGame = Game.TPS;
6868
return;
6969
}
70+
case "Tiny Tina's Assault On Dragon Keep": {
71+
DisplayGame = Game.AoDK;
72+
return;
73+
}
7074
default: {
7175
break;
7276
}
@@ -89,18 +93,23 @@ All the other games use the exact same value on the oldest accessible and curren
8993
} else if (version <= 66) {
9094
DisplayGame = Game.BL2;
9195
return;
96+
} else if (version <= 70) {
97+
DisplayGame = Game.AoDK;
98+
return;
9299
} else if (version <= 72) {
93100
DisplayGame = Game.TPS;
94101
return;
95102
}
96103
}
97104

98-
if (!profile.Entries.Any(e => e.ID == 129)) { // PlayerFOV (bl2, tps) / FOV (bl1e)
105+
if (!profile.Entries.Any(e => e.ID == 129)) { // PlayerFOV (bl2, tps, aodk) / FOV (bl1e)
99106
DisplayGame = Game.BL1;
100107
} else if (profile.Entries.Any(e => e.ID == 126)) { // ShowCompass
101108
DisplayGame = Game.BL1E;
102109
} else if (profile.Entries.Any(e => e.ID == 168)) { // ResetCameraOnSlam
103110
DisplayGame = Game.TPS;
111+
} else if (profile.Entries.Any(e => e.ID == 170)) { // ShowSubtitleBackground
112+
DisplayGame = Game.TPS;
104113
} else {
105114
DisplayGame = Game.BL2;
106115
}

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Totally not a forced acronym.
33

44
### [Requires .NET Core x86 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-3.1.20-windows-x86-installer)
55

6-
Profile editor for Borderlands 1, 2, TPS, and BL1 Enhanced. On top of the standard edits, also
7-
allows editing in the raw data format all four games use.
6+
Profile editor for Borderlands 1, 2, TPS, BL1 Enhanced, and Assault on Dragon Keep Standalone. On
7+
top of the standard edits, also allows editing in the raw data format all five games use.
88

99
![Image](https://i.imgur.com/G9CXiG3.png)
1010

XamlHelpers.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
171171
switch (game) {
172172
case Game.BL1:
173173
case Game.BL1E: prefix = "BL1("; break;
174+
case Game.AoDK: // Not sure this will stick but seems best for now
174175
case Game.BL2: prefix = "BL2("; break;
175176
case Game.TPS: prefix = "BLOZ("; break;
176177
};

bagpipe.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<UseWPF>true</UseWPF>
77
<Platforms>x86</Platforms>
88
<ApplicationIcon>icon.ico</ApplicationIcon>
9-
<AssemblyVersion>1.1.0.0</AssemblyVersion>
10-
<FileVersion>1.1.0.0</FileVersion>
9+
<AssemblyVersion>1.2.0.0</AssemblyVersion>
10+
<FileVersion>1.2.0.0</FileVersion>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

0 commit comments

Comments
 (0)