mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
huge commit for advanced stats feature.
broke data out into its own library. may be breaking changes with existing plugins
This commit is contained in:
@ -4,7 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using static SharedLibraryCore.Database.Models.EFClient;
|
||||
using static Data.Models.Client.EFClient;
|
||||
|
||||
namespace SharedLibraryCore.Configuration
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using static SharedLibraryCore.Database.Models.EFClient;
|
||||
using static Data.Models.Client.EFClient;
|
||||
using static SharedLibraryCore.Server;
|
||||
|
||||
namespace SharedLibraryCore.Configuration
|
||||
|
@ -2,13 +2,14 @@
|
||||
|
||||
namespace SharedLibraryCore.Configuration
|
||||
{
|
||||
public class DefaultConfiguration : IBaseConfiguration
|
||||
public class DefaultSettings : IBaseConfiguration
|
||||
{
|
||||
public string[] AutoMessages { get; set; }
|
||||
public string[] GlobalRules { get; set; }
|
||||
public MapConfiguration[] Maps { get; set; }
|
||||
public QuickMessageConfiguration[] QuickMessages {get; set;}
|
||||
public string[] DisallowedClientNames { get; set; }
|
||||
public GameStringConfiguration GameStrings { get; set; }
|
||||
|
||||
public IBaseConfiguration Generate() => this;
|
||||
|
24
SharedLibraryCore/Configuration/GameStringConfiguration.cs
Normal file
24
SharedLibraryCore/Configuration/GameStringConfiguration.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using Humanizer;
|
||||
|
||||
namespace SharedLibraryCore.Configuration
|
||||
{
|
||||
public class GameStringConfiguration : Dictionary<Server.Game, Dictionary<string, string>>
|
||||
{
|
||||
public string GetStringForGame(string key, Server.Game game = Server.Game.IW4)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!ContainsKey(game))
|
||||
{
|
||||
return key.Transform(To.TitleCase);
|
||||
}
|
||||
|
||||
var strings = this[game];
|
||||
return !strings.ContainsKey(key) ? key.Transform(To.TitleCase) : strings[key];
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user