Bladeren bron

[SugarCube] Add `OutfitShops`

Stephan Fuchs 2 maanden geleden
bovenliggende
commit
be75a7fe5a
1 gewijzigde bestanden met toevoegingen van 34 en 0 verwijderingen
  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
+		}
+	};
+}