[ChatBoxExtensions] Updated to 2023r172ex1

This commit is contained in:
kafeijao 2023-08-14 19:34:13 +01:00
parent 4c09f9bd57
commit 1d2533ff2b
No known key found for this signature in database
GPG key ID: E99978723E454B4C
13 changed files with 41 additions and 23 deletions

3
.gitignore vendored
View file

@ -401,3 +401,6 @@ FodyWeavers.xsd
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml
.idea/ .idea/
# Generated dll dependencies file to copy into the Directory.Build.props
lib_names.xml

View file

@ -1,12 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Mute SDraw's funny warning, because he only compilled for x64 while most people compile for both -->
<NoWarn>$(NoWarn);MSB3270</NoWarn>
</PropertyGroup>
<!-- Didn't put in the Directory.Build.props because it spams funny warnings... --> <!-- Didn't put in the Directory.Build.props because it spams funny warnings... -->
<ItemGroup> <ItemGroup>
<Reference Include="ml_prm"> <Reference Include="ml_prm">
<HintPath>$(MsBuildThisFileDirectory)\..\.ManagedLibs\ml_prm.dll</HintPath> <HintPath>$(MsBuildThisFileDirectory)\..\.ManagedLibs\ml_prm.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="ChatBox">
<HintPath>$(MsBuildThisFileDirectory)\..\.ManagedLibs\ChatBox.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -1,4 +1,4 @@
using ABI_RC.Core.Savior; using ABI_RC.Systems.InputManagement;
using HarmonyLib; using HarmonyLib;
namespace NAK.ChatBoxExtensions.HarmonyPatches; namespace NAK.ChatBoxExtensions.HarmonyPatches;
@ -9,6 +9,6 @@ public class CVRInputManagerPatches
[HarmonyPatch(typeof(CVRInputManager), nameof(CVRInputManager.Start))] [HarmonyPatch(typeof(CVRInputManager), nameof(CVRInputManager.Start))]
static void Postfix_CVRInputManager_Start(ref CVRInputManager __instance) static void Postfix_CVRInputManager_Start(ref CVRInputManager __instance)
{ {
ChatBoxExtensions.InputModule = __instance.gameObject.AddComponent<InputModules.InputModuleChatBoxExtensions>(); __instance.AddInputModule(ChatBoxExtensions.InputModule);
} }
} }

View file

@ -1,4 +1,4 @@
using ABI_RC.Core.Savior; using ABI_RC.Systems.InputManagement;
using UnityEngine; using UnityEngine;
namespace NAK.ChatBoxExtensions.InputModules; namespace NAK.ChatBoxExtensions.InputModules;

View file

@ -1,5 +1,5 @@
using ABI_RC.Core.Player; using ABI_RC.Core.Networking;
using ABI_RC.Core.Savior; using ABI_RC.Core.Player;
namespace NAK.ChatBoxExtensions.Integrations; namespace NAK.ChatBoxExtensions.Integrations;
@ -18,9 +18,9 @@ public class CommandBase
{ {
string partialName = argument.Replace("*", "").Trim(); string partialName = argument.Replace("*", "").Trim();
if (String.IsNullOrWhiteSpace(partialName)) return false; if (String.IsNullOrWhiteSpace(partialName)) return false;
return MetaPort.Instance.username.Contains(partialName); return AuthManager.username.Contains(partialName);
} }
return MetaPort.Instance.username == argument; return AuthManager.username == argument;
} }
internal static void LocalCommandIgnoreOthers(string argument, Action<string[]> callback) internal static void LocalCommandIgnoreOthers(string argument, Action<string[]> callback)
@ -53,4 +53,4 @@ public class CommandBase
{ {
return CVRPlayerManager.Instance.TryGetPlayerName(guid); return CVRPlayerManager.Instance.TryGetPlayerName(guid);
} }
} }

View file

@ -19,7 +19,7 @@ internal class ChatBoxCommands : CommandBase
{ {
RemoteCommandListenForSelf(message, args => RemoteCommandListenForSelf(message, args =>
{ {
API.SendMessage("/pong " + GetPlayerUsername(sender), false, true); API.SendMessage("/pong " + GetPlayerUsername(sender), false, true, true);
}); });
}); });
@ -33,10 +33,10 @@ internal class ChatBoxCommands : CommandBase
{ {
awaitingPing = false; awaitingPing = false;
TimeSpan timeSincePing = DateTime.Now - pingTime; // calculate the time difference TimeSpan timeSincePing = DateTime.Now - pingTime; // calculate the time difference
API.SendMessage($"Time since ping: {timeSincePing.TotalMilliseconds}ms", false, true); API.SendMessage($"Time since ping: {timeSincePing.TotalMilliseconds}ms", false, true, true);
return; return;
} }
API.SendMessage($"You have to ping first, {GetPlayerUsername(sender)}!", false, true); API.SendMessage($"You have to ping first, {GetPlayerUsername(sender)}!", false, true, true);
}); });
}); });
} }

View file

@ -1,5 +1,5 @@
using ABI_RC.Core; using ABI_RC.Core;
using ABI_RC.Core.Base; using ABI_RC.Core.Vivox;
namespace NAK.ChatBoxExtensions.Integrations; namespace NAK.ChatBoxExtensions.Integrations;
@ -28,14 +28,14 @@ internal class ChilloutVRBaseCommands : CommandBase
{ {
LocalCommandIgnoreOthers(message, args => LocalCommandIgnoreOthers(message, args =>
{ {
Audio.SetMicrophoneActive(true); VivoxDeviceHandler.InputMuted = true;
}); });
}, },
onCommandReceived: (sender, message, sound, displayMsg) => onCommandReceived: (sender, message, sound, displayMsg) =>
{ {
RemoteCommandListenForAll(message, args => RemoteCommandListenForAll(message, args =>
{ {
Audio.SetMicrophoneActive(true); VivoxDeviceHandler.InputMuted = false;
}); });
}); });
} }

View file

@ -8,8 +8,8 @@ public static class Commands
internal static void InitializeCommandHandlers() internal static void InitializeCommandHandlers()
{ {
Kafe.ChatBox.API.OnMessageSent += (source, msg, notification, displayMsg) => HandleSentCommand(msg, notification, displayMsg); Kafe.ChatBox.API.OnMessageSent += msg => HandleSentCommand(msg.Message, msg.TriggerNotification, msg.DisplayOnChatBox);
Kafe.ChatBox.API.OnMessageReceived += (source, sender, msg, notification, displayMsg) => HandleReceivedCommand(sender, msg, notification, displayMsg); Kafe.ChatBox.API.OnMessageReceived += msg => HandleReceivedCommand(msg.SenderGuid, msg.Message, msg.TriggerNotification, msg.DisplayOnChatBox);
} }
internal static void RegisterCommand(string prefix, Action<string, bool, bool> onCommandSent = null, Action<string, string, bool, bool> onCommandReceived = null) internal static void RegisterCommand(string prefix, Action<string, bool, bool> onCommandSent = null, Action<string, string, bool, bool> onCommandReceived = null)

View file

@ -6,7 +6,7 @@ namespace NAK.ChatBoxExtensions;
public class ChatBoxExtensions : MelonMod public class ChatBoxExtensions : MelonMod
{ {
internal static MelonLogger.Instance Logger; internal static MelonLogger.Instance Logger;
internal static InputModuleChatBoxExtensions InputModule; internal static InputModuleChatBoxExtensions InputModule = new();
public override void OnInitializeMelon() public override void OnInitializeMelon()
{ {

View file

@ -28,6 +28,6 @@ using System.Reflection;
namespace ChatBoxExtensions.Properties; namespace ChatBoxExtensions.Properties;
internal static class AssemblyInfoParams internal static class AssemblyInfoParams
{ {
public const string Version = "1.0.2"; public const string Version = "1.0.3";
public const string Author = "NotAKidoS"; public const string Author = "NotAKidoS";
} }

View file

@ -84,10 +84,6 @@
<HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\AwesomeTechnologies.VegetationStudioPro.Runtime.dll</HintPath> <HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\AwesomeTechnologies.VegetationStudioPro.Runtime.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="BakeryRuntimeAssembly">
<HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\BakeryRuntimeAssembly.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Bhaptics.Tact"> <Reference Include="Bhaptics.Tact">
<HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\Bhaptics.Tact.dll</HintPath> <HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\Bhaptics.Tact.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@ -176,6 +172,10 @@
<HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\MTJobSystem.dll</HintPath> <HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\MTJobSystem.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="NewBlood.EngineInternals">
<HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\NewBlood.EngineInternals.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\Newtonsoft.Json.dll</HintPath> <HintPath>$(MsBuildThisFileDirectory)\.ManagedLibs\Newtonsoft.Json.dll</HintPath>
<Private>False</Private> <Private>False</Private>

View file

@ -47,6 +47,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EzCurls", "EzCurls\EzCurls.
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlternateIKSystem", "AlternateIKSystem\AlternateIKSystem.csproj", "{CAB05E13-B529-4CDA-A2B5-B62E122408F8}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlternateIKSystem", "AlternateIKSystem\AlternateIKSystem.csproj", "{CAB05E13-B529-4CDA-A2B5-B62E122408F8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatBoxExtensions", "ChatBoxExtensions\ChatBoxExtensions.csproj", "{0E1DD746-33A1-4179-AE70-8FB83AC40ABC}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -141,6 +143,10 @@ Global
{CAB05E13-B529-4CDA-A2B5-B62E122408F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {CAB05E13-B529-4CDA-A2B5-B62E122408F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAB05E13-B529-4CDA-A2B5-B62E122408F8}.Release|Any CPU.ActiveCfg = Release|Any CPU {CAB05E13-B529-4CDA-A2B5-B62E122408F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAB05E13-B529-4CDA-A2B5-B62E122408F8}.Release|Any CPU.Build.0 = Release|Any CPU {CAB05E13-B529-4CDA-A2B5-B62E122408F8}.Release|Any CPU.Build.0 = Release|Any CPU
{0E1DD746-33A1-4179-AE70-8FB83AC40ABC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E1DD746-33A1-4179-AE70-8FB83AC40ABC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E1DD746-33A1-4179-AE70-8FB83AC40ABC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E1DD746-33A1-4179-AE70-8FB83AC40ABC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View file

@ -12,7 +12,7 @@ $cvrDefaultPath = "E:\temp\CVR_Experimental"
$dllsToStrip = @('Assembly-CSharp.dll','Assembly-CSharp-firstpass.dll','AVProVideo.Runtime.dll', 'Unity.TextMeshPro.dll', 'MagicaCloth.dll') $dllsToStrip = @('Assembly-CSharp.dll','Assembly-CSharp-firstpass.dll','AVProVideo.Runtime.dll', 'Unity.TextMeshPro.dll', 'MagicaCloth.dll')
# Array with the mods to grab # Array with the mods to grab
$modNames = @("BTKUILib", "BTKSAImmersiveHud", "ActionMenu", "MenuScalePatch") $modNames = @("BTKUILib", "BTKSAImmersiveHud", "ActionMenu", "MenuScalePatch", "ChatBox", "ml_prm")
# Array with dlls to ignore from ManagedLibs # Array with dlls to ignore from ManagedLibs
$cvrManagedLibNamesToIgnore = @("netstandard") $cvrManagedLibNamesToIgnore = @("netstandard")