Преглед на файлове

[SugarCube] Add `OutfitShops`

Stephan Fuchs преди 2 месеца
родител
ревизия
be75a7fe5a
променени са 1 файла, в които са добавени 34 реда и са изтрити 0 реда
  1. 34 0
      qsrc2tw/twine-code/core/wardrobe/OutfitShops.ts

+ 34 - 0
qsrc2tw/twine-code/core/wardrobe/OutfitShops.ts

@@ -0,0 +1,34 @@
+let defaultOutfitImageFunction = (id:string) =>{
+	const idParts = id.split('_');
+	const shop = idParts[0];
+	const type = idParts[1];
+	const index= idParts[2];
+
+	return `pc/items/${shop}/${type}/${index}.jpg`;
+};
+
+setup.outfitShop ??= {};
+setup.outfitShop['allure'] = {
+	outfitItems:{
+		image: (id:string)=>{
+			const idParts = id.split('_');
+			if(idParts.length != 4)
+				return undefined;
+			if(idParts[1] == "swim"){
+				if(idParts[2] == "one"){
+					const index = idParts[3];
+					return `pc/items/allure/one/${index}.jpg`;
+				}
+			}
+
+		}
+	}
+};
+
+for(const shopId of ['danilovich','gm']){
+	setup.outfitShop[shopId] = {
+		outfitItems:{
+			image: defaultOutfitImageFunction
+		}
+	};
+}