Fixes and improvements, no more FindObjectsOfType
This commit is contained in:
1 parent
a740fec7c8
commit
fb002cbf0c
328 files changed
+4318
-299
No files matched your search
@@ -110,36 +110,7 @@ namespace Skopje.Minimap
|
||||
|
||||
internal static SkopjePlayer FindLocalPlayer()
|
||||
{
|
||||
if (LocalPlayer != null)
|
||||
return LocalPlayer;
|
||||
|
||||
var players = UnityEngine.Object.FindObjectsOfType<SkopjePlayer>();
|
||||
if (players == null)
|
||||
return null;
|
||||
|
||||
SkopjePlayer solo = null;
|
||||
int count = 0;
|
||||
for (int i = 0; i < players.Length; i++)
|
||||
{
|
||||
SkopjePlayer player = players[i];
|
||||
if (player == null)
|
||||
continue;
|
||||
count++;
|
||||
solo = player;
|
||||
if (player.IsOwner)
|
||||
{
|
||||
LocalPlayer = player;
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 1)
|
||||
{
|
||||
LocalPlayer = solo;
|
||||
return solo;
|
||||
}
|
||||
|
||||
return null;
|
||||
return LocalPlayer;
|
||||
}
|
||||
|
||||
static Il2CppSystem.Action ToIl2Cpp(System.Action action)
|
||||
@@ -242,6 +213,13 @@ namespace Skopje.Minimap
|
||||
return;
|
||||
}
|
||||
|
||||
if (MinimapPlugin.LocalPlayer == null)
|
||||
{
|
||||
if (_root != null)
|
||||
_root.gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
float now = Time.unscaledTime;
|
||||
bool hudMissing = _hud == null || !_hud.gameObject.activeInHierarchy;
|
||||
if ((_time == null || hudMissing || _mapSprite == null || _bounds == null) && now >= _nextSearch)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"Skopje.Minimap/1.0.0": {
|
||||
"runtime": {
|
||||
"Skopje.Minimap.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Skopje.Minimap/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
|
||||
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Skopje.Minimap")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a740fec7c87ba4b24aefb7faf991fc5b69c71bd4")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Skopje.Minimap")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Skopje.Minimap")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1a3826b3edac31083c738331354c0945067b0b26ba4e13a47b6d51e0c931fb5d
|
||||
@@ -0,0 +1,18 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetFrameworkIdentifier = .NETCoreApp
|
||||
build_property.TargetFrameworkVersion = v6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property.EntryPointFilePath =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = Skopje.Minimap
|
||||
build_property.ProjectDir = C:\Users\andre\Desktop\SkopjeMods\Minimap\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.EffectiveAnalysisLevelStyle = 6.0
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
87fc95a1f81af8c227cc6fa9bf1e249bfdd31961c02e4bbc825bbcdc214d5dc1
|
||||
@@ -0,0 +1,12 @@
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\bin\Debug\net6.0\Skopje.Minimap.deps.json
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\bin\Debug\net6.0\Skopje.Minimap.dll
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\bin\Debug\net6.0\Skopje.Minimap.pdb
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\MinimapPlugin.csproj.AssemblyReference.cache
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\MinimapPlugin.GeneratedMSBuildEditorConfig.editorconfig
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\MinimapPlugin.AssemblyInfoInputs.cache
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\MinimapPlugin.AssemblyInfo.cs
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\MinimapPlugin.csproj.CoreCompileInputs.cache
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\Skopje.Minimap.dll
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\refint\Skopje.Minimap.dll
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\Skopje.Minimap.pdb
|
||||
C:\Users\andre\Desktop\SkopjeMods\Minimap\obj\Debug\net6.0\ref\Skopje.Minimap.dll
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"c:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj": {}
|
||||
"C:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"c:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj": {
|
||||
"C:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "c:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj",
|
||||
"projectUniqueName": "C:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj",
|
||||
"projectName": "Skopje.Minimap",
|
||||
"projectPath": "c:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj",
|
||||
"projectPath": "C:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj",
|
||||
"packagesPath": "C:\\Users\\andre\\AppData\\Local\\Temp\\cursor-sandbox-cache\\a0404811fc6e51c4c5761fd11591789f\\nuget",
|
||||
"outputPath": "c:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\obj\\",
|
||||
"outputPath": "C:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\andre\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
|
||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Skopje.Minimap")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9f4f8bf5235790c04718d7ca24b0f3f76e93b270")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a740fec7c87ba4b24aefb7faf991fc5b69c71bd4")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Skopje.Minimap")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Skopje.Minimap")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
76a35bd1005e7595549b8f53ede6d7fe291948c74a3299c2ccd64bca53d35f29
|
||||
194a92a10a00112e22368e5636cd730ed66a5f0bff0b215eb552db8471ba8527
|
||||
@@ -11,7 +11,7 @@ build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property.EntryPointFilePath =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = Skopje.Minimap
|
||||
build_property.ProjectDir = c:\Users\andre\Desktop\SkopjeMods\Minimap\
|
||||
build_property.ProjectDir = C:\Users\andre\Desktop\SkopjeMods\Minimap\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.EffectiveAnalysisLevelStyle = 6.0
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "fEqRFu6N7Gw=",
|
||||
"dgSpecHash": "nKRZ6cutJ3g=",
|
||||
"success": true,
|
||||
"projectFilePath": "c:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj",
|
||||
"projectFilePath": "C:\\Users\\andre\\Desktop\\SkopjeMods\\Minimap\\MinimapPlugin.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\andre\\AppData\\Local\\Temp\\cursor-sandbox-cache\\a0404811fc6e51c4c5761fd11591789f\\nuget\\microsoft.netcore.app.ref\\6.0.36\\microsoft.netcore.app.ref.6.0.36.nupkg.sha512",
|
||||
"C:\\Users\\andre\\AppData\\Local\\Temp\\cursor-sandbox-cache\\a0404811fc6e51c4c5761fd11591789f\\nuget\\microsoft.windowsdesktop.app.ref\\6.0.36\\microsoft.windowsdesktop.app.ref.6.0.36.nupkg.sha512",
|
||||
|
||||
Reference in new issue
Block a user