Commit 57439d05 authored by Romain DELEAU's avatar Romain DELEAU

save tooltips enable/disable preference

parent 820b2741
...@@ -71,6 +71,7 @@ export class AppComponent { ...@@ -71,6 +71,7 @@ export class AppComponent {
this.scenario.projectName = data.fileName; this.scenario.projectName = data.fileName;
fileName = data.fileName+' - RLG Maker'; fileName = data.fileName+' - RLG Maker';
} }
this.scenario.tooltips = this.tooltipService.activatedTooltips;
const jsonString = JSON.stringify(this.scenario); const jsonString = JSON.stringify(this.scenario);
const blob = new Blob([jsonString], { type: 'application/json' }); const blob = new Blob([jsonString], { type: 'application/json' });
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
...@@ -96,6 +97,7 @@ export class AppComponent { ...@@ -96,6 +97,7 @@ export class AppComponent {
const fileContent: string = reader.result as string; const fileContent: string = reader.result as string;
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;
scenario.context = Object.assign(new GameContext(), jsonData.context); scenario.context = Object.assign(new GameContext(), jsonData.context);
scenario.context.comments = jsonData.context.comments.map((commentData: any) => Object.assign(new Comment(), commentData)); scenario.context.comments = jsonData.context.comments.map((commentData: any) => Object.assign(new Comment(), commentData));
scenario.educationnalObjective = Object.assign(new GameEducationnalObjective(), jsonData.educationnalObjective); scenario.educationnalObjective = Object.assign(new GameEducationnalObjective(), jsonData.educationnalObjective);
......
...@@ -15,4 +15,5 @@ export class Scenario { ...@@ -15,4 +15,5 @@ export class Scenario {
ressources: Ressource[] = []; ressources: Ressource[] = [];
comments: Comment[] = []; comments: Comment[] = [];
projectName: string = ''; projectName: string = '';
tooltips: boolean = true;
} }
\ No newline at end of file
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