Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
9cfe12e3
Commit
9cfe12e3
authored
1 year ago
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
success/fail load save file
parent
acef9781
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
214 additions
and
115 deletions
+214
-115
app.component.ts
src/app/app.component.ts
+116
-108
app.module.ts
src/app/app.module.ts
+5
-1
identifier-snackbar.component.scss
...rs/identifier-snackbar/identifier-snackbar.component.scss
+3
-4
identifier-snackbar.component.ts
...bars/identifier-snackbar/identifier-snackbar.component.ts
+0
-2
loadingfail-snackbar.component.html
.../loadingfail-snackbar/loadingfail-snackbar.component.html
+1
-0
loadingfail-snackbar.component.scss
.../loadingfail-snackbar/loadingfail-snackbar.component.scss
+6
-0
loadingfail-snackbar.component.spec.ts
...adingfail-snackbar/loadingfail-snackbar.component.spec.ts
+23
-0
loadingfail-snackbar.component.ts
...rs/loadingfail-snackbar/loadingfail-snackbar.component.ts
+15
-0
loadingsucess-snackbar.component.html
...dingsucess-snackbar/loadingsucess-snackbar.component.html
+1
-0
loadingsucess-snackbar.component.scss
...dingsucess-snackbar/loadingsucess-snackbar.component.scss
+6
-0
loadingsucess-snackbar.component.spec.ts
...gsucess-snackbar/loadingsucess-snackbar.component.spec.ts
+23
-0
loadingsucess-snackbar.component.ts
...oadingsucess-snackbar/loadingsucess-snackbar.component.ts
+15
-0
No files found.
src/app/app.component.ts
View file @
9cfe12e3
...
...
@@ -28,6 +28,9 @@ import { ZoomService } from './services/zoom/zoom.service';
import
{
MatDialog
}
from
'@angular/material/dialog'
;
import
{
SaveDialogComponent
}
from
'./components/dialogs/save-dialog/save-dialog.component'
;
import
{
Title
}
from
'@angular/platform-browser'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
LoadingsucessSnackbarComponent
}
from
'./components/snackbars/loadingsucess-snackbar/loadingsucess-snackbar.component'
;
import
{
LoadingfailSnackbarComponent
}
from
'./components/snackbars/loadingfail-snackbar/loadingfail-snackbar.component'
;
@
Component
({
selector
:
'app-root'
,
...
...
@@ -41,7 +44,8 @@ export class AppComponent {
@
ViewChild
(
'fileInput'
)
fileInput
:
any
;
constructor
(
private
cdr
:
ChangeDetectorRef
,
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
)
{
pieceDetailsService
.
piece
=
this
.
scenario
;
this
.
scenario
.
missions
.
forEach
(
mission
=>
{
...
...
@@ -97,6 +101,7 @@ export class AppComponent {
const
reader
:
FileReader
=
new
FileReader
();
reader
.
readAsText
(
file
);
reader
.
onload
=
(
e
)
=>
{
try
{
const
fileContent
:
string
=
reader
.
result
as
string
;
const
jsonData
:
any
=
JSON
.
parse
(
fileContent
);
const
scenario
:
Scenario
=
Object
.
assign
(
new
Scenario
(),
jsonData
);
...
...
@@ -110,7 +115,7 @@ export class AppComponent {
scenario
.
ressources
=
jsonData
.
ressources
.
map
((
ressourceData
:
any
)
=>
Object
.
assign
(
new
Ressource
(),
ressourceData
));
scenario
.
comments
=
jsonData
.
comments
.
map
((
commentData
:
any
)
=>
Object
.
assign
(
new
Comment
(),
commentData
));
scenario
.
missions
=
jsonData
.
missions
.
map
((
missionData
:
any
)
=>
Object
.
assign
(
new
Mission
(),
missionData
));
scenario
.
missions
.
forEach
((
mission
,
index
)
=>
{
scenario
.
missions
.
forEach
((
mission
,
index
)
=>
{
mission
.
chronologie
=
jsonData
.
missions
[
index
].
chronologie
.
map
((
chronologieData
:
any
)
=>
{
if
(
chronologieData
!==
null
)
{
return
Object
.
assign
(
new
Step
(),
chronologieData
);
...
...
@@ -223,12 +228,15 @@ export class AppComponent {
this
.
scenario
=
scenario
;
this
.
pieceDetailsService
.
piece
=
this
.
scenario
;
if
(
scenario
.
projectName
)
{
this
.
titleService
.
setTitle
(
'RLG Maker - '
+
this
.
scenario
.
projectName
);
this
.
titleService
.
setTitle
(
'RLG Maker - '
+
this
.
scenario
.
projectName
);
}
else
{
this
.
titleService
.
setTitle
(
'RLG Maker'
);
}
this
.
cdr
.
detectChanges
();
this
.
_snackBar
.
openFromComponent
(
LoadingsucessSnackbarComponent
,
{
duration
:
5000
});
}
catch
{
this
.
_snackBar
.
openFromComponent
(
LoadingfailSnackbarComponent
,
{
duration
:
5000
});
}
};
}
}
...
...
This diff is collapsed.
Click to expand it.
src/app/app.module.ts
View file @
9cfe12e3
...
...
@@ -40,6 +40,8 @@ import { CreateDialogComponent } from './components/dialogs/create-dialog/create
import
{
GameCharactersComponent
}
from
'./pieces/game-characters/game-characters.component'
;
import
{
SaveDialogComponent
}
from
'./components/dialogs/save-dialog/save-dialog.component'
;
import
{
IdentifierSnackbarComponent
}
from
'./components/snackbars/identifier-snackbar/identifier-snackbar.component'
;
import
{
LoadingsucessSnackbarComponent
}
from
'./components/snackbars/loadingsucess-snackbar/loadingsucess-snackbar.component'
;
import
{
LoadingfailSnackbarComponent
}
from
'./components/snackbars/loadingfail-snackbar/loadingfail-snackbar.component'
;
@
NgModule
({
declarations
:
[
...
...
@@ -71,7 +73,9 @@ import { IdentifierSnackbarComponent } from './components/snackbars/identifier-s
CreateDialogComponent
,
GameCharactersComponent
,
SaveDialogComponent
,
IdentifierSnackbarComponent
IdentifierSnackbarComponent
,
LoadingsucessSnackbarComponent
,
LoadingfailSnackbarComponent
],
imports
:
[
BrowserModule
,
...
...
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component.scss
View file @
9cfe12e3
::ng-deep
.mat-snack-bar-container
{
background-color
:
#f
8aa14
;
background-color
:
#f
ec001
;
color
:
black
;
box-shadow
:
0px
0px
15px
5px
#f8aa14
;
//font-family: 'Glacial Indifference Bold';
justify-content
:
space-between
;
box-shadow
:
0px
0px
15px
5px
#fec001
;
text-align
:
center
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component.ts
View file @
9cfe12e3
...
...
@@ -8,8 +8,6 @@ import { MatSnackBarRef } from '@angular/material/snack-bar';
})
export
class
IdentifierSnackbarComponent
implements
OnInit
{
snackBarRef
=
inject
(
MatSnackBarRef
);
constructor
()
{
}
ngOnInit
():
void
{
...
...
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingfail-snackbar/loadingfail-snackbar.component.html
0 → 100644
View file @
9cfe12e3
<span
matSnackBarLabel
>
Chargement du fichier échoué
</span>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingfail-snackbar/loadingfail-snackbar.component.scss
0 → 100644
View file @
9cfe12e3
::ng-deep
.mat-snack-bar-container
{
background-color
:
#de3e44
;
color
:
white
;
box-shadow
:
0px
0px
15px
5px
#de3e44
;
text-align
:
center
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingfail-snackbar/loadingfail-snackbar.component.spec.ts
0 → 100644
View file @
9cfe12e3
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
LoadingfailSnackbarComponent
}
from
'./loadingfail-snackbar.component'
;
describe
(
'LoadingfailSnackbarComponent'
,
()
=>
{
let
component
:
LoadingfailSnackbarComponent
;
let
fixture
:
ComponentFixture
<
LoadingfailSnackbarComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
LoadingfailSnackbarComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
LoadingfailSnackbarComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingfail-snackbar/loadingfail-snackbar.component.ts
0 → 100644
View file @
9cfe12e3
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-loadingfail-snackbar'
,
templateUrl
:
'./loadingfail-snackbar.component.html'
,
styleUrls
:
[
'./loadingfail-snackbar.component.scss'
]
})
export
class
LoadingfailSnackbarComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingsucess-snackbar/loadingsucess-snackbar.component.html
0 → 100644
View file @
9cfe12e3
<span
matSnackBarLabel
>
Chargement du fichier réussi
</span>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingsucess-snackbar/loadingsucess-snackbar.component.scss
0 → 100644
View file @
9cfe12e3
::ng-deep
.mat-snack-bar-container
{
background-color
:
#1ba345
;
color
:
white
;
box-shadow
:
0px
0px
15px
5px
#1ba345
;
text-align
:
center
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingsucess-snackbar/loadingsucess-snackbar.component.spec.ts
0 → 100644
View file @
9cfe12e3
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
LoadingsucessSnackbarComponent
}
from
'./loadingsucess-snackbar.component'
;
describe
(
'LoadingsucessSnackbarComponent'
,
()
=>
{
let
component
:
LoadingsucessSnackbarComponent
;
let
fixture
:
ComponentFixture
<
LoadingsucessSnackbarComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
LoadingsucessSnackbarComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
LoadingsucessSnackbarComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
This diff is collapsed.
Click to expand it.
src/app/components/snackbars/loadingsucess-snackbar/loadingsucess-snackbar.component.ts
0 → 100644
View file @
9cfe12e3
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-loadingsucess-snackbar'
,
templateUrl
:
'./loadingsucess-snackbar.component.html'
,
styleUrls
:
[
'./loadingsucess-snackbar.component.scss'
]
})
export
class
LoadingsucessSnackbarComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment