Skip to content

Commit 74d7069

Browse files
committed
1.0.0
1 parent 7125064 commit 74d7069

32 files changed

Lines changed: 102 additions & 296 deletions

BlackMossTemplate.csproj.DotSettings

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net472</TargetFramework>
4-
<AssemblyName>BlackMossTemplate</AssemblyName>
5-
<Product>BlackMossTemplate</Product>
4+
<AssemblyName>ConsoleScript-ZH</AssemblyName>
5+
<Product>ConsoleScript-ZH</Product>
66
<Version>1.0.0</Version>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<LangVersion>latest</LangVersion>
@@ -11,10 +11,10 @@
1111
https://nuget.bepinex.dev/v3/index.json;
1212
https://nuget.samboy.dev/v3/index.json
1313
</RestoreAdditionalProjectSources>
14-
<RootNamespace>BlackMossTemplate</RootNamespace>
14+
<RootNamespace>ConsoleScriptZH</RootNamespace>
1515
<Platforms>AnyCPU;x64;x86</Platforms>
16-
<PackageProjectUrl>https://github.com/Black-Moss/BlackMossTemplate</PackageProjectUrl>
17-
<RepositoryUrl>https://github.com/Black-Moss/BlackMossTemplate</RepositoryUrl>
16+
<PackageProjectUrl>https://github.com/Black-Moss/ConsoleScript-ZH</PackageProjectUrl>
17+
<RepositoryUrl>https://github.com/Black-Moss/ConsoleScript-ZH</RepositoryUrl>
1818
</PropertyGroup>
1919

2020
<Import Project="vars.targets" />

Folder.DotSettings.user

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,8 @@
131131
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=F_003A_005CDownloads_005CCU_0020mod_005Cdll_005CUnityEngine_002EInputModule_002Edll/@EntryIndexedValue">True</s:Boolean>
132132
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=F_003A_005CDownloads_005CCU_0020mod_005Cdll_005CUnityEngine_002EUI_002Edll/@EntryIndexedValue">True</s:Boolean>
133133
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=F_003A_005CDownloads_005Cdll_005CUnity_002ETextMeshPro_002Edll/@EntryIndexedValue">True</s:Boolean>
134-
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=F_003A_005CDownloads_005Cdll_005CUnityEngine_002EUI_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
134+
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=F_003A_005CDownloads_005Cdll_005CUnityEngine_002EUI_002Edll/@EntryIndexedValue">True</s:Boolean>
135+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AConsoleScript_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F5b08a2df250f4fa7937257c7979bd2249da00_003F65_003F04f6454a_003FConsoleScript_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
136+
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue">&lt;AssemblyExplorer&gt;&#xD;
137+
&lt;Assembly Path="E:\CasualtiesUnknownDemo\CasualtiesUnknown_Data\Managed\Assembly-CSharp.dll" /&gt;&#xD;
138+
&lt;/AssemblyExplorer&gt;</s:String></wpf:ResourceDictionary>

Plugin.cs

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
using BepInEx;
1+
using System.Collections.Generic;
2+
using BepInEx;
23
using BepInEx.Logging;
34
using HarmonyLib;
45

56
namespace BlackMossTemplate
67
{
7-
[BepInPlugin("blackmoss.template", "BlackMossTemplate", "114514.1919.810")]
8+
[BepInPlugin("blackmoss.consolescriptzh", "ConsoleScriptZH", "1.0.0")]
89
public class Plugin : BaseUnityPlugin
910
{
1011
internal static new ManualLogSource Logger;
11-
private readonly Harmony _harmony = new("blackmoss.template");
12+
private readonly Harmony _harmony = new("blackmoss.consolescriptzh");
1213
public static Plugin Instance { get; private set; } = null!;
1314

1415
public void Awake()
@@ -17,7 +18,76 @@ public void Awake()
1718
Instance = this;
1819

1920
_harmony.PatchAll();
20-
Logger.LogInfo("Here's Black Moss!");
21+
Logger.LogInfo("控制台指令汉化补丁已启动!");
22+
}
23+
24+
[HarmonyPatch]
25+
public class ConsoleScriptPatch
26+
{
27+
[HarmonyPostfix]
28+
[HarmonyPatch(typeof(ConsoleScript), nameof(ConsoleScript.RegisterAllCommands))]
29+
public static void Postfix_RegisterAllCommands()
30+
{
31+
var commandDescriptions = new Dictionary<string, string>
32+
{
33+
{ "help", "显示所有可用命令的列表" },
34+
{ "heal", "瞬间治愈" },
35+
{ "coagulate", "停止所有出血" },
36+
{ "kill", "将脑组织完整度设为0立即杀死玩家" },
37+
{ "spawn", "在指定位置生成一个物品/环境物体" },
38+
{ "spawncategory", "从指定的战利品池生成所有物品,并且无重力" },
39+
{ "tp", "将玩家传送到指定位置。如果为空,则默认传送到光标位置" },
40+
{ "skiplayer", "如果未提供层级索引,则会立即跳到下一层;如果提供了层级索引,则会直接跳到该层" },
41+
{ "log", "在控制台历史中新增文本" },
42+
{ "talk", "让玩家说出一些话" },
43+
{ "framerate", "设置游戏的最大FPS。可能在构建版本中不起作用" },
44+
{ "alert", "显示一条提醒" },
45+
{ "volume", "设置音量" },
46+
{ "saveandquit", "立即保存游戏并退出到主菜单。加载存档时,你将回到当前关卡的起点" },
47+
{ "resetskills", "将所有技能设置为零" },
48+
{ "fucklore", "立即跳过任何全屏设定文本" },
49+
{ "timescale", "将时间刻度设置为所需的值" },
50+
{ "setconsoleheight", "将控制台高度设置为所需的值" },
51+
{ "setconsolecolor", "设置控制台某个元素的颜色。" },
52+
{ "copylog", "将整个控制台日志复制到剪贴板" },
53+
{ "clear", "清除控制台日志" },
54+
{ "addxp", "给予角色在选定技能上的经验" },
55+
{ "loglocale", "获取一个本地化字符串并将其记录到控制台" },
56+
{ "openfolder", "打开游戏文件夹" },
57+
{ "setbodyfield", "设置身体数值" },
58+
{ "setlimbfield", "设置肢体数值" },
59+
{ "amputate", "瞬间肢体断裂,不可逆转" },
60+
{ "unchipped", "打开/关闭无芯片模式" },
61+
{ "pixelate", "设置像素滤镜开/关" },
62+
{ "addcustomcommand", "向列表中增加自定义命令" },
63+
{ "addliquid", "向主手持有的物品中增加指定量的液体" },
64+
{ "locate", "搜索具有指定名称的任何物体,并传送到其中一个" },
65+
{ "removecustomcommand", "从列表中移除已有的自定义命令" },
66+
{ "music", "管理背景音乐。可以播放新曲目、跳过当前曲目的时间或打开MP3菜单" },
67+
{ "bind", "管理自定义命令绑定,可以增加、移除或列出它们" },
68+
{ "repeat", "以指定的次数运行指定的一系列命令,并带有延迟。" },
69+
{ "explode", "在指定位置发生爆炸,并可使用可选参数" },
70+
{ "echo", "切换所有新命令日志" },
71+
{ "starterkit", "以随机套装生成,包含基础容器、工具和药品" },
72+
{ "noclip", "切换无碰撞模式(启用飞行并禁用玩家碰撞)" },
73+
{ "playsound", "播放指定ID的音频" },
74+
{ "fullbright", "切换调试照明" },
75+
{ "errorlogging", "切换错误日志" }
76+
};
77+
78+
if (ConsoleScript.Commands == null)
79+
{
80+
return;
81+
}
82+
83+
foreach (var command in ConsoleScript.Commands)
84+
{
85+
if (commandDescriptions.TryGetValue(command.name, out string description))
86+
{
87+
command.description = description;
88+
}
89+
}
90+
}
2191
}
2292
}
2393
}

README.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

README_ZH.md

Lines changed: 0 additions & 45 deletions
This file was deleted.
-5.5 KB
Binary file not shown.
-7.25 KB
Binary file not shown.
0 Bytes
Binary file not shown.
512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)