Skip to content

Commit

Permalink
* (***ADDB***) Patch Tool: Fix patching some Blueprints causing CTDs.
Browse files Browse the repository at this point in the history
* (***ADDB***) Patch Tool: Fix adding new elements to Collections of references breaking things
  • Loading branch information
xADDBx committed Jan 12, 2025
1 parent e3279e7 commit 9937479
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ToyBox/Classes/MainUI/DiceRollsGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static void OnGUI() {
() => EnumGrid("All Attacks Hit".localize(), ref Settings.allAttacksHit, AutoWidth()),
() => EnumGrid("All Hits Critical".localize(), ref Settings.allHitsCritical, AutoWidth()),
() => EnumGrid("Roll With Advantage (take lower roll)".localize(), ref Settings.rollWithAdvantage, AutoWidth()),
() => EnumGrid("Roll With Disavantage (take higher roll)".localize(), ref Settings.rollWithDisadvantage, AutoWidth()),
() => EnumGrid("Roll With Disadvantage (take higher roll)".localize(), ref Settings.rollWithDisadvantage, AutoWidth()),
() => EnumGrid("Always Roll 100".localize(), ref Settings.alwaysRoll100, AutoWidth()),
() => EnumGrid("Always Roll 50".localize(), ref Settings.alwaysRoll50, AutoWidth()),
() => EnumGrid("Always Roll 1".localize(), ref Settings.alwaysRoll1, AutoWidth()),
Expand Down
2 changes: 1 addition & 1 deletion ToyBox/Classes/MainUI/PatchTool/UI/PatchToolTabUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ private void FieldGUI(object parent, PatchOperation wouldBePatch, Type type, obj
if (!toggleStates.TryGetValue((parent, info, index), out var state)) {
state = false;
}
var label = (@object as BlueprintReferenceBase)?.Guid.ToString();
var label = (@object as BlueprintReferenceBase)?.Guid?.ToString();
if (label.IsNullOrEmpty()) label = "Null or Empty Reference";
else label = BlueprintExtensions.GetTitle((@object as BlueprintReferenceBase)?.GetBlueprint()) + $"({label})";
if (state) {
Expand Down
3 changes: 2 additions & 1 deletion ToyBox/Classes/MainUI/PatchTool/Utils/DeepCopy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ private static Object InternalCopy(Object originalObject, IDictionary<Object, Ob
if (typeof(Delegate).IsAssignableFrom(typeToReflect)) return originalObject;

// Prevent messing up references by copying the cached instance of the blueprints.
if (!cloneTopBlueprint && typeof(BlueprintScriptableObject).IsAssignableFrom(typeToReflect)) return originalObject;
if (!cloneTopBlueprint && typeof(SimpleBlueprint).IsAssignableFrom(typeToReflect)) return originalObject;
if (typeof(UnityEngine.Object).IsAssignableFrom(typeToReflect)) return originalObject;

var cloneObject = targetObject ?? CloneMethod.Invoke(originalObject, null);
visited.Add(originalObject, cloneObject);
Expand Down
4 changes: 4 additions & 0 deletions ToyBox/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Here is a summarized list of features. This list only includes a part of the fea
- **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 Rogue - Ver 1.7.9 built for Rogue Trader 1.3.1.6
* (***ADDB***) Patch Tool: Fix patching some Blueprints causing CTDs.
* (***ADDB***) Patch Tool: Fix adding new elements to Collections of references breaking things

### ToyBox Rogue - Ver 1.7.8 built for Rogue Trader 1.3.0.57
* (***ADDB***) Fix somewhat critical error in PatchTool which would DeepCopy Blueprints, messing up cached references (noticeable e.g. when Proficiency Requirements aren't satisfied after patching something until the game is restarted once).
* (***ADDB***) No longer ignore delegates when Deep Copying => Fix e.g. Abilities disappearing from Weapons after patching them until restarting the game.
Expand Down

0 comments on commit 9937479

Please sign in to comment.