This commit is contained in:
Oscar 2025-06-26 21:12:11 +03:00
parent 8b61aa1d7b
commit 793165bb03
66 changed files with 89 additions and 95 deletions

View File

@ -2,7 +2,7 @@
"ClothUrl": "bugulma/3dglasses",
"Slot": "Body",
"Name": "3D Glasses",
"Description": null,
"Description": "3dglasses",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "microfivetwotwo/arrowthroughhead",
"Slot": "Body",
"Name": "Arrow through head",
"Description": null,
"Description": "arrowthroughhead",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "bugulma/aviatorsunglasses",
"Slot": "Body",
"Name": "Aviator Sunglasses",
"Description": null,
"Description": "aviatorsunglasses",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "gbonn/axolotlhat",
"Slot": "Body",
"Name": "Axolotl Hat",
"Description": null,
"Description": "axolotlhat",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/balaclavanoholesblack",
"Slot": "Body",
"Name": "Balaclava Noholes Black",
"Description": null,
"Description": "balaclavanoholesblack",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/ballisticmaskv1",
"Slot": "Body",
"Name": "Ballistic Mask - Slightly Worn",
"Description": null,
"Description": "ballisticmaskv1",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "neil/bunnyears",
"Slot": "Body",
"Name": "Bunny Ears",
"Description": null,
"Description": "bunnyears",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "microfivetwotwo/classicbasketballsneakers",
"Slot": "Body",
"Name": "Classic Basketball Sneakers",
"Description": null,
"Description": "classicbasketballsneakers",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/cleaningglovesv1",
"Slot": "Body",
"Name": "Cleaning Gloves 2 tone",
"Description": null,
"Description": "cleaningglovesv1",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/cleaningglovesv2",
"Slot": "Body",
"Name": "Black Cleaning Gloves",
"Description": null,
"Description": "cleaningglovesv2",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "jammie/cyberpunkglasses",
"Slot": "Body",
"Name": "Cyberpunk Glasses",
"Description": null,
"Description": "cyberpunkglasses",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "doubletrouble/denimshorts",
"Slot": "Body",
"Name": "Denim Shorts",
"Description": null,
"Description": "denimshorts",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "zedskipper/devilhorns",
"Slot": "Body",
"Name": "Devil Horns",
"Description": null,
"Description": "devilhorns",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "zedskipper/devilwings",
"Slot": "Body",
"Name": "Devil Wings",
"Description": null,
"Description": "devilwings",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "gbonn/doubletophat",
"Slot": "Body",
"Name": "Double Top Hat",
"Description": null,
"Description": "doubletophat",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/duckhat",
"Slot": "Body",
"Name": "Duck Hat",
"Description": null,
"Description": "duckhat",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "zedskipper/firefighter_helmet_top",
"Slot": "Body",
"Name": "Firefighter Helmet",
"Description": null,
"Description": "firefighterhelmettop",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "shadb/fluffyslippers",
"Slot": "Body",
"Name": "Fluffy Slippers",
"Description": null,
"Description": "fluffyslippers",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/froghatv1",
"Slot": "Body",
"Name": "Frog Bucket Hat",
"Description": null,
"Description": "froghatv1",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "stellawisps/goathorns",
"Slot": "Body",
"Name": "Horns",
"Description": null,
"Description": "goathorns",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "lakrin/hatjester",
"Slot": "Body",
"Name": "Jester Hat",
"Description": null,
"Description": "hatjester",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "doubletrouble/hockeymask",
"Slot": "Body",
"Name": "Hockey Mask",
"Description": null,
"Description": "hockeymask",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "zontax/homberg_hat",
"Slot": "Body",
"Name": "Homberg Hat",
"Description": null,
"Description": "homberghat",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "microfivetwotwo/imwithterrytshirt",
"Slot": "Body",
"Name": "I\u0027m with Terry T-Shirt",
"Description": null,
"Description": "imwithterrytshirt",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "bitropy/jetpack",
"Slot": "Body",
"Name": "Jetpack",
"Description": null,
"Description": "jetpack",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "luke/jussipaitajumper",
"Slot": "Body",
"Name": "Jussipaita Jumper",
"Description": null,
"Description": "jussipaitajumper",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/looseblackpants",
"Slot": "Body",
"Name": "Loose Black Pants",
"Description": null,
"Description": "looseblackpants",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/loosebrownpants",
"Slot": "Body",
"Name": "Loose Brown Pants",
"Description": null,
"Description": "loosebrownpants",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "gbonn/melonhelmet",
"Slot": "Body",
"Name": "Melon Helmet",
"Description": null,
"Description": "melonhelmet",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "bugulma/nvg",
"Slot": "Body",
"Name": "Night-vision Goggles",
"Description": null,
"Description": "nvg",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "raf/paperbag",
"Slot": "Body",
"Name": "Paper Bag Mask",
"Description": null,
"Description": "paperbag",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "zedskipper/piratehat",
"Slot": "Body",
"Name": "Pirate Hat",
"Description": null,
"Description": "piratehat",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "edgyvoxel/poncho2",
"Slot": "Body",
"Name": "Western Poncho",
"Description": null,
"Description": "poncho2",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/propanetankhelm",
"Slot": "Body",
"Name": "Propane Tank Helm",
"Description": null,
"Description": "propanetankhelm",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "gbonn/propellerhat",
"Slot": "Body",
"Name": "Propeller Hat",
"Description": null,
"Description": "propellerhat",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "pukes/pyjamabottoms",
"Slot": "Body",
"Name": "Pyjama Bottoms",
"Description": null,
"Description": "pyjamabottoms",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "pukes/pyjamatop",
"Slot": "Body",
"Name": "Pyjama Top",
"Description": null,
"Description": "pyjamatop",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "bulldog/rangerhelmet",
"Slot": "Body",
"Name": "Ranger Helmet",
"Description": null,
"Description": "rangerhelmet",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "microfivetwotwo/reapersuit",
"Slot": "Body",
"Name": "Reaper Suit",
"Description": null,
"Description": "reapersuit",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "microfivetwotwo/retrotechracerhelmet",
"Slot": "Body",
"Name": "Retrotech Racer Helmet",
"Description": null,
"Description": "retrotechracerhelmet",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "gkaf/safetyglasses",
"Slot": "Body",
"Name": "Safety Glasses",
"Description": null,
"Description": "safetyglasses",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "luke/sfsocks",
"Slot": "Body",
"Name": "Smallfish Socks",
"Description": null,
"Description": "sfsocks",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "shadb/sharkhead",
"Slot": "Body",
"Name": "Shark Head",
"Description": null,
"Description": "sharkhead",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "microfivetwotwo/skibidilid",
"Slot": "Body",
"Name": "Skibidi Lid",
"Description": null,
"Description": "skibidilid",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/skihelmet",
"Slot": "Body",
"Name": "Ski Helmet",
"Description": null,
"Description": "skihelmet",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/skihelmetgreen",
"Slot": "Body",
"Name": "Ski Helmet Green",
"Description": null,
"Description": "skihelmetgreen",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "pukes/sleepmask",
"Slot": "Body",
"Name": "Sleep Mask",
"Description": null,
"Description": "sleepmask",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "jammie/snowgoggles",
"Slot": "Body",
"Name": "Snow Goggles",
"Description": null,
"Description": "snowgoggles",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "jammie/snowmitten",
"Slot": "Body",
"Name": "Snow Mitten",
"Description": null,
"Description": "snowmitten",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "saandy/striped_jumper",
"Slot": "Body",
"Name": "Striped Jumper",
"Description": null,
"Description": "stripedjumper",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "microfivetwotwo/sunglasseswithanimatedlenses",
"Slot": "Body",
"Name": "Jackpot Animated Sunglasses",
"Description": null,
"Description": "sunglasseswithanimatedlenses",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "bugulma/teashades",
"Slot": "Body",
"Name": "Teashade Sunglasses",
"Description": null,
"Description": "teashades",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "fanlab/thugglasses",
"Slot": "Body",
"Name": "Thug Glasses",
"Description": null,
"Description": "thugglasses",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "daemoncast/tracktop",
"Slot": "Body",
"Name": "Tracktop",
"Description": null,
"Description": "tracktop",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "gbonn/trafficcone",
"Slot": "Body",
"Name": "Traffic Cone",
"Description": null,
"Description": "trafficcone",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "luke/varsityjacket",
"Slot": "Body",
"Name": "Varsity Jacket",
"Description": null,
"Description": "varsityjacket",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/weldinggogglesvisorup",
"Slot": "Body",
"Name": "Welding Goggles Visor Up",
"Description": null,
"Description": "weldinggogglesvisorup",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/whitetanktop",
"Slot": "Body",
"Name": "White Tank top",
"Description": null,
"Description": "whitetanktop",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "ducksworkshop/whitetanktopspoiled",
"Slot": "Body",
"Name": "Spoiled White Tank Top",
"Description": null,
"Description": "whitetanktopspoiled",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "shadb/wizardhat",
"Slot": "Body",
"Name": "Wizard Hat",
"Description": null,
"Description": "wizardhat",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -2,7 +2,7 @@
"ClothUrl": "edgyvoxel/xvioutfit",
"Slot": "Body",
"Name": "17th Outfit",
"Description": null,
"Description": "xvioutfit",
"Prefab": {
"_type": "gameobject",
"prefab": "prefabs/item_parcel.prefab"

View File

@ -831,7 +831,7 @@
"__version": 1,
"Flags": 0,
"Name": "ClothSpawner",
"Position": "128,0,0",
"Position": "352,80,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",

View File

@ -123,7 +123,7 @@ public sealed partial class Dedugan : Component
}
else if ( item.Definition is ClothingItemDefinition clothingDef )
{
StripByName( clothingDef.Name );
StripByName( clothingDef.Description );
}
}

View File

@ -140,7 +140,12 @@ partial class Dedugan
[Rpc.Broadcast]
public void StripByName( string name )
{
CurrentClothing.Clothing.RemoveAll( entry => entry.Clothing.Title == name );
CurrentClothing.Clothing.RemoveAll( entry =>
{
Log.Info( entry.Clothing.ResourceName.Replace( "_", "" ) );
return entry.Clothing.ResourceName.Replace( "_", "" ).Replace( " ", "" ) == name;
} );
CurrentClothing.Normalize();
CurrentClothing.Apply( Renderer );

View File

@ -3,13 +3,13 @@ using Sasalka;
public sealed class WorlModelClothSpawner : Component
{
[Property] public GameObject Prefab { get; set; }
[Property] public Vector3 CenterPosition { get; set; } = Vector3.Zero;
[Property] public float Spacing { get; set; } = 50.0f;
[Property] public float Height { get; set; } = 0.0f;
protected override void OnStart()
{
if ( !Networking.IsHost ) return;
var definitions = ResourceLibrary.GetAll<ClothingItemDefinition>();
var clothingItemDefinitions = definitions.ToList();
int total = clothingItemDefinitions.Count();
@ -20,40 +20,29 @@ public sealed class WorlModelClothSpawner : Component
return;
}
// Автоматически вычисляем минимальный радиус круга, чтобы вместить все предметы
// Площадь круга: πr², а площадь одного предмета: Spacing²
// Нам нужно чтобы πr² >= total * Spacing² → r >= sqrt(total * Spacing² / π)
float estimatedRadius = MathF.Sqrt( (total * Spacing * Spacing) / MathF.PI );
float radius = estimatedRadius;
// Вычисляем размер стороны квадрата
int itemsPerSide = 10; //Math.CeilToInt( Mathf.Sqrt( total ) );
float halfSize = (itemsPerSide - 1) * Spacing * 0.5f;
Log.Info( $"Auto-calculated radius: {radius}" );
Log.Info( $"Spawning {total} items in {itemsPerSide}x{itemsPerSide} square grid" );
int defIndex = 0;
for ( float x = -radius; x <= radius; x += Spacing )
for ( int i = 0; i < total; i++ )
{
for ( float y = -radius; y <= radius; y += Spacing )
{
if ( defIndex >= total )
break;
// Вычисляем позицию в сетке
int row = i / itemsPerSide;
int col = i % itemsPerSide;
if ( x * x + y * y <= radius * radius )
{
Vector3 pos = CenterPosition + new Vector3( x, y, Height );
float x = col * Spacing - halfSize;
float y = row * Spacing - halfSize;
Vector3 pos = WorldPosition + new Vector3( x, y, Height );
var gO = Prefab.Clone( pos );
gO.NetworkSpawn( null );
var item = gO.Components.Get<InventoryItem>();
if ( item is not null )
item.Definition = clothingItemDefinitions[defIndex];
defIndex++;
}
}
if ( defIndex >= total )
break;
item.Definition = clothingItemDefinitions[i];
}
}
}

View File

@ -11,7 +11,7 @@ public static class UpdateCloths
[Menu( "Editor", "MyClothing/Generate .clitem Files" )]
public static async void GenerateClitemFiles()
{
var packageResult = await Package.FindAsync( "type:clothing", 100 );
var packageResult = await Package.FindAsync( "type:clothing", 500 );
Directory.CreateDirectory( outputFolder );
@ -30,7 +30,7 @@ public static class UpdateCloths
ClothUrl = clothUrl,
Slot = "Body",
Name = package.Title,
Description = package.Description == "" ? package.Ident : package.Description,
Description = package.Ident.Replace( "_", "" ).Replace( " ", "" ),
Prefab = new { _type = "gameobject", prefab = "prefabs/item_parcel.prefab" },
ImageTexture = (string)null,
ImageUrl = imageUrl,