mirror of
https://github.com/anegostudios/vsmodtemplate
synced 2025-07-05 04:44:30 -07:00
- Feature: Adding a new mod also adds a ModSystem template file
- Fixed: Newly added mods had the wrong .net framework version - Fixed: Logging output not written to the IDE debug console
This commit is contained in:
parent
f2c81a4c55
commit
bea384b470
4 changed files with 2 additions and 44 deletions
|
@ -1,41 +0,0 @@
|
||||||
using System;
|
|
||||||
using Vintagestory.API.Client;
|
|
||||||
using Vintagestory.API.Common;
|
|
||||||
using Vintagestory.API.Server;
|
|
||||||
|
|
||||||
namespace VSModLauncher
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Redirects all log entries into the visual studio output window. Only for your convenience during development and testing.
|
|
||||||
/// </summary>
|
|
||||||
public class RedirectLogs : ModSystem
|
|
||||||
{
|
|
||||||
|
|
||||||
public override bool ShouldLoad(EnumAppSide side)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void StartServerSide(ICoreServerAPI api)
|
|
||||||
{
|
|
||||||
api.Server.Logger.EntryAdded += OnServerLogEntry;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnServerLogEntry(EnumLogType logType, string message, params object[] args)
|
|
||||||
{
|
|
||||||
if (logType == EnumLogType.VerboseDebug) return;
|
|
||||||
System.Diagnostics.Debug.WriteLine("[Server " + logType + "] " + message, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void StartClientSide(ICoreClientAPI api)
|
|
||||||
{
|
|
||||||
api.World.Logger.EntryAdded += OnClientLogEntry;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnClientLogEntry(EnumLogType logType, string message, params object[] args)
|
|
||||||
{
|
|
||||||
if (logType == EnumLogType.VerboseDebug) return;
|
|
||||||
System.Diagnostics.Debug.WriteLine("[Client " + logType + "] " + message, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -58,7 +58,6 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="RedirectLogs.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
<StartAction>Program</StartAction>
|
<StartAction>Program</StartAction>
|
||||||
<StartProgram>$(AppData)\Vintagestory\Vintagestory.exe</StartProgram>
|
<StartProgram>$(AppData)\Vintagestory\Vintagestory.exe</StartProgram>
|
||||||
<StartArguments>--openWorld="modsamplestest" -pcreativebuilding --addModPath="$(SolutionDir)mods"</StartArguments>
|
<StartArguments>--openWorld="modsamplestest" -pcreativebuilding --addModPath="$(SolutionDir)mods" --tracelog</StartArguments>
|
||||||
<StartWorkingDirectory>$(AppData)\Vintagestory\</StartWorkingDirectory>
|
<StartWorkingDirectory>$(AppData)\Vintagestory\</StartWorkingDirectory>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||||
<StartAction>Program</StartAction>
|
<StartAction>Program</StartAction>
|
||||||
<StartProgram>$(AppData)\Vintagestory\Vintagestory.exe</StartProgram>
|
<StartProgram>$(AppData)\Vintagestory\Vintagestory.exe</StartProgram>
|
||||||
<StartArguments>--openWorld="modsamplestest" -p3 --addModPath="$(SolutionDir)mods"</StartArguments>
|
<StartArguments>--openWorld="modsamplestest" -p3 --addModPath="$(SolutionDir)mods" --tracelog</StartArguments>
|
||||||
<StartWorkingDirectory>$(AppData)\Vintagestory\</StartWorkingDirectory>
|
<StartWorkingDirectory>$(AppData)\Vintagestory\</StartWorkingDirectory>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
BIN
vsmodtools.exe
BIN
vsmodtools.exe
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue