Adds a cvar for server rules (#8365)
Co-authored-by: Veritius <veritiusgaming@gmail.com> Co-authored-by: ike709 <ike709@github.com>
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using System.IO;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Configuration;
|
||||
|
||||
namespace Content.Client.Info;
|
||||
|
||||
@@ -11,13 +12,16 @@ namespace Content.Client.Info;
|
||||
public sealed partial class RulesControl : BoxContainer
|
||||
{
|
||||
[Dependency] private readonly IResourceCache _resourceManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
|
||||
|
||||
public RulesControl()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
var path = "Server Info/" + _cfgManager.GetCVar(CCVars.RulesFile);
|
||||
|
||||
AddChild(new InfoSection(Loc.GetString("ui-rules-header"),
|
||||
_resourceManager.ContentFileReadAllText($"/Server Info/Rules.txt"), true));
|
||||
_resourceManager.ContentFileReadAllText(path), true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user