diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java b/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java index 17d957387..83dc1fc7e 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java @@ -13,7 +13,7 @@ public class GachaBanner { @Getter private int gachaType; @Getter private int scheduleId; @Getter private String prefabPath; - @Getter private String previewPrefabPath; + private String previewPrefabPath; @Getter private String titlePath; private int costItemId = 0; private int costItemAmount = 1; @@ -47,6 +47,12 @@ public class GachaBanner { private int costItem = 0; @Getter private int wishMaxProgress = 2; + public String getPreviewPrefabPath() { + if (this.previewPrefabPath != null && !this.previewPrefabPath.isEmpty()) + return this.previewPrefabPath; + return "UI_Tab_" + this.prefabPath; + } + public ItemParamData getCost(int numRolls) { return switch (numRolls) { case 10 -> new ItemParamData((costItemId10 > 0) ? costItemId10 : getCostItem(), costItemAmount10); diff --git a/src/main/resources/defaults/data/Banners.json b/src/main/resources/defaults/data/Banners.json index 09d83215a..eaac49fcc 100644 --- a/src/main/resources/defaults/data/Banners.json +++ b/src/main/resources/defaults/data/Banners.json @@ -5,7 +5,6 @@ "scheduleId": 803, "bannerType": "EVENT", "prefabPath": "GachaShowPanel_A016", - "previewPrefabPath": "UI_Tab_GachaShowPanel_A016", "titlePath": "UI_GACHA_SHOW_PANEL_A016_TITLE", "costItemId": 224, "costItemAmount10": 8, @@ -22,7 +21,6 @@ "scheduleId": 893, "bannerType": "STANDARD", "prefabPath": "GachaShowPanel_A022", - "previewPrefabPath": "UI_Tab_GachaShowPanel_A022", "titlePath": "UI_GACHA_SHOW_PANEL_A022_TITLE", "costItemId": 224, "beginTime": 0, @@ -37,7 +35,6 @@ "scheduleId": 903, "bannerType": "EVENT", "prefabPath": "GachaShowPanel_A091", - "previewPrefabPath": "UI_Tab_GachaShowPanel_A091", "titlePath": "UI_GACHA_SHOW_PANEL_A045_TITLE", "costItemId": 223, "beginTime": 0, @@ -53,7 +50,6 @@ "scheduleId": 923, "bannerType": "EVENT", "prefabPath": "GachaShowPanel_A092", - "previewPrefabPath": "UI_Tab_GachaShowPanel_A092", "titlePath": "UI_GACHA_SHOW_PANEL_A018_TITLE", "costItemId": 223, "beginTime": 0, @@ -70,7 +66,6 @@ "scheduleId": 913, "bannerType": "WEAPON", "prefabPath": "GachaShowPanel_A093", - "previewPrefabPath": "UI_Tab_GachaShowPanel_A093", "titlePath": "UI_GACHA_SHOW_PANEL_A013_TITLE", "costItemId": 223, "beginTime": 0,