mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-17 18:39:07 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dcd68aed67 | ||
|
|
7bb97af619 | ||
|
|
cdc58df13c | ||
|
|
fe5cc9a82a | ||
|
|
01542a7dc6 | ||
|
|
e1f24abd5d | ||
|
|
646050fb72 | ||
|
|
87dadb9c62 | ||
|
|
cf421c5614 | ||
|
|
fc64e1d261 | ||
|
|
45fc4a86a5 | ||
|
|
ad105e5cd2 | ||
|
|
f668f56d66 | ||
|
|
de6672507a | ||
|
|
2855d4e9ae | ||
|
|
0c05c25e8e | ||
|
|
8335ede7d7 | ||
|
|
d79246f161 | ||
|
|
a504506129 |
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -3,12 +3,16 @@ name: Build
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '**/README.md'
|
||||
- '**/.gitignore'
|
||||
- '**/LICENSE'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- '.gitignore'
|
||||
- 'LICENSE'
|
||||
- '**/README.md'
|
||||
- '**/.gitignore'
|
||||
- '**/LICENSE'
|
||||
|
||||
env:
|
||||
BUILD_NUMBER: ${{ github.run_number }}
|
||||
@@ -54,6 +58,8 @@ jobs:
|
||||
${{ env.OUTPUT_PATH }}/McMaster.NETCore.Plugins.dll \
|
||||
${{ env.OUTPUT_PATH }}/Microsoft.DotNet.PlatformAbstractions.dll \
|
||||
${{ env.OUTPUT_PATH }}/Microsoft.Extensions.DependencyModel.dll \
|
||||
- name: Copy skins.json
|
||||
run: cp website/data/skins.json ${{ env.OUTPUT_PATH }}/skins.json
|
||||
- name: Zip
|
||||
uses: thedoctor0/zip-release@0.7.5
|
||||
with:
|
||||
|
||||
12
Config.cs
12
Config.cs
@@ -17,10 +17,16 @@ namespace WeaponPaints
|
||||
public string SuccessRefreshCommand { get; set; } = "Refreshing weapon paints.";
|
||||
[JsonPropertyName("ChosenKnifeMenu")]
|
||||
public string ChosenKnifeMenu { get; set; } = "You have chosen {KNIFE} as your knife.";
|
||||
[JsonPropertyName("ChosenSkinMenu")]
|
||||
public string ChosenSkinMenu { get; set; } = "You have chosen {SKIN} as your skin.";
|
||||
[JsonPropertyName("ChosenKnifeMenuKill")]
|
||||
public string ChosenKnifeMenuKill { get; set; } = "To correctly apply skin for knife, you need to type !kill.";
|
||||
[JsonPropertyName("KnifeMenuTitle")]
|
||||
public string KnifeMenuTitle { get; set; } = "Knife Menu.";
|
||||
[JsonPropertyName("WeaponMenuTitle")]
|
||||
public string WeaponMenuTitle { get; set; } = "Weapon Menu.";
|
||||
[JsonPropertyName("SkinMenuTitle")]
|
||||
public string SkinMenuTitle { get; set; } = "Select skin for {WEAPON}";
|
||||
}
|
||||
|
||||
public class Additional
|
||||
@@ -46,6 +52,9 @@ namespace WeaponPaints
|
||||
[JsonPropertyName("CommandSkin")]
|
||||
public string CommandSkin { get; set; } = "ws";
|
||||
|
||||
[JsonPropertyName("CommandSkinSelection")]
|
||||
public string CommandSkinSelection { get; set; } = "skins";
|
||||
|
||||
[JsonPropertyName("CommandRefresh")]
|
||||
public string CommandRefresh { get; set; } = "wp";
|
||||
|
||||
@@ -54,6 +63,9 @@ namespace WeaponPaints
|
||||
|
||||
[JsonPropertyName("GiveRandomKnife")]
|
||||
public bool GiveRandomKnife { get; set; } = false;
|
||||
|
||||
[JsonPropertyName("GiveRandomSkin")]
|
||||
public bool GiveRandomSkin { get; set; } = false;
|
||||
}
|
||||
|
||||
public class WeaponPaintsConfig : BasePluginConfig
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Description
|
||||
Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin for **[CSSharp](https://docs.cssharp.dev/)**.
|
||||
|
||||
## Created [Discord server](https://discord.gg/EEg6qtNScq) where you can discus about plugin.
|
||||
## Created [Discord server](https://discord.gg/d9CvaYPSFe) where you can discus about plugin.
|
||||
|
||||
### Consider to donate instead of buying from unknown sources.
|
||||
[](https://ko-fi.com/E1E2G0P2O) or [](https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE)
|
||||
|
||||
62
Utility.cs
Normal file
62
Utility.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Entities;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace WeaponPaints
|
||||
{
|
||||
public static class Utility
|
||||
{
|
||||
public static WeaponPaintsConfig? Config { get; set; }
|
||||
|
||||
public static bool IsPlayerValid(CCSPlayerController? player)
|
||||
{
|
||||
return (player != null && player.IsValid && !player.IsBot && !player.IsHLTV);
|
||||
}
|
||||
|
||||
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(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
763
WeaponPaints.cs
763
WeaponPaints.cs
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user