Initial CEF and DirectX overlay implementation (PoC, unfinished)

Still pretty unstable, game might crash at times.
Revamp build system and other small fixes
This commit is contained in:
sardelka9515
2022-11-05 18:35:39 +08:00
parent 2828b9b74f
commit 8961eb102b
97 changed files with 179796 additions and 204 deletions

View File

@ -3,6 +3,7 @@ using System.Drawing;
using GTA;
using GTA.UI;
using LemonUI.Menus;
using RageCoop.Client.GUI;
using RageCoop.Client.Loader;
namespace RageCoop.Client
@ -32,6 +33,14 @@ namespace RageCoop.Client
private static readonly NativeCheckboxItem ShowNetworkInfoItem =
new NativeCheckboxItem("Show Network Info", Networking.ShowNetworkInfo);
private static readonly NativeCheckboxItem DxHookTest =
new NativeCheckboxItem("Enable D3D11 hook", false);
private static readonly NativeCheckboxItem CefTest =
new NativeCheckboxItem("Test CEF overlay", false);
private static CefClient _testCef;
static DebugMenu()
{
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
@ -68,12 +77,43 @@ namespace RageCoop.Client
Main.Settings.ShowEntityOwnerName = ShowOwnerItem.Checked;
Util.SaveSettings();
};
DxHookTest.CheckboxChanged += Hook;
CefTest.CheckboxChanged += CefTestChange;
;
ReloadItem.Activated += ReloadDomain;
Menu.Add(SimulatedLatencyItem);
Menu.Add(ShowNetworkInfoItem);
Menu.Add(ShowOwnerItem);
Menu.Add(ReloadItem);
Menu.AddSubMenu(DiagnosticMenu);
Menu.Add(DxHookTest);
Menu.Add(CefTest);
}
private static void CefTestChange(object sender, EventArgs e)
{
if (CefTest.Checked)
{
_testCef = CefManager.CreateClient(new Size(640, 480));
_testCef.Scale = 0.8f;
_testCef.Opacity = 128;
Script.Wait(2000);
_testCef.Controller.LoadUrl("https://ragecoop.online/");
CefManager.ActiveClient = _testCef;
}
else
{
CefManager.DestroyClient(_testCef);
}
DxHookTest.Checked = HookManager.Hooked;
}
private static void Hook(object sender, EventArgs e)
{
if (DxHookTest.Checked)
HookManager.Initialize();
else
HookManager.CleanUp();
}
private static void ReloadDomain(object sender, EventArgs e)