Compare commits

...

17 Commits

Author SHA1 Message Date
Nereziel
cdc58df13c Merge pull request #67 from daffyyyy/fix-knife-3
Fixees
2023-11-25 23:30:31 +01:00
daffyyyy
fe5cc9a82a Update WeaponPaints.cs 2023-11-25 23:17:56 +01:00
daffyyyy
01542a7dc6 Fixees 2023-11-25 23:12:17 +01:00
Nereziel
e1f24abd5d removed exception 2023-11-25 13:10:52 +01:00
Nereziel
646050fb72 Merge pull request #64 from daffyyyy/fix-knife-2
Still knife fix :D (Previous sometimes give random knife to player)
2023-11-24 08:11:37 +01:00
daffyyyy
87dadb9c62 Update WeaponPaints.cs 2023-11-23 01:32:07 +01:00
Nereziel
cf421c5614 Merge pull request #63 from daffyyyy/fix-knife-2
Attempting to repair knives when a map or other plugin was giving them
2023-11-23 00:33:16 +01:00
daffyyyy
fc64e1d261 Additional checks 2023-11-23 00:21:04 +01:00
Nereziel
45fc4a86a5 Merge pull request #61 from daffyyyy/feature/random-skins
Random skins and more
2023-11-22 18:28:21 +01:00
daffyyyy
ad105e5cd2 Merge branch 'feature/random-skins' of https://github.com/daffyyyy/cs2-WeaponPaints into feature/random-skins 2023-11-21 23:54:17 +01:00
daffyyyy
f668f56d66 Give knife on spawn 2023-11-21 23:54:12 +01:00
Dawid Bepierszcz
de6672507a Update build.yml 2023-11-21 22:22:54 +01:00
daffyyyy
2855d4e9ae I baked new things
;)
2023-11-21 21:55:57 +01:00
Nereziel
0c05c25e8e messed discord link 2023-11-21 21:00:12 +01:00
Nereziel
8335ede7d7 Update README.md 2023-11-21 20:07:52 +01:00
Nereziel
d79246f161 Update build.yml 2023-11-21 20:06:31 +01:00
Nereziel
a504506129 test gh act 2023-11-21 20:03:53 +01:00
5 changed files with 604 additions and 205 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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.
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E2G0P2O) or [![Donate on Steam](https://github.com/Nereziel/cs2-WeaponPaints/assets/32937653/a0d53822-4ca7-4caf-83b4-e1a9b5f8c94e)](https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE)

55
Utility.cs Normal file
View File

@@ -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(" ");
}
}
}

File diff suppressed because it is too large Load Diff