Skip to content

Commit

Permalink
Updated DLC handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Jun 29, 2024
1 parent 7507d40 commit 0c7cd6f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Version 0.7.6
* Updates to DLC handling

## Version 0.7.5
* RuleCalculateArmorAC introduced

Expand Down
2 changes: 1 addition & 1 deletion Repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Releases": [
{
"Id": "TabletopTweaks-Core",
"Version": "0.7.5"
"Version": "0.7.6"
}
]
}
2 changes: 1 addition & 1 deletion TabletopTweaks-Core/Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"Repository": "https://raw.githubusercontent.com/Vek17/TabletopTweaks-Core/master/Repository.json",
"Requirements": [],
"LoadAfter": [ "MewsiferConsole.Mod" ],
"Version": "0.7.5"
"Version": "0.7.6"
}
22 changes: 13 additions & 9 deletions TabletopTweaks-Core/Utilities/DLCTools.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Kingmaker.DLC;
using Kingmaker.Stores;

namespace TabletopTweaks.Core.Utilities {
public static class DLCTools {
Expand All @@ -11,15 +12,18 @@ public static class DLCTools {
private static BlueprintDlc Dlc6 = BlueprintTools.GetBlueprint<BlueprintDlc>("c2340df3fdaf403baffe824ae7a0a547");

public static bool HasDLC(int number) {
switch (number) {
case 1: return Dlc1.IsAvailable;
case 2: return Dlc2.IsAvailable;
case 3: return Dlc3.IsAvailable;
case 4: return Dlc4.IsAvailable;
case 5: return Dlc5.IsAvailable;
case 6: return Dlc6.IsAvailable;
default: return false;
}
var DLC = number switch {
1 => Dlc1,
2 => Dlc2,
3 => Dlc3,
4 => Dlc4,
5 => Dlc5,
6 => Dlc6,
_ => null
};
if(DLC == null) { return false; }
StoreManager.RefreshDLCs(new BlueprintDlc[] { DLC });
return DLC.IsAvailable;
}
}
}

0 comments on commit 0c7cd6f

Please sign in to comment.