From cdfe9a42bdedb9384c5a72b25f8d0be98bba6a9e Mon Sep 17 00:00:00 2001 From: NGnius Date: Wed, 16 Oct 2019 20:54:53 -0400 Subject: [PATCH] Add new command to CLI (PoC) --- TestMod/TestMod.csproj | 6 ++++++ TestMod/TestPlugin.cs | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/TestMod/TestMod.csproj b/TestMod/TestMod.csproj index 7e61fc5..b06e6be 100644 --- a/TestMod/TestMod.csproj +++ b/TestMod/TestMod.csproj @@ -5,6 +5,9 @@ + + ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\RobocraftX_Data\Managed\CommandLine.dll + ..\..\..\IPA\IPA\bin\Debug\IPA\Data\Managed\IllusionPlugin.dll @@ -14,6 +17,9 @@ ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\RobocraftX_Data\Managed\UnityEngine.CoreModule.dll + + ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\RobocraftX_Data\Managed\uREPL.dll + diff --git a/TestMod/TestPlugin.cs b/TestMod/TestPlugin.cs index 789a310..70b2a50 100644 --- a/TestMod/TestPlugin.cs +++ b/TestMod/TestPlugin.cs @@ -1,6 +1,7 @@ using System; using IllusionPlugin; using UnityEngine; +using uREPL; namespace TestMod { @@ -10,7 +11,7 @@ namespace TestMod public string Name { get; } = "TestPlugin"; - public string Version { get; } = "2"; + public string Version { get; } = "v0.0.0a"; public void OnApplicationQuit() { @@ -19,8 +20,9 @@ namespace TestMod public void OnApplicationStart() { - //throw new NotImplementedException(); - UnityEngine.Debug.Log("Hello World!"); + Debug.Log("Hello World!"); + RuntimeCommands.Register("Log", LogCommand,"Write a message to Player.log (Runtime version)"); + Debug.Log("TestPlugin startup complete"); } public void OnFixedUpdate() @@ -46,7 +48,13 @@ namespace TestMod public void OnUpdate() { //throw new NotImplementedException(); - UnityEngine.Debug.Log("Baby's first mod injection"); + //UnityEngine.Debug.Log("Baby's first mod injection"); + } + + /* Log command method. This called by uREPL when the Log command is called from RCX */ + private void LogCommand(object msg) + { + Debug.Log(msg); } } }