Commit f9b30794 authored by Romain DELEAU's avatar Romain DELEAU

rework QuestReward + remove some console.log

parent e3968fae
......@@ -7,5 +7,6 @@ export class QuestReward extends Reward {
super('quest');
}
indexQuest!: number;
intitule!: string;
questName!: string;
}
......@@ -82,9 +82,14 @@
<button mat-button (click)="removeReward(i)"><mat-icon fontIcon="remove"></mat-icon></button>
</div>
<div class="piece-form-rewards-reward-quest" *ngIf="reward.type == 'quest'">
<select [(ngModel)]="getQuestReward(i).indexQuest">
<ng-container *ngFor="let quest of mission.roles; let index = index">
<option [ngValue]="index" *ngIf="i != index">{{quest.intitule ? quest.intitule : 'Role '+(index+1)}}</option>
<select (change)="changeQuestReward(i, $event)">
<ng-container *ngFor="let mission of scenario.missions; let indexMission = index">
<ng-container *ngFor="let quest of mission.roles; let indexRole = index">
<option [ngValue]="quest.questName" [selected]="getQuestReward(i).intitule == quest.intitule && getQuestReward(i).questName == quest.questName"
*ngIf="role.intitule && quest.questName && role.intitule == quest.intitule && role.questName != quest.questName">
{{quest.questName}}
</option>
</ng-container>
</ng-container>
</select>
<button mat-button (click)="removeReward(i)"><mat-icon fontIcon="remove"></mat-icon></button>
......
......@@ -148,4 +148,12 @@ export class RoleComponent implements OnInit {
removeObject(i: number, j: number): void {
this.getObjectsReward(i).objects.splice(j, 1);
}
changeQuestReward(index: number, event: any) {
let value: string = event.target.value;
let reward = new QuestReward();
reward.intitule = this.role.intitule;
reward.questName = value;
this.role.rewards[index] = reward;
}
}
......@@ -196,7 +196,6 @@ export class AnnexeTaskComponent implements OnInit {
} else {
this.onUncheckRessource(ressource);
}
console.log(this.task.prerequireRessources);
}
isCheckedRessource(ressource: Ressource): boolean {
......
......@@ -198,7 +198,6 @@ export class FinalTaskComponent implements OnInit {
} else {
this.onUncheckRessource(ressource);
}
console.log(this.task.prerequireRessources);
}
isCheckedRessource(ressource: Ressource): boolean {
......
......@@ -216,7 +216,6 @@ export class OptionnalTaskComponent implements OnInit {
} else {
this.onUncheckRessource(ressource);
}
console.log(this.task.prerequireRessources);
}
isCheckedRessource(ressource: Ressource): boolean {
......
......@@ -193,7 +193,6 @@ export class RandomEventComponent implements OnInit {
} else {
this.onUncheckRessource(ressource);
}
console.log(this.task.prerequireRessources);
}
isCheckedRessource(ressource: Ressource): boolean {
......
......@@ -216,7 +216,6 @@ export class TaskComponent implements OnInit {
} else {
this.onUncheckRessource(ressource);
}
console.log(this.task.prerequireRessources);
}
isCheckedRessource(ressource: Ressource): boolean {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment