From dd266b1a8ab56957574ca27996b2ad5908e198da Mon Sep 17 00:00:00 2001 From: Oscar Date: Tue, 10 Jun 2025 02:59:16 +0300 Subject: [PATCH] upd --- Assets/Items/Pijama.inv | 2 +- Assets/Items/shorts_1.inv | 16 +++ Assets/prefabs/Player.prefab | 164 +++++++++++++++---------------- Code/Player/Dedugan.Inventory.cs | 154 +++++++++++++++-------------- Code/Player/Dedugan.Player.cs | 24 +++-- Code/Player/RagdollController.cs | 7 +- sasalka.sln.DotSettings.user | 1 + 7 files changed, 200 insertions(+), 168 deletions(-) create mode 100644 Assets/Items/shorts_1.inv diff --git a/Assets/Items/Pijama.inv b/Assets/Items/Pijama.inv index 7476fb6..efe40e9 100644 --- a/Assets/Items/Pijama.inv +++ b/Assets/Items/Pijama.inv @@ -4,7 +4,7 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/pukes.pyjamatop/thumb.png.9405387bc9d8e406", "ClothUrl": "pukes/pyjamatop", - "Name": "Pijama", + "Name": "Pyjama Top", "Description": "Test clothing", "Prefab": null, "WeaponDefinition": { diff --git a/Assets/Items/shorts_1.inv b/Assets/Items/shorts_1.inv new file mode 100644 index 0000000..0da3967 --- /dev/null +++ b/Assets/Items/shorts_1.inv @@ -0,0 +1,16 @@ +{ + "Slot": "None", + "HoldType": "None", + "ImageTexture": null, + "ImageUrl": "https://cdn.sbox.game/org/doubletrouble/denimshorts/thumb/03a1325a-4ac5-4884-8cc2-b379a01b976c.png", + "ClothUrl": "doubletrouble/denimshorts", + "Name": "Denim Shorts", + "Description": "test shorts", + "Prefab": null, + "WeaponDefinition": { + "Position": "0,0,0", + "Rotation": "0,0,0,0" + }, + "__references": [], + "__version": 0 +} \ No newline at end of file diff --git a/Assets/prefabs/Player.prefab b/Assets/prefabs/Player.prefab index 11dd5d7..16ee3ea 100644 --- a/Assets/prefabs/Player.prefab +++ b/Assets/prefabs/Player.prefab @@ -141,9 +141,7 @@ }, "RunSpeed": 350, "WalkSpeed": 200, - "WorkshopItems": [ - "pukes/pyjamatop" - ] + "WorkshopItems": [] }, { "__type": "Sandbox.AudioListener", @@ -2030,8 +2028,8 @@ "__version": 1, "Flags": 8, "Name": "ankle_R", - "Position": "0.4100251,-4.377188,3.807455", - "Rotation": "0.6728532,0.2185255,-0.3316621,0.6241117", + "Position": "0.4100335,-4.377071,3.807489", + "Rotation": "0.6728557,0.2185201,-0.3316683,0.6241075", "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, @@ -2047,9 +2045,9 @@ "__version": 1, "Flags": 8, "Name": "ankle_L", - "Position": "0.4083929,4.427738,3.805784", - "Rotation": "0.6245901,0.3321031,-0.2183217,0.6722577", - "Scale": "1.000003,1.000003,1.000003", + "Position": "0.4083832,4.427598,3.805829", + "Rotation": "0.6245875,0.3321067,-0.218319,0.6722592", + "Scale": "1,1,1", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2064,9 +2062,9 @@ "__version": 1, "Flags": 8, "Name": "arm_lower_R", - "Position": "-2.777774,-8.907755,40.58329", - "Rotation": "0.5056845,0.3672242,-0.5358468,0.5677128", - "Scale": "1.000005,1.000005,1.000005", + "Position": "-2.305881,-8.654749,40.97688", + "Rotation": "0.5030814,0.3782525,-0.540166,0.5586189", + "Scale": "1.000004,1.000004,1.000004", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2081,9 +2079,9 @@ "__version": 1, "Flags": 8, "Name": "arm_lower_L", - "Position": "-2.554454,9.938415,41.12941", - "Rotation": "0.5901422,0.539196,-0.3564052,0.4837099", - "Scale": "1.000006,1.000006,1.000006", + "Position": "-1.954972,9.871452,41.46471", + "Rotation": "0.5850527,0.5385041,-0.3695764,0.4807702", + "Scale": "1.000003,1.000003,1.000003", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2098,9 +2096,9 @@ "__version": 1, "Flags": 8, "Name": "hand_R", - "Position": "-1.575329,-10.73443,33.19328", - "Rotation": "0.4779791,0.3452799,-0.5928894,0.5484523", - "Scale": "1.000006,1.000006,1.000006", + "Position": "-1.301779,-10.37271,33.53143", + "Rotation": "0.4744667,0.3565034,-0.5969852,0.5398108", + "Scale": "1.000005,1.000005,1.000005", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2115,9 +2113,9 @@ "__version": 1, "Flags": 8, "Name": "hand_L", - "Position": "-1.286812,12.18568,33.86737", - "Rotation": "0.5707431,0.5958003,-0.3323785,0.4569452", - "Scale": "1.000008,1.000008,1.000008", + "Position": "-0.8232388,11.98876,34.14148", + "Rotation": "0.5664198,0.5951051,-0.345663,0.4533604", + "Scale": "1.000003,1.000003,1.000003", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2132,9 +2130,9 @@ "__version": 1, "Flags": 8, "Name": "hold_R", - "Position": "-0.01371813,-9.381454,27.16162", - "Rotation": "0.3082592,0.7160788,0.06766287,0.6225988", - "Scale": "1.000008,1.000008,1.000008", + "Position": "0.1027977,-8.932137,27.48148", + "Rotation": "0.3143174,0.7234542,0.06842977,0.6108487", + "Scale": "1.000005,1.000005,1.000005", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2149,9 +2147,9 @@ "__version": 1, "Flags": 8, "Name": "hold_L", - "Position": "0.2557262,11.16746,27.76514", - "Rotation": "-0.2797161,0.7211201,-0.05373439,0.6315516", - "Scale": "1.000008,1.000008,1.000008", + "Position": "0.5759228,10.85694,28.0248", + "Rotation": "-0.2817041,0.7288769,-0.05973086,0.6211389", + "Scale": "1.000004,1.000004,1.000004", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2200,9 +2198,9 @@ "__version": 1, "Flags": 8, "Name": "leg_lower_R", - "Position": "2.368746,-4.429564,16.1687", - "Rotation": "0.4852337,0.5078025,-0.5660278,0.4316219", - "Scale": "1.000001,1.000001,1.000001", + "Position": "2.141828,-4.433267,16.20256", + "Rotation": "0.4914648,0.5026264,-0.5626303,0.435059", + "Scale": "1,1,1", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2217,9 +2215,9 @@ "__version": 1, "Flags": 8, "Name": "leg_lower_L", - "Position": "2.750974,4.852622,16.09278", - "Rotation": "0.4170566,0.5649363,-0.5238643,0.4821586", - "Scale": "1.000002,1.000002,1.000002", + "Position": "2.990841,4.839132,16.04515", + "Rotation": "0.4134015,0.568549,-0.5290765,0.4753201", + "Scale": "1.000001,1.000001,1.000001", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2234,9 +2232,9 @@ "__version": 1, "Flags": 8, "Name": "middle_of_both_hands", - "Position": "-1.104477,0.8691149,28.74636", - "Rotation": "0.01755048,0.7529662,0.006575623,0.6577923", - "Scale": "1.000007,1.000007,1.000007", + "Position": "-0.8430352,0.9475369,29.01887", + "Rotation": "0.01926278,0.7531982,0.004356876,0.6574971", + "Scale": "1.000004,1.000004,1.000004", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2251,9 +2249,9 @@ "__version": 1, "Flags": 8, "Name": "driver_arm_upper_R_twist1", - "Position": "-1.929822,-7.920132,45.43435", + "Position": "-1.400206,-7.729323,45.82975", "Rotation": "0,0,0,1", - "Scale": "1.000005,1.000005,1.000005", + "Scale": "1.000003,1.000003,1.000003", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2268,9 +2266,9 @@ "__version": 1, "Flags": 8, "Name": "driver_arm_lower_R_twist1", - "Position": "-2.176551,-9.821091,36.88829", + "Position": "-1.80383,-9.513729,37.25415", "Rotation": "0,0,0,1", - "Scale": "1.000006,1.000006,1.000006", + "Scale": "1.000004,1.000004,1.000004", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2285,9 +2283,9 @@ "__version": 1, "Flags": 8, "Name": "driver_elbow_R_position", - "Position": "-2.800889,-8.908604,40.57903", - "Rotation": "-0.03809046,-0.6245987,0.7799343,0.01131491", - "Scale": "1.000005,1.000005,1.000005", + "Position": "-2.314887,-8.657202,40.97291", + "Rotation": "-0.0298567,-0.6296679,0.7760905,0.01761862", + "Scale": "1.000004,1.000004,1.000004", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2302,9 +2300,9 @@ "__version": 1, "Flags": 8, "Name": "driver_elbow_L_position", - "Position": "-2.577524,9.940108,41.12513", - "Rotation": "-0.04260791,0.7959635,-0.5976314,0.08639171", - "Scale": "1.000006,1.000006,1.000006", + "Position": "-1.963849,9.874497,41.4608", + "Rotation": "-0.04279031,0.7921829,-0.6040214,0.07598255", + "Scale": "1.000003,1.000003,1.000003", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2319,9 +2317,9 @@ "__version": 1, "Flags": 8, "Name": "driver_arm_upper_L_twist1", - "Position": "-1.744466,8.632482,45.91122", + "Position": "-1.12625,8.624744,46.25906", "Rotation": "0,0,0,1", - "Scale": "1.000005,1.000005,1.000005", + "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2336,9 +2334,9 @@ "__version": 1, "Flags": 8, "Name": "driver_arm_lower_L_twist1", - "Position": "-1.920633,11.06205,37.49839", + "Position": "-1.389105,10.93011,37.80309", "Rotation": "0,0,0,1", - "Scale": "1.000007,1.000007,1.000007", + "Scale": "1.000003,1.000003,1.000003", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2353,7 +2351,7 @@ "__version": 1, "Flags": 8, "Name": "driver_leg_upper_R_twist1", - "Position": "1.46347,-4.2318,23.34433", + "Position": "1.383293,-4.265827,23.39594", "Rotation": "0,0,0,1", "Scale": "1.000001,1.000001,1.000001", "Tags": "", @@ -2370,9 +2368,9 @@ "__version": 1, "Flags": 8, "Name": "driver_leg_upper_L_twist1", - "Position": "1.678381,4.836231,23.24801", + "Position": "1.837544,4.795762,23.18769", "Rotation": "0,0,0,1", - "Scale": "1.000001,1.000001,1.000001", + "Scale": "1,1,1", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2387,8 +2385,8 @@ "__version": 1, "Flags": 8, "Name": "driver_kneecap_R_position", - "Position": "2.787574,-4.476758,16.13843", - "Rotation": "0.5176088,0.4734412,-0.5328195,0.4733266", + "Position": "2.503448,-4.474622,16.17259", + "Rotation": "0.5185856,0.4737309,-0.5330592,0.4716947", "Scale": "1.000001,1.000001,1.000001", "Tags": "", "Enabled": true, @@ -2404,9 +2402,9 @@ "__version": 1, "Flags": 8, "Name": "driver_kneecap_L_position", - "Position": "3.249787,4.906153,16.05798", - "Rotation": "0.6995426,0.04320066,0.0288072,0.712702", - "Scale": "1.000002,1.000002,1.000002", + "Position": "3.534691,4.896688,16.00735", + "Rotation": "0.7001207,0.04391778,0.02674206,0.7121707", + "Scale": "1.000001,1.000001,1.000001", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2421,9 +2419,9 @@ "__version": 1, "Flags": 8, "Name": "driver_leg_lower_R_twist1", - "Position": "1.389388,-4.403374,9.988078", + "Position": "1.275923,-4.405165,10.00504", "Rotation": "0,0,0,1", - "Scale": "1.000002,1.000002,1.000002", + "Scale": "1.000001,1.000001,1.000001", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2438,9 +2436,9 @@ "__version": 1, "Flags": 8, "Name": "driver_leg_lower_L_twist1", - "Position": "1.579678,4.640162,9.949263", + "Position": "1.699609,4.633352,9.925488", "Rotation": "0,0,0,1", - "Scale": "1.000002,1.000002,1.000002", + "Scale": "1.000001,1.000001,1.000001", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2455,9 +2453,9 @@ "__version": 1, "Flags": 8, "Name": "forward_reference_modelspace", - "Position": "-0.6776385,0.2271925,43.41444", + "Position": "-0.2639478,0.2526502,43.42427", "Rotation": "0,0,0,1", - "Scale": "1.000002,1.000002,1.000002", + "Scale": "1.000001,1.000001,1.000001", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2472,9 +2470,9 @@ "__version": 1, "Flags": 8, "Name": "eyes", - "Position": "5.072767,-0.3072115,63.30234", - "Rotation": "0.0140758,-0.01898375,-0.01293489,0.999637", - "Scale": "1.000004,1.000004,1.000004", + "Position": "5.885584,-0.1965587,63.25779", + "Rotation": "0.0126497,-0.01464069,-0.01462483,0.9997059", + "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2489,9 +2487,9 @@ "__version": 1, "Flags": 8, "Name": "eye_R_forward", - "Position": "4.988014,-3.651226,63.20652", - "Rotation": "0.0140758,-0.01898375,-0.01293489,0.999637", - "Scale": "1.000004,1.000004,1.000004", + "Position": "5.788969,-3.540511,63.17171", + "Rotation": "0.0126497,-0.01464069,-0.01462483,0.9997059", + "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2506,9 +2504,9 @@ "__version": 1, "Flags": 8, "Name": "eye_L_forward", - "Position": "5.157518,3.036803,63.39816", - "Rotation": "0.0140758,-0.01898375,-0.01293489,0.999637", - "Scale": "1.000004,1.000004,1.000004", + "Position": "5.982198,3.147393,63.34386", + "Rotation": "0.0126497,-0.01464069,-0.01462483,0.9997059", + "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2523,9 +2521,9 @@ "__version": 1, "Flags": 8, "Name": "forward_reference", - "Position": "0.027397,0.02358127,56.22047", - "Rotation": "0.0140758,-0.01898375,-0.01293489,0.999637", - "Scale": "1.000004,1.000004,1.000004", + "Position": "0.779397,0.1321325,56.21957", + "Rotation": "0.0126497,-0.01464069,-0.01462483,0.9997059", + "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2540,8 +2538,8 @@ "__version": 1, "Flags": 8, "Name": "foot_R", - "Position": "1.982162,-4.910528,0.1892754", - "Rotation": "0.0004858672,-0.00001408905,-0.08710641,0.9961989", + "Position": "1.982155,-4.910447,0.1893355", + "Rotation": "0.0004867911,-0.0000140816,-0.08711611,0.9961981", "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, @@ -2557,9 +2555,9 @@ "__version": 1, "Flags": 8, "Name": "foot_L", - "Position": "1.978726,4.96698,1.053321", - "Rotation": "-0.08723081,0.996188,0.000407666,0.00001469322", - "Scale": "1.000001,1.000001,1.000001", + "Position": "1.978698,4.966865,1.053316", + "Rotation": "-0.0872355,0.9961876,0.0004070103,0.00001410835", + "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, "NetworkMode": 2, @@ -2574,9 +2572,9 @@ "__version": 1, "Flags": 8, "Name": "hat", - "Position": "-0.2584102,-0.4028735,71.37216", - "Rotation": "0.0140758,-0.01898375,-0.01293489,0.999637", - "Scale": "1.000004,1.000004,1.000004", + "Position": "0.6251416,-0.2530355,71.37424", + "Rotation": "0.0126497,-0.01464069,-0.01462483,0.9997059", + "Scale": "1.000002,1.000002,1.000002", "Tags": "", "Enabled": true, "NetworkMode": 2, diff --git a/Code/Player/Dedugan.Inventory.cs b/Code/Player/Dedugan.Inventory.cs index 11ff47b..2ab270f 100644 --- a/Code/Player/Dedugan.Inventory.cs +++ b/Code/Player/Dedugan.Inventory.cs @@ -21,6 +21,11 @@ public sealed partial class Dedugan : Component Definition = ResourceLibrary.Get( "Items/Pijama.inv" ) } ); + Inventory.AddItem( new InventoryItem + { + Definition = ResourceLibrary.Get( "Items/shorts_1.inv" ) + } ); + Inventory.AddItem( new InventoryItem { Definition = ResourceLibrary.Get( "Items/pistol.inv" ) @@ -41,93 +46,90 @@ public sealed partial class Dedugan : Component private void OnItemEquipped( InventoryItem item ) { - var go = item.Definition.Prefab.Clone(); - - AnimationHelper.HoldType = item.Definition.HoldType; - - // switch ( item.Definition.Slot ) - // { - // case Inventar.InventorySlot.LeftHand | Inventar.InventorySlot.RightHand: - // go.Parent = Renderer.GetAttachmentObject( "hold_R" ); - // AnimationHelper.Handedness = CitizenAnimationHelper.Hand.Both; - // break; - // case Inventar.InventorySlot.RightHand: - // go.Parent = Renderer.GetAttachmentObject( "hold_R" ); - // AnimationHelper.Handedness = CitizenAnimationHelper.Hand.Right; - // break; - // case Inventar.InventorySlot.LeftHand: - // go.Parent = Renderer.GetAttachmentObject( "hold_L" ); - // AnimationHelper.Handedness = CitizenAnimationHelper.Hand.Left; - // break; - // default: - // go.Parent = Renderer.GetAttachmentObject( "forward_reference_modelspace" ); - // break; - // } - switch ( item.Definition.Slot ) + if ( item.Definition.Prefab.IsValid() ) { - case Inventar.InventorySlot.LeftHand | Inventar.InventorySlot.RightHand: - go.Parent = Renderer.GetAttachmentObject( "hold_R" ); - break; - case Inventar.InventorySlot.RightHand: - go.Parent = Renderer.GetAttachmentObject( "hold_R" ); - break; - case Inventar.InventorySlot.LeftHand: - go.Parent = Renderer.GetAttachmentObject( "hold_L" ); - break; - default: - go.Parent = Renderer.GetAttachmentObject( "forward_reference_modelspace" ); - break; + var go = item.Definition.Prefab.Clone(); + + AnimationHelper.HoldType = item.Definition.HoldType; + + switch ( item.Definition.Slot ) + { + case Inventar.InventorySlot.LeftHand | Inventar.InventorySlot.RightHand: + go.Parent = Renderer.GetAttachmentObject( "hold_R" ); + break; + case Inventar.InventorySlot.RightHand: + go.Parent = Renderer.GetAttachmentObject( "hold_R" ); + break; + case Inventar.InventorySlot.LeftHand: + go.Parent = Renderer.GetAttachmentObject( "hold_L" ); + break; + default: + go.Parent = Renderer.GetAttachmentObject( "forward_reference_modelspace" ); + break; + } + + go.LocalPosition = item.Definition.WeaponDefinition.Position; + go.LocalRotation = item.Definition.WeaponDefinition.Rotation; + + go.NetworkSpawn(); + + var hand = item.Definition.Slot switch + { + Inventar.InventorySlot.LeftHand => CitizenAnimationHelper.Hand.Left, + Inventar.InventorySlot.RightHand => CitizenAnimationHelper.Hand.Right, + Inventar.InventorySlot.LeftHand | Inventar.InventorySlot.RightHand => CitizenAnimationHelper.Hand.Both, + _ => CitizenAnimationHelper.Hand.Both + }; + + AnimationHelper.HoldType = item.Definition.HoldType; + AnimationHelper.Handedness = hand; + + RpcSetHoldAnimation( item.Definition.HoldType, hand ); + + InAds = true; + // item.SpawnedObject = go; } - - go.LocalPosition = item.Definition.WeaponDefinition.Position; - go.LocalRotation = item.Definition.WeaponDefinition.Rotation; - - go.NetworkSpawn(); - - var hand = item.Definition.Slot switch + else { - Inventar.InventorySlot.LeftHand => CitizenAnimationHelper.Hand.Left, - Inventar.InventorySlot.RightHand => CitizenAnimationHelper.Hand.Right, - Inventar.InventorySlot.LeftHand | Inventar.InventorySlot.RightHand => CitizenAnimationHelper.Hand.Both, - _ => CitizenAnimationHelper.Hand.Both - }; - - AnimationHelper.HoldType = item.Definition.HoldType; - AnimationHelper.Handedness = hand; - - RpcSetHoldAnimation( item.Definition.HoldType, hand ); - - InAds = true; - // item.SpawnedObject = go; + WearWorkshop( new List() { item.Definition.ClothUrl } ); + } } private void OnItemUnEquipped( InventoryItem item ) { - switch ( item.Definition.Slot ) + if ( item.Definition.Prefab.IsValid() ) { - case Inventar.InventorySlot.LeftHand | Inventar.InventorySlot.RightHand: - case Inventar.InventorySlot.RightHand: - case Inventar.InventorySlot.LeftHand: - var attachmentName = !item.Definition.Slot.HasFlag( Inventar.InventorySlot.RightHand ) - ? "hold_L" - : "hold_R"; + switch ( item.Definition.Slot ) + { + case Inventar.InventorySlot.LeftHand | Inventar.InventorySlot.RightHand: + case Inventar.InventorySlot.RightHand: + case Inventar.InventorySlot.LeftHand: + var attachmentName = !item.Definition.Slot.HasFlag( Inventar.InventorySlot.RightHand ) + ? "hold_L" + : "hold_R"; - Renderer.GetAttachmentObject( attachmentName ).Children.ForEach( child => child.Destroy() ); - // AnimationHelper.Handedness = CitizenAnimationHelper.Hand.Both; - // AnimationHelper.HoldType = CitizenAnimationHelper.HoldTypes.None; + Renderer.GetAttachmentObject( attachmentName ).Children.ForEach( child => child.Destroy() ); + // AnimationHelper.Handedness = CitizenAnimationHelper.Hand.Both; + // AnimationHelper.HoldType = CitizenAnimationHelper.HoldTypes.None; - RpcSetHoldAnimation( CitizenAnimationHelper.HoldTypes.None, CitizenAnimationHelper.Hand.Both ); - break; - default: - Renderer.GetAttachmentObject( "forward_reference_modelspace" ).Children - .ForEach( child => child.Destroy() ); - break; + RpcSetHoldAnimation( CitizenAnimationHelper.HoldTypes.None, CitizenAnimationHelper.Hand.Both ); + break; + default: + Renderer.GetAttachmentObject( "forward_reference_modelspace" ).Children + .ForEach( child => child.Destroy() ); + break; + } + + // item.SpawnedObject = null; + item.Destroy(); + + InAds = false; + } + else + { + Log.Info( "STRIPPIN" ); + StripByName( item.Definition.Name ); } - - // item.SpawnedObject = null; - item.Destroy(); - - InAds = false; } [Rpc.Broadcast] diff --git a/Code/Player/Dedugan.Player.cs b/Code/Player/Dedugan.Player.cs index 03f8c5b..1b235ca 100644 --- a/Code/Player/Dedugan.Player.cs +++ b/Code/Player/Dedugan.Player.cs @@ -76,12 +76,11 @@ partial class Dedugan CurrentClothing.Clothing.RemoveAll( entry => !allowedCategories.Contains( entry.Clothing.Category ) ); CurrentClothing.Apply( Renderer ); - - WearWorkshop( WorkshopItems ); } CancellationTokenSource _cts; + [Rpc.Broadcast] public async void WearWorkshop( List workshopItems ) { _cts = new CancellationTokenSource(); @@ -108,11 +107,24 @@ partial class Dedugan CurrentClothing.Normalize(); CurrentClothing.Apply( Renderer ); Renderer.PostAnimationUpdate(); + } - // foreach ( var clothing in CurrentClothing.Clothing ) - // { - // Log.Info( clothing.Clothing.Title ); - // } + [Rpc.Broadcast] + public void StripByName( string name ) + { + CurrentClothing.Clothing.RemoveAll( entry => entry.Clothing.Title == name ); + + CurrentClothing.Normalize(); + CurrentClothing.Apply( Renderer ); + Renderer.PostAnimationUpdate(); + } + + + public void CancelDressing() + { + _cts?.Cancel(); + _cts?.Dispose(); + _cts = default; } diff --git a/Code/Player/RagdollController.cs b/Code/Player/RagdollController.cs index fbec183..6044c2d 100644 --- a/Code/Player/RagdollController.cs +++ b/Code/Player/RagdollController.cs @@ -11,6 +11,8 @@ public sealed class RagdollController : Component [Group( "Config" ), Order( 0 ), Property] public bool isLocked { get; set; } + public float size { get; set; } + [Sync] public new bool Enabled { @@ -27,10 +29,11 @@ public sealed class RagdollController : Component if ( !value ) { + // size = bodyRenderer.Parameters.GetFloat( "scale_height" ); WorldPosition = bodyRenderer.WorldPosition; bodyRenderer.LocalPosition = Vector3.Zero; - bodyRenderer.ClearParameters(); + // bodyRenderer.ClearParameters(); bodyRenderer.ClearPhysicsBones(); } } @@ -60,7 +63,7 @@ public sealed class RagdollController : Component bodyLock.X = isLocked; bodyLock.Y = isLocked; bodyLock.Z = isLocked; - + bodyPhysics.Locking = bodyLock; bodyPhysics.MotionEnabled = !isLocked; WorldPosition = bodyRenderer.WorldPosition; diff --git a/sasalka.sln.DotSettings.user b/sasalka.sln.DotSettings.user index cc5e309..88ba20c 100644 --- a/sasalka.sln.DotSettings.user +++ b/sasalka.sln.DotSettings.user @@ -11,6 +11,7 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded