-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from daffyyyy/fix-knife-3
Fixees
- Loading branch information
Showing
2 changed files
with
188 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using CounterStrikeSharp.API.Modules.Utils; | ||
using System.Reflection; | ||
|
||
namespace WeaponPaints | ||
{ | ||
public static class Utility | ||
{ | ||
public static WeaponPaintsConfig? Config { get; set; } | ||
|
||
public static string ReplaceTags(string message) | ||
{ | ||
if (message.Contains('{')) | ||
{ | ||
string modifiedValue = message; | ||
if (Config != null) | ||
{ | ||
modifiedValue = modifiedValue.Replace("{WEBSITE}", Config.Website); | ||
} | ||
foreach (FieldInfo field in typeof(ChatColors).GetFields()) | ||
{ | ||
string pattern = $"{{{field.Name}}}"; | ||
if (message.Contains(pattern, StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
modifiedValue = modifiedValue.Replace(pattern, field.GetValue(null)!.ToString(), StringComparison.OrdinalIgnoreCase); | ||
} | ||
} | ||
return modifiedValue; | ||
} | ||
|
||
return message; | ||
} | ||
|
||
public static void Log(string message) | ||
{ | ||
Console.BackgroundColor = ConsoleColor.DarkGray; | ||
Console.ForegroundColor = ConsoleColor.Cyan; | ||
Console.WriteLine("[WeaponPaints] " + message); | ||
Console.ResetColor(); | ||
} | ||
public static void ShowAd(string moduleVersion) | ||
{ | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" _ _ _______ _______ _______ _______ __ _ _______ _______ ___ __ _ _______ _______ "); | ||
Console.WriteLine("| | _ | || || _ || || || | | || || _ || | | | | || || |"); | ||
Console.WriteLine("| || || || ___|| |_| || _ || _ || |_| || _ || |_| || | | |_| ||_ _|| _____|"); | ||
Console.WriteLine("| || |___ | || |_| || | | || || |_| || || | | | | | | |_____ "); | ||
Console.WriteLine("| || ___|| || ___|| |_| || _ || ___|| || | | _ | | | |_____ |"); | ||
Console.WriteLine("| _ || |___ | _ || | | || | | || | | _ || | | | | | | | _____| |"); | ||
Console.WriteLine("|__| |__||_______||__| |__||___| |_______||_| |__||___| |__| |__||___| |_| |__| |___| |_______|"); | ||
Console.WriteLine(" >> Version: " + moduleVersion); | ||
Console.WriteLine(" >> GitHub: https://github.com/Nereziel/cs2-WeaponPaints"); | ||
Console.WriteLine(" "); | ||
} | ||
} | ||
} |
Oops, something went wrong.