Skip to content
Open

Test #1104

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
e140dca
Prevent mod from being unable to load when localization files are mis…
Sep 20, 2023
e3c696f
moved error handling to locmanager
Sep 20, 2023
14d8ea5
Modified ModKitSettings fix? #1036
Sep 20, 2023
db3800e
Fix build not including loc files
Sep 20, 2023
ba0434e
w
Sep 20, 2023
8cb2c98
fix loc
Sep 20, 2023
2247b52
Improved Detection of old ToyBox versions; Now automatically delete o…
Oct 3, 2023
b4f411b
Version Bump; ReadMe
Oct 3, 2023
4f9ff08
Changed log messages
Oct 3, 2023
0dd3ccc
Fixed repository.json considering old mod id and old master branch
Oct 7, 2023
b18e7a4
Merge #1043
Nov 6, 2023
9d4d91b
Merge #1047
Nov 6, 2023
a5cb322
Version bump
Nov 19, 2023
0a1a234
v
Nov 19, 2023
e424cec
Fixed missing key update if collation happens too fast
Nov 22, 2023
8f0b8e0
Version push; repo change
Nov 24, 2023
c4594a1
ReadMe
Nov 24, 2023
67265cc
Add additional NullCheck to Rating extension of BlueprintItemEnchantm…
Dec 4, 2023
0ba96ab
Version push
Dec 15, 2023
3458adc
r
Dec 15, 2023
9caec5b
Catch errors to prevent broken menu on console view
evandixon Feb 7, 2024
fef6a4b
Merge branch 'main' into fix-steam-deck-map
xADDBx Feb 14, 2024
3ef0f0a
Merge pull request #20 from evandixon/fix-steam-deck-map
xADDBx Feb 14, 2024
47d20f2
Added Try/Catch (can't remember why); changed Log to Debug
Feb 14, 2024
ca6fede
Fixed Skill Point Cap (Inlining :( )
Feb 14, 2024
881587b
r
Feb 14, 2024
966d1f3
Auto Fail Skill Checks with DC > 250 to prevent infinite loop while c…
Feb 14, 2024
4e5bef1
Glyph Stuff
Feb 18, 2024
18f52d9
Remove RT Related Stuff 1
May 31, 2024
94e924d
Changes 2
May 31, 2024
af0cdfb
Reformat?
May 31, 2024
e6243c0
Version push
May 31, 2024
6803569
Fix issue with ModKit creating a package file on build
May 31, 2024
b133a54
Adjust gitignore
May 31, 2024
f3e44c9
Revert Repository.json to prevent showing update available
May 31, 2024
df562c7
ReadMes
May 31, 2024
8cbf88b
ReadMe
May 31, 2024
eb6c591
1.5.12a,b
Jun 1, 2024
d74cb7c
Fix Romance DLC Feature
Jun 2, 2024
3a32e72
1.5.12d
Jun 2, 2024
04fc096
1.5.12e - Fixes to Mythic stuff
Jun 2, 2024
993fcca
1.5.12f better Ignore Dialog Mythic
Jun 3, 2024
cc3160d
Add Auto Build workflow
Jun 4, 2024
b135e0c
Downgrade Repository.json
Jun 4, 2024
63220e5
PR Workflow Adjustment
xADDBx Jun 5, 2024
b43b288
Add Game Version to Release Name
xADDBx Jun 5, 2024
b518252
Better zip lookup
xADDBx Jun 5, 2024
031262b
More Workflow Update
xADDBx Jun 5, 2024
51a8393
Workflow now separated into Action
xADDBx Jun 5, 2024
dad4a12
1.5.12g => Disable VoiceOver in StatsGUI
xADDBx Jun 6, 2024
f9c1efe
Small Fixes to VoiceOver disabling
xADDBx Jun 6, 2024
44b0168
Saves Tab can now handle null Player Name without crashing
xADDBx Jun 6, 2024
fe7c0bb
Updated localization keys in case someone actually wants to localize …
xADDBx Jun 6, 2024
a9cfbc3
Display Name Change
xADDBx Jun 7, 2024
a8677ba
New Version
xADDBx Jun 13, 2024
4e7e47b
whoopsie
xADDBx Jun 13, 2024
dbb1ff6
Update repository link
xADDBx Jun 14, 2024
c7e3e92
* (***ADDB***) Fixed Ignore Alignment When Choosing A Class not worki…
xADDBx Jun 14, 2024
233104b
Change Action
xADDBx Jun 14, 2024
6f6bb5e
Update Workflow version
xADDBx Jun 14, 2024
5afd01d
recompile for new version.
xADDBx Jun 15, 2024
54df519
* (***ADDB***) Maybe make Magus: Always Allow Spell Combat work with …
xADDBx Jun 16, 2024
b86a1c2
Magus fix
xADDBx Jun 16, 2024
607bb87
w
xADDBx Jun 16, 2024
7462c0f
Add toggle to remove read-onlyness from etudes
Deltharis Jun 16, 2024
c222335
Merge branch 'main' of https://github.com/Deltharis/ToyBox-Wrath
Deltharis Jun 16, 2024
eb5625c
Change to postfix
Deltharis Jun 16, 2024
1457f46
Merge pull request #2 from Deltharis/main
xADDBx Jun 16, 2024
4d446df
w
xADDBx Jun 16, 2024
f173749
Test
xADDBx Jun 16, 2024
2dccd19
Blup blup blup
xADDBx Jun 16, 2024
b36d38d
Wup
xADDBx Jun 16, 2024
96de4dd
This is a commit message.
xADDBx Jun 16, 2024
91b926b
Prevent search 'n pick failure when parametrizedfeature causes exception
xADDBx Jun 17, 2024
95b0061
Make Buff Duration logging debug
xADDBx Jun 17, 2024
a5328d2
Still parametrized feature exception thingy
xADDBx Jun 17, 2024
9613b7b
Finally fix that annoying Magus Bug
xADDBx Jun 17, 2024
4bf5106
* (***ADDB***) Fix the Magus: Allow Spell Combat for dual wielding.
xADDBx Jun 17, 2024
edd8af5
Change Package Owner for Workflows
xADDBx Jun 18, 2024
6dd6aac
Merge
xADDBx Jun 18, 2024
997a9ee
Merge mistake
xADDBx Jun 18, 2024
aafe677
### ToyBox Wrath - Ver 1.5.18 (built for 2.3.2c)
xADDBx Jun 20, 2024
b7d041a
Test
xADDBx Jun 23, 2024
7d059e7
Update CasterHelpers.cs
CasDragon Jun 24, 2024
6e4f970
Update SpellsEditor.cs
CasDragon Jun 24, 2024
849e3d0
Update Build Mod on PR.yml
xADDBx Jun 24, 2024
5a9dc78
Update Build Mod on PR.yml
CasDragon Jun 24, 2024
757de1e
Update Build Mod on PR.yml
xADDBx Jun 24, 2024
68c29ac
Update Build Mod on PR.yml
CasDragon Jun 24, 2024
fac1c3f
Merge pull request #6 from CasDragon/main
xADDBx Jun 24, 2024
433f2e4
* (***ADDB***) Maybe Party tab shows more features now? (Especially P…
xADDBx Jun 24, 2024
4f3d63d
Merge branch 'main' of https://github.com/xADDBx/ToyBox_Wrath
xADDBx Jun 24, 2024
27b92a4
w
xADDBx Jun 24, 2024
aeb4b1d
* (***ADDB***) Add incompatibility checker! From now on ToyBox will s…
xADDBx Jun 24, 2024
5ec4849
* (***ADDB***) Add incompatibility checker! From now on ToyBox will s…
xADDBx Jun 24, 2024
476d175
More robust version check
xADDBx Jun 25, 2024
87664a8
Fix Roll10Init
CasDragon Jun 25, 2024
f93cd2b
Merge pull request #9 from CasDragon/main
xADDBx Jun 25, 2024
359dfdc
* (***ADDB***) Add feature under Party => Stats to turn on/off AI con…
xADDBx Jun 26, 2024
ff022d8
Fix IgnoreFeaturePrerequisitesWhenChoosingClass
CasDragon Jun 28, 2024
2989836
Update LevelUpPatchesWrath.cs
CasDragon Jun 28, 2024
635a624
Update LevelUpPatchesWrath.cs
CasDragon Jun 28, 2024
89a698d
Merge pull request #10 from CasDragon/main
xADDBx Jun 28, 2024
ecf6d51
* (***CascadingDragon***) Fix Ignore Feature Prerequisites When Choos…
xADDBx Jun 28, 2024
517e204
Add toggle to remove thumbs up/down in feature selections
CasDragon Jun 29, 2024
7a29a61
Update to patch every Recommedation component. Still doesn't work on …
CasDragon Jun 29, 2024
88442b2
Update README, Info.json, project file
CasDragon Jun 29, 2024
fee8206
Merge pull request #11 from CasDragon/main
xADDBx Jun 29, 2024
566a50d
Merge branch 'WrathBranch' of https://github.com/xADDBx/ToyBox-RogueT…
xADDBx Jun 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/Build Mod on PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
GAME_NAME: Wrath
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_NAME: ${{ github.repository_owner }}
PACKAGE_OWNER: xADDBx
PACKAGE_OWNER: cabarius
BRANCH_REF: ${{ github.event.pull_request.head.sha }}

- name: Upload build artifacts
Expand All @@ -29,11 +29,11 @@ jobs:

- name: Remove Test Label
if: always()
shell: pwsh
shell: bash
run: |
$headers = @{
Accept = 'application/vnd.github.v3+json'
Authorization = "token ${{ secrets.GITHUB_TOKEN }}"
}
$url = "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/safe%20to%20test"
Invoke-RestMethod -Uri $url -Method Delete -Headers $headers
curl --silent --fail-with-body \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.WRITE_PR_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/safe%20to%20test'
2 changes: 1 addition & 1 deletion .github/workflows/Build Mod on Push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
GAME_NAME: Wrath
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_NAME: ${{ github.repository_owner }}
PACKAGE_OWNER: xADDBx
PACKAGE_OWNER: cabarius

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Create Release for new Tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
GAME_NAME: Wrath
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_NAME: ${{ github.repository_owner }}
PACKAGE_OWNER: xADDBx
PACKAGE_OWNER: cabarius

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down
3 changes: 3 additions & 0 deletions ToyBox/Incompatibilities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
[ "1.5.12", "2.3.0bb" ]
]
2 changes: 1 addition & 1 deletion ToyBox/Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Id": "0ToyBox0",
"DisplayName": "ToyBox",
"Author": "Narria",
"Version": "1.5.18",
"Version": "1.5.24",
"ManagerVersion": "0.27.11",
"Requirements": [],
"AssemblyName": "ToyBox.dll",
Expand Down
4 changes: 3 additions & 1 deletion ToyBox/Localization/Wrath/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"LanguageCode": "en",
"Version": "1.5.12",
"Version": "1.5.23",
"Contributors": "The ToyBox Team",
"HomePage": "https://github.com/cabarius/ToyBox/",
"Strings": {
Expand Down Expand Up @@ -32,6 +32,7 @@
"<color=#00ff00ff>Allow </color><color=#C060F0FF>any gender</color> <color=#00ff00ff>for any </color><color=#FF4040FF>R</color><color=orange>o</color><color=yellow>m</color><color=#00ff00ff>a</color><color=cyan>n</color><color=#8080FFFF>c</color><color=#C060F0FF>e</color>": "<color=#00ff00ff>Allow </color><color=#C060F0FF>any gender</color> <color=#00ff00ff>for any </color><color=#FF4040FF>R</color><color=orange>o</color><color=yellow>m</color><color=#00ff00ff>a</color><color=cyan>n</color><color=#8080FFFF>c</color><color=#C060F0FF>e</color>",
"<color=#00ff00ff>Allow </color><color=#C060F0FF>multiple</color><color=#00ff00ff> romances at the same time</color>": "<color=#00ff00ff>Allow </color><color=#C060F0FF>multiple</color><color=#00ff00ff> romances at the same time</color>",
"<color=#00ff00ff>creation of </color>new characters<b><color=yellow>\nNote:</color></b><color=orange> This value applies to </color><b><color=yellow>all saves</color></b><color=orange> and in the main menu</color>": "<color=#00ff00ff>creation of </color>new characters<b><color=yellow>\nNote:</color></b><color=orange> This value applies to </color><b><color=yellow>all saves</color></b><color=orange> and in the main menu</color>",
"<color=#00ff00ff>Makes the thumbs up/down in disappear in selections</color>": "<color=#00ff00ff>Makes the thumbs up/down in disappear in selections</color>",
"<color=#00ff00ff>Some responses such as comments about your mythic powers will always choose the first one by default. This allows the game to mix things up a bit</color><b><color=yellow>\nWarning:</color></b><color=orange> this will introduce randomness to NPC responses to you in general and may lead to surprising or even wild outcomes</color>": "<color=#00ff00ff>Some responses such as comments about your mythic powers will always choose the first one by default. This allows the game to mix things up a bit</color><b><color=yellow>\nWarning:</color></b><color=orange> this will introduce randomness to NPC responses to you in general and may lead to surprising or even wild outcomes</color>",
"<color=#00ff00ff>Tells the game to reset the in game UI.</color><color=yellow> Warning</color><color=orange> Using this in dialog or the book will dismiss that dialog which may break progress so use with care</color>": "<color=#00ff00ff>Tells the game to reset the in game UI.</color><color=yellow> Warning</color><color=orange> Using this in dialog or the book will dismiss that dialog which may break progress so use with care</color>",
"<color=#00ff00ff>The following modifiers all work on </color><color=yellow>chance = chance (1 + modifier) </color><color=#00ff00ff>so a value of </color><color=yellow>-1</color><color=#00ff00ff> means the chance is 0, </color><color=yellow>0</color><color=#00ff00ff> is chance cost and </color><color=yellow>2</color><color=#00ff00ff> increases it 3x</color>": "<color=#00ff00ff>The following modifiers all work on </color><color=yellow>chance = chance (1 + modifier) </color><color=#00ff00ff>so a value of </color><color=yellow>-1</color><color=#00ff00ff> means the chance is 0, </color><color=yellow>0</color><color=#00ff00ff> is chance cost and </color><color=yellow>2</color><color=#00ff00ff> increases it 3x</color>",
Expand Down Expand Up @@ -455,6 +456,7 @@
"Ignore Class Restrictions": "Ignore Class Restrictions",
"ignore Equipment Restrictions": "ignore Equipment Restrictions",
"Ignore Event Solution Restrictions": "Ignore Event Solution Restrictions",
"Ignore Feature Recommendations": "Ignore Feature Recommendations",
"Ignore Feature Restrictions": "Ignore Feature Restrictions",
"Ignore Forbidden Archetypes": "Ignore Forbidden Archetypes",
"Ignore Pet Sizes For Mounting": "Ignore Pet Sizes For Mounting",
Expand Down
23 changes: 22 additions & 1 deletion ToyBox/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,32 @@
your save before using. Remember that "with great power comes great responsibility"
* **Quest Resolution**: this allows you to view your active quests and advance them as needed to work around bugs or
skip quests you don't want to do. Be warned this may break your game progression if used carelessly.

### Toybox Wrath - Ver 1.5.24 (built for 2.3.2c)
* (***CascadingDragon***) Add new feature, Toggle Feature Recommendations. This will turn off the thumbs up/down in the Feature Selections on Level Up (Toggle found in Level Up tab, under Ignore Feature Restrictions)

### ToyBox Wrath - Ver 1.5.23 (built for 2.3.2c)
* (***CascadingDragon***) Fix Ignore Feature Prerequisites When Choosing Class (now it now longer allows taking feats you shouldn't be able too).

### ToyBox Wrath - Ver 1.5.22 (built for 2.3.2c)
* (***ADDB***) Add feature under Party => Stats to turn on/off AI control of specific characters.
* (***CascadingDragon***) Fix Roll 10 Initiative.

### ToyBox Wrath - Ver 1.5.21 (built for 2.3.2c)
* (***ADDB***) Add incompatibility checker! From now on ToyBox will send a web request to check whether the current mod version has known incompatibilities with the current game version. This is done for cases where the mod still loads after updates, but causes issues in the background (i.e. enemies only having 1 HP). If it detects incompatibilities it will stop loading.

### ToyBox Wrath - Ver 1.5.20 (built for 2.3.2c)
* (***ADDB***) Maybe Party tab shows more features now? (Especially Parameterized stuff and such?).
* (***CascadingDragon***) Fix Merging Manually Added Mythic Spell Books.

### ToyBox Wrath - Ver 1.5.19 (built for 2.3.2c)
* (***ADDB***) Maybe Fixed Remote Companions Dialog causing companions to talk about other companions you might've never even joined you.
* (***ADDB***) My Magus changes broke some abilities (like Charge) if the feature is enabled. This should be fixed now.

### ToyBox Wrath - Ver 1.5.18 (built for 2.3.1e)
* (***ADDB***) Fix the Magus: Allow Spell Combat for dual wielding.
* (***ADDB***) Maybe added setting to forcefully disable all tutorials.
* (***ADDB***) Fix MysticalMayhem breaking Search 'n Pick. Is this mod even working correctly currently?
* (***ADDB***) Fix MysticalMayhem breaking Search 'n Pick. Is this mod even working correctly currently?.
* (***Delth***) Add toggle to remove read-onlyness from etudes.

### ToyBox Wrath - Ver 1.5.15 (built for 2.3.1e)
Expand Down
2 changes: 1 addition & 1 deletion ToyBox/Repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Releases": [
{
"Id": "0ToyBox0",
"Version": "1.5.18"
"Version": "1.5.22"
}
]
}
2 changes: 1 addition & 1 deletion ToyBox/ToyBox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Description>ToyBox</Description>
<AppDesignerFolder>Properties</AppDesignerFolder>
<OutputType>Library</OutputType>
<Version>1.5.18</Version>
<Version>1.5.24</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<FileAlignment>512</FileAlignment>
<LangVersion>latest</LangVersion>
Expand Down
20 changes: 12 additions & 8 deletions ToyBox/classes/Infrastructure/CasterHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Kingmaker.Blueprints;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes;
using Kingmaker.Blueprints.Root;
using Kingmaker.EntitySystem.Entities;
Expand Down Expand Up @@ -246,25 +246,29 @@ public static int GetActualSpellsLearned(Spellbook spellbook, int level, List<Bl
}
#endif

public static IEnumerable<ClassData> MergableClasses(this UnitEntityData unit) {
public static IEnumerable<BlueprintSpellbook> MergableClasses(this UnitEntityData unit) {
var spellbookCandidates = unit.Spellbooks
.Where(sb => sb.IsStandaloneMythic && sb.Blueprint.CharacterClass != null)
.Select(sb => sb.Blueprint).ToHashSet();
/* Dragon's comment on this. Why are we looking for the Mythic class here? It means you can't merge mythic spellbooks that are added via Toybox
* Or any other method that wouldn't add the Mythic class
* Looks like maybe for localized name, but... then it's not that functional
*/
//Mod.Log($"{unit.CharacterName} - spellbookCandidates: {string.Join(", ", spellbookCandidates.Select(sb => sb.DisplayName))}");
var classCandidates = unit.Progression.Classes
.Where(cl => cl.Spellbook != null && spellbookCandidates.Contains(cl.Spellbook));
//var classCandidates = unit.Progression.Classes
// .Where(cl => cl.Spellbook != null && spellbookCandidates.Contains(cl.Spellbook));
//Mod.Log($"{unit.CharacterName} - classCandidates: {string.Join(", ", classCandidates.Select(cl => cl.CharacterClass.Name))}");
return classCandidates;
return spellbookCandidates;
}
public static void MergeMythicSpellbook(this Spellbook targetSpellbook, ClassData fromClass) {
public static void MergeMythicSpellbook(this Spellbook targetSpellbook, BlueprintSpellbook fromClass) {
var unit = targetSpellbook.Owner;
var oldMythicSpellbookBp = fromClass?.Spellbook;
var oldMythicSpellbookBp = fromClass;
if (fromClass == null || oldMythicSpellbookBp == null || !oldMythicSpellbookBp.IsMythic) {
Mod.Warn("Can't merge because you don't have a mythic class / mythic spellbook!");
return;
}

fromClass.Spellbook = targetSpellbook.Blueprint;
//fromClass.Spellbook = targetSpellbook.Blueprint;
targetSpellbook.m_Type = SpellbookType.Mythic;
targetSpellbook.AddSpecialList(oldMythicSpellbookBp.MythicSpellList);
for (var i = targetSpellbook.MythicLevel; i < unit.Progression.MythicLevel; i++) {
Expand Down
5 changes: 1 addition & 4 deletions ToyBox/classes/MainUI/Browser/FactsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,7 @@ public static List<Action> OnGUI<Item, Definition>(UnitEntityData ch, Browser<De
} else {
browser.OnGUI(
fact,
() => {
var types = fact.GroupBy(f => f.Blueprint.GetType()).Select(g => g.FirstOrDefault().Blueprint.GetType());
return GetBlueprints<Definition>()?.Where(bp => types.Contains(bp.GetType()));
},
GetBlueprints<Definition>,
(feature) => (Definition)feature.Blueprint,
(blueprint) => $"{GetSearchKey(blueprint)}" + (Settings.searchDescriptions ? $"{blueprint.Description}" : ""),
blueprint => new[] { GetSortKey(blueprint) },
Expand Down
4 changes: 2 additions & 2 deletions ToyBox/classes/MainUI/DiceRollsGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static void OnGUI() {
() => EnumGrid("Never Roll 20".localize(), ref Settings.neverRoll20, AutoWidth()),
() => EnumGrid("Never Roll 1".localize(), ref Settings.neverRoll1, AutoWidth()),
() => EnumGrid("Initiative: Always Roll 20".localize(), ref Settings.roll20Initiative, AutoWidth()),
() => EnumGrid("Initiative: Always Roll 10".localize(), ref Settings.roll20Initiative, AutoWidth()),
() => EnumGrid("Initiative: Always Roll 10".localize(), ref Settings.roll10Initiative, AutoWidth()),
() => EnumGrid("Initiative: Always Roll 1".localize(), ref Settings.roll1Initiative, AutoWidth()),
() => EnumGrid("Non Combat: Take 20".localize(), ref Settings.alwaysRoll20OutOfCombat, AutoWidth()),
() => EnumGrid("Non Combat: Roll at least 10".localize(), ref Settings.rollAtLeast10OutOfCombat, AutoWidth()),
Expand All @@ -29,4 +29,4 @@ public static void OnGUI() {
);
}
}
}
}
5 changes: 5 additions & 0 deletions ToyBox/classes/MainUI/LevelUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public static void OnGUI() {
Space(25);
Label(("Experimental".cyan() + ": lets you select any feat ignoring prerequisites.".green()).localize());
},
() => {
Toggle("Ignore Feature Recommendations".localize(), ref Settings.toggleFeatureRecommendations);
Space(25);
Label(("Makes the thumbs up/down in disappear in selections".green()).localize());
},
() => Toggle("Allow Companions to Take Mythic Classes".localize(), ref Settings.toggleAllowCompanionsToBecomeMythic),
() => Toggle("Allow Pets to Take Mythic Classes".localize(), ref Settings.toggleAllowMythicPets),
() => Toggle("Ignore Prerequisites When Choosing A Feat".localize(), ref Settings.toggleFeaturesIgnorePrerequisites),
Expand Down
47 changes: 47 additions & 0 deletions ToyBox/classes/MainUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
using Kingmaker.UI.Common;
using Newtonsoft.Json;
using ToyBox.Multiclass;
using System.Net;

namespace ToyBox {
#if DEBUG
[EnableReloading]
#endif
internal static class Main {
internal const string LinkToIncompatibilitiesFile = "https://raw.githubusercontent.com/xADDBx/ToyBox-Wrath/main/ToyBox/Incompatibilities.json";
internal static Harmony HarmonyInstance;
public static readonly LogChannel logger = LogChannelFactory.GetOrCreate("Respec");
private static string _modId;
Expand Down Expand Up @@ -78,6 +80,10 @@ public static void SetNeedsResetGameUI() {
public static List<GameObject> Objects;
private static bool Load(UnityModManager.ModEntry modEntry) {
try {
if (!IsGameVersionSupported(modEntry.Version, modEntry.Logger)) {
modEntry.Logger.Log("Fatal! The current Game Version has known incompatabilities with your current ToyBox version! Please Update.");
return false;
}
#if DEBUG
modEntry.OnUnload = OnUnload;
#endif
Expand Down Expand Up @@ -380,5 +386,46 @@ private static void OnUpdate(UnityModManager.ModEntry modEntry, float z) {
Teleport.TeleportParty();
}
}
public static bool IsGameVersionSupported(Version modVersion, UnityModManager.ModEntry.ModLogger logger) {
try {
using var web = new WebClient();
var raw = web.DownloadString(LinkToIncompatibilitiesFile);
var definition = new[] { new[] { "", "" } };
var versions = JsonConvert.DeserializeAnonymousType(raw, definition);
var currentOrNewer = versions.FirstOrDefault(v => new Version(v[0]) >= modVersion);
if (currentOrNewer == null) return true;
return new Version(GetNumifiedVersion(currentOrNewer[1])) > new Version(GetNumifiedVersion(GameVersion.GetVersion()));
} catch (Exception ex) {
logger.Log(ex.ToString());
}
return true;
}
public static string GetNumifiedVersion(string version) {
var comps = version.Split('.');
var newComps = new List<string>();
foreach (var comp in comps) {
uint num = 0;
foreach (var c in comp) {
uint newNum = num;
try {
checked {
if (uint.TryParse(c.ToString(), out var n)) {
newNum = newNum * 10u + n;
} else {
int signedCharNumber = char.ToUpper(c) - ' ';
uint unsignedCharNumber = (uint)Math.Max(0, Math.Min(signedCharNumber, 99));
newNum = newNum * 100u + unsignedCharNumber;
}
num = newNum;
}
} catch (OverflowException) {
logger.Log($"Encountered uint overflow while parsing version component {comp}, continuing with {num}");
break;
}
}
newComps.Add(num.ToString());
}
return string.Join(".", newComps);
}
}
}
4 changes: 2 additions & 2 deletions ToyBox/classes/MainUI/PartyEditor/SpellsEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Kingmaker.Blueprints;
using Kingmaker.Blueprints;
using Kingmaker.EntitySystem.Entities;
using Kingmaker.UnitLogic;
using Kingmaker.UnitLogic.Abilities;
Expand Down Expand Up @@ -45,7 +45,7 @@ public static List<Action> OnSpellsGUI(UnitEntityData ch, List<Spellbook> spellb
25.space();
foreach (var cl in mergeableClasses) {
var sb = spellbook;
ActionButton(cl.CharacterClass.LocalizedName.ToString(), () => sb.MergeMythicSpellbook(cl));
ActionButton(cl.GetDisplayName(), () => sb.MergeMythicSpellbook(cl));
15.space();
}
25.space();
Expand Down
Loading