Commit 34f8d656 authored by Romain DELEAU's avatar Romain DELEAU

Task unity mode + fix on clear character in task reward on character delete +...

Task unity mode + fix on clear character in task reward on character delete + fix en translate of 'plan de relance'
parent 22308e3a
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<img class="langIcon" [src]="'./assets/lang/icons/'+selectedLang+'.png'"/> <img class="langIcon" [src]="'./assets/lang/icons/'+selectedLang+'.png'"/>
<span>{{'lang_label' | translate}}</span> <span>{{'lang_label' | translate}}</span>
</button> </button>
<span mat-menu-item (click)="unityService.unity_isActive = !unityService.unity_isActive; unityTrace($event)" <span mat-menu-item (click)="unityService.unity_isActive = !unityService.unity_isActive; unityTrace($event); minimapService.reset()"
[matTooltip]="translate.instant('unity_tooltip')" [matTooltip]="translate.instant('unity_tooltip')"
matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltips">
<input name="unity" type="checkbox" [(ngModel)]="unityService.unity_isActive"/> <input name="unity" type="checkbox" [(ngModel)]="unityService.unity_isActive"/>
......
...@@ -334,6 +334,68 @@ export class AppComponent { ...@@ -334,6 +334,68 @@ export class AppComponent {
let i: number = scenario.characters.findIndex(element => element.name == (task.reward as Character).name && element.description == (task.reward as Character).description && element.color == (task.reward as Character).color); let i: number = scenario.characters.findIndex(element => element.name == (task.reward as Character).name && element.description == (task.reward as Character).description && element.color == (task.reward as Character).color);
task.reward = scenario.characters[i]; task.reward = scenario.characters[i];
} }
if ((task.typeUnity == 'getObject' || task.typeUnity == 'depositObject' || task.typeUnity == 'interactObject') && task.object) {
if (scenario.ressources.some(element => element.name == (task.object as Ressource).name && element.number == (task.object as Ressource).number && element.type == (task.object as Ressource).type)) {
let i: number = scenario.ressources.findIndex(element => element.name == (task.object as Ressource).name && element.number == (task.object as Ressource).number && element.type == (task.object as Ressource).type);
task.object = scenario.ressources[i];
} else {
let i: number = role.ressources.findIndex(element => element.name == (task.object as Ressource).name && element.number == (task.object as Ressource).number && element.type == (task.object as Ressource).type);
task.object = role.ressources[i];
}
}
if ((task.typeUnity == 'askTooSeeRole' || task.typeUnity == 'talkWithRole') && task.role) {
mission.roles.forEach(role => {
if (role.intitule == task.role) {
task.role == role.intitule;
}
});
}
if ((task.typeUnity == 'character' || task.typeUnity == 'exchangeObjects') && task.character) {
scenario.characters.forEach(character => {
if (character.color == task.character?.color && character.description == task.character.description && character.name == task.character.name && character.tel == task.character.tel) {
task.character = character;
}
});
}
if ((task.typeUnity == 'combineObjects')) {
task.combineObjects.forEach((combineObject, index) => {
if (combineObject[0] != null) {
if (scenario.ressources.some(element => element.name == (combineObject[0] as Ressource).name && element.number == (combineObject[0] as Ressource).number && element.type == (combineObject[0] as Ressource).type)) {
let i: number = scenario.ressources.findIndex(element => element.name == (combineObject[0] as Ressource).name && element.number == (combineObject[0] as Ressource).number && element.type == (combineObject[0] as Ressource).type);
task.combineObjects[index][0] = scenario.ressources[i];
} else {
let i: number = role.ressources.findIndex(element => element.name == (combineObject[0] as Ressource).name && element.number == (combineObject[0] as Ressource).number && element.type == (combineObject[0] as Ressource).type);
task.combineObjects[index][0] = role.ressources[i];
}
}
});
}
if ((task.typeUnity == 'exchangeObjects')) {
task.giveObjects.forEach((giveObject, index) => {
if (giveObject[0] != null) {
if (scenario.ressources.some(element => element.name == (giveObject[0] as Ressource).name && element.number == (giveObject[0] as Ressource).number && element.type == (giveObject[0] as Ressource).type)) {
let i: number = scenario.ressources.findIndex(element => element.name == (giveObject[0] as Ressource).name && element.number == (giveObject[0] as Ressource).number && element.type == (giveObject[0] as Ressource).type);
task.giveObjects[index][0] = scenario.ressources[i];
} else {
let i: number = role.ressources.findIndex(element => element.name == (giveObject[0] as Ressource).name && element.number == (giveObject[0] as Ressource).number && element.type == (giveObject[0] as Ressource).type);
task.giveObjects[index][0] = role.ressources[i];
}
}
})
task.receiveObjects.forEach((receiveObject, index) => {
if (receiveObject[0] != null) {
if (scenario.ressources.some(element => element.name == (receiveObject[0] as Ressource).name && element.number == (receiveObject[0] as Ressource).number && element.type == (receiveObject[0] as Ressource).type)) {
let i: number = scenario.ressources.findIndex(element => element.name == (receiveObject[0] as Ressource).name && element.number == (receiveObject[0] as Ressource).number && element.type == (receiveObject[0] as Ressource).type);
task.receiveObjects[index][0] = scenario.ressources[i];
} else {
let i: number = role.ressources.findIndex(element => element.name == (receiveObject[0] as Ressource).name && element.number == (receiveObject[0] as Ressource).number && element.type == (receiveObject[0] as Ressource).type);
task.receiveObjects[index][0] = role.ressources[i];
}
}
})
}
} }
}); });
}); });
......
...@@ -21,6 +21,18 @@ export class Task { ...@@ -21,6 +21,18 @@ export class Task {
characters: Character[] = []; characters: Character[] = [];
repeat: Repeat = new Repeat(); repeat: Repeat = new Repeat();
name: string = '';
typeUnity: string = 'getObject';
objectQuantity: number = 1;
object: Ressource | null = null;
interactionName: string = '';
character: Character | null = null;
combineObjects: (Ressource | number | null)[][] = [[null,1],[null,1]]; // [0] = Ressource & [1] = quantity
giveObjects: (Ressource | number | null)[][] = [[null,1]];
receiveObjects: (Ressource | number | null)[][] = [[null,1]];
other: string = '';
role: string = ''; //role.intitule
supplementaryRole!: SupplementaryRole; supplementaryRole!: SupplementaryRole;
interrupt: string = ''; interrupt: string = '';
...@@ -47,4 +59,16 @@ export class Task { ...@@ -47,4 +59,16 @@ export class Task {
this.reward = null; this.reward = null;
this.rewardQuantity = 1; this.rewardQuantity = 1;
} }
public resetUnityContent(): void {
this.object = null;
this.objectQuantity = 1;
this.character = null;
this.combineObjects = [[null,1],[null,1]];
this.giveObjects = [[null,1]];
this.receiveObjects = [[null,1]];
this.other = '';
this.role = '';
this.interactionName = '';
}
} }
...@@ -52,6 +52,9 @@ export class GameCharactersComponent implements OnInit { ...@@ -52,6 +52,9 @@ export class GameCharactersComponent implements OnInit {
task.resetReward(); task.resetReward();
task.rewardType = 'none'; task.rewardType = 'none';
} }
if (task?.typeUnity == 'character' || task?.typeUnity == 'exchangeObjects') {
task.character = null;
}
} }
}); });
}); });
...@@ -86,10 +89,13 @@ export class GameCharactersComponent implements OnInit { ...@@ -86,10 +89,13 @@ export class GameCharactersComponent implements OnInit {
if (typeof i !== 'undefined' && i !== -1) { if (typeof i !== 'undefined' && i !== -1) {
task?.characters.splice(i, 1); task?.characters.splice(i, 1);
} }
if (task?.rewardType == 'character') { if (task?.rewardType == 'character' && task.reward == this.scenario.characters[index]) {
task.resetReward(); task.resetReward();
task.rewardType = 'none'; task.rewardType = 'none';
} }
if ((task?.typeUnity == 'character' || task?.typeUnity == 'exchangeObjects') && task.character == this.scenario.characters[index]) {
task.character = null;
}
}); });
}); });
}); });
......
...@@ -113,6 +113,26 @@ export class RoleComponent implements OnInit { ...@@ -113,6 +113,26 @@ export class RoleComponent implements OnInit {
task.resetReward(); task.resetReward();
task.rewardType = 'none'; task.rewardType = 'none';
} }
if (task?.typeUnity == 'getObject' || task?.typeUnity == 'combineObjects' || task?.typeUnity == 'exchangeObjects' || task?.typeUnity == 'depositObject' || task?.typeUnity == 'interactObject') {
if (task.object == ressource) {
task.object = null;
}
task.combineObjects.forEach((object, i) => {
if (object[0] == ressource) {
task.combineObjects[i][0] = null;
}
});
task.giveObjects.forEach((object, i) => {
if (object[0] == ressource) {
task.giveObjects[i][0] = null;
}
});
task.receiveObjects.forEach((object, i) => {
if (object[0] == ressource) {
task.receiveObjects[i][0] = null;
}
});
}
}); });
}); });
}); });
...@@ -130,6 +150,19 @@ export class RoleComponent implements OnInit { ...@@ -130,6 +150,19 @@ export class RoleComponent implements OnInit {
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
let missionIndex: number = this.scenario.missions.findIndex(mission => mission == this.mission); let missionIndex: number = this.scenario.missions.findIndex(mission => mission == this.mission);
if (result == true) { if (result == true) {
this.mission.roles.forEach(role => {
role.tasks.forEach(inlineTask => {
inlineTask.forEach(task => {
if (task instanceof Task) {
if (task.typeUnity == 'talkWithRole' || task.typeUnity == 'askToSeeRole') {
if (task.role == role.intitule) {
task.role = '';
}
}
}
});
});
});
this.mission.roles.splice(this.i, 1); this.mission.roles.splice(this.i, 1);
this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',missionIndex,this.i,'all','Role_['+(this.i)+']','#9AD5EC')); this.scenario.traces.push(new Trace(this.scenario.traces.length,'delete',missionIndex,this.i,'all','Role_['+(this.i)+']','#9AD5EC'));
this.minimapService.reset(); this.minimapService.reset();
...@@ -187,6 +220,26 @@ export class RoleComponent implements OnInit { ...@@ -187,6 +220,26 @@ export class RoleComponent implements OnInit {
task.resetReward(); task.resetReward();
task.rewardType = 'none'; task.rewardType = 'none';
} }
if (task?.typeUnity == 'getObject' || task?.typeUnity == 'combineObjects' || task?.typeUnity == 'exchangeObjects' || task?.typeUnity == 'depositObject' || task?.typeUnity == 'interactObject') {
if (task.object == this.role.ressources[index]) {
task.object = null;
}
task.combineObjects.forEach((object, i) => {
if (object[0] == this.role.ressources[index]) {
task.combineObjects[i][0] = null;
}
});
task.giveObjects.forEach((object, i) => {
if (object[0] == this.role.ressources[index]) {
task.giveObjects[i][0] = null;
}
});
task.receiveObjects.forEach((object, i) => {
if (object[0] == this.role.ressources[index]) {
task.receiveObjects[i][0] = null;
}
});
}
}); });
}); });
this.role.ressources.splice(index, 1); this.role.ressources.splice(index, 1);
......
...@@ -53,6 +53,26 @@ export class RulesComponent implements OnInit { ...@@ -53,6 +53,26 @@ export class RulesComponent implements OnInit {
task.resetReward(); task.resetReward();
task.rewardType = 'none'; task.rewardType = 'none';
} }
if (task?.typeUnity == 'getObject' || task?.typeUnity == 'combineObjects' || task?.typeUnity == 'exchangeObjects' || task?.typeUnity == 'depositObject' || task?.typeUnity == 'interactObject') {
if (task.object == ressource) {
task.object = null;
}
task.combineObjects.forEach((object, i) => {
if (object[0] == ressource) {
task.combineObjects[i][0] = null;
}
});
task.giveObjects.forEach((object, i) => {
if (object[0] == ressource) {
task.giveObjects[i][0] = null;
}
});
task.receiveObjects.forEach((object, i) => {
if (object[0] == ressource) {
task.receiveObjects[i][0] = null;
}
});
}
} }
}); });
}); });
...@@ -91,6 +111,26 @@ export class RulesComponent implements OnInit { ...@@ -91,6 +111,26 @@ export class RulesComponent implements OnInit {
task.resetReward(); task.resetReward();
task.rewardType = 'none'; task.rewardType = 'none';
} }
if (task?.typeUnity == 'getObject' || task?.typeUnity == 'combineObjects' || task?.typeUnity == 'exchangeObjects' || task?.typeUnity == 'depositObject' || task?.typeUnity == 'interactObject') {
if (task.object == this.scenario.ressources[index]) {
task.object = null;
}
task.combineObjects.forEach((object, i) => {
if (object[0] == this.scenario.ressources[index]) {
task.combineObjects[i][0] = null;
}
});
task.giveObjects.forEach((object, i) => {
if (object[0] == this.scenario.ressources[index]) {
task.giveObjects[i][0] = null;
}
});
task.receiveObjects.forEach((object, i) => {
if (object[0] == this.scenario.ressources[index]) {
task.receiveObjects[i][0] = null;
}
});
}
}); });
}); });
}); });
......
...@@ -282,6 +282,132 @@ ...@@ -282,6 +282,132 @@
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
margin-bottom: 10px; margin-bottom: 10px;
&-unity {
display: flex;
flex-direction: column;
max-width: 355px;
select {
width: 80%;
height: 35px;
}
input {
width: 74%;
height: 25px;
}
textarea {
flex-grow: 0;
width: 74%;
border-radius: 10px;
height: 40px;
}
&-type, &-typeContent {
display: flex;
justify-content: space-between;
}
&-typeContent {
height: 109px;
margin-top: 2px;
margin-bottom: 5px;
overflow-y: auto;
justify-content: right;
&-button {
background-color: white;
width: 64px;
height: 35px;
margin-right: 5px;
border-radius: 10px;
&-add {
position: relative;
left: 100%;
transform: translateX(-100%);
}
}
&-getObject, &-depositObject, &-combineObjects-element-object, &-exchangeObjects-element-object {
width: 80%;
display: flex;
justify-content: space-between;
input {
width: 10%;
}
}
&-character, &-talkWithRole, &-askToSeeRole, &-other {
display: flex;
justify-content: right;
width: 100%;
}
&-combineObjects, &-exchangeObjects {
display: flex;
flex-direction: column;
&-element {
display: flex;
justify-content: right;
}
}
&-exchangeObjects {
&-give {
padding-bottom: 2px;
border-bottom: solid 1px black;
}
&-receive {
padding-top: 2px;
display: flex;
flex-direction: column;
}
}
&-interactObject {
display: flex;
flex-direction: column;
justify-content: right;
width: 100%;
&-select {
display: flex;
justify-content: right;
margin-bottom: 2px;
}
&-name {
display: flex;
justify-content: right;
}
}
}
&-infos {
display: flex;
flex-direction: column;
&-name, &-desc {
display: flex;
justify-content: space-between;
width: 100%;
}
&-name {
margin-bottom: 2px;
}
}
}
} }
&-bottom { &-bottom {
......
...@@ -18,6 +18,7 @@ import { MinimapService } from 'src/app/services/minimap/minimap.service'; ...@@ -18,6 +18,7 @@ import { MinimapService } from 'src/app/services/minimap/minimap.service';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { TutorialService } from 'src/app/services/tutorial/tutorial.service'; import { TutorialService } from 'src/app/services/tutorial/tutorial.service';
import { FinishTutorialComponent } from 'src/app/components/snackbars/finish-tutorial/finish-tutorial.component'; import { FinishTutorialComponent } from 'src/app/components/snackbars/finish-tutorial/finish-tutorial.component';
import { UnityService } from 'src/app/services/unity/unity.service';
@Component({ @Component({
selector: 'app-annexe-task', selector: 'app-annexe-task',
...@@ -45,7 +46,7 @@ export class AnnexeTaskComponent implements OnInit { ...@@ -45,7 +46,7 @@ export class AnnexeTaskComponent implements OnInit {
antecedent: boolean = false; antecedent: boolean = false;
constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog, constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog,
private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService, private tutorialService: TutorialService) { } private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService, private tutorialService: TutorialService, protected unityService: UnityService) { }
ngOnInit(): void { ngOnInit(): void {
this.setPieceWidth(); this.setPieceWidth();
...@@ -351,4 +352,28 @@ export class AnnexeTaskComponent implements OnInit { ...@@ -351,4 +352,28 @@ export class AnnexeTaskComponent implements OnInit {
editMoveTrace(event: any, source: string): void { editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Side_task_['+this.i+';'+this.j+']', '#BCCECC')); this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Side_task_['+this.i+';'+this.j+']', '#BCCECC'));
} }
addCombineObject(): void {
this.task.combineObjects.push([null,1]);
}
removeCombineObject(index: number): void {
this.task.combineObjects.splice(index,1);
}
addExchangeGiveObject(): void {
this.task.giveObjects.push([null,1]);
}
removeExchangeGiveObject(index: number): void {
this.task.giveObjects.splice(index,1);
}
addExchangeReceiveObject(): void {
this.task.receiveObjects.push([null,1]);
}
removeExchangeReceiveObject(index: number): void {
this.task.receiveObjects.splice(index,1);
}
} }
...@@ -325,6 +325,132 @@ ...@@ -325,6 +325,132 @@
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
margin-bottom: 10px; margin-bottom: 10px;
&-unity {
display: flex;
flex-direction: column;
max-width: 355px;
select {
width: 80%;
height: 35px;
}
input {
width: 74%;
height: 25px;
}
textarea {
flex-grow: 0;
width: 74%;
border-radius: 10px;
height: 40px;
}
&-type, &-typeContent {
display: flex;
justify-content: space-between;
}
&-typeContent {
height: 109px;
margin-top: 2px;
margin-bottom: 5px;
overflow-y: auto;
justify-content: right;
&-button {
background-color: white;
width: 64px;
height: 35px;
margin-right: 5px;
border-radius: 10px;
&-add {
position: relative;
left: 100%;
transform: translateX(-100%);
}
}
&-getObject, &-depositObject, &-combineObjects-element-object, &-exchangeObjects-element-object {
width: 80%;
display: flex;
justify-content: space-between;
input {
width: 10%;
}
}
&-character, &-talkWithRole, &-askToSeeRole, &-other {
display: flex;
justify-content: right;
width: 100%;
}
&-combineObjects, &-exchangeObjects {
display: flex;
flex-direction: column;
&-element {
display: flex;
justify-content: right;
}
}
&-exchangeObjects {
&-give {
padding-bottom: 2px;
border-bottom: solid 1px black;
}
&-receive {
padding-top: 2px;
display: flex;
flex-direction: column;
}
}
&-interactObject {
display: flex;
flex-direction: column;
justify-content: right;
width: 100%;
&-select {
display: flex;
justify-content: right;
margin-bottom: 2px;
}
&-name {
display: flex;
justify-content: right;
}
}
}
&-infos {
display: flex;
flex-direction: column;
&-name, &-desc {
display: flex;
justify-content: space-between;
width: 100%;
}
&-name {
margin-bottom: 2px;
}
}
}
} }
&-bottom { &-bottom {
......
...@@ -16,6 +16,7 @@ import { IdentifierSnackbarComponent } from 'src/app/components/snackbars/identi ...@@ -16,6 +16,7 @@ import { IdentifierSnackbarComponent } from 'src/app/components/snackbars/identi
import { Trace } from 'src/app/class/trace/trace'; import { Trace } from 'src/app/class/trace/trace';
import { MinimapService } from 'src/app/services/minimap/minimap.service'; import { MinimapService } from 'src/app/services/minimap/minimap.service';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { UnityService } from 'src/app/services/unity/unity.service';
@Component({ @Component({
selector: 'app-final-task', selector: 'app-final-task',
...@@ -43,7 +44,7 @@ export class FinalTaskComponent implements OnInit { ...@@ -43,7 +44,7 @@ export class FinalTaskComponent implements OnInit {
antecedent: boolean = false; antecedent: boolean = false;
constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog, constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog,
private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService) { } private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService, protected unityService: UnityService) { }
ngOnInit(): void { ngOnInit(): void {
this.setPieceWidth(); this.setPieceWidth();
...@@ -359,4 +360,28 @@ export class FinalTaskComponent implements OnInit { ...@@ -359,4 +360,28 @@ export class FinalTaskComponent implements OnInit {
editMoveTrace(event: any, source: string): void { editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Final_task_['+this.i+';'+this.j+']', '#B28386')); this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Final_task_['+this.i+';'+this.j+']', '#B28386'));
} }
addCombineObject(): void {
this.task.combineObjects.push([null,1]);
}
removeCombineObject(index: number): void {
this.task.combineObjects.splice(index,1);
}
addExchangeGiveObject(): void {
this.task.giveObjects.push([null,1]);
}
removeExchangeGiveObject(index: number): void {
this.task.giveObjects.splice(index,1);
}
addExchangeReceiveObject(): void {
this.task.receiveObjects.push([null,1]);
}
removeExchangeReceiveObject(index: number): void {
this.task.receiveObjects.splice(index,1);
}
} }
...@@ -333,9 +333,134 @@ ...@@ -333,9 +333,134 @@
} }
&-content { &-content {
margin-top: 10px;
height: 100%; height: 100%;
margin-bottom: 10px; margin-bottom: 10px;
&-unity {
display: flex;
flex-direction: column;
max-width: 355px;
select {
width: 80%;
height: 35px;
}
input {
width: 74%;
height: 25px;
}
textarea {
flex-grow: 0;
width: 74%;
border-radius: 10px;
height: 40px;
}
&-type, &-typeContent {
display: flex;
justify-content: space-between;
}
&-typeContent {
height: 109px;
margin-top: 2px;
margin-bottom: 5px;
overflow-y: auto;
justify-content: right;
&-button {
background-color: white;
width: 64px;
height: 35px;
margin-right: 5px;
border-radius: 10px;
&-add {
position: relative;
left: 100%;
transform: translateX(-100%);
}
}
&-getObject, &-depositObject, &-combineObjects-element-object, &-exchangeObjects-element-object {
width: 80%;
display: flex;
justify-content: space-between;
input {
width: 10%;
}
}
&-character, &-talkWithRole, &-askToSeeRole, &-other {
display: flex;
justify-content: right;
width: 100%;
}
&-combineObjects, &-exchangeObjects {
display: flex;
flex-direction: column;
&-element {
display: flex;
justify-content: right;
}
}
&-exchangeObjects {
&-give {
padding-bottom: 2px;
border-bottom: solid 1px black;
}
&-receive {
padding-top: 2px;
display: flex;
flex-direction: column;
}
}
&-interactObject {
display: flex;
flex-direction: column;
justify-content: right;
width: 100%;
&-select {
display: flex;
justify-content: right;
margin-bottom: 2px;
}
&-name {
display: flex;
justify-content: right;
}
}
}
&-infos {
display: flex;
flex-direction: column;
&-name, &-desc {
display: flex;
justify-content: space-between;
width: 100%;
}
&-name {
margin-bottom: 2px;
}
}
}
} }
&-bottom { &-bottom {
......
...@@ -18,6 +18,7 @@ import { MinimapService } from 'src/app/services/minimap/minimap.service'; ...@@ -18,6 +18,7 @@ import { MinimapService } from 'src/app/services/minimap/minimap.service';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { MoveOptionnalTasksComponent } from 'src/app/components/snackbars/move-optionnal-tasks/move-optionnal-tasks.component'; import { MoveOptionnalTasksComponent } from 'src/app/components/snackbars/move-optionnal-tasks/move-optionnal-tasks.component';
import { DeleteOptionnalTasksComponent } from 'src/app/components/snackbars/delete-optionnal-tasks/delete-optionnal-tasks.component'; import { DeleteOptionnalTasksComponent } from 'src/app/components/snackbars/delete-optionnal-tasks/delete-optionnal-tasks.component';
import { UnityService } from 'src/app/services/unity/unity.service';
@Component({ @Component({
selector: 'app-optionnal-task', selector: 'app-optionnal-task',
...@@ -45,7 +46,7 @@ export class OptionnalTaskComponent implements OnInit { ...@@ -45,7 +46,7 @@ export class OptionnalTaskComponent implements OnInit {
antecedent: boolean = false; antecedent: boolean = false;
constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog, constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog,
private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService) { } private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService, protected unityService: UnityService) { }
ngOnInit(): void { ngOnInit(): void {
this.setPieceWidth(); this.setPieceWidth();
...@@ -386,4 +387,28 @@ export class OptionnalTaskComponent implements OnInit { ...@@ -386,4 +387,28 @@ export class OptionnalTaskComponent implements OnInit {
editMoveTrace(event: any, source: string): void { editMoveTrace(event: any, source: string): void {
this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Opt_task_['+this.i+';'+this.j+']', '#E8E3B3')); this.scenario.traces.push(new Trace(this.scenario.traces.length,'move',this.missionIndex,this.roleIndex,source,'Opt_task_['+this.i+';'+this.j+']', '#E8E3B3'));
} }
addCombineObject(): void {
this.task.combineObjects.push([null,1]);
}
removeCombineObject(index: number): void {
this.task.combineObjects.splice(index,1);
}
addExchangeGiveObject(): void {
this.task.giveObjects.push([null,1]);
}
removeExchangeGiveObject(index: number): void {
this.task.giveObjects.splice(index,1);
}
addExchangeReceiveObject(): void {
this.task.receiveObjects.push([null,1]);
}
removeExchangeReceiveObject(index: number): void {
this.task.receiveObjects.splice(index,1);
}
} }
...@@ -333,6 +333,132 @@ ...@@ -333,6 +333,132 @@
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
margin-bottom: 10px; margin-bottom: 10px;
&-unity {
display: flex;
flex-direction: column;
max-width: 355px;
select {
width: 80%;
height: 35px;
}
input {
width: 74%;
height: 25px;
}
textarea {
flex-grow: 0;
width: 74%;
border-radius: 10px;
height: 40px;
}
&-type, &-typeContent {
display: flex;
justify-content: space-between;
}
&-typeContent {
height: 109px;
margin-top: 2px;
margin-bottom: 5px;
overflow-y: auto;
justify-content: right;
&-button {
background-color: white;
width: 64px;
height: 35px;
margin-right: 5px;
border-radius: 10px;
&-add {
position: relative;
left: 100%;
transform: translateX(-100%);
}
}
&-getObject, &-depositObject, &-combineObjects-element-object, &-exchangeObjects-element-object {
width: 80%;
display: flex;
justify-content: space-between;
input {
width: 10%;
}
}
&-character, &-talkWithRole, &-askToSeeRole, &-other {
display: flex;
justify-content: right;
width: 100%;
}
&-combineObjects, &-exchangeObjects {
display: flex;
flex-direction: column;
&-element {
display: flex;
justify-content: right;
}
}
&-exchangeObjects {
&-give {
padding-bottom: 2px;
border-bottom: solid 1px black;
}
&-receive {
padding-top: 2px;
display: flex;
flex-direction: column;
}
}
&-interactObject {
display: flex;
flex-direction: column;
justify-content: right;
width: 100%;
&-select {
display: flex;
justify-content: right;
margin-bottom: 2px;
}
&-name {
display: flex;
justify-content: right;
}
}
}
&-infos {
display: flex;
flex-direction: column;
&-name, &-desc {
display: flex;
justify-content: space-between;
width: 100%;
}
&-name {
margin-bottom: 2px;
}
}
}
} }
&-bottom { &-bottom {
......
...@@ -17,6 +17,7 @@ import { Trace } from 'src/app/class/trace/trace'; ...@@ -17,6 +17,7 @@ import { Trace } from 'src/app/class/trace/trace';
import { MinimapService } from 'src/app/services/minimap/minimap.service'; import { MinimapService } from 'src/app/services/minimap/minimap.service';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { TutorialService } from 'src/app/services/tutorial/tutorial.service'; import { TutorialService } from 'src/app/services/tutorial/tutorial.service';
import { UnityService } from 'src/app/services/unity/unity.service';
@Component({ @Component({
selector: 'app-task', selector: 'app-task',
...@@ -44,7 +45,8 @@ export class TaskComponent implements OnInit { ...@@ -44,7 +45,8 @@ export class TaskComponent implements OnInit {
antecedent: boolean = false; antecedent: boolean = false;
constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog, constructor(protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, public dialog: MatDialog,
private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService, private tutorialService: TutorialService) { } private _snackBar: MatSnackBar, private minimapService: MinimapService, protected translate: TranslateService, private tutorialService: TutorialService,
protected unityService: UnityService) { }
ngOnInit(): void { ngOnInit(): void {
this.setPieceWidth(); this.setPieceWidth();
...@@ -416,4 +418,28 @@ export class TaskComponent implements OnInit { ...@@ -416,4 +418,28 @@ export class TaskComponent implements OnInit {
this.tutorialService.validPhase(); this.tutorialService.validPhase();
} }
} }
addCombineObject(): void {
this.task.combineObjects.push([null,1]);
}
removeCombineObject(index: number): void {
this.task.combineObjects.splice(index,1);
}
addExchangeGiveObject(): void {
this.task.giveObjects.push([null,1]);
}
removeExchangeGiveObject(index: number): void {
this.task.giveObjects.splice(index,1);
}
addExchangeReceiveObject(): void {
this.task.receiveObjects.push([null,1]);
}
removeExchangeReceiveObject(index: number): void {
this.task.receiveObjects.splice(index,1);
}
} }
\ No newline at end of file
...@@ -205,6 +205,24 @@ ...@@ -205,6 +205,24 @@
"task_transform_annexeTask": "Convert to Side task", "task_transform_annexeTask": "Convert to Side task",
"task_transform_optionnalTask": "Convert to Alternative Task", "task_transform_optionnalTask": "Convert to Alternative Task",
"task_transform_finalTask": "Convert to Final Task", "task_transform_finalTask": "Convert to Final Task",
"task_unity_type_label": "Type:",
"task_unity_type_getObject": "Retrieve an item",
"task_unity_type_character": "Talk to an NPC",
"task_unity_type_combineObjects": "Combine objects",
"task_unity_type_talkWithRole": "Talk to another role",
"task_unity_type_exchangeObjects": "Exchange objects",
"task_unity_type_depositObject": "Deposit an object",
"task_unity_type_askToSeeRole": "Ask to see the role",
"task_unity_type_interactObject": "Interact with an object",
"task_unity_type_other": "Other",
"task_unity_objectName_label": "Name of the object",
"task_unity_roleName_label": "Name of the role",
"task_unity_characterName_label": "Name of the character",
"task_unity_interactName_placeholder": "Name of the interaction",
"task_unity_exchangeObjects_give_label": "Give:",
"task_unity_exchangeObjects_receive_label": "To receive:",
"task_unity_name_label": "Name:",
"task_unity_desc_label": "Descr:",
"normalTask_title": "Task", "normalTask_title": "Task",
"normalTask_action_placeholder": "Ordering the main HTML tags", "normalTask_action_placeholder": "Ordering the main HTML tags",
"normalTask_add": "Add a Task", "normalTask_add": "Add a Task",
...@@ -374,7 +392,7 @@ ...@@ -374,7 +392,7 @@
"legals_dysfunction_title": "Dysfunction and viruses.", "legals_dysfunction_title": "Dysfunction and viruses.",
"legals_dysfunction_content": "IMT Nord Europe cannot be held responsible for direct or indirect damages, losses, or expenses resulting from the use of this website, or the inability of a third party to use it, or from a malfunction, interruption, virus, or a problem with the line or system.", "legals_dysfunction_content": "IMT Nord Europe cannot be held responsible for direct or indirect damages, losses, or expenses resulting from the use of this website, or the inability of a third party to use it, or from a malfunction, interruption, virus, or a problem with the line or system.",
"legals_credits_title": "Credits", "legals_credits_title": "Credits",
"legals_credits_content1": "The texts on this site are licensed under CC-BY-NC-SA (Creative Commons with permission for use under the conditions of attribution, non-commercial use, and sharing under the same initial terms).\n\nIcons created by max.icons and Freepik, sourced from: www.flaticon.com and are licensed under CC-BY 3.0.\n\nDevelopment: Romain Deleau\n\nWeb design: Gaëlle Guigon\n\nThese works are part of the Nucléofil project, funded by the government as part of the recovery plan.", "legals_credits_content1": "The texts on this site are licensed under CC-BY-NC-SA (Creative Commons with permission for use under the conditions of attribution, non-commercial use, and sharing under the same initial terms).\n\nIcons created by max.icons and Freepik, sourced from: www.flaticon.com and are licensed under CC-BY 3.0.\n\nDevelopment: Romain Deleau\n\nWeb design: Gaëlle Guigon\n\nThese works are part of the Nucléofil project, funded by the government as part of the stimulus package.",
"legals_credits_content2": "Additionally, they are the subject of a doctoral thesis at Sorbonne Université (at LIP6 in the team MOCAH), in collaboration with IMT Nord Europe.", "legals_credits_content2": "Additionally, they are the subject of a doctoral thesis at Sorbonne Université (at LIP6 in the team MOCAH), in collaboration with IMT Nord Europe.",
"legals_cookies_title": "Cookies", "legals_cookies_title": "Cookies",
"legals_cookies_content": "We do not record any cookies and do not save any personal data!", "legals_cookies_content": "We do not record any cookies and do not save any personal data!",
......
...@@ -205,6 +205,24 @@ ...@@ -205,6 +205,24 @@
"task_transform_annexeTask": "Transformer en Tâche annexe", "task_transform_annexeTask": "Transformer en Tâche annexe",
"task_transform_optionnalTask": "Transformer en Tâche alternative", "task_transform_optionnalTask": "Transformer en Tâche alternative",
"task_transform_finalTask": "Transformer en Tâche finale", "task_transform_finalTask": "Transformer en Tâche finale",
"task_unity_type_label": "Type :",
"task_unity_type_getObject": "Récupérer un objet",
"task_unity_type_character": "Parler à un PNJ",
"task_unity_type_combineObjects": "Combiner des objets",
"task_unity_type_talkWithRole": "Parler avec un autre rôle",
"task_unity_type_exchangeObjects": "Échanger des objets",
"task_unity_type_depositObject": "Déposer un objet",
"task_unity_type_askToSeeRole": "Demander à voir le rôle",
"task_unity_type_interactObject": "Interagir avec un objet",
"task_unity_type_other": "Autre",
"task_unity_objectName_label": "Nom de l'objet",
"task_unity_roleName_label": "Nom du rôle",
"task_unity_characterName_label": "Nom du personnage",
"task_unity_interactName_placeholder": "Nom de l'interaction",
"task_unity_exchangeObjects_give_label": "Donne :",
"task_unity_exchangeObjects_receive_label": "A recevoir :",
"task_unity_name_label": "Nom :",
"task_unity_desc_label": "Descr :",
"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",
"normalTask_add": "Ajouter une Tâche", "normalTask_add": "Ajouter une Tâche",
......
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