Initial migration commit to .NET 7

Menu, sync and other stuff except resource system should be working.
We're far from finished
This commit is contained in:
Sardelka9515
2023-01-28 20:51:29 +08:00
parent 0112140f0e
commit cac2385c35
107 changed files with 36610 additions and 267320 deletions

View File

@ -1,10 +1,7 @@
using System;
using System.Drawing;
using GTA;
using GTA.UI;
using LemonUI.Menus;
using RageCoop.Client.GUI;
using RageCoop.Client.Loader;
namespace RageCoop.Client
{
@ -22,8 +19,6 @@ namespace RageCoop.Client
Alignment = Main.Settings.FlipMenu ? Alignment.Right : Alignment.Left
};
public static NativeItem ReloadItem = new NativeItem("Reload", "Reload RAGECOOP and associated scripts");
public static NativeItem SimulatedLatencyItem =
new NativeItem("Simulated network latency", "Simulated network latency in ms (one way)", "0");
@ -33,14 +28,6 @@ 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);
@ -77,49 +64,10 @@ 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)
{
LoaderContext.RequestUnload();
}
}
}