mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-12 08:00:30 +01:00
Added settings option for configurable barrier placement distance
This commit is contained in:
parent
934e73d5c1
commit
646498bbc5
2 changed files with 7 additions and 3 deletions
|
|
@ -81,7 +81,7 @@ namespace SceneManager
|
||||||
private static void UpdateShadowBarrierPosition()
|
private static void UpdateShadowBarrierPosition()
|
||||||
{
|
{
|
||||||
DisableBarrierMenuOptionsIfShadowConeTooFar();
|
DisableBarrierMenuOptionsIfShadowConeTooFar();
|
||||||
shadowBarrier.Position = TracePlayerView(15, TraceFlags.IntersectEverything).HitPosition;
|
shadowBarrier.Position = TracePlayerView(SettingsMenu.barrierPlacementDistance.Value, TraceFlags.IntersectEverything).HitPosition;
|
||||||
Rage.Native.NativeFunction.Natives.PLACE_OBJECT_ON_GROUND_PROPERLY(shadowBarrier);
|
Rage.Native.NativeFunction.Natives.PLACE_OBJECT_ON_GROUND_PROPERLY(shadowBarrier);
|
||||||
shadowBarrier.Heading = rotateBarrier.Value;
|
shadowBarrier.Heading = rotateBarrier.Value;
|
||||||
|
|
||||||
|
|
@ -239,7 +239,7 @@ namespace SceneManager
|
||||||
return World.TraceLine(start, end, flags);
|
return World.TraceLine(start, end, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static HitResult TracePlayerView(float maxTraceDistance = 15f, TraceFlags flags = TraceFlags.IntersectEverything) => TracePlayerView(out Vector3 v1, out Vector3 v2, maxTraceDistance, flags);
|
internal static HitResult TracePlayerView(float maxTraceDistance = 30f, TraceFlags flags = TraceFlags.IntersectEverything) => TracePlayerView(out Vector3 v1, out Vector3 v2, maxTraceDistance, flags);
|
||||||
//------------ CREDIT PNWPARKS FOR THESE FUNCTIONS ------------\\
|
//------------ CREDIT PNWPARKS FOR THESE FUNCTIONS ------------\\
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ namespace SceneManager
|
||||||
public static UIMenuCheckboxItem debugGraphics = new UIMenuCheckboxItem("Enable 3D Waypoints", false),
|
public static UIMenuCheckboxItem debugGraphics = new UIMenuCheckboxItem("Enable 3D Waypoints", false),
|
||||||
hints = new UIMenuCheckboxItem("Enable Hints", true); // Refactor this to be true/false based off the ini
|
hints = new UIMenuCheckboxItem("Enable Hints", true); // Refactor this to be true/false based off the ini
|
||||||
public static UIMenuListScrollerItem<SpeedUnitsOfMeasure> speedUnits = new UIMenuListScrollerItem<SpeedUnitsOfMeasure>("Speed Unit of Measure", "", new[] { SpeedUnitsOfMeasure.MPH, SpeedUnitsOfMeasure.KPH });
|
public static UIMenuListScrollerItem<SpeedUnitsOfMeasure> speedUnits = new UIMenuListScrollerItem<SpeedUnitsOfMeasure>("Speed Unit of Measure", "", new[] { SpeedUnitsOfMeasure.MPH, SpeedUnitsOfMeasure.KPH });
|
||||||
|
public static UIMenuNumericScrollerItem<int> barrierPlacementDistance = new UIMenuNumericScrollerItem<int>("Barrier Placement Distance", "How far away you can place a barrier (in meters)", 1, 30, 1);
|
||||||
|
|
||||||
public enum SpeedUnitsOfMeasure
|
public enum SpeedUnitsOfMeasure
|
||||||
{
|
{
|
||||||
MPH,
|
MPH,
|
||||||
|
|
@ -28,6 +30,8 @@ namespace SceneManager
|
||||||
settingsMenu.AddItem(debugGraphics);
|
settingsMenu.AddItem(debugGraphics);
|
||||||
settingsMenu.AddItem(hints);
|
settingsMenu.AddItem(hints);
|
||||||
settingsMenu.AddItem(speedUnits);
|
settingsMenu.AddItem(speedUnits);
|
||||||
|
settingsMenu.AddItem(barrierPlacementDistance);
|
||||||
|
barrierPlacementDistance.Index = 14;
|
||||||
|
|
||||||
settingsMenu.OnCheckboxChange += SettingsMenu_OnCheckboxChange;
|
settingsMenu.OnCheckboxChange += SettingsMenu_OnCheckboxChange;
|
||||||
settingsMenu.OnScrollerChange += SettingsMenu_OnScrollerChange;
|
settingsMenu.OnScrollerChange += SettingsMenu_OnScrollerChange;
|
||||||
|
|
@ -47,7 +51,7 @@ namespace SceneManager
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugGraphics.DrawSphereOnPlayer(debugGraphics);
|
DebugGraphics.Draw3DWaypointOnPlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue