Skip to content

Commit

Permalink
Merge pull request #47 from AquaticLabs/master
Browse files Browse the repository at this point in the history
Reworking some of the ESP Keybinding problems,
  • Loading branch information
AquaticLabs authored Dec 26, 2022
2 parents fd3d154 + 7039608 commit 416480f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static async void CheckForUpdate()
try
{
var client = new GitHubClient(new ProductHeaderValue("UmbraUpdateCheck"));
var releases = await client.Repository.Release.GetAll("Acher0ns", "Umbra-Mod-Menu").ConfigureAwait(false);
var releases = await client.Repository.Release.GetAll("Aquatic-Labs", "Umbra-Mod-Menu").ConfigureAwait(false);
var latest = releases[0];
latestVersion = latest.TagName;

Expand Down
51 changes: 34 additions & 17 deletions Menus/Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Render : Menu
public static List<PressurePlateController> secretButtons = new List<PressurePlateController>();
public static List<ScrapperController> scrappers = new List<ScrapperController>();
public static List<HurtBox> hurtBoxes;
public static bool onRenderIntEnable = true, renderMobs, renderInteractables, renderMods = true;
public static bool scenePopulateToggle = true, renderMobs, renderInteractables, renderMods = true;

public Button toggleActiveMods;
public Button toggleInteractESP;
Expand Down Expand Up @@ -69,15 +69,42 @@ public override void Reset()
base.Reset();
}

public static void RefreshInteractables(SceneDirector obj)
{
RefreshInteractables();
}
public static void RefreshInteractables()
{
barrelInteractions = MonoBehaviour.FindObjectsOfType<BarrelInteraction>().ToList();
purchaseInteractions = MonoBehaviour.FindObjectsOfType<PurchaseInteraction>().ToList();
secretButtons = MonoBehaviour.FindObjectsOfType<PressurePlateController>().ToList();
scrappers = MonoBehaviour.FindObjectsOfType<ScrapperController>().ToList();
}
private void ToggleRenderInteractables()
{

if (renderInteractables)
{
DisableInteractables();
}
else
{
EnableInteractables();
Render.RefreshInteractables();
}
renderInteractables = !renderInteractables;
}
public static void ToggleRenderInteractablesKey()
{

if (renderInteractables)
{
DisableInteractables();
}
else
{
EnableInteractables();
Render.RefreshInteractables();
}
renderInteractables = !renderInteractables;
}
Expand All @@ -94,31 +121,21 @@ private void ToggleRenderMobs()

public static void EnableInteractables()
{
if (onRenderIntEnable)
if (scenePopulateToggle)
{
DumpInteractables(null);
SceneDirector.onPostPopulateSceneServer += DumpInteractables;
onRenderIntEnable = false;
SceneDirector.onPostPopulateSceneServer += RefreshInteractables;
scenePopulateToggle = false;
}
}

public static void DisableInteractables()
{
if (!onRenderIntEnable)
if (!scenePopulateToggle)
{
SceneDirector.onPostPopulateSceneServer -= DumpInteractables;
onRenderIntEnable = true;
SceneDirector.onPostPopulateSceneServer -= RefreshInteractables;
scenePopulateToggle = true;
}
}

public static void DumpInteractables(SceneDirector obj)
{
barrelInteractions = MonoBehaviour.FindObjectsOfType<BarrelInteraction>().ToList();
purchaseInteractions = MonoBehaviour.FindObjectsOfType<PurchaseInteraction>().ToList();
secretButtons = MonoBehaviour.FindObjectsOfType<PressurePlateController>().ToList();
scrappers = MonoBehaviour.FindObjectsOfType<ScrapperController>().ToList();
}

public static void DrawTeleporter() {
camera = Camera.main;

Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.5")]
[assembly: AssemblyFileVersion("2.0.5")]
[assembly: AssemblyVersion("2.0.6")]
[assembly: AssemblyFileVersion("2.0.6")]
8 changes: 4 additions & 4 deletions UmbraMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UmbraMenu : MonoBehaviour
{
public const string
NAME = "U M B R A",
VERSION = "2.0.5";
VERSION = "2.0.6";



Expand Down Expand Up @@ -161,7 +161,7 @@ private void OnGUI()
#region Watermark
if (Loader.updateAvailable)
{
GUI.Label(new Rect(Screen.width - 250, 1f, 100, 50f), $"Umbra Menu (v{VERSION}) <color=grey>-</color> <color=yellow>Lastest (v{Loader.latestVersion})</color>", Styles.WatermarkStyle);
GUI.Label(new Rect(Screen.width - 250, 1f, 100, 50f), $"Umbra Menu (v{VERSION}) <color=grey>-</color> <color=yellow>Latest (v{Loader.latestVersion})</color>", Styles.WatermarkStyle);
}
else if (Loader.upToDate)
{
Expand Down Expand Up @@ -293,7 +293,7 @@ public void OnSceneLoaded(Scene s1, Scene s2)
{
if (Menus.Render.renderInteractables)
{
Menus.Render.DumpInteractables(null);
Menus.Render.RefreshInteractables();
}
}
}
Expand Down Expand Up @@ -1136,7 +1136,7 @@ private void Keybinds()

if (Input.GetKeyDown(keybindDict["RENDER INTERACTABLES"].KeyCode))
{
Menus.Render.renderInteractables = !Menus.Render.renderInteractables;
Menus.Render.ToggleRenderInteractablesKey();
Utility.FindButtonById(6, 2).SetEnabled(Menus.Render.renderInteractables);
}

Expand Down
25 changes: 14 additions & 11 deletions UmbraMenu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@
<HintPath>.\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="com.unity.multiplayer-hlapi.Runtime">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\com.unity.multiplayer-hlapi.Runtime.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\com.unity.multiplayer-hlapi.Runtime.dll</HintPath>
</Reference>
<Reference Include="HGCSharpUtils">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\HGCSharpUtils.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\HGCSharpUtils.dll</HintPath>
</Reference>
<Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand All @@ -134,31 +134,34 @@
<HintPath>.\Octokit.dll</HintPath>
</Reference>
<Reference Include="Rewired_Core">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\Rewired_Core.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\Rewired_Core.dll</HintPath>
</Reference>
<Reference Include="RoR2">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\RoR2.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\RoR2.dll</HintPath>
</Reference>
<Reference Include="System">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\System.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextCoreModule">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.TextCoreModule.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.TextCoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>D:\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\Programs\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 416480f

Please sign in to comment.