diff --git a/Assets/Items/Cloth/3dglasses.clitem b/Assets/Items/Cloth/3dglasses.clitem index a404882..aa65fe1 100644 --- a/Assets/Items/Cloth/3dglasses.clitem +++ b/Assets/Items/Cloth/3dglasses.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "bugulma/3dglasses", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "3D Glasses", "Description": "3dglasses", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/bugulma/3dglasses/thumb/9f61b3b4-74cb-4eb5-9ec8-eb399c7c9c7d.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/arrowthroughhead.clitem b/Assets/Items/Cloth/arrowthroughhead.clitem index 0a19094..2072241 100644 --- a/Assets/Items/Cloth/arrowthroughhead.clitem +++ b/Assets/Items/Cloth/arrowthroughhead.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "microfivetwotwo/arrowthroughhead", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Arrow through head", "Description": "arrowthroughhead", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/microfivetwotwo.arrowthroughhead/thumb.png.84ad8ab39e94fb7f", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/aviatorsunglasses.clitem b/Assets/Items/Cloth/aviatorsunglasses.clitem index f78a2de..6c4ae3c 100644 --- a/Assets/Items/Cloth/aviatorsunglasses.clitem +++ b/Assets/Items/Cloth/aviatorsunglasses.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "bugulma/aviatorsunglasses", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Aviator Sunglasses", "Description": "aviatorsunglasses", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/bugulma/aviatorsunglasses/thumb/af7f9115-c03a-411f-84d9-364c21a3a88a.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/axolotlhat.clitem b/Assets/Items/Cloth/axolotlhat.clitem index ed1796d..1bca285 100644 --- a/Assets/Items/Cloth/axolotlhat.clitem +++ b/Assets/Items/Cloth/axolotlhat.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "gbonn/axolotlhat", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Axolotl Hat", "Description": "axolotlhat", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/gbonn.axolotlhat/thumb.png.6904ffacd460d7ac", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/balaclavanoholesblack.clitem b/Assets/Items/Cloth/balaclavanoholesblack.clitem index 6e54068..6b2840b 100644 --- a/Assets/Items/Cloth/balaclavanoholesblack.clitem +++ b/Assets/Items/Cloth/balaclavanoholesblack.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/balaclavanoholesblack", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Balaclava Noholes Black", "Description": "balaclavanoholesblack", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/balaclavanoholesblack/thumb/718ab42d-4149-4533-ada2-7c1f22fe138d.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/ballisticmaskv1.clitem b/Assets/Items/Cloth/ballisticmaskv1.clitem index 00a7edf..13567e1 100644 --- a/Assets/Items/Cloth/ballisticmaskv1.clitem +++ b/Assets/Items/Cloth/ballisticmaskv1.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/ballisticmaskv1", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Ballistic Mask - Slightly Worn", "Description": "ballisticmaskv1", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/ballisticmaskv1/thumb/4a6d7662-29b0-4f0c-a6ed-90b2905116dd.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/bunnyears.clitem b/Assets/Items/Cloth/bunnyears.clitem index 6e8ae3a..789f64f 100644 --- a/Assets/Items/Cloth/bunnyears.clitem +++ b/Assets/Items/Cloth/bunnyears.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "neil/bunnyears", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Bunny Ears", "Description": "bunnyears", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/neil.bunnyears/thumb.png.3fc91cf542b0f276", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/classicbasketballsneakers.clitem b/Assets/Items/Cloth/classicbasketballsneakers.clitem index 2fce088..ace49e7 100644 --- a/Assets/Items/Cloth/classicbasketballsneakers.clitem +++ b/Assets/Items/Cloth/classicbasketballsneakers.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "microfivetwotwo/classicbasketballsneakers", - "Slot": "Body", + "Slot": "Feet", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Classic Basketball Sneakers", "Description": "classicbasketballsneakers", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/microfivetwotwo.classicbasketballsneakers/thumb.png.5e316a9db5ed8a1d", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/cleaningglovesv1.clitem b/Assets/Items/Cloth/cleaningglovesv1.clitem index da30175..aee4995 100644 --- a/Assets/Items/Cloth/cleaningglovesv1.clitem +++ b/Assets/Items/Cloth/cleaningglovesv1.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/cleaningglovesv1", - "Slot": "Body", + "Slot": "Hands", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Cleaning Gloves 2 tone", "Description": "cleaningglovesv1", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/cleaningglovesv1/thumb/3bcc1fb8-b7ba-47d4-a7e3-6a61243bb15a.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/cleaningglovesv2.clitem b/Assets/Items/Cloth/cleaningglovesv2.clitem index 1d70692..aa95e76 100644 --- a/Assets/Items/Cloth/cleaningglovesv2.clitem +++ b/Assets/Items/Cloth/cleaningglovesv2.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/cleaningglovesv2", - "Slot": "Body", + "Slot": "Hands", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Black Cleaning Gloves", "Description": "cleaningglovesv2", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/cleaningglovesv2/thumb/d0ecb094-4931-4619-be25-3628711b9431.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/cyberpunkglasses.clitem b/Assets/Items/Cloth/cyberpunkglasses.clitem index fcb9d4c..0e63831 100644 --- a/Assets/Items/Cloth/cyberpunkglasses.clitem +++ b/Assets/Items/Cloth/cyberpunkglasses.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "jammie/cyberpunkglasses", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Cyberpunk Glasses", "Description": "cyberpunkglasses", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/jammie.cyberpunkglasses/thumb.png.ac1dde3ce46a63e8", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/denimshorts.clitem b/Assets/Items/Cloth/denimshorts.clitem index 643edfa..d3c8b6f 100644 --- a/Assets/Items/Cloth/denimshorts.clitem +++ b/Assets/Items/Cloth/denimshorts.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "doubletrouble/denimshorts", - "Slot": "Body", + "Slot": "Bottom", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Denim Shorts", "Description": "denimshorts", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/doubletrouble/denimshorts/thumb/6eb2b1e4-d5cc-4afb-8482-ef4b3c049727.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/devilhorns.clitem b/Assets/Items/Cloth/devilhorns.clitem index b817177..0da3695 100644 --- a/Assets/Items/Cloth/devilhorns.clitem +++ b/Assets/Items/Cloth/devilhorns.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "zedskipper/devilhorns", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Devil Horns", "Description": "devilhorns", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/zedskipper.devilhorns/thumb.png.6d4a8cdf9b857a8f", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/doubletophat.clitem b/Assets/Items/Cloth/doubletophat.clitem index 979594b..33bc47c 100644 --- a/Assets/Items/Cloth/doubletophat.clitem +++ b/Assets/Items/Cloth/doubletophat.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "gbonn/doubletophat", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Double Top Hat", "Description": "doubletophat", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/gbonn.doubletophat/thumb.png.b7cf66efffe14d5f", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/duckhat.clitem b/Assets/Items/Cloth/duckhat.clitem index 697187e..ce7f4e0 100644 --- a/Assets/Items/Cloth/duckhat.clitem +++ b/Assets/Items/Cloth/duckhat.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/duckhat", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Duck Hat", "Description": "duckhat", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/duckhat/thumb/1588b283-19e0-4982-a421-f90068fa688c.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/firefighter_helmet_top.clitem b/Assets/Items/Cloth/firefighter_helmet_top.clitem index 4ff2885..c3eefc4 100644 --- a/Assets/Items/Cloth/firefighter_helmet_top.clitem +++ b/Assets/Items/Cloth/firefighter_helmet_top.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "zedskipper/firefighter_helmet_top", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Firefighter Helmet", "Description": "firefighterhelmettop", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/zedskipper.firefighter_helmet_top/thumb.png.ce6459e8d15f4efa", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/fluffyslippers.clitem b/Assets/Items/Cloth/fluffyslippers.clitem index c9f761e..3c8e3e0 100644 --- a/Assets/Items/Cloth/fluffyslippers.clitem +++ b/Assets/Items/Cloth/fluffyslippers.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "shadb/fluffyslippers", - "Slot": "Body", + "Slot": "Feet", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Fluffy Slippers", "Description": "fluffyslippers", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/shadb.fluffyslippers/thumb.png.74097a2166abfb5", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/froghatv1.clitem b/Assets/Items/Cloth/froghatv1.clitem index c675f48..1a17b7b 100644 --- a/Assets/Items/Cloth/froghatv1.clitem +++ b/Assets/Items/Cloth/froghatv1.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/froghatv1", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Frog Bucket Hat", "Description": "froghatv1", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/froghatv1/thumb/84c3fed2-376c-49bc-a54e-3c8ba00f5530.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/goathorns.clitem b/Assets/Items/Cloth/goathorns.clitem index 1a5da92..3d7b418 100644 --- a/Assets/Items/Cloth/goathorns.clitem +++ b/Assets/Items/Cloth/goathorns.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "stellawisps/goathorns", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Horns", "Description": "goathorns", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/stellawisps.goathorns/thumb.png.f0af53d423adb315", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/hatjester.clitem b/Assets/Items/Cloth/hatjester.clitem index 8ed0908..3b89c11 100644 --- a/Assets/Items/Cloth/hatjester.clitem +++ b/Assets/Items/Cloth/hatjester.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "lakrin/hatjester", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Jester Hat", "Description": "hatjester", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/lakrin.hatjester/thumb.png.12c08519ee16b454", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/hockeymask.clitem b/Assets/Items/Cloth/hockeymask.clitem index 4527171..5b37764 100644 --- a/Assets/Items/Cloth/hockeymask.clitem +++ b/Assets/Items/Cloth/hockeymask.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "doubletrouble/hockeymask", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Hockey Mask", "Description": "hockeymask", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/doubletrouble.hockeymask/thumb.png.a188f9176597da70", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/homberg_hat.clitem b/Assets/Items/Cloth/homberg_hat.clitem index 5ee85e6..aaa9d4d 100644 --- a/Assets/Items/Cloth/homberg_hat.clitem +++ b/Assets/Items/Cloth/homberg_hat.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "zontax/homberg_hat", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Homberg Hat", "Description": "homberghat", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/zontax.homberg_hat/thumb.png.e9ed7f1952377c22", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/looseblackpants.clitem b/Assets/Items/Cloth/looseblackpants.clitem index 3854428..59049f9 100644 --- a/Assets/Items/Cloth/looseblackpants.clitem +++ b/Assets/Items/Cloth/looseblackpants.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/looseblackpants", - "Slot": "Body", + "Slot": "Bottom", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Loose Black Pants", "Description": "looseblackpants", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/looseblackpants/thumb/28653368-fde8-4b09-9adf-591f46afbb3c.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/loosebrownpants.clitem b/Assets/Items/Cloth/loosebrownpants.clitem index 7941b65..b0e7c89 100644 --- a/Assets/Items/Cloth/loosebrownpants.clitem +++ b/Assets/Items/Cloth/loosebrownpants.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/loosebrownpants", - "Slot": "Body", + "Slot": "Bottom", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Loose Brown Pants", "Description": "loosebrownpants", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/loosebrownpants/thumb/34fed9c3-d279-4608-8dd4-1f1dedca188e.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/melonhelmet.clitem b/Assets/Items/Cloth/melonhelmet.clitem index 7470150..926b6cd 100644 --- a/Assets/Items/Cloth/melonhelmet.clitem +++ b/Assets/Items/Cloth/melonhelmet.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "gbonn/melonhelmet", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Melon Helmet", "Description": "melonhelmet", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/gbonn.melonhelmet/thumb.png.f4b3ec8c275076c3", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/nvg.clitem b/Assets/Items/Cloth/nvg.clitem index 8864527..b4224ac 100644 --- a/Assets/Items/Cloth/nvg.clitem +++ b/Assets/Items/Cloth/nvg.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "bugulma/nvg", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Night-vision Goggles", "Description": "nvg", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/bugulma/nvg/thumb/6c78edae-06ee-48b9-aa5b-4f751187a155.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/piratehat.clitem b/Assets/Items/Cloth/piratehat.clitem index 22312e4..9afb2eb 100644 --- a/Assets/Items/Cloth/piratehat.clitem +++ b/Assets/Items/Cloth/piratehat.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "zedskipper/piratehat", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Pirate Hat", "Description": "piratehat", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/zedskipper.piratehat/thumb.png.4dc0302e00f6fbd7", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/propanetankhelm.clitem b/Assets/Items/Cloth/propanetankhelm.clitem index 929e986..7f29ab4 100644 --- a/Assets/Items/Cloth/propanetankhelm.clitem +++ b/Assets/Items/Cloth/propanetankhelm.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "ducksworkshop/propanetankhelm", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Propane Tank Helm", "Description": "propanetankhelm", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/propanetankhelm/thumb/f3f94d9c-0782-4f8a-9fbf-9c0c66e099bc.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/propellerhat.clitem b/Assets/Items/Cloth/propellerhat.clitem index 7b31cb6..7031181 100644 --- a/Assets/Items/Cloth/propellerhat.clitem +++ b/Assets/Items/Cloth/propellerhat.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "gbonn/propellerhat", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Propeller Hat", "Description": "propellerhat", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/gbonn.propellerhat/thumb.png.39d839fc687bb529", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/pyjamabottoms.clitem b/Assets/Items/Cloth/pyjamabottoms.clitem index 3c73544..1dd7dd1 100644 --- a/Assets/Items/Cloth/pyjamabottoms.clitem +++ b/Assets/Items/Cloth/pyjamabottoms.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "pukes/pyjamabottoms", - "Slot": "Body", + "Slot": "Bottom", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Pyjama Bottoms", "Description": "pyjamabottoms", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/pukes.pyjamabottoms/thumb.png.2c4ce23bebd09859", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/rangerhelmet.clitem b/Assets/Items/Cloth/rangerhelmet.clitem index 9dd9869..add079a 100644 --- a/Assets/Items/Cloth/rangerhelmet.clitem +++ b/Assets/Items/Cloth/rangerhelmet.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "bulldog/rangerhelmet", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Ranger Helmet", "Description": "rangerhelmet", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/bulldog.rangerhelmet/thumb.png.72fd06137d4691df", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/retrotechracerhelmet.clitem b/Assets/Items/Cloth/retrotechracerhelmet.clitem index f69b2dd..4d90233 100644 --- a/Assets/Items/Cloth/retrotechracerhelmet.clitem +++ b/Assets/Items/Cloth/retrotechracerhelmet.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "microfivetwotwo/retrotechracerhelmet", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Retrotech Racer Helmet", "Description": "retrotechracerhelmet", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/microfivetwotwo.retrotechracerhelmet/thumb.png.6debe4873184c136", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/safetyglasses.clitem b/Assets/Items/Cloth/safetyglasses.clitem index c50d15d..fa91801 100644 --- a/Assets/Items/Cloth/safetyglasses.clitem +++ b/Assets/Items/Cloth/safetyglasses.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "gkaf/safetyglasses", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Safety Glasses", "Description": "safetyglasses", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/gkaf.safetyglasses/thumb.png.4930fdfd9dcd705c", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/sfsocks.clitem b/Assets/Items/Cloth/sfsocks.clitem index 75d6e0d..a050d60 100644 --- a/Assets/Items/Cloth/sfsocks.clitem +++ b/Assets/Items/Cloth/sfsocks.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "luke/sfsocks", - "Slot": "Body", + "Slot": "Bottom", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Smallfish Socks", "Description": "sfsocks", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/luke.sfsocks/thumb.png.1afb82a849d2f8d3", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/sharkhead.clitem b/Assets/Items/Cloth/sharkhead.clitem index 42dd5d5..263a96d 100644 --- a/Assets/Items/Cloth/sharkhead.clitem +++ b/Assets/Items/Cloth/sharkhead.clitem @@ -1,6 +1,10 @@ { "ClothUrl": "shadb/sharkhead", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "BodyPart": "", + "Category": "Clothing", "Name": "Shark Head", "Description": "sharkhead", "Prefab": { @@ -10,6 +14,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/shadb.sharkhead/thumb.png.cda75d69b325a050", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/skibidilid.clitem b/Assets/Items/Cloth/skibidilid.clitem index d0c31ac..a18ada7 100644 --- a/Assets/Items/Cloth/skibidilid.clitem +++ b/Assets/Items/Cloth/skibidilid.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "microfivetwotwo/skibidilid", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Skibidi Lid", "Description": "skibidilid", "Prefab": { @@ -10,6 +13,10 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/microfivetwotwo.skibidilid/thumb.png.c7d32555cfd3eb63", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsStackable": false, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/skihelmetgreen.clitem b/Assets/Items/Cloth/skihelmetgreen.clitem index dab9b55..c5a39f5 100644 --- a/Assets/Items/Cloth/skihelmetgreen.clitem +++ b/Assets/Items/Cloth/skihelmetgreen.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "ducksworkshop/skihelmetgreen", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Ski Helmet Green", "Description": "skihelmetgreen", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/skihelmetgreen/thumb/9fb0468b-fa48-4c39-a80c-870d91293046.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/sleepmask.clitem b/Assets/Items/Cloth/sleepmask.clitem index 47a66df..d9ef0b4 100644 --- a/Assets/Items/Cloth/sleepmask.clitem +++ b/Assets/Items/Cloth/sleepmask.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "pukes/sleepmask", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Sleep Mask", "Description": "sleepmask", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/pukes.sleepmask/thumb.png.b87686ad5d97c35a", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/snowgoggles.clitem b/Assets/Items/Cloth/snowgoggles.clitem index 5e10099..db959c3 100644 --- a/Assets/Items/Cloth/snowgoggles.clitem +++ b/Assets/Items/Cloth/snowgoggles.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "jammie/snowgoggles", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Snow Goggles", "Description": "snowgoggles", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/jammie.snowgoggles/thumb.png.2fe4662e72e3ea5f", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/sunglasseswithanimatedlenses.clitem b/Assets/Items/Cloth/sunglasseswithanimatedlenses.clitem index 30b0b74..bd7bd3a 100644 --- a/Assets/Items/Cloth/sunglasseswithanimatedlenses.clitem +++ b/Assets/Items/Cloth/sunglasseswithanimatedlenses.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "microfivetwotwo/sunglasseswithanimatedlenses", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Jackpot Animated Sunglasses", "Description": "sunglasseswithanimatedlenses", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/microfivetwotwo.sunglasseswithanimatedlenses/thumb.png.4cd0e084b475da06", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/thugglasses.clitem b/Assets/Items/Cloth/thugglasses.clitem index 36f4a12..7a1d35a 100644 --- a/Assets/Items/Cloth/thugglasses.clitem +++ b/Assets/Items/Cloth/thugglasses.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "fanlab/thugglasses", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Thug Glasses", "Description": "thugglasses", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/fanlab.thugglasses/thumb.png.16669a12b1e62af3", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/trafficcone.clitem b/Assets/Items/Cloth/trafficcone.clitem index f346d87..b4a3f3e 100644 --- a/Assets/Items/Cloth/trafficcone.clitem +++ b/Assets/Items/Cloth/trafficcone.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "gbonn/trafficcone", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Traffic Cone", "Description": "trafficcone", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/gbonn.trafficcone/thumb.png.a97a7cac4a8e8918", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/weldinggogglesvisorup.clitem b/Assets/Items/Cloth/weldinggogglesvisorup.clitem index a316685..03baa9d 100644 --- a/Assets/Items/Cloth/weldinggogglesvisorup.clitem +++ b/Assets/Items/Cloth/weldinggogglesvisorup.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "ducksworkshop/weldinggogglesvisorup", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Welding Goggles Visor Up", "Description": "weldinggogglesvisorup", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/ducksworkshop/weldinggogglesvisorup/thumb/ff7a517b-ded4-49e6-b777-696e6a6b8f0b.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/wizardhat.clitem b/Assets/Items/Cloth/wizardhat.clitem index cd37825..bd7a0a6 100644 --- a/Assets/Items/Cloth/wizardhat.clitem +++ b/Assets/Items/Cloth/wizardhat.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "shadb/wizardhat", - "Slot": "Body", + "Slot": "Head", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "Wizard Hat", "Description": "wizardhat", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/asset/shadb.wizardhat/thumb.png.e1eed67e9d79abca", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Assets/Items/Cloth/xvioutfit.clitem b/Assets/Items/Cloth/xvioutfit.clitem index 26d4473..84b5020 100644 --- a/Assets/Items/Cloth/xvioutfit.clitem +++ b/Assets/Items/Cloth/xvioutfit.clitem @@ -1,6 +1,9 @@ { "ClothUrl": "edgyvoxel/xvioutfit", - "Slot": "Body", + "Slot": "Body, Bottom", + "ArmorValue": 0, + "IsVisible": true, + "Category": "Clothing", "Name": "17th Outfit", "Description": "xvioutfit", "Prefab": { @@ -10,6 +13,9 @@ "ImageTexture": null, "ImageUrl": "https://cdn.sbox.game/org/edgyvoxel/xvioutfit/thumb/648dca1c-4b2a-4b9f-bdd2-bca374536455.png", "MaxCount": 1, + "Rarity": "Common", + "Weight": 1, + "IsEquipable": true, "__references": [], "__version": 0 } \ No newline at end of file diff --git a/Code/Inventory/Definitions/BaseItemDefinition.cs b/Code/Inventory/Definitions/BaseItemDefinition.cs index aac2321..19fdad5 100644 --- a/Code/Inventory/Definitions/BaseItemDefinition.cs +++ b/Code/Inventory/Definitions/BaseItemDefinition.cs @@ -19,49 +19,40 @@ public enum ItemRarity Legendary } -[GameResource("Base Item Definition", "inv", "", Category = "Sasalka", Icon = "inventory_2")] +[GameResource( "Base Item Definition", "inv", "", Category = "Sasalka", Icon = "inventory_2" )] public class BaseItemDefinition : GameResource { - [Property, Title("Basic Info")] - public string Name { get; set; } = "Unknown Item"; + [Property, Title( "Basic Info" )] public string Name { get; set; } = "Unknown Item"; - [Property] - public string Description { get; set; } = ""; + [Property] public string Description { get; set; } = ""; - [Property, Category("Visual")] - [ResourceType("prefab")] - public GameObject Prefab { get; set; } = GameObject.GetPrefab("prefabs/item_parcel.prefab"); + [Property, Category( "Visual" )] + [ResourceType( "prefab" )] + public GameObject Prefab { get; set; } = GameObject.GetPrefab( "prefabs/item_parcel.prefab" ); - [Property, Category("Visual")] - public Texture ImageTexture { get; set; } + [Property, Category( "Visual" )] public Texture ImageTexture { get; set; } - [Property, Category("Visual")] - public string ImageUrl { get; set; } + [Property, Category( "Visual" )] public string ImageUrl { get; set; } - [Property, Category("Properties")] - [Range(1, 1000)] + [Property, Category( "Properties" )] + [Range( 1, 1000 )] public int MaxCount { get; set; } = 1; - [Property, Category("Properties")] - public virtual ItemCategory Category { get; set; } = ItemCategory.Misc; + [Property, Category( "Properties" )] public virtual ItemCategory Category { get; set; } = ItemCategory.Misc; - [Property, Category("Properties")] - public ItemRarity Rarity { get; set; } = ItemRarity.Common; + [Property, Category( "Properties" )] public ItemRarity Rarity { get; set; } = ItemRarity.Common; - [Property, Category("Properties")] - public float Weight { get; set; } = 1.0f; + [Property, Category( "Properties" )] public float Weight { get; set; } = 1.0f; - [Property, Category("Properties")] - public bool IsStackable => MaxCount > 1; + [Property, Category( "Properties" )] public bool IsStackable = false; - [Property, Category("Properties")] - public bool IsEquipable => this is IEquipable; + [Property, Category( "Properties" )] public bool IsEquipable => this is IEquipable; public virtual Inventar.InventorySlot? GetSlot() => null; public virtual bool CanUse() => false; - public virtual void OnUse(InventoryItem item) { } + public virtual void OnUse( InventoryItem item ) { } public string GetRarityColor() { diff --git a/Code/Inventory/Definitions/ClothingItemDefinition.cs b/Code/Inventory/Definitions/ClothingItemDefinition.cs index 303d0c9..acf1d39 100644 --- a/Code/Inventory/Definitions/ClothingItemDefinition.cs +++ b/Code/Inventory/Definitions/ClothingItemDefinition.cs @@ -15,8 +15,8 @@ public class ClothingItemDefinition : BaseItemDefinition, IEquipable [Property, Category( "Clothing Properties" )] public bool IsVisible { get; set; } = true; - [Property, Category( "Clothing Properties" )] - public string BodyPart { get; set; } = ""; + // [Property, Category( "Clothing Properties" )] + // public string BodyPart { get; set; } = ""; public override Inventar.InventorySlot? GetSlot() => Slot; diff --git a/Code/Inventory/Inventar.cs b/Code/Inventory/Inventar.cs index 2fe8d68..177d597 100644 --- a/Code/Inventory/Inventar.cs +++ b/Code/Inventory/Inventar.cs @@ -38,15 +38,23 @@ public class Inventar : Component public event Action OnItemAdded; public event Action OnItemRemoved; + // Кэш для оптимизации поиска предметов + private Dictionary _itemCache = new(); + private bool _cacheDirty = true; + public bool CanAddItem( InventoryItem item ) { if ( item == null || item.Definition == null ) return false; - // Проверяем, есть ли уже такой предмет в инвентаре - var existingItem = Items.FirstOrDefault( x => x.Definition == item.Definition ); + // Обновляем кэш при необходимости + if ( _cacheDirty ) + { + UpdateItemCache(); + } - if ( existingItem != null ) + // Проверяем, есть ли уже такой предмет в инвентаре + if ( _itemCache.TryGetValue( item.Definition, out var existingItem ) ) { // Если предмет уже есть, проверяем, можно ли добавить к нему количество return existingItem.Count + item.Count <= item.Definition.MaxCount; @@ -62,6 +70,22 @@ public class Inventar : Component return item.Count <= item.Definition.MaxCount; } + /// + /// Обновляет кэш предметов + /// + private void UpdateItemCache() + { + _itemCache.Clear(); + foreach ( var item in Items ) + { + if ( item.Definition != null ) + { + _itemCache[item.Definition] = item; + } + } + _cacheDirty = false; + } + /// /// Добавляет предмет в инвентарь, распределяя по существующим и новым стекам. Возвращает остаток, который не удалось добавить (или 0, если всё добавлено). /// @@ -80,6 +104,7 @@ public class Inventar : Component { stack.Count += canAdd; toAdd -= canAdd; + _cacheDirty = true; // Помечаем кэш как устаревший OnChanged?.Invoke(); OnItemAdded?.Invoke( stack ); } @@ -94,6 +119,7 @@ public class Inventar : Component var newStack = new InventoryItem { Definition = item.Definition, Count = stackCount, MagazineAmmo = item.MagazineAmmo }; Items.Add( newStack ); toAdd -= stackCount; + _cacheDirty = true; // Помечаем кэш как устаревший OnChanged?.Invoke(); OnItemAdded?.Invoke( newStack ); } @@ -112,6 +138,7 @@ public class Inventar : Component // Удаляем весь предмет UnEquipItem( item ); Items.Remove( item ); + _cacheDirty = true; // Помечаем кэш как устаревший OnChanged?.Invoke(); OnItemRemoved?.Invoke( item ); return true; @@ -120,6 +147,7 @@ public class Inventar : Component { // Уменьшаем количество item.Count -= count; + _cacheDirty = true; // Помечаем кэш как устаревший OnChanged?.Invoke(); return true; } diff --git a/Code/Player/Dedugan.cs b/Code/Player/Dedugan.cs index 1189da4..b07d392 100644 --- a/Code/Player/Dedugan.cs +++ b/Code/Player/Dedugan.cs @@ -39,6 +39,12 @@ public sealed partial class Dedugan : Component, IUseContext, Component.INetwork private Vector3 _wishDirection; + // Кэш для оптимизации + private bool _isOwner; + private float _lastBodyYaw; + private float _lastCameraYaw; + private bool _bodyRotationDirty = true; + protected override void OnStart() { InventoryStart(); @@ -66,9 +72,12 @@ public sealed partial class Dedugan : Component, IUseContext, Component.INetwork protected override void OnUpdate() { + _isOwner = Network.IsOwner; + UpdateCustomAnimations(); InventoryUpdate(); - if ( Network.IsOwner ) + + if ( _isOwner ) { EyeAngles += Input.AnalogLook; EyeAngles = EyeAngles.WithPitch( MathX.Clamp( EyeAngles.pitch, -89f, 89f ) ); @@ -122,6 +131,21 @@ public sealed partial class Dedugan : Component, IUseContext, Component.INetwork /// private void UpdateBodyRotation() { + var currentBodyYaw = Renderer.LocalRotation.Yaw(); + var currentCameraYaw = EyeAngles.yaw; + + // Проверяем, изменились ли углы + if ( Math.Abs( currentBodyYaw - _lastBodyYaw ) < 0.1f && + Math.Abs( currentCameraYaw - _lastCameraYaw ) < 0.1f && + !_bodyRotationDirty ) + { + return; // Пропускаем обновление, если углы не изменились + } + + _lastBodyYaw = currentBodyYaw; + _lastCameraYaw = currentCameraYaw; + _bodyRotationDirty = false; + var targetRotation = Rotation.LookAt( Rotation.FromYaw( EyeAngles.yaw ).Forward, -_directionToAxis ); var currentForward = Renderer.LocalRotation.Forward; float angleDiff = currentForward.Angle( targetRotation.Forward ); @@ -162,6 +186,7 @@ public sealed partial class Dedugan : Component, IUseContext, Component.INetwork { Renderer.LocalRotation = Rotation.Slerp( Renderer.LocalRotation, Rotation.FromYaw( EyeAngles.yaw ), Time.Delta * 3f ); + _bodyRotationDirty = true; // Помечаем, что тело повернулось } } } diff --git a/Code/Weapons/BaseWeapon.cs b/Code/Weapons/BaseWeapon.cs index 9d9c3ee..9ac7902 100644 --- a/Code/Weapons/BaseWeapon.cs +++ b/Code/Weapons/BaseWeapon.cs @@ -35,6 +35,10 @@ public class BaseWeapon : InventoryItem, IUseable private WeaponItemDefinition _weaponDefinition; private bool _isInitialized; private InventoryItem _inventoryItem; + + // Оптимизация обновлений + private TimeSince _lastEffectsUpdate = 0f; + private const float EFFECTS_UPDATE_INTERVAL = 0.1f; // Обновляем эффекты каждые 100мс // IUseable реализация - Cooldown вычисляется на основе FireRate public float Cooldown @@ -95,8 +99,12 @@ public class BaseWeapon : InventoryItem, IUseable FinishReload(); } - // Обновляем эффекты - UpdateEffects(); + // Обновляем эффекты с интервалом для оптимизации + if ( _lastEffectsUpdate >= EFFECTS_UPDATE_INTERVAL ) + { + UpdateEffects(); + _lastEffectsUpdate = 0f; + } } /// @@ -132,11 +140,16 @@ public class BaseWeapon : InventoryItem, IUseable { base.OnEquipped(); - // Получаем Rigidbody в момент экипировки - _rigidbody = GameObject.Components.Get(); + // Кэшируем Rigidbody при экипировке + if ( _rigidbody == null ) + _rigidbody = GameObject.Components.Get(); + if ( _rigidbody != null ) _rigidbody.Enabled = false; + if ( _pickupItem == null ) + _pickupItem = GameObject.Components.Get(); + if ( _pickupItem != null ) _pickupItem.Enabled = false; } @@ -148,8 +161,7 @@ public class BaseWeapon : InventoryItem, IUseable { base.OnUnEquipped(); - // Получаем Rigidbody в момент снятия - _rigidbody = GameObject.Components.Get(); + // Используем кэшированный Rigidbody if ( _rigidbody != null ) _rigidbody.Enabled = true;