Skip to content

Commit

Permalink
添加项目文件。
Browse files Browse the repository at this point in the history
  • Loading branch information
ACaiCat committed Apr 16, 2023
1 parent aac0ae6 commit 7ce2ce8
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ForceChinese.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TShock" Version="5.1.3" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions ForceChinese.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ForceChinese", "ForceChinese.csproj", "{339CEF56-D9BE-45A6-9EE0-BE516C42AE8E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{339CEF56-D9BE-45A6-9EE0-BE516C42AE8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{339CEF56-D9BE-45A6-9EE0-BE516C42AE8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{339CEF56-D9BE-45A6-9EE0-BE516C42AE8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{339CEF56-D9BE-45A6-9EE0-BE516C42AE8E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FFAB03F1-2573-439A-9BD4-79BAA60E355E}
EndGlobalSection
EndGlobal
81 changes: 81 additions & 0 deletions Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
using System.Data;
using Terraria.Localization;
using TerrariaApi.Server;
using TShockAPI;


namespace ForceChinese
{
[ApiVersion(2, 1)]
public class Main : TerrariaPlugin
{
public override string Author
{
get
{
return "Cai";
}
}


public override string Description
{
get
{
return "强制使用简体中文作为服务器语言";
}
}

public override string Name
{
get
{
return "ForceChineseLang(强制简体中文)";
}
}

public override Version Version
{
get
{
return new Version(1, 2, 0, 0);
}
}

public Main(Terraria.Main game) : base(game)
{
//LanguageManager.Instance.SetLanguage(7);
if (Terraria.Program.LaunchParameters.ContainsKey("-lang"))
{
Terraria.Program.LaunchParameters["-lang"] = "7";

}
else
{
Terraria.Program.LaunchParameters.Add("-lang", "7");

}
Console.WriteLine(
"[ForceChineseLang]已强制修改语言选项!\n" +
"*如需使用其他语言请移除此插件!\n" +
"*本插件为免费插件");
base.Order = int.MinValue;
}

public override void Initialize()
{

}



protected override void Dispose(bool disposing)
{
if (disposing)
{

}
base.Dispose(disposing);
}
}
}

0 comments on commit 7ce2ce8

Please sign in to comment.