{"TotalCount":10,"Files":[{"Ident":"whiletruedoend.fistsanimationhelper","Path":"__gen_RazorNamespace.cs","FileName":"__gen_RazorNamespace.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":72176,"Code":"global using Microsoft.AspNetCore.Components; \nglobal using Microsoft.AspNetCore.Components.Rendering;\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"Editor/MyEditorMenu.cs","FileName":"MyEditorMenu.cs","PackageType":"library","CodeKind":"Editor","AssetVersionId":72176,"Code":"using Editor;\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"UnitTests/UnitTest.cs","FileName":"UnitTest.cs","PackageType":"library","CodeKind":"UnitTest","AssetVersionId":72176,"Code":"global using Microsoft.VisualStudio.TestTools.UnitTesting;\r\n\r\n[TestClass]\r\npublic class TestInit\r\n{\r\n\t[AssemblyInitialize]\r\n\tpublic static void ClassInitialize( TestContext context )\r\n\t{\r\n\t\tSandbox.Application.InitUnitTest();\r\n\t}\r\n}\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"FootstepSoundsComponent.cs","FileName":"FootstepSoundsComponent.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":72176,"Code":"using Sandbox;\r\nusing Sandbox.Diagnostics;\r\nusing Sandbox.Services;\r\nusing System;\r\nusing System.Threading;\r\npublic sealed class FootstepSoundsComponent : Component\r\n{ \r\n\t[Property] SkinnedModelRenderer Source { get; set; }\r\n\r\n\t[Property] bool StaticSound { get; set; }\r\n\t[Property, ShowIf(\u0022StaticSound\u0022, true)] SoundEvent FootstepSound { get; set; }\r\n\tprotected override void OnEnabled()\r\n\t{\r\n\t\tif ( Source is null )\r\n\t\t\treturn;\r\n\r\n\t\tSource.OnFootstepEvent \u002B= OnEvent;\r\n\t}\r\n\r\n\tprotected override void OnDisabled()\r\n\t{\r\n\t\tif ( Source is null )\r\n\t\t\treturn;\r\n\r\n\t\tSource.OnFootstepEvent -= OnEvent;\r\n\t}\r\n\r\n\tprivate void OnEvent( SceneModel.FootstepEvent e )\r\n\t{\r\n\t\tif ( !StaticSound )\r\n\t\t\tPhysicalFootstep(e);\r\n\t\telse\r\n\t\t\tSound.Play( FootstepSound, Transform.Position );\r\n\t}\r\n\r\n\tvoid PhysicalFootstep( SceneModel.FootstepEvent e )\r\n\t{\r\n\t\tvar tr = Scene.Trace\r\n\t\t\t.Ray( e.Transform.Position \u002B Vector3.Up * 20, e.Transform.Position \u002B Vector3.Up * -20 )\r\n\t\t\t.Run();\r\n\r\n\t\tif ( !tr.Hit )\r\n\t\t\treturn;\r\n\r\n\t\tvar snd = Sound.Play( tr.Surface.Sounds.FootLand, Transform.Position );\r\n\t\tsnd.Volume = 0.5f;\r\n\t}\r\n}\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"GravityControllerComponent.cs","FileName":"GravityControllerComponent.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":72176,"Code":"using Sandbox;\r\n\r\n/// \u003Csummary\u003E\r\n/// This is a component - in your library!\r\n/// \u003C/summary\u003E\r\n[Title( \u0022Gravity Controller\u0022 )]\r\npublic class GravityController : Component\r\n{\r\n\t[Property] [Range(0.0f, 10000, 0.5f, false, true)] float Strength { get; set; } = 850.0f;\r\n    protected override void OnUpdate()\r\n    {\r\n        base.OnUpdate();\r\n\t\tif (Scene.PhysicsWorld.Gravity != Transform.Rotation.Down * Strength)\r\n\t\t{\r\n\t\t\tScene.PhysicsWorld.Gravity = Transform.Rotation.Down * Strength;\r\n            foreach (var item in Scene.PhysicsWorld.Bodies)\r\n            {\r\n\t\t\t\titem.Sleeping = false;\r\n            }\r\n        }\r\n\t\t\r\n    }\r\n\r\n    protected override void DrawGizmos()\r\n    {\r\n        base.DrawGizmos();\r\n\t\tGizmo.Draw.Arrow( Vector3.Zero, Vector3.Down * Strength / 50.0f, 4, 1 );\r\n    }\r\n}\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"UnitTests/LibraryTest.cs","FileName":"LibraryTest.cs","PackageType":"library","CodeKind":"UnitTest","AssetVersionId":72176,"Code":"using Sandbox;\r\n\r\n[TestClass]\r\npublic partial class LibraryTests\r\n{\r\n\t[TestMethod]\r\n\tpublic void SceneTest()\r\n\t{\r\n\t\tvar scene = new Scene();\r\n\t\tusing ( scene.Push() )\r\n\t\t{\r\n\t\t\tvar go = new GameObject();\r\n\r\n\t\t\tAssert.AreEqual( 1, scene.Directory.GameObjectCount );\r\n\t\t}\r\n\t}\r\n\r\n}\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"Code/FistsAnimationHelper.cs","FileName":"FistsAnimationHelper.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":72176,"Code":"using Sandbox;\r\n\r\n[Title( \u0022Fists Animation Helper\u0022 )]\r\npublic sealed class FistsAnimationHelper : Component\r\n{\r\n\t[Property]\r\n\tSkinnedModelRenderer Target { get; set; }\r\n\r\n\tpublic bool IsGrounded\r\n\t{\r\n\t\tget =\u003E Target.GetBool( \u0022b_grounded\u0022 );\r\n\t\tset =\u003E Target.Set( \u0022b_grounded\u0022, value );\r\n\t}\r\n\r\n\tpublic bool IsRunning\r\n\t{\r\n\t\tget =\u003E Target.GetBool( \u0022b_sprint\u0022 );\r\n\t\tset =\u003E Target.Set( \u0022b_sprint\u0022, value );\r\n\t}\r\n\r\n\tpublic float ViewBob\r\n\t{\r\n\t\tget =\u003E Target.GetFloat( \u0022move_bob\u0022 );\r\n\t\tset =\u003E Target.Set( \u0022move_bob\u0022, System.Math.Clamp( value, 0f, 1f ) );\r\n\t}\r\n\r\n\tpublic void TriggerJump()\r\n\t{\r\n\t\tTarget.Set( \u0022b_jump\u0022, true );\r\n\t}\r\n\r\n\tpublic void TriggerAttack()\r\n\t{\r\n\t\tTarget.Set( \u0022b_attack\u0022, true );\r\n\t}\r\n\r\n\tpublic void TriggerHolster()\r\n\t{\r\n\t\tTarget.Set( \u0022b_holster\u0022, true );\r\n\t}\r\n\r\n\tpublic void TriggerDeploy()\r\n\t{\r\n\t\tTarget.Set( \u0022b_deploy\u0022, true );\r\n\t}\r\n}\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"CitizenCustomisationComponent.cs","FileName":"CitizenCustomisationComponent.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":72176,"Code":"using Sandbox;\r\nusing Sandbox.Citizen;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\n\r\n[Title( \u0022Citizen Customisation\u0022 )]\r\npublic sealed class CitizenCustomisationComponent : Component\r\n{\r\n\t[Property] SkinnedModelRenderer body { get; set; }\r\n\r\n\t[Property] bool UseClientClothes { get; set; } = true;\r\n\r\n\t[Property][HideIf( \u0022UseClientClothes\u0022, true )] List\u003CClothing\u003E Clothes { get; set; }\r\n\r\n\tprotected override void OnStart()\r\n\t{\r\n\t\tApplyClothes();\r\n\t}\r\n\r\n\tpublic void ApplyClothes()\r\n\t{\r\n\t\tif ( body == null )\r\n\t\t{\r\n\t\t\tif ( Components.TryGet\u003CSkinnedModelRenderer\u003E( out var test ) )\r\n\t\t\t{\r\n\t\t\t\tbody = test;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ( UseClientClothes )\r\n\t\t\tLocalClothes();\r\n\t\telse\r\n\t\t\tListClothes();\r\n\t}\r\n\r\n\tpublic void RemoveClothes()\r\n\t{\r\n\t\tvar emptyContainer = new ClothingContainer();\r\n\t\temptyContainer.Apply( body );\r\n\t}\r\n\r\n\tvoid LocalClothes()\r\n\t{\r\n\t\tvar clothes = ClothingContainer.CreateFromLocalUser();\r\n\t\tclothes.Apply( body );\r\n\t}\r\n\r\n\tvoid ListClothes()\r\n\t{\r\n\t\tvar container = new ClothingContainer();\r\n\t\tforeach ( var item in Clothes )\r\n\t\t{\r\n\t\t\tcontainer.Clothing.Add( (new ClothingContainer.ClothingEntry( item )) );\r\n\t\t}\r\n\t\tcontainer.Apply( body );\r\n\t}\r\n\r\n\tprotected override void DrawGizmos()\r\n\t{\r\n\t\t// base.DrawGizmos();\r\n\t\t// foreach ( var item in Clothes )\r\n\t\t// {\r\n\t\t// \tGizmo.Draw.Model( item.Model );\r\n\t\t// }\r\n\t}\r\n\r\n}\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":"FistsAnimationHelper.cs","FileName":"FistsAnimationHelper.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":72176,"Code":"using Sandbox;\r\n\r\n[Title( \u0022Fists Animation Helper\u0022 )]\r\npublic sealed class FistsAnimationHelper : Component\r\n{\r\n\t[Property]\r\n\tSkinnedModelRenderer Target { get; set; }\r\n\r\n\tpublic bool IsGrounded\r\n\t{\r\n\t\tget =\u003E Target.GetBool( \u0022b_grounded\u0022 );\r\n\t\tset =\u003E Target.Set( \u0022b_grounded\u0022, value );\r\n\t}\r\n\r\n\tpublic bool IsRunning\r\n\t{\r\n\t\tget =\u003E Target.GetBool( \u0022b_sprint\u0022 );\r\n\t\tset =\u003E Target.Set( \u0022b_sprint\u0022, value );\r\n\t}\r\n\r\n\tpublic float ViewBob\r\n\t{\r\n\t\tget =\u003E Target.GetFloat( \u0022move_bob\u0022 );\r\n\t\tset =\u003E Target.Set( \u0022move_bob\u0022, System.Math.Clamp( value, 0f, 1f ) );\r\n\t}\r\n\r\n\tpublic void TriggerJump()\r\n\t{\r\n\t\tTarget.Set( \u0022b_jump\u0022, true );\r\n\t}\r\n\r\n\tpublic void TriggerAttack()\r\n\t{\r\n\t\tTarget.Set( \u0022b_attack\u0022, true );\r\n\t}\r\n\r\n\tpublic void TriggerHolster()\r\n\t{\r\n\t\tTarget.Set( \u0022b_holster\u0022, true );\r\n\t}\r\n\r\n\tpublic void TriggerDeploy()\r\n\t{\r\n\t\tTarget.Set( \u0022b_deploy\u0022, true );\r\n\t}\r\n}\r\n"},{"Ident":"whiletruedoend.fistsanimationhelper","Path":".obj/__compiler_extra.cs","FileName":"__compiler_extra.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":72176,"Code":"global using static Sandbox.Internal.GlobalGameNamespace;\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022AddonTitle\u0022, \u0022Fists Animation Helper\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022AddonIdent\u0022, \u0022fistsanimationhelper\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022OrgIdent\u0022, \u0022whiletruedoend\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022Ident\u0022, \u0022whiletruedoend.fistsanimationhelper\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022CompileTime\u0022, \u002206-Sep-24 18:57:41\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022EngineVersion\u0022, \u002217\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022EngineMinorVersion\u0022, \u00221\u0022 )]\r\n\r\n[assembly: System.Runtime.Versioning.TargetFramework( \u0022.NETCoreApp,Version=v7.0\u0022, FrameworkDisplayName = \u0022.NET 7.0\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyVersion(\u00220.0.147.0\u0022)]\r\n[assembly: global::System.Reflection.AssemblyFileVersion(\u00220.0.147.0\u0022)]"}]}