Commit 0a39569f authored by Romain DELEAU's avatar Romain DELEAU

add tel no on characters when unity mode is active

parent a336e823
......@@ -3,4 +3,5 @@ export class Character {
name: string = '';
description: string = '';
color: string = '#000000';
tel: string = '';
}
......@@ -24,7 +24,10 @@
<label for="description">{{'char_description_label' | translate}}</label>
<textarea class="background" name="description" [(ngModel)]="newCharacter.description" (change)="editTrace($event,'newCharacter_description')"></textarea>
</div>
<div class="piece-form-character-create-infos-phone" *ngIf="unityService.unity_isActive">
<label for="tel">{{'char_phone_label' | translate}}</label>
<input name="tel" type="tel" [(ngModel)]="newCharacter.tel" (change)="editTrace($event, 'newCharacter_tel')"/>
</div>
<div class="piece-form-character-create-infos-color">
<label for="color">{{'char_color_label' | translate}}</label>
<input name="color" type="color" [(ngModel)]="newCharacter.color" (change)="editTrace($event,'newCharacter_color')"/>
......@@ -49,7 +52,10 @@
<label for="description">{{'char_description_label' | translate}}</label>
<textarea name="description" [(ngModel)]="character.description" (change)="editTrace($event,'Character_['+index+']_description')"></textarea>
</div>
<div class="piece-form-character-create-infos-phone" *ngIf="unityService.unity_isActive">
<label for="tel">{{'char_phone_label' | translate}}</label>
<input name="tel" type="tel" [(ngModel)]="character.tel" (change)="editTrace($event, 'newCharacter_tel')"/>
</div>
<div class="piece-form-character-create-infos-color">
<label for="color">{{'char_color_label' | translate}}</label>
<input name="color" type="color" [(ngModel)]="character.color" (change)="editTrace($event,'Character_['+index+']_color')"/>
......
......@@ -10,6 +10,7 @@ import { Task } from 'src/app/class/task/task';
import { Trace } from 'src/app/class/trace/trace';
import { MinimapService } from 'src/app/services/minimap/minimap.service';
import { TranslateService } from '@ngx-translate/core';
import { UnityService } from 'src/app/services/unity/unity.service';
@Component({
selector: 'app-game-characters',
......@@ -22,7 +23,8 @@ export class GameCharactersComponent implements OnInit {
@Input() scenario = new Scenario()
newCharacter: Character = new Character();
constructor(protected tooltipService: TooltipService, public dialog: MatDialog, protected pieceDetailsService: PieceDetailsService, private minimapService: MinimapService, protected translate: TranslateService) { }
constructor(protected tooltipService: TooltipService, public dialog: MatDialog, protected pieceDetailsService: PieceDetailsService, private minimapService: MinimapService, protected translate: TranslateService,
protected unityService: UnityService) { }
ngOnInit(): void {
}
......
......@@ -32,6 +32,10 @@ matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedToolt
<label for="description">{{'char_description_label' | translate}}</label>
<textarea name="description" [(ngModel)]="character.description" disabled></textarea>
</div>
<div class="piece-form-character-create-infos-phone" *ngIf="unityService.unity_isActive">
<label for="tel">{{'char_phone_label' | translate}}</label>
<input name="tel" type="tel" [(ngModel)]="newCharacter.tel" disabled=""/>
</div>
<div class="piece-form-character-infos-color">
<label for="color">{{'char_color_label' | translate}}</label>
<input name="color" type="color" [(ngModel)]="character.color" disabled/>
......
......@@ -7,6 +7,7 @@ import { Task } from 'src/app/class/task/task';
import { Trace } from 'src/app/class/trace/trace';
import { PieceDetailsService } from 'src/app/services/piece-details/piece-details.service';
import { TooltipService } from 'src/app/services/tooltip/tooltip.service';
import { UnityService } from 'src/app/services/unity/unity.service';
@Component({
selector: 'app-characters',
......@@ -21,7 +22,8 @@ export class CharactersComponent implements OnInit {
selectedAssignCharacter!: Character | undefined;
selectedDeleteCharacterIndex!: number;
constructor(protected tooltipService: TooltipService, public dialog: MatDialog, private pieceDetailsService: PieceDetailsService, protected translate: TranslateService) { }
constructor(protected tooltipService: TooltipService, public dialog: MatDialog, private pieceDetailsService: PieceDetailsService, protected translate: TranslateService,
protected unityService: UnityService) { }
ngOnInit(): void {
}
......
......@@ -236,6 +236,7 @@
"char_create_tooltip": "If non-playabe characters (NPCs) are to be involved in the scenario, they must be described with this tile. Each character has its own color and is visible on the tasks in which it is involved. The teacher can be considered a character if he/she doesn't have a full Role.",
"char_name_label": "Name",
"char_description_label": "Description",
"char_phone_label": "Tel no:",
"char_color_label": "Color",
"chars_title": "Non player characters",
"char_tooltip": "To involve this character in a Task or Random Event, click on the respective tile and select this character from the sidebar.",
......
......@@ -236,6 +236,7 @@
"char_create_tooltip": "Si des personnages non joueurs (PNJ) doivent intervenir dans le scénario, ils doivent être décrits avec cette tuile. Chaque personnage a sa propre couleur et sont visibles sur les tâches où ils interviennent. L'enseignant peut être considéré comme un personnage s'il n'a pas un Rôle à part entière.",
"char_name_label": "Nom",
"char_description_label": "Description",
"char_phone_label": "N° tél :",
"char_color_label": "Couleur",
"chars_title": "Personnages non joueur",
"char_tooltip": "Pour faire intervenir ce personnage sur une Tâche ou Événement aléatoire, cliquez sur la tuile en question et sélectionnez ce personnage dans la barre latérale.",
......
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