Skip to content

Commit

Permalink
* (***ADDB***) Add Slider to Enhanced Camera to (persistently) offset…
Browse files Browse the repository at this point in the history
… the Camera Elevation by a specified value
  • Loading branch information
xADDBx committed Jan 12, 2025
1 parent 9937479 commit 058d3e8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ToyBox/Classes/MainUI/EnhancedUI/EnhancedCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ public static void OnGUI() {
BindableActionButton(ResetAdditionalCameraAngles, true);
},
() => LogSlider("Field Of View".localize(), ref Settings.fovMultiplier, 0.4f, 5.0f, 1, 2, "", AutoWidth()),
() => Toggle("Add Camera Elevation Offset".localize(), ref Settings.toggleOffsetCameraHeight),
() => {
if (Settings.toggleOffsetCameraHeight) {
Space(50);
Slider(ref Settings.CameraElevationOffset, -10.0f, 100.0f, 0, 1);
}
},
() => { }
);
}
Expand Down
2 changes: 2 additions & 0 deletions ToyBox/Classes/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ internal PerSaveSettings perSave {
public bool toggleInvertXAxis = false;
public bool toggleInvertKeyboardXAxis = false;
public bool toggleInvertYAxis = false;
public bool toggleOffsetCameraHeight = false;
public float CameraElevationOffset = 0f;
public float fovMultiplier = 1;
internal float AdjustedFovMultiplier => Math.Max(fovMultiplier, toggleZoomableLocalMaps ? 1.25f : 0.4f);

Expand Down
6 changes: 6 additions & 0 deletions ToyBox/Classes/MonkeyPatchin/BagOfPatches/CamereRT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ private static void PlaceOnGround(ref Vector3 __result) {
if (!Settings.toggleCameraElevation && !Settings.toggleFreeCamera) return;
__result.y = CameraElevation;
}
[HarmonyPatch(nameof(CameraRig.PlaceOnGround2)), HarmonyPriority(Priority.HigherThanNormal)]
[HarmonyPostfix]
private static void PlaceOnGround2(ref Vector3 __result) {
if (!Settings.toggleOffsetCameraHeight) return;
__result.y += Settings.CameraElevationOffset;
}
}
}
}
11 changes: 11 additions & 0 deletions ToyBox/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage(
"CodeQuality",
"IDE0051:Remove unused private members",
Justification = "Members are implicitly called via reflection and such")]
3 changes: 2 additions & 1 deletion ToyBox/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ Here is a summarized list of features. This list only includes a part of the fea
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 patching some Blueprints causing CTDs
* (***ADDB***) Patch Tool: Fix adding new elements to Collections of references breaking things
* (***ADDB***) Add Slider to Enhanced Camera to (persistently) offset the Camera Elevation by a specified value

### 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).
Expand Down

0 comments on commit 058d3e8

Please sign in to comment.