Skip to content

Commit 1bfe575

Browse files
committed
单独一个文件
1 parent 9fa3164 commit 1bfe575

5 files changed

Lines changed: 37 additions & 23 deletions

File tree

HelpSense/Commands/InfoCommand.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ public class InfoCommand : ICommand
2121
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
2222
{
2323
Player player;
24-
TranslateConfig TranslateConfig = Plugin.Instance.TranslateConfig;
24+
CommandTranslateConfig CommandTranslateConfig = Plugin.Instance.CommandTranslateConfig;
2525

2626
if (sender is null || (player = Player.Get(sender)) is null)
2727
{
28-
response = TranslateConfig.InfoCommandFailed;
28+
response = CommandTranslateConfig.InfoCommandFailed;
2929
return false;
3030
}
3131

3232
if (player.DoNotTrack || !Plugin.Instance.Config.SavePlayersInfo)
3333
{
34-
response = TranslateConfig.InfoCommandFailed;
34+
response = CommandTranslateConfig.InfoCommandFailed;
3535
return false;
3636
}
3737

@@ -50,11 +50,11 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
5050

5151
var sb = StringBuilderPool.Pool.Get();
5252

53-
sb.AppendLine(TranslateConfig.InfoCommandTitle);
54-
sb.AppendLine(TranslateConfig.InfoCommandPlayedTime.Replace("%day%" , day.ToString()).Replace("%hour%", hour.ToString()).Replace("%minutes%", minutes.ToString()));
55-
sb.AppendLine(TranslateConfig.InfoCommandRolePlayed.Replace("%rolePlayed%" , rolePlayed.ToString()));
56-
sb.AppendLine(TranslateConfig.InfoCommandKillsDamages.Replace("%kills%" , kills.ToString()).Replace("%scpKills%", scpKills.ToString()).Replace("%playerDamage%", playerDamage.ToString()).Replace("%playerDeath%", playerDeath.ToString()));
57-
sb.AppendLine(TranslateConfig.InfoCommandShot.Replace("%shot%" , shot.ToString()));
53+
sb.AppendLine(CommandTranslateConfig.InfoCommandTitle);
54+
sb.AppendLine(CommandTranslateConfig.InfoCommandPlayedTime.Replace("%day%" , day.ToString()).Replace("%hour%", hour.ToString()).Replace("%minutes%", minutes.ToString()));
55+
sb.AppendLine(CommandTranslateConfig.InfoCommandRolePlayed.Replace("%rolePlayed%" , rolePlayed.ToString()));
56+
sb.AppendLine(CommandTranslateConfig.InfoCommandKillsDamages.Replace("%kills%" , kills.ToString()).Replace("%scpKills%", scpKills.ToString()).Replace("%playerDamage%", playerDamage.ToString()).Replace("%playerDeath%", playerDeath.ToString()));
57+
sb.AppendLine(CommandTranslateConfig.InfoCommandShot.Replace("%shot%" , shot.ToString()));
5858

5959
response = sb.ToString();
6060
StringBuilderPool.Pool.Return(sb);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace HelpSense.ConfigSystem
9+
{
10+
public class CommandTranslateConfig
11+
{
12+
[Description("玩家信息指令_标题")]
13+
public string InfoCommandTitle { get; set; } = "自从插件安装后你已在本服游玩了";
14+
[Description("玩家信息指令_时间")]
15+
public string InfoCommandPlayedTime { get; set; } = "<color=red>%day%</color>天<color=red>%hour%</color>小时<color=red>%minutes%</color>分钟";
16+
[Description("玩家信息指令_角色")]
17+
public string InfoCommandRolePlayed { get; set; } = "一共扮演了<color=red>%rolePlayed%</color>次角色";
18+
[Description("玩家信息指令_击杀和伤害")]
19+
public string InfoCommandKillsDamages { get; set; } = "你一共击杀了<color=red>%kills%</color>个人<color=red>%scpKills%</color>个SCP | 一共造成了<color=red>%playerDamage%</color>点伤害(伤害包括无效的) | 一共死亡<color=red>%playerDeath%次</color>";
20+
[Description("玩家信息指令_射击")]
21+
public string InfoCommandShot { get; set; } = "一共开了<color=red>%shot%</color>枪";
22+
[Description("玩家信息指令_因DNT查询失败的消息")]
23+
public string InfoCommandFailed { get; set; } = "查询失败,请关闭DNT或服务器未启用此功能";
24+
}
25+
}

HelpSense/ConfigSystem/TranslateConfig.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,20 +285,5 @@ public class TranslateConfig
285285
public string SkynetSpecialIntroduction { get; set; } = "<color=blue>天网 机动特遣队</color>";
286286
[Description("非礼勿视机动特遣队特殊介绍")]
287287
public string SeeNoEvilSpecialIntroduction { get; set; } = "<color=blue>非礼勿视 机动特遣队</color>";
288-
///
289-
///
290-
///
291-
[Description("玩家信息指令_标题")]
292-
public string InfoCommandTitle { get; set; } = "自从插件安装后你已在本服游玩了";
293-
[Description("玩家信息指令_时间")]
294-
public string InfoCommandPlayedTime { get; set; } = "<color=red>%day%</color>天<color=red>%hour%</color>小时<color=red>%minutes%</color>分钟";
295-
[Description("玩家信息指令_角色")]
296-
public string InfoCommandRolePlayed { get; set; } = "一共扮演了<color=red>%rolePlayed%</color>次角色";
297-
[Description("玩家信息指令_击杀和伤害")]
298-
public string InfoCommandKillsDamages { get; set; } = "你一共击杀了<color=red>%kills%</color>个人<color=red>%scpKills%</color>个SCP | 一共造成了<color=red>%playerDamage%</color>点伤害(伤害包括无效的) | 一共死亡<color=red>%playerDeath%次</color>";
299-
[Description("玩家信息指令_射击")]
300-
public string InfoCommandShot { get; set; } = "一共开了<color=red>%shot%</color>枪";
301-
[Description("玩家信息指令_因DNT查询失败的消息")]
302-
public string InfoCommandFailed { get; set; } = "查询失败,请关闭DNT或服务器未启用此功能";
303288
}
304289
}

HelpSense/HelpSense.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<Compile Include="Commands\InfoCommand.cs" />
5555
<Compile Include="Commands\VersionCommand.cs" />
5656
<Compile Include="Commands\RescueCommand.cs" />
57+
<Compile Include="ConfigSystem\CommandTranslateConfig.cs" />
5758
<Compile Include="ConfigSystem\Config.cs" />
5859
<Compile Include="ConfigSystem\SSSSTranslateConfig.cs" />
5960
<Compile Include="ConfigSystem\TranslateConfig.cs" />

HelpSense/Plugin.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public class Plugin
5656
[PluginConfig("SSSSTranslateConfig.yml")]
5757
public SSSSTranslateConfig SSSSTranslateConfig;
5858

59+
[PluginConfig("CommandTranslateConfig.yml")]
60+
public CommandTranslateConfig CommandTranslateConfig;
61+
5962
public System.Random Random = new(DateTime.Now.GetHashCode());
6063

6164
public static string RespawnTimerDirectoryPath { get; private set; }

0 commit comments

Comments
 (0)