Commit 1b3cf6c9 authored by Romain DELEAU's avatar Romain DELEAU

export unity/disable unused task in unity mode

parent 26778f08
...@@ -82,11 +82,11 @@ ...@@ -82,11 +82,11 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"><mat-icon fontIcon="add"></mat-icon></button> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"><mat-icon fontIcon="add"></mat-icon></button>
<mat-menu #addTaskMenu="matMenu"> <mat-menu #addTaskMenu="matMenu">
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'normal')">{{'normalTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'normal')">{{'normalTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'annexe')">{{'annexeTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'annexe')" *ngIf="!unityService.unity_isActive">{{'annexeTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'optionnal')">{{'optionnalTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'optionnal')" *ngIf="!unityService.unity_isActive">{{'optionnalTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'final')" *ngIf="canCreateFinalOrRepeatTask(tasks, j)">{{'finalTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'final')" *ngIf="canCreateFinalOrRepeatTask(tasks, j) && !unityService.unity_isActive">{{'finalTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bfdaa3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'event')">{{'randomEvent_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bfdaa3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'event')" *ngIf="!unityService.unity_isActive">{{'randomEvent_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#abbcc6'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'repeat')" *ngIf="canCreateFinalOrRepeatTask(tasks, j)">{{'repeatTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#abbcc6'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, j, 'repeat')" *ngIf="canCreateFinalOrRepeatTask(tasks, j) && !unityService.unity_isActive">{{'repeatTask_add' | translate}}</button>
</mat-menu> </mat-menu>
</div> </div>
</div> </div>
...@@ -96,11 +96,11 @@ ...@@ -96,11 +96,11 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"><mat-icon fontIcon="add"></mat-icon></button> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"><mat-icon fontIcon="add"></mat-icon></button>
<mat-menu #addTaskMenu="matMenu"> <mat-menu #addTaskMenu="matMenu">
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'normal')">{{'normalTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'normal')">{{'normalTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'annexe')">{{'annexeTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'annexe')" *ngIf="!unityService.unity_isActive">{{'annexeTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'optionnal')">{{'optionnalTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'optionnal')" *ngIf="!unityService.unity_isActive">{{'optionnalTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'final')">{{'finalTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'final')" *ngIf="!unityService.unity_isActive">{{'finalTask_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bfdaa3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'event')">{{'randomEvent_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#bfdaa3'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'event')" *ngIf="!unityService.unity_isActive">{{'randomEvent_add' | translate}}</button>
<button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#abbcc6'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'repeat')">{{'repeatTask_add' | translate}}</button> <button class="container-scenario-main-missions-mission-roles-role-tasks-menuButton" [style.background-color]="'#abbcc6'" mat-menu-item (click)="addTask(mission, role, missionIndex, roleIndex, i, tasks.length, 'repeat')" *ngIf="!unityService.unity_isActive">{{'repeatTask_add' | translate}}</button>
</mat-menu> </mat-menu>
</div> </div>
</div> </div>
...@@ -150,6 +150,13 @@ ...@@ -150,6 +150,13 @@
<mat-icon fontIcon="download_file"></mat-icon> <mat-icon fontIcon="download_file"></mat-icon>
<span>{{'download_label' | translate}}</span> <span>{{'download_label' | translate}}</span>
</button> </button>
<button mat-menu-item [matMenuTriggerFor]="unityExportMissionMenu"
[matTooltip]="translate.instant('exportUnity_tooltip')"
matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltips"
*ngIf="unityService.unity_isActive">
<mat-icon fontIcon="download_for_offline"></mat-icon>
<span>{{'exportUnity_label' | translate}}</span>
</button>
<button mat-menu-item (click)="selectFile()" <button mat-menu-item (click)="selectFile()"
[matTooltip]="translate.instant('upload_tooltip')" [matTooltip]="translate.instant('upload_tooltip')"
matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltips">
...@@ -203,6 +210,21 @@ ...@@ -203,6 +210,21 @@
<span>{{'language_en' | translate}}</span> <span>{{'language_en' | translate}}</span>
</button> </button>
</mat-menu> </mat-menu>
<mat-menu #unityExportMissionMenu="matMenu">
<span mat-menu-item [matMenuTriggerFor]="unityExportRoleMenu" [matMenuTriggerData]="{missionIndex: missionIndex}"
*ngFor="let mission of scenario.missions, let missionIndex = index">
<span>{{translate.instant('siderTitle_mission')+' '+(missionIndex+1)}}</span>
</span>
</mat-menu>
<mat-menu #unityExportRoleMenu="matMenu">
<ng-template matMenuContent let-missionIndex="missionIndex">
<button mat-menu-item (click)="exportRoleToUnity(role, roleIndex, missionIndex)"
*ngFor="let role of scenario.missions[missionIndex].roles, let roleIndex = index">
<mat-icon fontIcon="download_file"></mat-icon>
<span>{{role.intitule ? role.intitule : translate.instant('siderTitle_role')+' '+(roleIndex+1)}}</span>
</button>
</ng-template>
</mat-menu>
</div> </div>
<div class="container-minimap" [ngClass]="siderFolded ? 'siderFolded' : ''"></div> <div class="container-minimap" [ngClass]="siderFolded ? 'siderFolded' : ''"></div>
......
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
} }
} }
::ng-deep .mat-expansion-panel-content { ::ng-deep .mat-menu-item {
font-family: 'Glacial Indifference', sans-serif; font-family: 'Glacial Indifference', sans-serif;
font-size: 16px; font-size: 16px;
} }
\ No newline at end of file
...@@ -46,6 +46,7 @@ import { DeclarativeSentence } from './class/sentence/declarativeSentence/declar ...@@ -46,6 +46,7 @@ import { DeclarativeSentence } from './class/sentence/declarativeSentence/declar
import { ObjectReward } from './class/rewards/object-reward/object-reward'; import { ObjectReward } from './class/rewards/object-reward/object-reward';
import { DiscussionReward } from './class/rewards/discussion-reward/discussion-reward'; import { DiscussionReward } from './class/rewards/discussion-reward/discussion-reward';
import { RoleEducationnalObjective } from './class/role-educationnal-objective/role-educationnal-objective'; import { RoleEducationnalObjective } from './class/role-educationnal-objective/role-educationnal-objective';
import { ExportUnity } from './class/exportUnity/export-unity';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
...@@ -140,9 +141,6 @@ export class AppComponent { ...@@ -140,9 +141,6 @@ export class AppComponent {
changeMode(): void { changeMode(): void {
this.unityService.unity_isActive = !this.unityService.unity_isActive this.unityService.unity_isActive = !this.unityService.unity_isActive
if (this.unityService.unity_isActive) {
alert(this.translate.instant('unity_export_notavailable'))
}
} }
downloadManual(): void { downloadManual(): void {
...@@ -605,6 +603,29 @@ export class AppComponent { ...@@ -605,6 +603,29 @@ export class AppComponent {
} }
} }
exportRoleToUnity(role: Role, roleIndex: number, missionIndex: number) {
let exporter = new ExportUnity(this.scenario, role);
let fileName: string = '';
if (role.intitule) {
fileName = role.intitule+' - '+this.translate.instant('siderTitle_mission')+' '+(missionIndex+1)+(this.scenario.projectName ? ' - '+this.scenario.projectName : '')+' - RLG Maker Export';
} else {
fileName = this.translate.instant('siderTitle_role')+' '+(roleIndex+1)+' - '+this.translate.instant('siderTitle_mission')+' '+(missionIndex+1)+(this.scenario.projectName ? ' - '+this.scenario.projectName : '')+' - RLG Maker Export';
}
try {
const jsonString = exporter.exportRoleToUnity();
const blob = new Blob([jsonString], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.download = fileName;
link.href = url;
link.click();
URL.revokeObjectURL(url);
} catch {
this._snackBar.open(this.translate.instant('snackbar_unity_exportFailed'), '', { duration: 10000, panelClass: 'snackbar-fail' });
}
}
zoomIn(): void { zoomIn(): void {
if (this.zoomService.zoom < 1.5) { if (this.zoomService.zoom < 1.5) {
const element = this.elementRef.nativeElement.querySelector('.container-appMouseWheelZoom'); const element = this.elementRef.nativeElement.querySelector('.container-appMouseWheelZoom');
......
import { ExportUnity } from './export-unity';
describe('ExportUnity', () => {
it('should create an instance', () => {
expect(new ExportUnity()).toBeTruthy();
});
});
import { Discussion } from "../discussion/discussion";
import { CharacterReward } from "../rewards/character-reward/character-reward";
import { DiscussionReward } from "../rewards/discussion-reward/discussion-reward";
import { ObjectReward } from "../rewards/object-reward/object-reward";
import { QuestReward } from "../rewards/quest-reward/quest-reward";
import { SkillReward } from "../rewards/skill-reward/skill-reward";
import { Role } from "../role/role";
import { Scenario } from "../scenario/scenario";
import { DeclarativeSentence } from "../sentence/declarativeSentence/declarative-sentence";
import { InterrogativeSentence } from "../sentence/interrogativeSentence/interrogative-sentence";
import { Task } from "../task/task";
export class ExportUnity {
private scenario: Scenario;
private role: Role;
private exportedRole: UnityRole = {
Character: [],
Discussion: [],
InterrogativeSentence: [],
DeclarativeSentence: [],
Response: [],
Quests: [],
SpeakToTask: [],
GetObjectTasks: [],
InteractWithTask: [],
BeginQuestResult: [],
ChangeDiscussionResult: [],
GetObjectResult: [],
GetPhoneNumberResult: [],
AddCharacterKnowledgementResult: [],
EarnSkillResult: [],
SkillCategory: [],
Skill: [],
Item: []
}
private characterID: number = 0;
private resultID: number = 0;
private itemID: number = 0;
private skillID: number = 0;
private questID: number = 0;
private taskID: number = 0;
constructor(scenario: Scenario, role: Role) {
this.scenario = scenario;
this.role = role;
}
public exportRoleToUnity(): string {
this.exportedRole.Character = this.getCharacters();
this.exportedRole.SkillCategory = this.getSkillCategories();
this.exportedRole.Skill = this.getSkills();
this.exportedRole.Item = this.getItems();
this.exportedRole.Quests = this.getQuests();
this.exportedRole.GetPhoneNumberResult = this.getGetPhoneNumberResults();
this.exportedRole.GetObjectResult = this.getGetObjectResults();
this.exportedRole.EarnSkillResult = this.getEarnSkillResults();
this.exportedRole.ChangeDiscussionResult = this.getChangeDiscussionResults();
this.exportedRole.BeginQuestResult = this.getBeginQuestResults();
this.exportedRole.Discussion = this.getDiscussions();
this.exportedRole.InterrogativeSentence = this.getInterrogativeSentences();
this.exportedRole.DeclarativeSentence = this.getDeclarativeSentences();
this.exportedRole.Response = this.getResponses();
this.exportedRole.SpeakToTask = this.getSpeakToTasks();
this.exportedRole.InteractWithTask = this.getInteractWithTasks();
this.exportedRole.GetObjectTasks = this.getGetObjectTasks();
this.affectRequiredTasks();
return JSON.stringify(this.exportedRole,undefined,2);
}
private getCharacters(): UnityCharacter[] {
let characters: UnityCharacter[] = [];
this.role.discussions.forEach(discussion => {
if (!characters.some(char => discussion.character.name == char.name && discussion.character.tel == char.phone)) {
let char: UnityCharacter = {
name: discussion.character.name,
ID: this.characterID++,
discussionID: [],
currentDiscussionID: undefined,
phone: discussion.character.tel
};
characters.push(char);
}
});
this.role.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
if (!characters.some(char => reward.character.name == char.name && reward.character.tel == char.phone)) {
let char: UnityCharacter = {
name: reward.character.name,
ID: this.characterID++,
discussionID: [],
currentDiscussionID: undefined,
phone: reward.character.tel
};
characters.push(char);
}
}
});
this.role.tasks.forEach(inlineTask => {
inlineTask.forEach(task => {
if (task instanceof Task) {
if (task.character) {
if (!characters.some(char => task.character?.name == char.name && task.character.tel == char.phone)) {
let char: UnityCharacter = {
name: task.character.name,
ID: this.characterID++,
discussionID: [],
currentDiscussionID: undefined,
phone: task.character.tel
};
characters.push(char);
}
}
task.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
if (!characters.some(char => reward.character.name == char.name && reward.character.tel == char.phone)) {
let char: UnityCharacter = {
name: reward.character.name,
ID: this.characterID++,
discussionID: [],
currentDiscussionID: undefined,
phone: reward.character.tel
};
characters.push(char);
}
}
});
}
});
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
if (!characters.some(char => reward.character.name == char.name && reward.character.tel == char.phone)) {
let char: UnityCharacter = {
name: reward.character.name,
ID: this.characterID++,
discussionID: [],
currentDiscussionID: undefined,
phone: reward.character.tel
};
characters.push(char);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
if (!characters.some(char => reward.character.name == char.name && reward.character.tel == char.phone)) {
let char: UnityCharacter = {
name: reward.character.name,
ID: this.characterID++,
discussionID: [],
currentDiscussionID: undefined,
phone: reward.character.tel
};
characters.push(char);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
if (!characters.some(char => reward.character.name == char.name && reward.character.tel == char.phone)) {
let char: UnityCharacter = {
name: reward.character.name,
ID: this.characterID++,
discussionID: [],
currentDiscussionID: undefined,
phone: reward.character.tel
};
characters.push(char);
}
}
});
});
return characters;
}
private getDiscussions(): UnityDiscussion[] {
let discussions: UnityDiscussion[] = [];
this.role.discussions.forEach(discuss => {
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == discuss.character.name && char.phone == discuss.character.tel) as UnityCharacter;
let results: number[] = [];
discuss.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let resultID: number = (this.exportedRole.BeginQuestResult.find(result => result.name == 'Débloquer la quête : '+reward.questName) as UnityBeginQuestResult).ID;
results.push(resultID);
}
if (reward instanceof SkillReward) {
let resultID: number = (this.exportedRole.EarnSkillResult.find(result => 'Compétence acquise : '+reward.skill.name == result.name) as UnityEarnSkillResult).ID;
results.push(resultID);
}
if (reward instanceof CharacterReward) {
let resultID: number = (this.exportedRole.GetPhoneNumberResult.find(result => 'Récupérer le numéro de '+reward.character.name == result.name) as UnityGetPhoneNumberResult).ID;
results.push(resultID);
}
if (reward instanceof ObjectReward) {
let resultID: number = (this.exportedRole.GetObjectResult.find(result => 'Objet reçu : '+reward.object.name == result.name && reward.quantity == result.quantity) as UnityGetObjectResult).ID;
results.push(resultID);
}
if (reward instanceof DiscussionReward) {
let resultID: number = (this.exportedRole.ChangeDiscussionResult.find(result => result.discussionID == reward.discussionId) as UnityChangeDiscussionResult).ID;
results.push(resultID);
}
});
let discussion: UnityDiscussion = {
ID: discuss.ID,
name: discuss.name,
sentenceID: discuss.sentences,
resultID: results,
firstSentence: discuss.firstSentenceID,
characterID: character.ID
};
discussions.push(discussion);
});
return discussions;
}
private getInterrogativeSentences(): UnityInterrogativeSentence[] {
let sentences: UnityInterrogativeSentence[] = [];
this.role.sentences.forEach(sentence => {
if (sentence instanceof InterrogativeSentence) {
let results: number[] = [];
sentence.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let resultID: number = (this.exportedRole.BeginQuestResult.find(result => result.name == 'Débloquer la quête : '+reward.questName) as UnityBeginQuestResult).ID;
results.push(resultID);
}
if (reward instanceof SkillReward) {
let resultID: number = (this.exportedRole.EarnSkillResult.find(result => 'Compétence acquise : '+reward.skill.name == result.name) as UnityEarnSkillResult).ID;
results.push(resultID);
}
if (reward instanceof CharacterReward) {
let resultID: number = (this.exportedRole.GetPhoneNumberResult.find(result => 'Récupérer le numéro de '+reward.character.name == result.name) as UnityGetPhoneNumberResult).ID;
results.push(resultID);
}
if (reward instanceof ObjectReward) {
let resultID: number = (this.exportedRole.GetObjectResult.find(result => 'Objet reçu : '+reward.object.name == result.name && reward.quantity == result.quantity) as UnityGetObjectResult).ID;
results.push(resultID);
}
if (reward instanceof DiscussionReward) {
let resultID: number = (this.exportedRole.ChangeDiscussionResult.find(result => result.discussionID == reward.discussionId) as UnityChangeDiscussionResult).ID;
results.push(resultID);
}
});
let interrogativeSentence: UnityInterrogativeSentence = {
ID: sentence.ID,
value: sentence.value,
resultID: results,
idDiscussion: sentence.idDiscussion,
responseID: sentence.responses
}
sentences.push(interrogativeSentence);
}
});
return sentences;
}
private getDeclarativeSentences(): UnityDeclarativeSentence[] {
let sentences: UnityDeclarativeSentence[] = [];
this.role.sentences.forEach(sentence => {
if (sentence instanceof DeclarativeSentence) {
let results: number[] = [];
sentence.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let resultID: number = (this.exportedRole.BeginQuestResult.find(result => result.name == 'Débloquer la quête : '+reward.questName) as UnityBeginQuestResult).ID;
results.push(resultID);
}
if (reward instanceof SkillReward) {
let resultID: number = (this.exportedRole.EarnSkillResult.find(result => 'Compétence acquise : '+reward.skill.name == result.name) as UnityEarnSkillResult).ID;
results.push(resultID);
}
if (reward instanceof CharacterReward) {
let resultID: number = (this.exportedRole.GetPhoneNumberResult.find(result => 'Récupérer le numéro de '+reward.character.name == result.name) as UnityGetPhoneNumberResult).ID;
results.push(resultID);
}
if (reward instanceof ObjectReward) {
let resultID: number = (this.exportedRole.GetObjectResult.find(result => 'Objet reçu : '+reward.object.name == result.name && reward.quantity == result.quantity) as UnityGetObjectResult).ID;
results.push(resultID);
}
if (reward instanceof DiscussionReward) {
let resultID: number = (this.exportedRole.ChangeDiscussionResult.find(result => result.discussionID == reward.discussionId) as UnityChangeDiscussionResult).ID;
results.push(resultID);
}
});
let interrogativeSentence: UnityDeclarativeSentence = {
ID: sentence.ID,
value: sentence.value,
resultID: results,
idDiscussion: sentence.idDiscussion,
nextSentence: sentence.nextSentence
}
sentences.push(interrogativeSentence);
}
});
return sentences;
}
private getResponses(): UnityResponse[] {
let responses: UnityResponse[] = [];
this.role.responses.forEach(resp => {
let results: number[] = [];
resp.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let resultID: number = (this.exportedRole.BeginQuestResult.find(result => result.name == 'Débloquer la quête : '+reward.questName) as UnityBeginQuestResult).ID;
results.push(resultID);
}
if (reward instanceof SkillReward) {
let resultID: number = (this.exportedRole.EarnSkillResult.find(result => 'Compétence acquise : '+reward.skill.name == result.name) as UnityEarnSkillResult).ID;
results.push(resultID);
}
if (reward instanceof CharacterReward) {
let resultID: number = (this.exportedRole.GetPhoneNumberResult.find(result => 'Récupérer le numéro de '+reward.character.name == result.name) as UnityGetPhoneNumberResult).ID;
results.push(resultID);
}
if (reward instanceof ObjectReward) {
let resultID: number = (this.exportedRole.GetObjectResult.find(result => 'Objet reçu : '+reward.object.name == result.name && reward.quantity == result.quantity) as UnityGetObjectResult).ID;
results.push(resultID);
}
if (reward instanceof DiscussionReward) {
let resultID: number = (this.exportedRole.ChangeDiscussionResult.find(result => result.discussionID == reward.discussionId) as UnityChangeDiscussionResult).ID;
results.push(resultID);
}
});
let response: UnityResponse = {
ID: resp.ID,
value: resp.value,
nextSentence: resp.nextSentence,
resultID: results,
idInterrogativeSentence: resp.idInterrogativeSentence
};
responses.push(response);
});
return responses;
}
private getQuests(): UnityQuest[] {
let quests: UnityQuest[] = [];
quests[0] = {
ID: this.questID++,
name: this.role.questName,
description: this.role.description,
taskID: [],
resultID: [],
requiredQuestID: []
}
this.scenario.missions.forEach(mission => {
mission.roles.forEach(role => {
if (role.intitule == this.role.intitule && role.questName != this.role.questName) {
let quest: UnityQuest = {
ID: this.questID,
name: role.questName,
description: role.description,
taskID: [],
resultID: [],
requiredQuestID: []
};
quests.push(quest);
}
});
});
return quests;
}
private getSpeakToTasks(): UnitySpeakToTask[] {
let tasks: UnitySpeakToTask[] = [];
this.role.tasks.forEach(inlineTask => {
inlineTask.forEach(task => {
if (task instanceof Task && task.type == 'normal' && task.typeUnity == 'character') {
let taskID: number = this.taskID++;
this.exportedRole.Quests[0].taskID.push(taskID);
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == task.character?.name && char.phone == task.character?.tel) as UnityCharacter;
let results: number[] = [];
task.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let resultID: number = (this.exportedRole.BeginQuestResult.find(result => result.name == 'Débloquer la quête : '+reward.questName) as UnityBeginQuestResult).ID;
results.push(resultID);
}
if (reward instanceof SkillReward) {
let resultID: number = (this.exportedRole.EarnSkillResult.find(result => 'Compétence acquise : '+reward.skill.name == result.name) as UnityEarnSkillResult).ID;
results.push(resultID);
}
if (reward instanceof CharacterReward) {
let resultID: number = (this.exportedRole.GetPhoneNumberResult.find(result => 'Récupérer le numéro de '+reward.character.name == result.name) as UnityGetPhoneNumberResult).ID;
results.push(resultID);
}
if (reward instanceof ObjectReward) {
let resultID: number = (this.exportedRole.GetObjectResult.find(result => 'Objet reçu : '+reward.object.name == result.name && reward.quantity == result.quantity) as UnityGetObjectResult).ID;
results.push(resultID);
}
if (reward instanceof DiscussionReward) {
let resultID: number = (this.exportedRole.ChangeDiscussionResult.find(result => result.discussionID == reward.discussionId) as UnityChangeDiscussionResult).ID;
results.push(resultID);
}
});
let taskUnity: UnitySpeakToTask = {
ID: taskID,
name: task.name,
questID: 0,
description: task.objective,
requiredTaskID: [],
resultID: results,
characterID: character.ID
}
tasks.push(taskUnity);
}
});
});
return tasks;
}
private getGetObjectTasks(): UnityGetObjectTask[] {
let tasks: UnityGetObjectTask[] = [];
this.role.tasks.forEach(inlineTask => {
inlineTask.forEach(task => {
if (task instanceof Task && task.type == 'normal' && task.typeUnity == 'getObject') {
let taskID: number = this.taskID++;
this.exportedRole.Quests[0].taskID.push(taskID);
let object: UnityItem = this.exportedRole.Item.find(item => item.name == task.object?.name) as UnityItem;
let results: number[] = [];
task.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let resultID: number = (this.exportedRole.BeginQuestResult.find(result => result.name == 'Débloquer la quête : '+reward.questName) as UnityBeginQuestResult).ID;
results.push(resultID);
}
if (reward instanceof SkillReward) {
let resultID: number = (this.exportedRole.EarnSkillResult.find(result => 'Compétence acquise : '+reward.skill.name == result.name) as UnityEarnSkillResult).ID;
results.push(resultID);
}
if (reward instanceof CharacterReward) {
let resultID: number = (this.exportedRole.GetPhoneNumberResult.find(result => 'Récupérer le numéro de '+reward.character.name == result.name) as UnityGetPhoneNumberResult).ID;
results.push(resultID);
}
if (reward instanceof ObjectReward) {
let resultID: number = (this.exportedRole.GetObjectResult.find(result => 'Objet reçu : '+reward.object.name == result.name && reward.quantity == result.quantity) as UnityGetObjectResult).ID;
results.push(resultID);
}
if (reward instanceof DiscussionReward) {
let resultID: number = (this.exportedRole.ChangeDiscussionResult.find(result => result.discussionID == reward.discussionId) as UnityChangeDiscussionResult).ID;
results.push(resultID);
}
});
let taskUnity: UnityGetObjectTask = {
ID: taskID,
name: task.name,
questID: 0,
description: task.objective,
requiredTaskID: [],
resultID: results,
objectID: object.ID,
quantity: task.objectQuantity
}
tasks.push(taskUnity);
}
});
});
return tasks;
}
private getInteractWithTasks(): UnityInteractWithTask[] {
let tasks: UnityInteractWithTask[] = [];
this.role.tasks.forEach(inlineTask => {
inlineTask.forEach(task => {
if (task instanceof Task && task.type == 'normal' && task.typeUnity == 'interactObject') {
let taskID: number = this.taskID++;
this.exportedRole.Quests[0].taskID.push(taskID);
let object: UnityItem = this.exportedRole.Item.find(item => item.name == task.object?.name) as UnityItem;
let results: number[] = [];
task.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let resultID: number = (this.exportedRole.BeginQuestResult.find(result => result.name == 'Débloquer la quête : '+reward.questName) as UnityBeginQuestResult).ID;
results.push(resultID);
}
if (reward instanceof SkillReward) {
let resultID: number = (this.exportedRole.EarnSkillResult.find(result => 'Compétence acquise : '+reward.skill.name == result.name) as UnityEarnSkillResult).ID;
results.push(resultID);
}
if (reward instanceof CharacterReward) {
let resultID: number = (this.exportedRole.GetPhoneNumberResult.find(result => 'Récupérer le numéro de '+reward.character.name == result.name) as UnityGetPhoneNumberResult).ID;
results.push(resultID);
}
if (reward instanceof ObjectReward) {
let resultID: number = (this.exportedRole.GetObjectResult.find(result => 'Objet reçu : '+reward.object.name == result.name && reward.quantity == result.quantity) as UnityGetObjectResult).ID;
results.push(resultID);
}
if (reward instanceof DiscussionReward) {
let resultID: number = (this.exportedRole.ChangeDiscussionResult.find(result => result.discussionID == reward.discussionId) as UnityChangeDiscussionResult).ID;
results.push(resultID);
}
});
let taskUnity: UnityInteractWithTask = {
ID: taskID,
name: task.name,
questID: 0,
description: task.objective,
requiredTaskID: [],
resultID: results,
objectID: object.ID
}
tasks.push(taskUnity);
}
});
});
return tasks;
}
private affectRequiredTasks(): void {
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
if (task instanceof Task && task.type == 'normal') {
let unityRelatedTask = this.getRelatedUnityTask(task);
task.prerequireTasks.forEach(antecedent => {
let identifierRelatedTask: Task = this.getIdentifierRelatedTask(antecedent.identifier);
unityRelatedTask.requiredTaskID = unityRelatedTask.requiredTaskID.concat(this.getRequiredTasks(identifierRelatedTask));
});
}
});
});
}
private getRelatedUnityTask(task: Task): UnitySpeakToTask | UnityGetObjectTask | UnityInteractWithTask {
if (task.typeUnity === 'character') {
let foundTask = this.exportedRole.SpeakToTask.find(tsk => tsk.name === task.name && tsk.description === task.objective);
if (foundTask) {
return foundTask as UnitySpeakToTask;
}
}
if (task.typeUnity === 'getObject') {
let foundTask = this.exportedRole.GetObjectTasks.find(tsk => tsk.name === task.name && tsk.description === task.objective);
if (foundTask) {
return foundTask as UnityGetObjectTask;
}
}
if (task.typeUnity === 'interactObject') {
let foundTask = this.exportedRole.InteractWithTask.find(tsk => tsk.name === task.name && tsk.description === task.objective);
if (foundTask) {
return foundTask as UnityInteractWithTask;
}
}
throw new Error('Unknown typeUnity '+task.typeUnity);
}
private getIdentifierRelatedTask(identifier: string): Task {
let relatedTask: Task = new Task('normal');
this.role.tasks.forEach(inlineTask => {
inlineTask.forEach(task => {
if (task instanceof Task) {
if (task.identifier == identifier) {
relatedTask = task;
}
}
});
});
return relatedTask;
}
private getRequiredTasks(task: Task): number[] {
let antecedents: number[] = [];
if (task.type == 'normal') {
let antecedentID = this.getRelatedUnityTask(task).ID;
if (antecedentID != undefined) {
antecedents.push(antecedentID);
}
} else {
task.prerequireTasks.forEach(antecedent => {
let identifierRelatedTask: Task = this.getIdentifierRelatedTask(antecedent.identifier);
antecedents = antecedents.concat(this.getRequiredTasks(identifierRelatedTask));
});
}
return antecedents;
}
private getBeginQuestResults(): UnityBeginQuestResult[] {
let results: UnityBeginQuestResult[] = [];
this.role.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let quest: UnityQuest = this.exportedRole.Quests.find(qst => qst.name == reward.questName) as UnityQuest;
if (!results.some(element => element.questID == quest.ID)) {
let result: UnityBeginQuestResult = {
ID: this.resultID++,
name: 'Débloquer la quête : '+reward.questName,
questID: quest.ID
};
results.push(result);
}
}
});
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
if (task instanceof Task) {
task.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let quest: UnityQuest = this.exportedRole.Quests.find(qst => qst.name == reward.questName) as UnityQuest;
if (!results.some(element => element.questID == quest.ID)) {
let result: UnityBeginQuestResult = {
ID: this.resultID++,
name: 'Débloquer la quête : '+reward.questName,
questID: quest.ID
};
results.push(result);
}
}
});
}
});
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let quest: UnityQuest = this.exportedRole.Quests.find(qst => qst.name == reward.questName) as UnityQuest;
if (!results.some(element => element.questID == quest.ID)) {
let result: UnityBeginQuestResult = {
ID: this.resultID++,
name: 'Débloquer la quête : '+reward.questName,
questID: quest.ID
};
results.push(result);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let quest: UnityQuest = this.exportedRole.Quests.find(qst => qst.name == reward.questName) as UnityQuest;
if (!results.some(element => element.questID == quest.ID)) {
let result: UnityBeginQuestResult = {
ID: this.resultID++,
name: 'Débloquer la quête : '+reward.questName,
questID: quest.ID
};
results.push(result);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof QuestReward) {
let quest: UnityQuest = this.exportedRole.Quests.find(qst => qst.name == reward.questName) as UnityQuest;
if (!results.some(element => element.questID == quest.ID)) {
let result: UnityBeginQuestResult = {
ID: this.resultID++,
name: 'Débloquer la quête : '+reward.questName,
questID: quest.ID
};
results.push(result);
}
}
});
});
return results;
}
private getChangeDiscussionResults(): UnityChangeDiscussionResult[] {
let results: UnityChangeDiscussionResult[] = [];
this.role.rewards.forEach(reward => {
if (reward instanceof DiscussionReward) {
let discussion: Discussion = this.role.discussions.find(discuss => discuss.ID == reward.discussionId) as Discussion;
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == discussion.character.name && char.phone == discussion.character.tel) as UnityCharacter;
if (!results.some(element => element.characterID == character.ID && element.discussionID == discussion.ID)) {
let result: UnityChangeDiscussionResult = {
ID: this.resultID++,
name: 'Changer la conversation de '+character.name+' en '+discussion.name,
characterID: character.ID,
discussionID: discussion.ID
};
results.push(result);
}
}
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof DiscussionReward) {
let discussion: Discussion = this.role.discussions.find(discuss => discuss.ID == reward.discussionId) as Discussion;
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == discussion.character.name && char.phone == discussion.character.tel) as UnityCharacter;
if (!results.some(element => element.characterID == character.ID && element.discussionID == discussion.ID)) {
let result: UnityChangeDiscussionResult = {
ID: this.resultID++,
name: 'Changer la conversation de '+character.name+' en '+discussion.name,
characterID: character.ID,
discussionID: discussion.ID
};
results.push(result);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof DiscussionReward) {
let discussion: Discussion = this.role.discussions.find(discuss => discuss.ID == reward.discussionId) as Discussion;
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == discussion.character.name && char.phone == discussion.character.tel) as UnityCharacter;
if (!results.some(element => element.characterID == character.ID && element.discussionID == discussion.ID)) {
let result: UnityChangeDiscussionResult = {
ID: this.resultID++,
name: 'Changer la conversation de '+character.name+' en '+discussion.name,
characterID: character.ID,
discussionID: discussion.ID
};
results.push(result);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof DiscussionReward) {
let discussion: Discussion = this.role.discussions.find(discuss => discuss.ID == reward.discussionId) as Discussion;
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == discussion.character.name && char.phone == discussion.character.tel) as UnityCharacter;
if (!results.some(element => element.characterID == character.ID && element.discussionID == discussion.ID)) {
let result: UnityChangeDiscussionResult = {
ID: this.resultID++,
name: 'Changer la conversation de '+character.name+' en '+discussion.name,
characterID: character.ID,
discussionID: discussion.ID
};
results.push(result);
}
}
});
});
return results;
}
private getGetObjectResults(): UnityGetObjectResult[] {
let results: UnityGetObjectResult[] = [];
this.role.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
let item: UnityItem = this.exportedRole.Item.find(obj => obj.name == reward.object.name) as UnityItem;
if (!results.some(element => element.objectID == item.ID && element.quantity == reward.quantity)) {
let resultID: number = this.resultID++;
let result: UnityGetObjectResult = {
ID: resultID,
name: 'Objet reçu : '+item.name,
quantity: reward.quantity,
objectID: item.ID
};
results.push(result);
}
}
});
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
if (task instanceof Task) {
task.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
let item: UnityItem = this.exportedRole.Item.find(obj => obj.name == reward.object.name) as UnityItem;
if (!results.some(element => element.objectID == item.ID && element.quantity == reward.quantity)) {
let resultID: number = this.resultID++;
let result: UnityGetObjectResult = {
ID: resultID,
name: 'Objet reçu : '+item.name,
quantity: reward.quantity,
objectID: item.ID
};
results.push(result);
}
}
});
}
});
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
let item: UnityItem = this.exportedRole.Item.find(obj => obj.name == reward.object.name) as UnityItem;
if (!results.some(element => element.objectID == item.ID && element.quantity == reward.quantity)) {
let resultID: number = this.resultID++;
let result: UnityGetObjectResult = {
ID: resultID,
name: 'Objet reçu : '+item.name,
quantity: reward.quantity,
objectID: item.ID
};
results.push(result);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
let item: UnityItem = this.exportedRole.Item.find(obj => obj.name == reward.object.name) as UnityItem;
if (!results.some(element => element.objectID == item.ID && element.quantity == reward.quantity)) {
let resultID: number = this.resultID++;
let result: UnityGetObjectResult = {
ID: resultID,
name: 'Objet reçu : '+item.name,
quantity: reward.quantity,
objectID: item.ID
};
results.push(result);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
let item: UnityItem = this.exportedRole.Item.find(obj => obj.name == reward.object.name) as UnityItem;
if (!results.some(element => element.objectID == item.ID && element.quantity == reward.quantity)) {
let resultID: number = this.resultID++;
let result: UnityGetObjectResult = {
ID: resultID,
name: 'Objet reçu : '+item.name,
quantity: reward.quantity,
objectID: item.ID
};
results.push(result);
}
}
});
});
return results;
}
private getGetPhoneNumberResults(): UnityGetPhoneNumberResult[] {
let results: UnityGetPhoneNumberResult[] = [];
this.role.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == reward.character.name && char.phone == reward.character.tel) as UnityCharacter;
if (!results.some(element => character.ID == element.characterID)) {
let resultID: number = this.resultID++;
let result: UnityGetPhoneNumberResult = {
ID: resultID,
characterID: character.ID,
name: 'Récupérer le numéro de '+character.name
};
results.push(result);
}
}
});
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
if (task instanceof Task) {
task.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == reward.character.name && char.phone == reward.character.tel) as UnityCharacter;
if (!results.some(element => character.ID == element.characterID)) {
let resultID: number = this.resultID++;
let result: UnityGetPhoneNumberResult = {
ID: resultID,
characterID: character.ID,
name: 'Récupérer le numéro de '+character.name
};
results.push(result);
}
}
});
}
});
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == reward.character.name && char.phone == reward.character.tel) as UnityCharacter;
if (!results.some(element => character.ID == element.characterID)) {
let resultID: number = this.resultID++;
let result: UnityGetPhoneNumberResult = {
ID: resultID,
characterID: character.ID,
name: 'Récupérer le numéro de '+character.name
};
results.push(result);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == reward.character.name && char.phone == reward.character.tel) as UnityCharacter;
if (!results.some(element => character.ID == element.characterID)) {
let resultID: number = this.resultID++;
let result: UnityGetPhoneNumberResult = {
ID: resultID,
characterID: character.ID,
name: 'Récupérer le numéro de '+character.name
};
results.push(result);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof CharacterReward) {
let character: UnityCharacter = this.exportedRole.Character.find(char => char.name == reward.character.name && char.phone == reward.character.tel) as UnityCharacter;
if (!results.some(element => character.ID == element.characterID)) {
let resultID: number = this.resultID++;
let result: UnityGetPhoneNumberResult = {
ID: resultID,
characterID: character.ID,
name: 'Récupérer le numéro de '+character.name
};
results.push(result);
}
}
});
});
return results;
}
private getAddCharacterKnowledgementResults(): UnityAddCharacterKnowledgementResult[] {
let results: UnityAddCharacterKnowledgementResult[] = [];
return results;
}
private getEarnSkillResults(): UnityEarnSkillResult[] {
let results: UnityEarnSkillResult[] = [];
this.role.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
let skill: UnitySkill = this.exportedRole.Item.find(skl => skl.name == reward.skill.name) as UnitySkill;
if (!results.some(element => element.skillID == skill.ID)) {
let resultID: number = this.resultID++;
let result: UnityEarnSkillResult = {
ID: resultID,
name: 'Compétence acquise : '+skill.name,
skillID: skill.ID
};
skill.resultID.push(resultID);
results.push(result);
}
}
});
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
if (task instanceof Task) {
task.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
let skill: UnitySkill = this.exportedRole.Item.find(skl => skl.name == reward.skill.name) as UnitySkill;
if (!results.some(element => element.skillID == skill.ID)) {
let resultID: number = this.resultID++;
let result: UnityEarnSkillResult = {
ID: resultID,
name: 'Compétence acquise : '+skill.name,
skillID: skill.ID
};
skill.resultID.push(resultID);
results.push(result);
}
}
});
}
});
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
let skill: UnitySkill = this.exportedRole.Item.find(skl => skl.name == reward.skill.name) as UnitySkill;
if (!results.some(element => element.skillID == skill.ID)) {
let resultID: number = this.resultID++;
let result: UnityEarnSkillResult = {
ID: resultID,
name: 'Compétence acquise : '+skill.name,
skillID: skill.ID
};
skill.resultID.push(resultID);
results.push(result);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
let skill: UnitySkill = this.exportedRole.Item.find(skl => skl.name == reward.skill.name) as UnitySkill;
if (!results.some(element => element.skillID == skill.ID)) {
let resultID: number = this.resultID++;
let result: UnityEarnSkillResult = {
ID: resultID,
name: 'Compétence acquise : '+skill.name,
skillID: skill.ID
};
skill.resultID.push(resultID);
results.push(result);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
let skill: UnitySkill = this.exportedRole.Item.find(skl => skl.name == reward.skill.name) as UnitySkill;
if (!results.some(element => element.skillID == skill.ID)) {
let resultID: number = this.resultID++;
let result: UnityEarnSkillResult = {
ID: resultID,
name: 'Compétence acquise : '+skill.name,
skillID: skill.ID
};
skill.resultID.push(resultID);
results.push(result);
}
}
});
});
return results;
}
private getSkillCategories(): UnitySkillCategory[] {
let categories: UnitySkillCategory[] = [];
let category: UnitySkillCategory = {
ID: 0,
name: 'Compétence non catégorisée',
description: 'Ce fichier a été généré par RLG Maker, qui ne permet pas encore la création de catégories de compétences',
skillsID: []
};
categories.push(category);
return categories;
}
private getSkills(): UnitySkill[] {
let skills: UnitySkill[] = [];
this.role.ressources.forEach(ressource => {
if (ressource.type == 'attribut') {
if (!skills.some(skill => ressource.name == skill.name)) {
let skillID: number = this.skillID++;
let skill: UnitySkill = {
ID: skillID,
name: ressource.name,
description: '',
skillCategoryID: 0,
resultID: []
};
skills.push(skill);
this.exportedRole.SkillCategory[0].skillsID.push(skillID);
}
}
});
this.role.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
if (!skills.some(skill => reward.skill.name == skill.name)) {
let skillID: number = this.skillID++;
let skill: UnitySkill = {
ID: skillID,
name: reward.skill.name,
description: '',
skillCategoryID: 0,
resultID: []
};
skills.push(skill);
this.exportedRole.SkillCategory[0].skillsID.push(skillID);
}
}
});
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
if (task instanceof Task) {
task.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
if (!skills.some(skill => reward.skill.name == skill.name)) {
let skillID: number = this.skillID++;
let skill: UnitySkill = {
ID: skillID,
name: reward.skill.name,
description: '',
skillCategoryID: 0,
resultID: []
};
skills.push(skill);
this.exportedRole.SkillCategory[0].skillsID.push(skillID);
}
}
});
}
});
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
if (!skills.some(skill => reward.skill.name == skill.name)) {
let skillID: number = this.skillID++;
let skill: UnitySkill = {
ID: skillID,
name: reward.skill.name,
description: '',
skillCategoryID: 0,
resultID: []
};
skills.push(skill);
this.exportedRole.SkillCategory[0].skillsID.push(skillID);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
if (!skills.some(skill => reward.skill.name == skill.name)) {
let skillID: number = this.skillID++;
let skill: UnitySkill = {
ID: skillID,
name: reward.skill.name,
description: '',
skillCategoryID: 0,
resultID: []
};
skills.push(skill);
this.exportedRole.SkillCategory[0].skillsID.push(skillID);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof SkillReward) {
if (!skills.some(skill => reward.skill.name == skill.name)) {
let skillID: number = this.skillID++;
let skill: UnitySkill = {
ID: skillID,
name: reward.skill.name,
description: '',
skillCategoryID: 0,
resultID: []
};
skills.push(skill);
this.exportedRole.SkillCategory[0].skillsID.push(skillID);
}
}
});
});
return skills;
}
private getItems(): UnityItem[] {
let items: UnityItem[] = [];
this.role.ressources.forEach(ressource => {
if (ressource.type == 'object') {
if (!items.some(item => ressource.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: ressource.name,
description: ''
};
items.push(item);
}
}
});
this.role.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
if (!items.some(item => reward.object.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: reward.object.name,
description: ''
};
items.push(item);
}
}
});
this.role.tasks.forEach(inlineTasks => {
inlineTasks.forEach(task => {
if (task instanceof Task) {
if ((task.typeUnity == 'getObject' || task.typeUnity == 'interactObject') && task.object) {
if (!items.some(item => task.object?.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: task.object?.name,
description: ''
};
items.push(item);
}
}
task.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
if (!items.some(item => reward.object.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: reward.object.name,
description: ''
}
items.push(item);
}
}
});
}
});
});
this.role.discussions.forEach(discussion => {
discussion.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
if (!items.some(item => reward.object.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: reward.object.name,
description: ''
}
items.push(item);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
if (!items.some(item => reward.object.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: reward.object.name,
description: ''
}
items.push(item);
}
}
});
});
this.role.sentences.forEach(sentence => {
sentence.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
if (!items.some(item => reward.object.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: reward.object.name,
description: ''
}
items.push(item);
}
}
});
});
this.role.responses.forEach(response => {
response.rewards.forEach(reward => {
if (reward instanceof ObjectReward) {
if (!items.some(item => reward.object.name == item.name)) {
let item: UnityItem = {
ID: this.itemID++,
name: reward.object.name,
description: ''
}
items.push(item);
}
}
});
});
return items;
}
}
interface UnityCharacter {
name: string;
ID: number;
discussionID: number[];
currentDiscussionID: number|undefined;
phone: string;
}
interface UnityDiscussion {
name: string;
ID: number;
sentenceID: number[];
resultID: number[];
firstSentence: number;
characterID: number;
}
interface UnityInterrogativeSentence {
ID: number;
value: string;
resultID: number[];
idDiscussion: number;
responseID: number[];
}
interface UnityDeclarativeSentence {
ID: number;
value: string;
resultID: number[];
idDiscussion: number;
nextSentence: number;
}
interface UnityResponse {
ID: number;
value: string;
nextSentence: number;
resultID: number[];
idInterrogativeSentence: number;
}
interface UnityQuest {
name: string;
ID: number;
description: string;
taskID: number[];
resultID: number[];
requiredQuestID: number[];
}
interface UnitySpeakToTask {
ID: number;
name: string;
questID: number;
description: string;
requiredTaskID: number[];
resultID: number[];
characterID: number;
}
interface UnityGetObjectTask {
ID: number;
name: string;
questID: number;
description: string;
requiredTaskID: number[];
resultID: number[];
objectID: number;
quantity: number;
}
interface UnityInteractWithTask {
ID: number;
name: string;
questID: number;
description: string;
requiredTaskID: number[];
resultID: number[];
objectID: number;
}
interface UnityBeginQuestResult {
ID: number;
name: string;
questID: number;
}
interface UnityChangeDiscussionResult {
ID: number;
name: string;
characterID: number;
discussionID: number;
}
interface UnityGetObjectResult {
ID: number;
name: string;
objectID: number;
quantity: number;
}
interface UnityGetPhoneNumberResult {
ID: number;
name: string;
characterID: number;
}
interface UnityAddCharacterKnowledgementResult {
}
interface UnityEarnSkillResult {
ID: number;
name: string;
skillID: number;
}
interface UnitySkillCategory {
ID: number;
name: string;
description: string;
skillsID: number[];
}
interface UnitySkill {
ID: number;
name: string;
description: string;
skillCategoryID: number;
resultID: number[];
}
interface UnityItem {
name: string;
ID: number;
description: string;
}
interface UnityRole {
Character: UnityCharacter[];
Discussion: UnityDiscussion[];
InterrogativeSentence: UnityInterrogativeSentence[];
DeclarativeSentence: UnityDeclarativeSentence[];
Response: UnityResponse[];
Quests: UnityQuest[]
SpeakToTask: UnitySpeakToTask[];
GetObjectTasks: UnityGetObjectTask[];
InteractWithTask: UnityInteractWithTask[];
BeginQuestResult: UnityBeginQuestResult[];
ChangeDiscussionResult: UnityChangeDiscussionResult[];
GetObjectResult: UnityGetObjectResult[];
GetPhoneNumberResult: UnityGetPhoneNumberResult[];
AddCharacterKnowledgementResult: UnityAddCharacterKnowledgementResult[];
EarnSkillResult: UnityEarnSkillResult[];
SkillCategory: UnitySkillCategory[];
Skill: UnitySkill[];
Item: UnityItem[];
}
\ No newline at end of file
<div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="onClickPiece()" <div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="!unityService.unity_isActive ? onClickPiece() : ''"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'" : 'var(--piece-background-color)'"
[matTooltip]="translate.instant('annexeTask_tooltip')" [matTooltip]="translate.instant('annexeTask_tooltip')"
matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips || unityService.unity_isActive"
[class]="pieceDetailsService.piece == task ? 'isActive' : 'border'"> [class]="pieceDetailsService.piece == task ? 'isActive' : 'border'">
<div class="piece-attach piece-attach-left"></div> <div class="piece-attach piece-attach-left"></div>
<div class="piece-attach piece-attach-right" [style.background]="task.supplementaryRole ? task.supplementaryRole.color : 'var(--piece-background-color)'"></div> <div class="piece-attach piece-attach-right" [style.background]="task.supplementaryRole ? task.supplementaryRole.color : 'var(--piece-background-color)'"></div>
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<mat-menu #menuChange="matMenu"> <mat-menu #menuChange="matMenu">
<button class="piece-menu-changeMenuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="onClickChange('normal')">{{'task_transform_normalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="onClickChange('normal')">{{'task_transform_normalTask' | translate}}</button>
<button class="piece-menu-changeMenuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="onClickChange('optionnal')">{{'task_transform_optionnalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="onClickChange('optionnal')" *ngIf="!unityService.unity_isActive">{{'task_transform_optionnalTask' | translate}}</button>
<button class="piece-menu-changeMenuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="onClickChange('final')" *ngIf="canChangeInFinalTask()">{{'task_transform_finalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="onClickChange('final')" *ngIf="canChangeInFinalTask() && !unityService.unity_isActive">{{'task_transform_finalTask' | translate}}</button>
</mat-menu> </mat-menu>
</div> </div>
<mat-icon fontIcon="backspace" (click)="onClickErase()" <mat-icon fontIcon="backspace" (click)="onClickErase()"
...@@ -121,181 +121,25 @@ ...@@ -121,181 +121,25 @@
<div class="piece-form-top"> <div class="piece-form-top">
<input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5" <input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5"
[matTooltip]="translate.instant('task_identifier_tooltip')" [matTooltip]="translate.instant('task_identifier_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"/> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"/>
<div class="piece-form-top-title">{{'annexeTask_title' | translate}}</div> <div class="piece-form-top-title">{{'annexeTask_title' | translate}}</div>
<mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon> <mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
<mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon>
<span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span> <span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span>
</div> </div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('annexe')[0] && j == findFirstIndexOfTaskType('annexe')[1]) ? urlIcon : ''" <textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('annexe')[0] && j == findFirstIndexOfTaskType('annexe')[1]) ? urlIcon : ''"
*ngIf="!unityService.unity_isActive"
[placeholder]="translate.instant('annexeTask_action_placeholder')" [placeholder]="translate.instant('annexeTask_action_placeholder')"
[matTooltip]="translate.instant('task_action_tooltip')" [matTooltip]="translate.instant('task_action_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"></textarea>
<div class="piece-form-content piece-form-content-unity" *ngIf="unityService.unity_isActive">
<div class="piece-form-content-unity-type">
<label for="type">{{'task_unity_type_label' | translate}}</label>
<select name="type" [(ngModel)]="task.typeUnity" (change)="task.resetUnityContent()">
<option value="getObject">{{'task_unity_type_getObject' | translate}}</option>
<option value="character">{{'task_unity_type_character' | translate}}</option>
<option value="combineObjects">{{'task_unity_type_combineObjects' | translate}}</option>
<option value="talkWithRole">{{'task_unity_type_talkWithRole' | translate}}</option>
<option value="exchangeObjects">{{'task_unity_type_exchangeObjects' | translate}}</option>
<option value="depositObject">{{'task_unity_type_depositObject' | translate}}</option>
<option value="askToSeeRole">{{'task_unity_type_askToSeeRole' | translate}}</option>
<option value="interactObject">{{'task_unity_type_interactObject' | translate}}</option>
</select>
</div>
<div class="piece-form-content-unity-typeContent">
<div class="piece-form-content-unity-typeContent-getObject" *ngIf="task.typeUnity == 'getObject'">
<input type="number" [(ngModel)]="task.objectQuantity"/>
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
<ng-container *ngFor="let role2 of mission.roles">
<ng-container *ngIf="role2 != role">
<ng-container *ngFor="let ressource of role2.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</ng-container>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-character" *ngIf="task.typeUnity == 'character'">
<select [(ngModel)]="task.character">
<option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
<option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
</select>
</div>
<div class="piece-form-content-unity-typeContent-combineObjects" *ngIf="task.typeUnity == 'combineObjects'">
<div class="piece-form-content-unity-typeContent-combineObjects-element" *ngFor="let element of task.combineObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeCombineObject(elementIndex)" *ngIf="task.combineObjects.length > 2"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-combineObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addCombineObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
<div class="piece-form-content-unity-typeContent-talkWithRole" *ngIf="task.typeUnity == 'talkWithRole'">
<select [(ngModel)]="task.role">
<option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
<ng-container *ngFor="let selectableRole of mission.roles">
<option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-exchangeObjects" *ngIf="task.typeUnity == 'exchangeObjects'">
<div class="piece-form-content-unity-typeContent-exchangeObjects-give">
<label>{{'task_unity_exchangeObjects_give_label' | translate}}</label>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.giveObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeGiveObject(elementIndex)" *ngIf="task.giveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeGiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
<div class="piece-form-content-unity-typeContent-exchangeObjects-receive">
<select [(ngModel)]="task.character">
<option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
<option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
</select>
<label>{{'task_unity_exchangeObjects_receive_label' | translate}}</label>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.receiveObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeReceiveObject(elementIndex)" *ngIf="task.receiveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeReceiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
</div>
<div class="piece-form-content-unity-typeContent-depositObject" *ngIf="task.typeUnity == 'depositObject'">
<input type="number" [(ngModel)]="task.objectQuantity"/>
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-askToSeeRole" *ngIf="task.typeUnity == 'askToSeeRole'">
<select [(ngModel)]="task.role">
<option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
<ng-container *ngFor="let selectableRole of mission.roles">
<option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-interactObject" *ngIf="task.typeUnity == 'interactObject'">
<div class="piece-form-content-unity-typeContent-interactObject-select">
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
<ng-container *ngFor="let role2 of mission.roles">
<ng-container *ngFor="let ressource of role2.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-interactObject-name">
<input name="interactionName" type="text" [(ngModel)]="task.interactionName" [placeholder]="translate.instant('task_unity_interactName_placeholder')"/>
</div>
</div>
</div>
<div class="piece-form-content-unity-infos">
<div class="piece-form-content-unity-infos-name">
<label for="name">{{'task_unity_name_label' | translate}}</label>
<input name="name" type="text" [(ngModel)]="task.name"/>
</div>
<div class="piece-form-content-unity-infos-desc">
<label for="description">{{'task_unity_desc_label' | translate}}</label>
<textarea name="description" [(ngModel)]="task.objective"></textarea>
</div>
</div>
</div>
<div class="piece-form-bottom"> <div class="piece-form-bottom">
<div class="piece-form-bottom-duration" <div class="piece-form-bottom-duration"
[matTooltip]="translate.instant('task_duration_tooltip')" [matTooltip]="translate.instant('task_duration_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')"/> <input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')" [disabled]="unityService.unity_isActive"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')"> <select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')" [disabled]="unityService.unity_isActive">
<option value="UT">{{'task_duration_ut' | translate}}</option> <option value="UT">{{'task_duration_ut' | translate}}</option>
<option value="min">{{'task_duration_min' | translate}}</option> <option value="min">{{'task_duration_min' | translate}}</option>
<option value="tours">{{'task_duration_turn' | translate}}</option> <option value="tours">{{'task_duration_turn' | translate}}</option>
...@@ -307,9 +151,13 @@ ...@@ -307,9 +151,13 @@
<mat-icon class="piece-form-bottom-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-bottom-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon>
<button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()" <button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()"
[matTooltip]="translate.instant('task_prerequire_tooltip')" [matTooltip]="translate.instant('task_prerequire_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
{{'task_prerequire_label' | translate}} {{'task_prerequire_label' | translate}}
</button> </button>
</div> </div>
</div> </div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask' : ''" [ngStyle]="{'width': pieceWidth+'px'}" [matTooltip]="translate.instant('task_unity_disabledTask_tooltip')" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"></div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask-attach-right' : ''"></div>
</div> </div>
...@@ -190,6 +190,7 @@ ...@@ -190,6 +190,7 @@
position: absolute; position: absolute;
left: -20px; left: -20px;
top: 200px; top: 200px;
z-index: 101;
} }
} }
......
<div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="onClickPiece()" <div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="!unityService.unity_isActive ? onClickPiece() : ''"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'" : 'var(--piece-background-color)'"
[matTooltip]="translate.instant('finalTask_tooltip')" [matTooltip]="translate.instant('finalTask_tooltip')"
matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips || unityService.unity_isActive"
[class]="pieceDetailsService.piece == task ? 'isActive' : 'border'"> [class]="pieceDetailsService.piece == task ? 'isActive' : 'border'">
<div class="piece-attach piece-attach-left"></div> <div class="piece-attach piece-attach-left"></div>
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<mat-menu #menuChange="matMenu"> <mat-menu #menuChange="matMenu">
<button class="piece-menu-changeMenuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="onClickChange('normal')">{{'task_transform_normalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="onClickChange('normal')">{{'task_transform_normalTask' | translate}}</button>
<button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')">{{'task_transform_annexeTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')" *ngIf="!unityService.unity_isActive">{{'task_transform_annexeTask' | translate}}</button>
<button class="piece-menu-changeMenuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="onClickChange('optionnal')">{{'task_transform_optionnalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="onClickChange('optionnal')" *ngIf="!unityService.unity_isActive">{{'task_transform_optionnalTask' | translate}}</button>
</mat-menu> </mat-menu>
</div> </div>
<mat-icon fontIcon="backspace" (click)="onClickErase()" <mat-icon fontIcon="backspace" (click)="onClickErase()"
...@@ -149,186 +149,31 @@ ...@@ -149,186 +149,31 @@
<div class="piece-form-top"> <div class="piece-form-top">
<input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5" <input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5"
[matTooltip]="translate.instant('task_identifier_tooltip')" [matTooltip]="translate.instant('task_identifier_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"/> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"/>
<div class="piece-form-top-title">{{'finalTask_title' | translate}}</div> <div class="piece-form-top-title">{{'finalTask_title' | translate}}</div>
<mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon> <mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
<mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon>
<span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span> <span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span>
<button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()" <button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()"
[matTooltip]="translate.instant('task_common_tooltip')" [matTooltip]="translate.instant('task_common_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
<mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon> <mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
</button> </button>
</div> </div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('final')[0] && j == findFirstIndexOfTaskType('final')[1]) ? urlIcon : ''" <textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('final')[0] && j == findFirstIndexOfTaskType('final')[1]) ? urlIcon : ''"
*ngIf="!unityService.unity_isActive"
[placeholder]="translate.instant('finalTask_action_placeholder')" [placeholder]="translate.instant('finalTask_action_placeholder')"
[matTooltip]="translate.instant('task_action_tooltip')" [matTooltip]="translate.instant('task_action_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"></textarea>
<div class="piece-form-content piece-form-content-unity" *ngIf="unityService.unity_isActive">
<div class="piece-form-content-unity-type">
<label for="type">{{'task_unity_type_label' | translate}}</label>
<select name="type" [(ngModel)]="task.typeUnity" (change)="task.resetUnityContent()">
<option value="getObject">{{'task_unity_type_getObject' | translate}}</option>
<option value="character">{{'task_unity_type_character' | translate}}</option>
<option value="combineObjects">{{'task_unity_type_combineObjects' | translate}}</option>
<option value="talkWithRole">{{'task_unity_type_talkWithRole' | translate}}</option>
<option value="exchangeObjects">{{'task_unity_type_exchangeObjects' | translate}}</option>
<option value="depositObject">{{'task_unity_type_depositObject' | translate}}</option>
<option value="askToSeeRole">{{'task_unity_type_askToSeeRole' | translate}}</option>
<option value="interactObject">{{'task_unity_type_interactObject' | translate}}</option>
</select>
</div>
<div class="piece-form-content-unity-typeContent">
<div class="piece-form-content-unity-typeContent-getObject" *ngIf="task.typeUnity == 'getObject'">
<input type="number" [(ngModel)]="task.objectQuantity"/>
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
<ng-container *ngFor="let role2 of mission.roles">
<ng-container *ngIf="role2 != role">
<ng-container *ngFor="let ressource of role2.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</ng-container>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-character" *ngIf="task.typeUnity == 'character'">
<select [(ngModel)]="task.character">
<option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
<option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
</select>
</div>
<div class="piece-form-content-unity-typeContent-combineObjects" *ngIf="task.typeUnity == 'combineObjects'">
<div class="piece-form-content-unity-typeContent-combineObjects-element" *ngFor="let element of task.combineObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeCombineObject(elementIndex)" *ngIf="task.combineObjects.length > 2"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-combineObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addCombineObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
<div class="piece-form-content-unity-typeContent-talkWithRole" *ngIf="task.typeUnity == 'talkWithRole'">
<select [(ngModel)]="task.role">
<option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
<ng-container *ngFor="let selectableRole of mission.roles">
<option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-exchangeObjects" *ngIf="task.typeUnity == 'exchangeObjects'">
<div class="piece-form-content-unity-typeContent-exchangeObjects-give">
<label>{{'task_unity_exchangeObjects_give_label' | translate}}</label>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.giveObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeGiveObject(elementIndex)" *ngIf="task.giveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeGiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
<div class="piece-form-content-unity-typeContent-exchangeObjects-receive">
<select [(ngModel)]="task.character">
<option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
<option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
</select>
<label>{{'task_unity_exchangeObjects_receive_label' | translate}}</label>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.receiveObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeReceiveObject(elementIndex)" *ngIf="task.receiveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeReceiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
</div>
<div class="piece-form-content-unity-typeContent-depositObject" *ngIf="task.typeUnity == 'depositObject'">
<input type="number" [(ngModel)]="task.objectQuantity"/>
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-askToSeeRole" *ngIf="task.typeUnity == 'askToSeeRole'">
<select [(ngModel)]="task.role">
<option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
<ng-container *ngFor="let selectableRole of mission.roles">
<option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-interactObject" *ngIf="task.typeUnity == 'interactObject'">
<div class="piece-form-content-unity-typeContent-interactObject-select">
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
<ng-container *ngFor="let role2 of mission.roles">
<ng-container *ngFor="let ressource of role2.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-interactObject-name">
<input name="interactionName" type="text" [(ngModel)]="task.interactionName" [placeholder]="translate.instant('task_unity_interactName_placeholder')"/>
</div>
</div>
</div>
<div class="piece-form-content-unity-infos">
<div class="piece-form-content-unity-infos-name">
<label for="name">{{'task_unity_name_label' | translate}}</label>
<input name="name" type="text" [(ngModel)]="task.name"/>
</div>
<div class="piece-form-content-unity-infos-desc">
<label for="description">{{'task_unity_desc_label' | translate}}</label>
<textarea name="description" [(ngModel)]="task.objective"></textarea>
</div>
</div>
</div>
<div class="piece-form-bottom"> <div class="piece-form-bottom">
<div class="piece-form-bottom-duration" <div class="piece-form-bottom-duration"
[matTooltip]="translate.instant('task_duration_tooltip')" [matTooltip]="translate.instant('task_duration_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')"/> <input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')" [disabled]="unityService.unity_isActive"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')"> <select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')" [disabled]="unityService.unity_isActive">
<option value="UT">{{'task_duration_ut' | translate}}</option> <option value="UT">{{'task_duration_ut' | translate}}</option>
<option value="min">{{'task_duration_min' | translate}}</option> <option value="min">{{'task_duration_min' | translate}}</option>
<option value="tours">{{'task_duration_turn' | translate}}</option> <option value="tours">{{'task_duration_turn' | translate}}</option>
...@@ -340,9 +185,12 @@ ...@@ -340,9 +185,12 @@
<mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon>
<button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()" <button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()"
[matTooltip]="translate.instant('task_prerequire_tooltip')" [matTooltip]="translate.instant('task_prerequire_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
{{'task_prerequire_label' | translate}} {{'task_prerequire_label' | translate}}
</button> </button>
</div> </div>
</div> </div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask' : ''" [ngStyle]="{'width': pieceWidth+'px'}" [matTooltip]="translate.instant('task_unity_disabledTask_tooltip')" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"></div>
</div> </div>
...@@ -230,6 +230,7 @@ ...@@ -230,6 +230,7 @@
position: absolute; position: absolute;
left: -20px; left: -20px;
top: 200px; top: 200px;
z-index: 101;
} }
} }
......
<div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="onClickPiece()" <div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="!unityService.unity_isActive ? onClickPiece() : ''"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'" : 'var(--piece-background-color)'"
[matTooltip]="translate.instant('optionnalTask_tooltip')" [matTooltip]="translate.instant('optionnalTask_tooltip')"
matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips || unityService.unity_isActive"
[class]="pieceDetailsService.piece == task ? 'isActive' : 'border'"> [class]="pieceDetailsService.piece == task ? 'isActive' : 'border'">
<div class="piece-attach piece-attach-left"></div> <div class="piece-attach piece-attach-left"></div>
<div class="piece-attach piece-attach-right" [style.background]="task.supplementaryRole ? task.supplementaryRole.color : 'var(--piece-background-color)'"></div> <div class="piece-attach piece-attach-right" [style.background]="task.supplementaryRole ? task.supplementaryRole.color : 'var(--piece-background-color)'"></div>
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
<mat-menu #menuChange="matMenu"> <mat-menu #menuChange="matMenu">
<button class="piece-menu-changeMenuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="onClickChange('normal')">{{'task_transform_normalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#b9dfe3'" mat-menu-item (click)="onClickChange('normal')">{{'task_transform_normalTask' | translate}}</button>
<button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')">{{'task_transform_annexeTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')" *ngIf="!unityService.unity_isActive">{{'task_transform_annexeTask' | translate}}</button>
<button class="piece-menu-changeMenuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="onClickChange('final')" *ngIf="canChangeInFinalTask()">{{'task_transform_finalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#b28386'" mat-menu-item (click)="onClickChange('final')" *ngIf="canChangeInFinalTask() && !unityService.unity_isActive">{{'task_transform_finalTask' | translate}}</button>
</mat-menu> </mat-menu>
</div> </div>
<mat-icon fontIcon="backspace" (click)="onClickErase()" <mat-icon fontIcon="backspace" (click)="onClickErase()"
...@@ -150,186 +150,31 @@ ...@@ -150,186 +150,31 @@
<div class="piece-form-top"> <div class="piece-form-top">
<input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5" <input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5"
[matTooltip]="translate.instant('task_identifier_tooltip')" [matTooltip]="translate.instant('task_identifier_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"/> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"/>
<div class="piece-form-top-title">{{'optionnalTask_title1' | translate}}<br>{{'optionnalTask_title2' | translate}}</div> <div class="piece-form-top-title">{{'optionnalTask_title1' | translate}}<br>{{'optionnalTask_title2' | translate}}</div>
<mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon> <mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
<mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon>
<span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span> <span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span>
<button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()" <button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()"
[matTooltip]="translate.instant('task_common_tooltip')" [matTooltip]="translate.instant('task_common_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
<mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon> <mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
</button> </button>
</div> </div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('optionnal')[0] && j == findFirstIndexOfTaskType('optionnal')[1]) ? urlIcon : ''" <textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('optionnal')[0] && j == findFirstIndexOfTaskType('optionnal')[1]) ? urlIcon : ''"
*ngIf="!unityService.unity_isActive"
[placeholder]="translate.instant('optionnalTask_action_placeholder')" [placeholder]="translate.instant('optionnalTask_action_placeholder')"
[matTooltip]="translate.instant('task_action_tooltip')" [matTooltip]="translate.instant('task_action_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"></textarea>
<div class="piece-form-content piece-form-content-unity" *ngIf="unityService.unity_isActive">
<div class="piece-form-content-unity-type">
<label for="type">{{'task_unity_type_label' | translate}}</label>
<select name="type" [(ngModel)]="task.typeUnity" (change)="task.resetUnityContent()">
<option value="getObject">{{'task_unity_type_getObject' | translate}}</option>
<option value="character">{{'task_unity_type_character' | translate}}</option>
<option value="combineObjects">{{'task_unity_type_combineObjects' | translate}}</option>
<option value="talkWithRole">{{'task_unity_type_talkWithRole' | translate}}</option>
<option value="exchangeObjects">{{'task_unity_type_exchangeObjects' | translate}}</option>
<option value="depositObject">{{'task_unity_type_depositObject' | translate}}</option>
<option value="askToSeeRole">{{'task_unity_type_askToSeeRole' | translate}}</option>
<option value="interactObject">{{'task_unity_type_interactObject' | translate}}</option>
</select>
</div>
<div class="piece-form-content-unity-typeContent">
<div class="piece-form-content-unity-typeContent-getObject" *ngIf="task.typeUnity == 'getObject'">
<input type="number" [(ngModel)]="task.objectQuantity"/>
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
<ng-container *ngFor="let role2 of mission.roles">
<ng-container *ngIf="role2 != role">
<ng-container *ngFor="let ressource of role2.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</ng-container>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-character" *ngIf="task.typeUnity == 'character'">
<select [(ngModel)]="task.character">
<option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
<option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
</select>
</div>
<div class="piece-form-content-unity-typeContent-combineObjects" *ngIf="task.typeUnity == 'combineObjects'">
<div class="piece-form-content-unity-typeContent-combineObjects-element" *ngFor="let element of task.combineObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeCombineObject(elementIndex)" *ngIf="task.combineObjects.length > 2"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-combineObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addCombineObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
<div class="piece-form-content-unity-typeContent-talkWithRole" *ngIf="task.typeUnity == 'talkWithRole'">
<select [(ngModel)]="task.role">
<option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
<ng-container *ngFor="let selectableRole of mission.roles">
<option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-exchangeObjects" *ngIf="task.typeUnity == 'exchangeObjects'">
<div class="piece-form-content-unity-typeContent-exchangeObjects-give">
<label>{{'task_unity_exchangeObjects_give_label' | translate}}</label>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.giveObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeGiveObject(elementIndex)" *ngIf="task.giveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeGiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
<div class="piece-form-content-unity-typeContent-exchangeObjects-receive">
<select [(ngModel)]="task.character">
<option [ngValue]="null" selected disabled>{{'task_unity_characterName_label' | translate}}</option>
<option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
</select>
<label>{{'task_unity_exchangeObjects_receive_label' | translate}}</label>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element" *ngFor="let element of task.receiveObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeExchangeReceiveObject(elementIndex)" *ngIf="task.receiveObjects.length > 1"><mat-icon fontIcon="remove"></mat-icon></button>
<div class="piece-form-content-unity-typeContent-exchangeObjects-element-object">
<input type="number" [(ngModel)]="element[1]"/>
<select [(ngModel)]="element[0]">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
</div>
<button mat-button class="piece-form-content-unity-typeContent-button piece-form-content-unity-typeContent-button-add" (click)="addExchangeReceiveObject()"><mat-icon fontIcon="add"></mat-icon></button>
</div>
</div>
<div class="piece-form-content-unity-typeContent-depositObject" *ngIf="task.typeUnity == 'depositObject'">
<input type="number" [(ngModel)]="task.objectQuantity"/>
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of role.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-askToSeeRole" *ngIf="task.typeUnity == 'askToSeeRole'">
<select [(ngModel)]="task.role">
<option [ngValue]="''" selected disabled>{{'task_unity_roleName_label' | translate}}</option>
<ng-container *ngFor="let selectableRole of mission.roles">
<option *ngIf="selectableRole != role && selectableRole.intitule != ''">{{selectableRole.intitule}}</option>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-interactObject" *ngIf="task.typeUnity == 'interactObject'">
<div class="piece-form-content-unity-typeContent-interactObject-select">
<select [(ngModel)]="task.object">
<option [ngValue]="null" selected disabled>{{'task_unity_objectName_label' | translate}}</option>
<ng-container *ngFor="let ressource of scenario.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
<ng-container *ngFor="let role2 of mission.roles">
<ng-container *ngFor="let ressource of role2.ressources">
<option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
</ng-container>
</ng-container>
</select>
</div>
<div class="piece-form-content-unity-typeContent-interactObject-name">
<input name="interactionName" type="text" [(ngModel)]="task.interactionName" [placeholder]="translate.instant('task_unity_interactName_placeholder')"/>
</div>
</div>
</div>
<div class="piece-form-content-unity-infos">
<div class="piece-form-content-unity-infos-name">
<label for="name">{{'task_unity_name_label' | translate}}</label>
<input name="name" type="text" [(ngModel)]="task.name"/>
</div>
<div class="piece-form-content-unity-infos-desc">
<label for="description">{{'task_unity_desc_label' | translate}}</label>
<textarea name="description" [(ngModel)]="task.objective"></textarea>
</div>
</div>
</div>
<div class="piece-form-bottom"> <div class="piece-form-bottom">
<div class="piece-form-bottom-duration" <div class="piece-form-bottom-duration"
[matTooltip]="translate.instant('task_duration_tooltip')" [matTooltip]="translate.instant('task_duration_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')"/> <input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')" [disabled]="unityService.unity_isActive"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')"> <select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')" [disabled]="unityService.unity_isActive">
<option value="UT">{{'task_duration_ut' | translate}}</option> <option value="UT">{{'task_duration_ut' | translate}}</option>
<option value="min">{{'task_duration_min' | translate}}</option> <option value="min">{{'task_duration_min' | translate}}</option>
<option value="tours">{{'task_duration_turn' | translate}}</option> <option value="tours">{{'task_duration_turn' | translate}}</option>
...@@ -341,9 +186,13 @@ ...@@ -341,9 +186,13 @@
<mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon>
<button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()" <button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()"
[matTooltip]="translate.instant('task_prerequire_tooltip')" [matTooltip]="translate.instant('task_prerequire_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
{{'task_prerequire_label' | translate}} {{'task_prerequire_label' | translate}}
</button> </button>
</div> </div>
</div> </div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask' : ''" [ngStyle]="{'width': pieceWidth+'px'}" [matTooltip]="translate.instant('task_unity_disabledTask_tooltip')" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"></div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask-attach-right' : ''"></div>
</div> </div>
...@@ -241,6 +241,7 @@ ...@@ -241,6 +241,7 @@
position: absolute; position: absolute;
left: -20px; left: -20px;
top: 200px; top: 200px;
z-index: 101;
} }
} }
......
<div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="onClickPiece()" <div class="piece" [ngStyle]="{'width': pieceWidth+'px'}" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'; displaySymbolChoice='hide'" (click)="!unityService.unity_isActive ? onClickPiece() : ''"
[style.background]="task.supplementaryRole ? [style.background]="task.supplementaryRole ?
'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)' 'linear-gradient(140deg, var(--piece-background-color) 0%, var(--piece-background-color) 55%,'+task.supplementaryRole.color+' 55%,'+task.supplementaryRole.color+' 100%)'
: 'var(--piece-background-color)'" : 'var(--piece-background-color)'"
...@@ -138,27 +138,30 @@ ...@@ -138,27 +138,30 @@
<div class="piece-form-top"> <div class="piece-form-top">
<input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5" <input class="piece-form-top-identifier" name="identifier" type="text" [(ngModel)]="task.identifier" (change)="changeIdentifier($event)" placeholder="A" min="1" maxlength="5"
[matTooltip]="translate.instant('task_identifier_tooltip')" [matTooltip]="translate.instant('task_identifier_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"/> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"/>
<div class="piece-form-top-title">{{'randomEvent_title1' | translate}}<br>{{'randomEvent_title2' | translate}}</div> <div class="piece-form-top-title">{{'randomEvent_title1' | translate}}<br>{{'randomEvent_title2' | translate}}</div>
<mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon> <mat-icon class="piece-form-top-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
<mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-top-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon>
<span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span> <span class="piece-form-top-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span>
<button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()" <button mat-button class="piece-form-top-symbol" (click)="changeDisplaySymbolChoice()"
[matTooltip]="translate.instant('task_common_tooltip')" [matTooltip]="translate.instant('task_common_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
<mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon> <mat-icon *ngIf="task.symbol.symbol" [style.color]="task.symbol.color" [fontIcon]="task.symbol.symbol"></mat-icon>
</button> </button>
</div> </div>
<textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('event')[0] && j == findFirstIndexOfTaskType('event')[1]) ? urlIcon : ''" <textarea class="piece-form-content" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('event')[0] && j == findFirstIndexOfTaskType('event')[1]) ? urlIcon : ''"
[placeholder]="translate.instant('randomEvent_action_placeholder')" [placeholder]="translate.instant('randomEvent_action_placeholder')"
[matTooltip]="translate.instant('task_action_tooltip')" [matTooltip]="translate.instant('task_action_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"></textarea>
<div class="piece-form-bottom"> <div class="piece-form-bottom">
<div class="piece-form-bottom-duration" <div class="piece-form-bottom-duration"
[matTooltip]="translate.instant('task_duration_tooltip')" [matTooltip]="translate.instant('task_duration_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')"/> <input name="value" type="number" [(ngModel)]="task.duration" (input)="durationChange()" min="0" (change)="task.duration < 0 ? task.duration = 0 : ''; editTrace($event,'Task_duration')" [disabled]="unityService.unity_isActive"/>
<select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')"> <select name="unite" [(ngModel)]="task.durationUnit" (change)="durationChange(); editTrace($event,'Task_duration_unit')" [disabled]="unityService.unity_isActive">
<option value="UT">{{'task_duration_ut' | translate}}</option> <option value="UT">{{'task_duration_ut' | translate}}</option>
<option value="min">{{'task_duration_min' | translate}}</option> <option value="min">{{'task_duration_min' | translate}}</option>
<option value="tours">{{'task_duration_turn' | translate}}</option> <option value="tours">{{'task_duration_turn' | translate}}</option>
...@@ -170,9 +173,13 @@ ...@@ -170,9 +173,13 @@
<mat-icon class="piece-form-bottom-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-bottom-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon>
<button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()" <button mat-button class="piece-form-bottom-prerequires" (click)="changeDisplayPrerequires()"
[matTooltip]="translate.instant('task_prerequire_tooltip')" [matTooltip]="translate.instant('task_prerequire_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
{{'task_prerequire_label' | translate}} {{'task_prerequire_label' | translate}}
</button> </button>
</div> </div>
</div> </div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask' : ''" [ngStyle]="{'width': pieceWidth+'px'}" [matTooltip]="translate.instant('task_unity_disabledTask_tooltip')" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"></div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask-attach-right' : ''"></div>
</div> </div>
...@@ -232,6 +232,7 @@ ...@@ -232,6 +232,7 @@
position: absolute; position: absolute;
left: -20px; left: -20px;
top: 200px; top: 200px;
z-index: 101;
} }
} }
......
<div class="piece" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'" (click)="onClickPiece()" <div class="piece" (mouseover)="displayMenu='show'" (mouseleave)="displayMenu='hide'" (click)="!unityService.unity_isActive ? onClickPiece() : ''"
[class]="pieceDetailsService.piece == task ? 'isActive' : 'border'"> [class]="pieceDetailsService.piece == task ? 'isActive' : 'border'">
<div class="piece-attach piece-attach-left"></div> <div class="piece-attach piece-attach-left"></div>
...@@ -106,7 +106,8 @@ ...@@ -106,7 +106,8 @@
<textarea [(ngModel)]="task.objective" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('repeat')[0] && j == findFirstIndexOfTaskType('repeat')[1]) ? urlIcon : ''" <textarea [(ngModel)]="task.objective" [(ngModel)]="task.objective" (change)="editTrace($event,'Task_action')" [style.background-image]="(i == findFirstIndexOfTaskType('repeat')[0] && j == findFirstIndexOfTaskType('repeat')[1]) ? urlIcon : ''"
[placeholder]="translate.instant('repeatTask_action_placeholder')" [placeholder]="translate.instant('repeatTask_action_placeholder')"
[matTooltip]="translate.instant('task_action_tooltip')" [matTooltip]="translate.instant('task_action_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></textarea> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive"></textarea>
<mat-icon class="piece-form-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon> <mat-icon class="piece-form-comment" fontIcon="comment" *ngIf="task.comments.length > 0"></mat-icon>
<mat-icon class="piece-form-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-repeat" fontIcon="refresh" *ngIf="(task.repeat.iteration > 0 || task.repeat.while != '' || task.repeat.limitMissionRepeat) && !unityService.unity_isActive"></mat-icon>
<span class="piece-form-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span> <span class="piece-form-repeat-off" *ngIf="(task.repeat.iteration == 0 && task.repeat.while == '') && task.repeat.limitMissionRepeat && !unityService.unity_isActive"></span>
...@@ -116,8 +117,11 @@ ...@@ -116,8 +117,11 @@
<mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon> <mat-icon class="piece-form-interrupt" fontIcon="front_hand" *ngIf="task.interrupt != '' && !unityService.unity_isActive"></mat-icon>
<button mat-button class="piece-form-prerequires" (click)="changeDisplayPrerequires()" <button mat-button class="piece-form-prerequires" (click)="changeDisplayPrerequires()"
[matTooltip]="translate.instant('task_prerequire_tooltip')" [matTooltip]="translate.instant('task_prerequire_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
[disabled]="unityService.unity_isActive">
{{'task_prerequire_label' | translate}} {{'task_prerequire_label' | translate}}
</button> </button>
</div> </div>
<div [ngClass]="unityService.unity_isActive ? 'disabledTask' : ''" [matTooltip]="translate.instant('task_unity_disabledTask_tooltip')" matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"></div>
</div> </div>
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
position: absolute; position: absolute;
left: -20px; left: -20px;
top: 200px; top: 200px;
z-index: 101;
} }
} }
...@@ -268,4 +269,10 @@ ...@@ -268,4 +269,10 @@
.isActive::after, .border::after { .isActive::after, .border::after {
border-top-right-radius: 50%; border-top-right-radius: 50%;
border-bottom-right-radius: 50%; border-bottom-right-radius: 50%;
}
.disabledTask {
border-top-right-radius: 50%;
border-bottom-right-radius: 50%;
width: 400px;
} }
\ No newline at end of file
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
<div> <div>
<mat-icon fontIcon="change_circle" [matMenuTriggerFor]="menuChange" <mat-icon fontIcon="change_circle" [matMenuTriggerFor]="menuChange"
[matTooltip]="translate.instant('task_transform_tooltip')" [matTooltip]="translate.instant('task_transform_tooltip')"
matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon> matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips"
*ngIf="!unityService.unity_isActive"></mat-icon>
<mat-menu #menuChange="matMenu"> <mat-menu #menuChange="matMenu">
<button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')">{{'task_transform_annexeTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#bccecc'" mat-menu-item (click)="onClickChange('annexe')">{{'task_transform_annexeTask' | translate}}</button>
<button class="piece-menu-changeMenuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="onClickChange('optionnal')">{{'task_transform_optionnalTask' | translate}}</button> <button class="piece-menu-changeMenuButton" [style.background-color]="'#e8e3b3'" mat-menu-item (click)="onClickChange('optionnal')">{{'task_transform_optionnalTask' | translate}}</button>
...@@ -171,11 +172,11 @@ ...@@ -171,11 +172,11 @@
<select name="type" [(ngModel)]="task.typeUnity" (change)="task.resetUnityContent()"> <select name="type" [(ngModel)]="task.typeUnity" (change)="task.resetUnityContent()">
<option value="getObject">{{'task_unity_type_getObject' | translate}}</option> <option value="getObject">{{'task_unity_type_getObject' | translate}}</option>
<option value="character">{{'task_unity_type_character' | translate}}</option> <option value="character">{{'task_unity_type_character' | translate}}</option>
<option value="combineObjects">{{'task_unity_type_combineObjects' | translate}}</option> <!--<option value="combineObjects">{{'task_unity_type_combineObjects' | translate}}</option>-->
<option value="talkWithRole">{{'task_unity_type_talkWithRole' | translate}}</option> <!--<option value="talkWithRole">{{'task_unity_type_talkWithRole' | translate}}</option>-->
<option value="exchangeObjects">{{'task_unity_type_exchangeObjects' | translate}}</option> <!--<option value="exchangeObjects">{{'task_unity_type_exchangeObjects' | translate}}</option>-->
<option value="depositObject">{{'task_unity_type_depositObject' | translate}}</option> <!--<option value="depositObject">{{'task_unity_type_depositObject' | translate}}</option>-->
<option value="askToSeeRole">{{'task_unity_type_askToSeeRole' | translate}}</option> <!--<option value="askToSeeRole">{{'task_unity_type_askToSeeRole' | translate}}</option>-->
<option value="interactObject">{{'task_unity_type_interactObject' | translate}}</option> <option value="interactObject">{{'task_unity_type_interactObject' | translate}}</option>
</select> </select>
</div> </div>
...@@ -204,7 +205,7 @@ ...@@ -204,7 +205,7 @@
<option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option> <option *ngFor="let character of scenario.characters" [ngValue]="character">{{character.name}}</option>
</select> </select>
</div> </div>
<!--
<div class="piece-form-content-unity-typeContent-combineObjects" *ngIf="task.typeUnity == 'combineObjects'"> <div class="piece-form-content-unity-typeContent-combineObjects" *ngIf="task.typeUnity == 'combineObjects'">
<div class="piece-form-content-unity-typeContent-combineObjects-element" *ngFor="let element of task.combineObjects, let elementIndex = index"> <div class="piece-form-content-unity-typeContent-combineObjects-element" *ngFor="let element of task.combineObjects, let elementIndex = index">
<button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeCombineObject(elementIndex)" *ngIf="task.combineObjects.length > 2"><mat-icon fontIcon="remove"></mat-icon></button> <button mat-button class="piece-form-content-unity-typeContent-button" (click)="removeCombineObject(elementIndex)" *ngIf="task.combineObjects.length > 2"><mat-icon fontIcon="remove"></mat-icon></button>
...@@ -288,7 +289,7 @@ ...@@ -288,7 +289,7 @@
</ng-container> </ng-container>
</select> </select>
</div> </div>
-->
<div class="piece-form-content-unity-typeContent-interactObject" *ngIf="task.typeUnity == 'interactObject'"> <div class="piece-form-content-unity-typeContent-interactObject" *ngIf="task.typeUnity == 'interactObject'">
<div class="piece-form-content-unity-typeContent-interactObject-select"> <div class="piece-form-content-unity-typeContent-interactObject-select">
<select [(ngModel)]="task.object"> <select [(ngModel)]="task.object">
......
...@@ -238,6 +238,7 @@ ...@@ -238,6 +238,7 @@
position: absolute; position: absolute;
left: -20px; left: -20px;
top: 200px; top: 200px;
z-index: 101;
} }
} }
......
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
"enableHelp_label": "Enable the tooltips", "enableHelp_label": "Enable the tooltips",
"enableHelp_tooltip": "Description of each element of the RLG Maker.", "enableHelp_tooltip": "Description of each element of the RLG Maker.",
"unity_label": "Integrate the game into Unity", "unity_label": "Integrate the game into Unity",
"unity_tooltip": "Usage in a specific game template. Contact gaelle.guigon@imt-nord-europe.fr for more information.", "unity_tooltip": "Usage in a specific game template. Contact gaelle.guigon@imt-nord-europe.fr for more information. Only normal tasks are active in this mode.",
"unity_export_notavailable": "Attention, file export for the Unity application is not yet available in this version, only editing of the scenario in preparation is possible",
"download_label": "Download this scenario", "download_label": "Download this scenario",
"download_tooltip": "Download a backup of the scenario.", "download_tooltip": "Download a backup of the scenario.",
"exportUnity_label": "Export Role",
"exportUnity_tooltip": "Export the desired role in a format readable by the third-party application. Contact gaelle.guigon@imt-nord-europe.fr for more information. Attention, an exported file cannot be used to reload a saved scenario in RLG Maker.",
"upload_label": "Import a scenario", "upload_label": "Import a scenario",
"upload_tooltip": "Import a backup of the scenario.", "upload_tooltip": "Import a backup of the scenario.",
"manual_label": "Download the guide", "manual_label": "Download the guide",
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"snackbar_roleName": "Attention, this title is already used in this Mission", "snackbar_roleName": "Attention, this title is already used in this Mission",
"snackbar_moveOptionnalTask": "Make sure to keep alternative tasks grouped in the same column", "snackbar_moveOptionnalTask": "Make sure to keep alternative tasks grouped in the same column",
"snackbar_deleteOptionnalTask": "Attention, alternative tasks go in pairs at minimum, ensure that the user always has a choice between several of these tasks", "snackbar_deleteOptionnalTask": "Attention, alternative tasks go in pairs at minimum, ensure that the user always has a choice between several of these tasks",
"snackbar_unity_exportFailed": "Export failed, please ensure all exported fields are properly filled",
"siderTitle_game": "Game", "siderTitle_game": "Game",
"siderTitle_mission": "Mission", "siderTitle_mission": "Mission",
...@@ -231,6 +233,7 @@ ...@@ -231,6 +233,7 @@
"task_unity_exchangeObjects_receive_label": "To receive:", "task_unity_exchangeObjects_receive_label": "To receive:",
"task_unity_name_label": "Name:", "task_unity_name_label": "Name:",
"task_unity_desc_label": "Descr:", "task_unity_desc_label": "Descr:",
"task_unity_disabledTask_tooltip": "Task disabled, only normal tasks are enabled in Unity mode",
"task_copy_snackbar": "Task copied, go to another role to paste it\nSome fields are not copied, make sure to manually verify the information when pasting", "task_copy_snackbar": "Task copied, go to another role to paste it\nSome fields are not copied, make sure to manually verify the information when pasting",
"normalTask_title": "Task", "normalTask_title": "Task",
"normalTask_action_placeholder": "Ordering the main HTML tags", "normalTask_action_placeholder": "Ordering the main HTML tags",
......
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
"enableHelp_label": "Activer les aides", "enableHelp_label": "Activer les aides",
"enableHelp_tooltip": "Descriptif de chaque élément du RLG Maker.", "enableHelp_tooltip": "Descriptif de chaque élément du RLG Maker.",
"unity_label": "Intégrer le jeu sous Unity", "unity_label": "Intégrer le jeu sous Unity",
"unity_tooltip": "Utilisation dans un template de jeu précis. Contacter gaelle.guigon@imt-nord-europe.fr pour plus d'informations.", "unity_tooltip": "Utilisation dans un template de jeu précis. Contacter gaelle.guigon@imt-nord-europe.fr pour plus d'informations. Seules les tâches normale sont actives dans ce mode.",
"unity_export_notavailable": "Attention, l'export de fichier pour l'application Unity n'est pas encore disponible dans cette version, seule l'édition du scénario en prévision est possible",
"download_label": "Télécharger ce scénario", "download_label": "Télécharger ce scénario",
"download_tooltip": "Télécharger une sauvegarde du scénario.", "download_tooltip": "Télécharger une sauvegarde du scénario.",
"exportUnity_label": "Exporter un rôle",
"exportUnity_tooltip": "Exporter le rôle voulu au format lisible par l'application tierce. Contacter gaelle.guigon@imt-nord-europe.fr pour plus d'informations. Attention, un fichier exporté ne peut être utilisé pour recharger une sauvegarde du scénario dans RLG Maker.",
"upload_label": "Importer un scénario", "upload_label": "Importer un scénario",
"upload_tooltip": "Importer une sauvegarde du scénario.", "upload_tooltip": "Importer une sauvegarde du scénario.",
"manual_label": "Télécharger le guide", "manual_label": "Télécharger le guide",
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"snackbar_roleName": "Attention, cet intitulé est déjà utilisé dans cette Mission", "snackbar_roleName": "Attention, cet intitulé est déjà utilisé dans cette Mission",
"snackbar_moveOptionnalTask": "Veillez à garder les tâches alternatives groupées dans la même colonne", "snackbar_moveOptionnalTask": "Veillez à garder les tâches alternatives groupées dans la même colonne",
"snackbar_deleteOptionnalTask": "Attention, les tâches alternatives vont au minimum par deux, veillez à ce que l'utilisateur ait toujours le choix entre plusieurs de ces tâches", "snackbar_deleteOptionnalTask": "Attention, les tâches alternatives vont au minimum par deux, veillez à ce que l'utilisateur ait toujours le choix entre plusieurs de ces tâches",
"snackbar_unity_exportFailed": "Export échoué, veillez à vérifier que tous les champs exportés soient bien remplis",
"siderTitle_game": "Jeu", "siderTitle_game": "Jeu",
"siderTitle_mission": "Mission", "siderTitle_mission": "Mission",
...@@ -231,6 +233,7 @@ ...@@ -231,6 +233,7 @@
"task_unity_exchangeObjects_receive_label": "A recevoir :", "task_unity_exchangeObjects_receive_label": "A recevoir :",
"task_unity_name_label": "Nom :", "task_unity_name_label": "Nom :",
"task_unity_desc_label": "Descr :", "task_unity_desc_label": "Descr :",
"task_unity_disabledTask_tooltip": "Tâche désactivée, seules les tâches normales sont activées en mode Unity",
"task_copy_snackbar": "Tâche copiée, rendez-vous dans un autre rôle pour le coller\nCertains champs ne sont pas copiés, veillez à vérifier manuellement les informations lors du collage", "task_copy_snackbar": "Tâche copiée, rendez-vous dans un autre rôle pour le coller\nCertains champs ne sont pas copiés, veillez à vérifier manuellement les informations lors du collage",
"normalTask_title": "Tâche", "normalTask_title": "Tâche",
"normalTask_action_placeholder": "Positionner dans l'ordre les balises HTML principales", "normalTask_action_placeholder": "Positionner dans l'ordre les balises HTML principales",
......
...@@ -101,6 +101,36 @@ $highlight-color: #009b00; ...@@ -101,6 +101,36 @@ $highlight-color: #009b00;
border: 1px solid black; border: 1px solid black;
} }
select:disabled, button:disabled {
opacity: 0.5;
color: black !important;
}
.disabledTask {
background-color: #d3d3d3;
opacity: 0.6;
height: 400px;
position: absolute;
top: 0;
z-index: 100;
&-attach-right {
width: 40px;
height: 40px;
transform: translateY(-50%) rotate(45deg);
position: absolute;
right: -20px;
top: 200px;
background-color: #d3d3d3;
opacity: 0.6;
pointer-events: none;
z-index: 100;
clip-path: polygon(0 0, 100% 100%, 100% 0);
}
}
.snackbar-fail { .snackbar-fail {
background-color: #de3e44; background-color: #de3e44;
color: white; color: white;
......
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