Skip to content

Commit 9144f89

Browse files
Add Adjust ArrowSize (#101)
Co-authored-by: originalnicodr <[email protected]>
1 parent 3bc1268 commit 9144f89

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed
Binary file not shown.

src/Cinematic/ArrowGenerator.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using HarmonyLib;
22
using System.Collections.Generic;
33
using UnityEngine;
4+
using UnityExplorer.Config;
45
#if UNHOLLOWER
56
using IL2CPPUtils = UnhollowerBaseLib.UnhollowerUtils;
67
#endif
@@ -12,8 +13,12 @@ namespace UnityExplorer
1213
{
1314
public class ArrowGenerator
1415
{
15-
public static GameObject CreateArrow(Vector3 arrowPosition, Quaternion arrowRotation, Color color){
16+
public static GameObject CreateArrow(Vector3 arrowPosition, Quaternion arrowRotation, Color color)
17+
{
1618
try {
19+
float arrowSizeValue = ConfigManager.Arrow_Size.Value;
20+
Vector3 arrowSize = new Vector3(Math.Max(arrowSizeValue, 0.1f), Math.Max(arrowSizeValue, 0.1f), Math.Max(arrowSizeValue, 0.1f));
21+
1722
GameObject cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
1823
cylinder.GetComponent<Collider>().enabled = false;
1924
cylinder.GetComponent<MeshFilter>().mesh = CreateCylinderMesh(0.01f, 20, 2);
@@ -34,6 +39,7 @@ public static GameObject CreateArrow(Vector3 arrowPosition, Quaternion arrowRota
3439

3540
GameObject arrow = new GameObject("CUE-Arrow");
3641
cylinder.transform.SetParent(arrow.transform, true);
42+
arrow.transform.localScale = arrowSize;
3743
arrow.transform.position = arrowPosition;
3844
arrow.transform.rotation = arrowRotation;
3945
arrow.transform.position += 0.5f * arrow.transform.forward; // Move the arrow forward so the cylinder starts on the wanted position

src/Cinematic/Cells/LightCell.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using UnityEngine;
2+
using UnityExplorer.Config;
23
using UniverseLib.UI;
34
using UniverseLib.UI.Models;
45
using UniverseLib.UI.Widgets.ScrollView;
@@ -69,6 +70,9 @@ public virtual GameObject CreateContent(GameObject parent)
6970

7071
private void ToggleVisualizer(){
7172
GameObject visualizer = light.transform.GetChild(0).gameObject;
73+
float arrowSize = ConfigManager.Arrow_Size.Value;
74+
Vector3 arrowSizeVec = new Vector3(Math.Max(arrowSize, 0.1f), Math.Max(arrowSize, 0.1f), Math.Max(arrowSize, 0.1f));
75+
light.transform.GetChild(0).localScale = arrowSizeVec;
7276
visualizer.SetActive(!visualizer.activeSelf);
7377
}
7478

src/Config/ConfigManager.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public static class ConfigManager
3232
public static ConfigElement<bool> Reflection_Hide_NativeInfoPtrs;
3333
public static ConfigElement<bool> Auto_Scale_UI;
3434
public static ConfigElement<bool> Reset_Camera_Transform;
35+
public static ConfigElement<float> Arrow_Size;
3536

3637
public static ConfigElement<KeyCode> Pause;
3738
public static ConfigElement<KeyCode> Frameskip;
@@ -167,7 +168,7 @@ private static void CreateConfigElements()
167168
"Optional keybind to begin a UI-mode Mouse Inspect.",
168169
KeyCode.None);
169170

170-
CSConsole_Assembly_Blacklist = new("CSharp Console Assembly Blacklist",
171+
CSConsole_Assembly_Blacklist = new("CSharp Console Assembly Blacklist",
171172
"Use this to blacklist Assembly names from being referenced by the C# Console. Requires a Reset of the C# Console.\n" +
172173
"Separate each Assembly with a semicolon ';'." +
173174
"For example, to blacklist Assembly-CSharp, you would add 'Assembly-CSharp;'",
@@ -178,7 +179,7 @@ private static void CreateConfigElements()
178179
"Seperate signatures with a semicolon ';'.\r\n" +
179180
"For example, to blacklist Camera.main, you would add 'UnityEngine.Camera.main;'",
180181
"");
181-
182+
182183
Reflection_Hide_NativeInfoPtrs = new("Hide NativeMethodInfoPtr_s and NativeFieldInfoPtr_s",
183184
"Use this to blacklist NativeMethodPtr_s and NativeFieldInfoPtrs_s from the class inspector, mainly to reduce clutter.\r\n" +
184185
"For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.",
@@ -187,15 +188,19 @@ private static void CreateConfigElements()
187188
Auto_Scale_UI = new("Make the mod UI automatically scale with resolution",
188189
"Especially useful when running games in high resolutions and you are having a hard time reading the mods menu (requires restart).",
189190
true);
190-
191+
191192
Reset_Camera_Transform = new("Reset Camera transform on freecam disable",
192193
"Reset the camera position and rotation between freecam sessions, so the freecam always starts from the gameplay position and rotation.",
193194
false);
195+
196+
Arrow_Size = new("Visualizers arrows size",
197+
"Cam Paths nodes and Lights Manager lights visualizers' arrow size (must be positive) (needs visualizer toggled to reflect changes).",
198+
1f);
194199

195200
Pause = new("Pause",
196201
"Toggle the pause of the game.",
197202
KeyCode.PageUp);
198-
203+
199204
Frameskip = new("Frameskip",
200205
"Skip a frame when the game is paused.",
201206
KeyCode.PageDown);
@@ -249,7 +254,7 @@ private static void CreateConfigElements()
249254
Left_1 = new("Left 1",
250255
"Move the freecam to the left.",
251256
KeyCode.A);
252-
257+
253258
Left_2 = new("Left 2",
254259
"Move the freecam to the left, alt key.",
255260
KeyCode.LeftArrow);

src/Loader/Standalone/Editor/ExplorerEditorBehaviour.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class ExplorerEditorBehaviour : MonoBehaviour
3030
public bool Auto_Scale_UI;
3131
public bool Reset_Camera_Transform;
3232
public FreeCamPanel.FreeCameraType Default_Freecam;
33+
public float Arrow_Size = 1f;
3334

3435
public KeyCode Pause;
3536
public KeyCode Frameskip;
@@ -87,6 +88,7 @@ internal void LoadConfigs()
8788
ConfigManager.Auto_Scale_UI.Value = this.Auto_Scale_UI;
8889
ConfigManager.Reset_Camera_Transform.Value = this.Reset_Camera_Transform;
8990
ConfigManager.Default_Freecam.Value = this.Default_Freecam;
91+
ConfigManager.Arrow_Size.Value = this.Arrow_Size;
9092

9193
ConfigManager.Pause.Value = this.Pause;
9294
ConfigManager.Frameskip.Value = this.Frameskip;

0 commit comments

Comments
 (0)