|
@@ -126,12 +126,29 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
|
|
|
}
|
|
|
this.FindNode("NoData").active = false;
|
|
|
let prefab = await AB.ins.loadPrefab("prefab/play/GameTaskItem");
|
|
|
- let layout = this.FindNode("task_layout");
|
|
|
- for (let i = 0; i < taskList.length; i++) {
|
|
|
- let task = taskList[i];
|
|
|
+ let normal_task_layout = this.FindNode("task_layout_normal");
|
|
|
+
|
|
|
+ let normalTaskList = taskList.filter((item) => item.taskType == 1);
|
|
|
+
|
|
|
+ for (let i = 0; i < normalTaskList.length; i++) {
|
|
|
+ let normalTask = normalTaskList[i];
|
|
|
+ let item = instantiate(prefab);
|
|
|
+ item.parent = normal_task_layout;
|
|
|
+ item.getComponent(GameTaskItem).init(this.data.gameId, normalTask, this);
|
|
|
+ }
|
|
|
+
|
|
|
+ let seasonTaskList = taskList.filter((item) => item.taskType == 2);
|
|
|
+ if (seasonTaskList.length == 0) {
|
|
|
+ this.FindNode("lbl_title_task_season").active = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let season_task_layout = this.FindNode("task_layout_season");
|
|
|
+
|
|
|
+ for (let i = 0; i < seasonTaskList.length; i++) {
|
|
|
+ let seasonTask = seasonTaskList[i];
|
|
|
let item = instantiate(prefab);
|
|
|
- item.parent = layout;
|
|
|
- item.getComponent(GameTaskItem).init(this.data.gameId, task, this);
|
|
|
+ item.parent = season_task_layout;
|
|
|
+ item.getComponent(GameTaskItem).init(this.data.gameId, seasonTask, this);
|
|
|
}
|
|
|
}
|
|
|
async setIcon(gameId: number) {
|
|
@@ -203,6 +220,7 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
|
|
|
this.data.currentSpin -= onceTimes;
|
|
|
this.refreshSpinTimes();
|
|
|
|
|
|
+ let critCount = UserM.ins.getGoodsCount(GoodsId.POG_CRITICAL_CARD);
|
|
|
let rewards = [];
|
|
|
for (let index = 0; index < onceTimes; index++) {
|
|
|
let spinResult: GameSpinResult = await GameM.ins.gameSpin(
|
|
@@ -213,15 +231,18 @@ export class GameDetailLayer extends BaseUI implements GameTaskItemCallback {
|
|
|
}
|
|
|
let pog = spinResult.totalPog;
|
|
|
|
|
|
- let critResult = await GameM.ins.getCritReward(
|
|
|
- this.data.gameId,
|
|
|
- spinResult.spinId
|
|
|
- );
|
|
|
- if (!critResult) {
|
|
|
- continue;
|
|
|
+ if (critCount > 0) {
|
|
|
+ critCount--;
|
|
|
+ let critResult = await GameM.ins.getCritReward(
|
|
|
+ this.data.gameId,
|
|
|
+ spinResult.spinId
|
|
|
+ );
|
|
|
+ if (!critResult) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ pog += critResult.critPog;
|
|
|
}
|
|
|
|
|
|
- pog += critResult.critPog;
|
|
|
let g = new GoodInfo();
|
|
|
g.count = pog;
|
|
|
g.id = GoodsId.POG;
|