Commit a336e823 authored by Romain DELEAU's avatar Romain DELEAU

enable/disable unity mode

parent 760bff28
...@@ -179,12 +179,12 @@ ...@@ -179,12 +179,12 @@
<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>
<button mat-menu-item disabled <span mat-menu-item (click)="unityService.unity_isActive = !unityService.unity_isActive"
[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"/> <input name="unity" type="checkbox" [(ngModel)]="unityService.unity_isActive"/>
<label for="unity">{{'unity_label' | translate}}</label> <label for="unity">{{'unity_label' | translate}}</label>
</button> </span>
<button mat-menu-item (click)="consultLegals()" <button mat-menu-item (click)="consultLegals()"
[matTooltip]="translate.instant('legal_tooltip')" [matTooltip]="translate.instant('legal_tooltip')"
matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltips"> matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltips">
......
...@@ -41,6 +41,7 @@ import { VerifyGameFailSnackbarComponent } from './components/snackbars/verify-g ...@@ -41,6 +41,7 @@ import { VerifyGameFailSnackbarComponent } from './components/snackbars/verify-g
import { VerifyDialogComponent } from './components/dialogs/verify-dialog/verify-dialog.component'; import { VerifyDialogComponent } from './components/dialogs/verify-dialog/verify-dialog.component';
import { LegalDialogComponent } from './components/dialogs/legal-dialog/legal-dialog.component'; import { LegalDialogComponent } from './components/dialogs/legal-dialog/legal-dialog.component';
import { CreateOptionnalTaskDialogComponent } from './components/dialogs/create-optionnal-task-dialog/create-optionnal-task-dialog.component'; import { CreateOptionnalTaskDialogComponent } from './components/dialogs/create-optionnal-task-dialog/create-optionnal-task-dialog.component';
import { UnityService } from './services/unity/unity.service';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
...@@ -57,7 +58,8 @@ export class AppComponent { ...@@ -57,7 +58,8 @@ export class AppComponent {
constructor(private cdr: ChangeDetectorRef, private http: HttpClient, protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService, constructor(private cdr: ChangeDetectorRef, private http: HttpClient, protected pieceDetailsService: PieceDetailsService, protected tooltipService: TooltipService,
private elementRef: ElementRef, private zoomService: ZoomService, private dialog: MatDialog, private titleService: Title, private elementRef: ElementRef, private zoomService: ZoomService, private dialog: MatDialog, private titleService: Title,
private _snackBar: MatSnackBar, protected minimapService: MinimapService, protected translate: TranslateService, protected tutorialService: TutorialService) { private _snackBar: MatSnackBar, protected minimapService: MinimapService, protected translate: TranslateService, protected tutorialService: TutorialService,
protected unityService: UnityService) {
translate.setTranslation('en', require('../assets/lang/en.json')); translate.setTranslation('en', require('../assets/lang/en.json'));
translate.setTranslation('fr', require('../assets/lang/fr.json')); translate.setTranslation('fr', require('../assets/lang/fr.json'));
...@@ -108,6 +110,7 @@ export class AppComponent { ...@@ -108,6 +110,7 @@ export class AppComponent {
this.titleService.setTitle('RLG Maker - '+this.scenario.projectName); this.titleService.setTitle('RLG Maker - '+this.scenario.projectName);
} }
this.scenario.tooltips = this.tooltipService.activatedTooltips; this.scenario.tooltips = this.tooltipService.activatedTooltips;
this.scenario.unity_isActive = this.unityService.unity_isActive;
this.scenario.traces.push(new Trace(this.scenario.traces.length, 'quick_save', undefined, undefined, 'all', 'Scenario')); this.scenario.traces.push(new Trace(this.scenario.traces.length, 'quick_save', undefined, undefined, 'all', 'Scenario'));
const jsonString = JSON.stringify(this.scenario,undefined,2); const jsonString = JSON.stringify(this.scenario,undefined,2);
const blob = new Blob([jsonString], { type: 'application/json' }); const blob = new Blob([jsonString], { type: 'application/json' });
...@@ -163,6 +166,7 @@ export class AppComponent { ...@@ -163,6 +166,7 @@ export class AppComponent {
this.titleService.setTitle('RLG Maker - '+this.scenario.projectName); this.titleService.setTitle('RLG Maker - '+this.scenario.projectName);
} }
this.scenario.tooltips = this.tooltipService.activatedTooltips; this.scenario.tooltips = this.tooltipService.activatedTooltips;
this.scenario.unity_isActive = this.unityService.unity_isActive;
this.scenario.tutorial_isActive = this.tutorialService.isActive; this.scenario.tutorial_isActive = this.tutorialService.isActive;
this.scenario.tutorial_phase = this.tutorialService.phase; this.scenario.tutorial_phase = this.tutorialService.phase;
this.scenario.tutorial_optionnalPhase = this.tutorialService.optionnalPhase; this.scenario.tutorial_optionnalPhase = this.tutorialService.optionnalPhase;
...@@ -197,6 +201,7 @@ export class AppComponent { ...@@ -197,6 +201,7 @@ export class AppComponent {
const jsonData: any = JSON.parse(fileContent); const jsonData: any = JSON.parse(fileContent);
const scenario: Scenario = Object.assign(new Scenario(), jsonData); const scenario: Scenario = Object.assign(new Scenario(), jsonData);
this.tooltipService.activatedTooltips = scenario.tooltips; this.tooltipService.activatedTooltips = scenario.tooltips;
this.unityService.unity_isActive = scenario.unity_isActive;
this.tutorialService.isActive = scenario.tutorial_isActive; this.tutorialService.isActive = scenario.tutorial_isActive;
this.tutorialService.phase = scenario.tutorial_phase; this.tutorialService.phase = scenario.tutorial_phase;
this.tutorialService.optionnalPhase = scenario.tutorial_optionnalPhase; this.tutorialService.optionnalPhase = scenario.tutorial_optionnalPhase;
......
...@@ -17,6 +17,7 @@ export class Scenario { ...@@ -17,6 +17,7 @@ export class Scenario {
comments: Comment[] = []; comments: Comment[] = [];
projectName: string = ''; projectName: string = '';
tooltips: boolean = true; tooltips: boolean = true;
unity_isActive: boolean = false;
tutorial_isActive: boolean = true; tutorial_isActive: boolean = true;
tutorial_phase: number = 1; tutorial_phase: number = 1;
tutorial_optionnalPhase: string = ''; tutorial_optionnalPhase: string = '';
......
import { TestBed } from '@angular/core/testing';
import { UnityService } from './unity.service';
describe('UnityService', () => {
let service: UnityService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(UnityService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class UnityService {
unity_isActive: boolean = false;
constructor() { }
}
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"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. Not available in this version.", "unity_tooltip": "Usage in a specific game template. Contact gaelle.guigon@imt-nord-europe.fr for more information.",
"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.",
"upload_label": "Import a scenario", "upload_label": "Import a scenario",
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"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. Non disponible dans cette version.", "unity_tooltip": "Utilisation dans un template de jeu précis. Contacter gaelle.guigon@imt-nord-europe.fr pour plus d'informations.",
"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.",
"upload_label": "Importer un scénario", "upload_label": "Importer un scénario",
......
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