Browse Source

[SugarCube] Add `OutfitShops`

Stephan Fuchs 2 tháng trước cách đây
mục cha
commit
be75a7fe5a
1 tập tin đã thay đổi với 34 bổ sung0 xóa
  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
+		}
+	};
+}