mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 15:40: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:
parent
e7f40c9624
commit
a7fd140e1f
5 changed files with 37 additions and 16 deletions
|
|
@ -17,8 +17,7 @@ namespace SceneManager
|
||||||
GetAssemblyVersion();
|
GetAssemblyVersion();
|
||||||
MenuManager.InstantiateMenus();
|
MenuManager.InstantiateMenus();
|
||||||
|
|
||||||
if (Settings.EnableHints)
|
DisplayHintsToOpenMenu();
|
||||||
DisplayHintsToOpenMenu();
|
|
||||||
|
|
||||||
GameFiber UserInputFiber = new GameFiber(() => GetUserInput.LoopForUserInput());
|
GameFiber UserInputFiber = new GameFiber(() => GetUserInput.LoopForUserInput());
|
||||||
UserInputFiber.Start();
|
UserInputFiber.Start();
|
||||||
|
|
@ -36,19 +35,19 @@ namespace SceneManager
|
||||||
{
|
{
|
||||||
if (Settings.ModifierKey == Keys.None && Settings.ModifierButton == ControllerButtons.None)
|
if (Settings.ModifierKey == Keys.None && Settings.ModifierButton == ControllerButtons.None)
|
||||||
{
|
{
|
||||||
Game.DisplayNotification($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press the ~b~{Settings.ToggleKey} key ~w~or ~b~{Settings.ToggleButton} button ~w~while on foot");
|
Hints.Display($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press the ~b~{Settings.ToggleKey} key ~w~or ~b~{Settings.ToggleButton} button ~w~while on foot");
|
||||||
}
|
}
|
||||||
else if (Settings.ModifierKey == Keys.None)
|
else if (Settings.ModifierKey == Keys.None)
|
||||||
{
|
{
|
||||||
Game.DisplayNotification($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press the ~b~{Settings.ToggleKey} key ~w~or ~b~{Settings.ModifierButton} ~w~+ ~b~{Settings.ToggleButton} buttons ~w~while on foot");
|
Hints.Display($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press the ~b~{Settings.ToggleKey} key ~w~or ~b~{Settings.ModifierButton} ~w~+ ~b~{Settings.ToggleButton} buttons ~w~while on foot");
|
||||||
}
|
}
|
||||||
else if (Settings.ModifierButton == ControllerButtons.None)
|
else if (Settings.ModifierButton == ControllerButtons.None)
|
||||||
{
|
{
|
||||||
Game.DisplayNotification($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press ~b~{Settings.ModifierKey} ~w~+ ~b~{Settings.ToggleKey} ~w~or the ~b~{Settings.ToggleButton} button ~w~while on foot");
|
Hints.Display($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press ~b~{Settings.ModifierKey} ~w~+ ~b~{Settings.ToggleKey} ~w~or the ~b~{Settings.ToggleButton} button ~w~while on foot");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Game.DisplayNotification($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press the ~b~{Settings.ModifierKey} ~w~+ ~b~{Settings.ToggleKey} keys ~w~or ~b~{Settings.ModifierButton} ~w~+ ~b~{Settings.ToggleButton} buttons ~w~while on foot");
|
Hints.Display($"~o~Scene Manager\n~y~[Hint]~w~ To open the menu, press the ~b~{Settings.ModifierKey} ~w~+ ~b~{Settings.ToggleKey} keys ~w~or ~b~{Settings.ModifierButton} ~w~+ ~b~{Settings.ToggleButton} buttons ~w~while on foot");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
17
SceneManager/Hints.cs
Normal file
17
SceneManager/Hints.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
using Rage;
|
||||||
|
|
||||||
|
namespace SceneManager
|
||||||
|
{
|
||||||
|
class Hints
|
||||||
|
{
|
||||||
|
public static bool Enabled { get; set; } = SettingsMenu.hints.Checked;
|
||||||
|
|
||||||
|
public static void Display(string message)
|
||||||
|
{
|
||||||
|
if (Enabled)
|
||||||
|
{
|
||||||
|
Game.DisplayNotification($"{message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -15,7 +15,6 @@ namespace SceneManager
|
||||||
public static UIMenu barrierMenu { get; private set; }
|
public static UIMenu barrierMenu { get; private set; }
|
||||||
public static List<Rage.Object> barriers = new List<Rage.Object>() { };
|
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 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 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);
|
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)
|
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)
|
if (shadowBarrier)
|
||||||
shadowBarrier.Delete();
|
shadowBarrier.Delete();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@ namespace SceneManager
|
||||||
class SettingsMenu
|
class SettingsMenu
|
||||||
{
|
{
|
||||||
public static UIMenu settingsMenu { get; private set; }
|
public static UIMenu settingsMenu { get; private set; }
|
||||||
public static UIMenuCheckboxItem debugGraphics;
|
public static UIMenuCheckboxItem debugGraphics = new UIMenuCheckboxItem("Enable 3D Waypoints", false),
|
||||||
public static UIMenuListScrollerItem<SpeedUnitsOfMeasure> speedUnits;
|
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
|
public enum SpeedUnitsOfMeasure
|
||||||
{
|
{
|
||||||
MPH,
|
MPH,
|
||||||
|
|
@ -24,8 +25,9 @@ namespace SceneManager
|
||||||
|
|
||||||
public static void BuildSettingsMenu()
|
public static void BuildSettingsMenu()
|
||||||
{
|
{
|
||||||
settingsMenu.AddItem(debugGraphics = new UIMenuCheckboxItem("Enable Debug Graphics", false));
|
settingsMenu.AddItem(debugGraphics);
|
||||||
settingsMenu.AddItem(speedUnits = new UIMenuListScrollerItem<SpeedUnitsOfMeasure>("Speed Unit of Measure", "", new[] { SpeedUnitsOfMeasure.MPH, SpeedUnitsOfMeasure.KPH }));
|
settingsMenu.AddItem(hints);
|
||||||
|
settingsMenu.AddItem(speedUnits);
|
||||||
|
|
||||||
settingsMenu.OnCheckboxChange += SettingsMenu_OnCheckboxChange;
|
settingsMenu.OnCheckboxChange += SettingsMenu_OnCheckboxChange;
|
||||||
settingsMenu.OnScrollerChange += SettingsMenu_OnScrollerChange;
|
settingsMenu.OnScrollerChange += SettingsMenu_OnScrollerChange;
|
||||||
|
|
@ -35,8 +37,6 @@ namespace SceneManager
|
||||||
{
|
{
|
||||||
if (checkboxItem == debugGraphics)
|
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)
|
if (debugGraphics.Checked)
|
||||||
{
|
{
|
||||||
foreach (Path path in PathMainMenu.GetPaths())
|
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)
|
private static void SettingsMenu_OnScrollerChange(UIMenu sender, UIMenuScrollerItem scrollerItem, int oldIndex, int newIndex)
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AITasking.cs" />
|
<Compile Include="AITasking.cs" />
|
||||||
<Compile Include="DebugGraphics.cs" />
|
<Compile Include="DebugGraphics.cs" />
|
||||||
|
<Compile Include="Hints.cs" />
|
||||||
<Compile Include="Menus\BarrierMenu.cs" />
|
<Compile Include="Menus\BarrierMenu.cs" />
|
||||||
<Compile Include="Object Classes\CollectedVehicle.cs" />
|
<Compile Include="Object Classes\CollectedVehicle.cs" />
|
||||||
<Compile Include="Menus\EditPathMenu.cs" />
|
<Compile Include="Menus\EditPathMenu.cs" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue