1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 23:50:29 +01:00

Created new Hints class. Implemented Hints.Display method. Added option to SettingsMenu to enable/disable hints in-game.

This commit is contained in:
Rich Dunne 2020-08-26 19:16:28 -06:00
parent e7f40c9624
commit a7fd140e1f
5 changed files with 37 additions and 16 deletions

View file

@ -15,7 +15,6 @@ namespace SceneManager
public static UIMenu barrierMenu { get; private set; }
public static List<Rage.Object> barriers = new List<Rage.Object>() { };
// TODO: Refactor as dictionary
private static UIMenuListScrollerItem<string> barrierList = new UIMenuListScrollerItem<string>("Select Barrier", "", new[] { "Large Striped Cone", "Large Cone", "Medium Striped Cone", "Medium Cone", "Roadpole A", "Roadpole B", "Police Barrier", "Road Barrier", "Flare" });
private static string[] barrierObjectNames = new string[] { "prop_mp_cone_01", "prop_roadcone01c", "prop_mp_cone_02", "prop_mp_cone_03", "prop_roadpole_01a", "prop_roadpole_01b", "prop_barrier_work05", "prop_barrier_work06a", "prop_flare_01b" };
private static UIMenuNumericScrollerItem<int> rotateBarrier = new UIMenuNumericScrollerItem<int>("Rotate Barrier", "Rotate the barrier.", 0, 350, 10);
@ -48,12 +47,12 @@ namespace SceneManager
public static void CreateShadowBarrier(UIMenu barrierMenu)
{
if (EntryPoint.Settings.EnableHints)
if (Settings.EnableHints)
{
Game.DisplayNotification($"~o~Scene Manager\n~y~[Hint]~y~ ~w~The shadow cone will disappear if you aim too far away.");
Hints.Display($"~o~Scene Manager\n~y~[Hint]~y~ ~w~The shadow cone will disappear if you aim too far away.");
}
//Game.LogTrivial("Creating shadow cone");
//Game.LogTrivial("Creating shadow barrier");
if (shadowBarrier)
shadowBarrier.Delete();

View file

@ -7,8 +7,9 @@ namespace SceneManager
class SettingsMenu
{
public static UIMenu settingsMenu { get; private set; }
public static UIMenuCheckboxItem debugGraphics;
public static UIMenuListScrollerItem<SpeedUnitsOfMeasure> speedUnits;
public static UIMenuCheckboxItem debugGraphics = new UIMenuCheckboxItem("Enable 3D Waypoints", false),
hints = new UIMenuCheckboxItem("Enable Hints", true);
public static UIMenuListScrollerItem<SpeedUnitsOfMeasure> speedUnits = new UIMenuListScrollerItem<SpeedUnitsOfMeasure>("Speed Unit of Measure", "", new[] { SpeedUnitsOfMeasure.MPH, SpeedUnitsOfMeasure.KPH });
public enum SpeedUnitsOfMeasure
{
MPH,
@ -24,8 +25,9 @@ namespace SceneManager
public static void BuildSettingsMenu()
{
settingsMenu.AddItem(debugGraphics = new UIMenuCheckboxItem("Enable Debug Graphics", false));
settingsMenu.AddItem(speedUnits = new UIMenuListScrollerItem<SpeedUnitsOfMeasure>("Speed Unit of Measure", "", new[] { SpeedUnitsOfMeasure.MPH, SpeedUnitsOfMeasure.KPH }));
settingsMenu.AddItem(debugGraphics);
settingsMenu.AddItem(hints);
settingsMenu.AddItem(speedUnits);
settingsMenu.OnCheckboxChange += SettingsMenu_OnCheckboxChange;
settingsMenu.OnScrollerChange += SettingsMenu_OnScrollerChange;
@ -35,8 +37,6 @@ namespace SceneManager
{
if (checkboxItem == debugGraphics)
{
// TODO: Fix graphics don't display when new path is created, have to uncheck and re-check the option
// TODO: Add branch for this during path creation ... create temp Waypoint list during path creation, then assign to path[i] after creation?
if (debugGraphics.Checked)
{
foreach (Path path in PathMainMenu.GetPaths())
@ -48,6 +48,11 @@ namespace SceneManager
}
}
}
if(checkboxItem == hints)
{
Hints.Enabled = hints.Checked ? true : false;
}
}
private static void SettingsMenu_OnScrollerChange(UIMenu sender, UIMenuScrollerItem scrollerItem, int oldIndex, int newIndex)