コード例 #1
0
        /// <summary>
        /// Initializes the language system.
        /// </summary>
        public static void Init()
        {
            serverLang = ConVarManager.CreateConVar(null, "ServerLang", DefaultLang, "The language key for the server").Value;
            serverLang.ConVar.ValueChanged += OnServerLanguageChanged;

            foreach (var file in coreFiles)
            {
                LoadPhrases(file);
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes the chat helper.
        /// </summary>
        public static void Init()
        {
            var description = new StringBuilder()
                              .AppendLine("Specifies how admin activity should be relayed to users. Add up the values below to get the functionality you want.")
                              .AppendLine("1: Show admin activity to non-admins anonymously.")
                              .AppendLine("2: If 1 is specified, admin names will be shown.")
                              .AppendLine("4: Show admin activity to admins anonymously.")
                              .AppendLine("8: If 4 is specified, admin names will be shown.")
                              .AppendLine("16: Always show admin names to root users.")
                              .AppendLine()
                              .AppendLine("Default: 13 (1+4+8)")
                              .ToString();

            showActivity = ConVarManager.CreateConVar(null, "ShowActivity", "13", description, true, 0, true, 31).Value;
        }
コード例 #3
0
ファイル: VoteManager.cs プロジェクト: SevenMod/SevenMod
 /// <summary>
 /// Initializes the voting system.
 /// </summary>
 internal static void Init()
 {
     ShowVoteProgress = ConVarManager.CreateConVar(null, "ShowVoteProgress", "True", "Show votes in chat.").Value;
 }
コード例 #4
0
 /// <summary>
 /// Creates a new <see cref="ConVar"/> or returns the existing one if one with the same name already exists.
 /// </summary>
 /// <param name="name">The name of the variable.</param>
 /// <param name="defaultValue">The default value of the variable as a string.</param>
 /// <param name="description">Optional description for the variable.</param>
 /// <param name="hasMin">Optional value indicating whether the variable has a minimum value.</param>
 /// <param name="min">The minimum value of the variable if <paramref name="hasMin"/> is <c>true</c>.</param>
 /// <param name="hasMax">Optional value indicating whether the variable has a maximum value.</param>
 /// <param name="max">The maximum value of the variable if <paramref name="hasMax"/> is <c>true</c>.</param>
 /// <returns>The <see cref="ConVar"/> object representing the console variable.</returns>
 protected ConVar CreateConVar(string name, string defaultValue, string description = "", bool hasMin = false, float min = 0.0f, bool hasMax = false, float max = 1.0f)
 {
     return(ConVarManager.CreateConVar(this, name, defaultValue, description, hasMin, min, hasMax, max));
 }
コード例 #5
0
ファイル: ChatHook.cs プロジェクト: SevenMod/SevenMod
 /// <summary>
 /// Initializes the chat hook system.
 /// </summary>
 internal static void Init()
 {
     publicChatTrigger = ConVarManager.CreateConVar(null, "PublicChatTrigger", "!", "Chat prefix for public commands.").Value;
     silentChatTrigger = ConVarManager.CreateConVar(null, "SilentChatTrigger", "/", "Chat prefix for silent commands.").Value;
 }