Compare commits

..

4 Commits

Author SHA1 Message Date
Nereziel
f820c7d251 Merge pull request #115 from daffyyyy/main
1.4a
Updated css version
Probably not needed SkinVisibilityFix anymore
2024-01-20 20:20:44 +01:00
Dawid Bepierszcz
6e5d595c0f Merge branch 'Nereziel:main' into main 2024-01-20 18:05:40 +01:00
Dawid Bepierszcz
71d57eb3ad Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-01-20 18:04:52 +01:00
Dawid Bepierszcz
620b067991 1.4a
- Probably not needed `SkinsVisibilityFix` anymore
2024-01-20 18:04:50 +01:00
5 changed files with 24 additions and 7 deletions

View File

@@ -95,8 +95,10 @@ namespace WeaponPaints
if (player == null || !player.IsValid) return HookResult.Continue; if (player == null || !player.IsValid) return HookResult.Continue;
/*
if (Config.Additional.SkinVisibilityFix) if (Config.Additional.SkinVisibilityFix)
AddTimer(0.2f, () => RefreshSkins(player)); AddTimer(0.2f, () => RefreshSkins(player));
*/
return HookResult.Continue; return HookResult.Continue;
} }
@@ -243,13 +245,16 @@ namespace WeaponPaints
if (Config.Additional.KnifeEnabled && !PlayerHasKnife(player)) if (Config.Additional.KnifeEnabled && !PlayerHasKnife(player))
{ {
g_knifePickupCount[(int)player.Index] = 0; g_knifePickupCount[(int)player.Index] = 0;
AddTimer(0.1f, () => GiveKnifeToPlayer(player)); GiveKnifeToPlayer(player);
//AddTimer(0.1f, () => GiveKnifeToPlayer(player));
} }
/*
if (Config.Additional.SkinVisibilityFix) if (Config.Additional.SkinVisibilityFix)
{ {
AddTimer(0.3f, () => RefreshSkins(player)); AddTimer(0.3f, () => RefreshSkins(player));
} }
*/
return HookResult.Continue; return HookResult.Continue;
} }

View File

@@ -1 +1 @@
1.3i 1.4a

View File

@@ -23,6 +23,11 @@ namespace WeaponPaints
if (isKnife) if (isKnife)
{ {
weapon.AttributeManager.Item.EntityQuality = 3; weapon.AttributeManager.Item.EntityQuality = 3;
if (weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
skeleton.ForceParentToBeNetworked = true;
}
} }
if (_config.Additional.GiveRandomSkin && if (_config.Additional.GiveRandomSkin &&
@@ -38,7 +43,8 @@ namespace WeaponPaints
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null) if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{ {
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode); var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
skeleton.ModelState.MeshGroupMask = 2; //skeleton.ModelState.MeshGroupMask = 2;
skeleton.ForceParentToBeNetworked = true;
} }
return; return;
} }
@@ -52,10 +58,12 @@ namespace WeaponPaints
weapon.FallbackPaintKit = weaponInfo.Paint; weapon.FallbackPaintKit = weaponInfo.Paint;
weapon.FallbackSeed = weaponInfo.Seed; weapon.FallbackSeed = weaponInfo.Seed;
weapon.FallbackWear = weaponInfo.Wear; weapon.FallbackWear = weaponInfo.Wear;
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null) if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{ {
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode); var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
skeleton.ModelState.MeshGroupMask = 2; skeleton.ForceParentToBeNetworked = true;
//skeleton.ModelState.MeshGroupMask = 2;
} }
} }
@@ -171,6 +179,7 @@ namespace WeaponPaints
internal void RefreshSkins(CCSPlayerController? player) internal void RefreshSkins(CCSPlayerController? player)
{ {
return;
if (!Utility.IsPlayerValid(player) || !player!.PawnIsAlive) return; if (!Utility.IsPlayerValid(player) || !player!.PawnIsAlive) return;
AddTimer(0.18f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3")); AddTimer(0.18f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3"));
@@ -234,8 +243,11 @@ namespace WeaponPaints
} }
} }
} }
/*
if (Config.Additional.SkinVisibilityFix) if (Config.Additional.SkinVisibilityFix)
RefreshSkins(player); RefreshSkins(player);
*/
} }
} }

View File

@@ -9,7 +9,7 @@ using System.Collections.Concurrent;
namespace WeaponPaints; namespace WeaponPaints;
[MinimumApiVersion(142)] [MinimumApiVersion(144)]
public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig> public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
{ {
internal static readonly Dictionary<string, string> weaponList = new() internal static readonly Dictionary<string, string> weaponList = new()
@@ -145,7 +145,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
public override string ModuleAuthor => "Nereziel & daffyy"; public override string ModuleAuthor => "Nereziel & daffyy";
public override string ModuleDescription => "Skin and knife selector, standalone and web-based"; public override string ModuleDescription => "Skin and knife selector, standalone and web-based";
public override string ModuleName => "WeaponPaints"; public override string ModuleName => "WeaponPaints";
public override string ModuleVersion => "1.3i"; public override string ModuleVersion => "1.4a";
public static WeaponPaintsConfig GetWeaponPaintsConfig() public static WeaponPaintsConfig GetWeaponPaintsConfig()
{ {

View File

@@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.147" /> <PackageReference Include="CounterStrikeSharp.API" Version="1.0.148" />
<PackageReference Include="Dapper" Version="2.1.28" /> <PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="MySqlConnector" Version="2.3.4" /> <PackageReference Include="MySqlConnector" Version="2.3.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />