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
00e45d3c
Commit
00e45d3c
authored
Nov 22, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change lang icons + reactivate leave security popup
parent
d7570dc3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
12 deletions
+28
-12
app.component.html
src/app/app.component.html
+9
-3
app.component.scss
src/app/app.component.scss
+15
-0
app.component.ts
src/app/app.component.ts
+4
-9
en.png
src/assets/lang/icons/en.png
+0
-0
fr.png
src/assets/lang/icons/fr.png
+0
-0
No files found.
src/app/app.component.html
View file @
00e45d3c
...
@@ -154,10 +154,16 @@
...
@@ -154,10 +154,16 @@
<div
class=
"container-settings container-settings-secondline"
>
<div
class=
"container-settings container-settings-secondline"
>
<button
mat-mini-fab
color=
"white"
style=
"font-size: 20px;"
[
matMenuTriggerFor
]="
changeLanguageMenu
"
<button
mat-mini-fab
color=
"white"
style=
"font-size: 20px;"
[
matMenuTriggerFor
]="
changeLanguageMenu
"
[
matTooltip
]="
translate
.
instant
('
lang_tooltip
')"
[
matTooltip
]="
translate
.
instant
('
lang_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
{{langEmoji}}
</button>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<img
class=
"langIcon"
[
src
]="'../
assets
/
lang
/
icons
/'+
selectedLang
+'.
png
'"
>
</button>
<mat-menu
#
changeLanguageMenu=
"matMenu"
>
<mat-menu
#
changeLanguageMenu=
"matMenu"
>
<button
mat-menu-item
(
click
)="
changeLanguage
('
fr
')"
>
🇫🇷 {{'language_fr' | translate}}
</button>
<button
mat-menu-item
class=
"buttonLang"
(
click
)="
changeLanguage
('
fr
')"
>
<button
mat-menu-item
(
click
)="
changeLanguage
('
en
')"
>
🇬🇧 {{'language_en' | translate}}
</button>
<img
class=
"langIcon"
src=
"../assets/lang/icons/fr.png"
/>
<div>
{{'language_fr' | translate}}
</div>
</button>
<button
mat-menu-item
class=
"buttonLang"
(
click
)="
changeLanguage
('
en
')"
>
<img
class=
"langIcon langIcon-icon"
src=
"../assets/lang/icons/en.png"
/>
<div>
{{'language_en' | translate}}
</div>
</button>
</mat-menu>
</mat-menu>
<button
mat-mini-fab
color=
"white"
(
click
)="
downloadManual
()"
<button
mat-mini-fab
color=
"white"
(
click
)="
downloadManual
()"
[
matTooltip
]="
translate
.
instant
('
manual_tooltip
')"
[
matTooltip
]="
translate
.
instant
('
manual_tooltip
')"
...
...
src/app/app.component.scss
View file @
00e45d3c
...
@@ -250,6 +250,21 @@
...
@@ -250,6 +250,21 @@
}
}
}
}
}
}
.langIcon
{
width
:
28px
;
height
:
28px
;
}
.buttonLang
{
display
:
flex
;
flex-direction
:
row
;
img
{
margin-top
:
10px
;
margin-right
:
5px
;
}
}
::ng-deep
.mat-tooltip
{
::ng-deep
.mat-tooltip
{
font-size
:
15px
;
font-size
:
15px
;
...
...
src/app/app.component.ts
View file @
00e45d3c
...
@@ -49,7 +49,6 @@ export class AppComponent {
...
@@ -49,7 +49,6 @@ export class AppComponent {
scenario
:
Scenario
=
new
Scenario
();
scenario
:
Scenario
=
new
Scenario
();
@
ViewChild
(
'fileInput'
)
fileInput
:
any
;
@
ViewChild
(
'fileInput'
)
fileInput
:
any
;
selectedLang
:
string
=
'en'
;
selectedLang
:
string
=
'en'
;
langEmoji
:
string
=
'🇬🇧'
;
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
,
...
@@ -65,10 +64,6 @@ export class AppComponent {
...
@@ -65,10 +64,6 @@ export class AppComponent {
this
.
selectedLang
=
selectedLang
;
this
.
selectedLang
=
selectedLang
;
}
}
translate
.
use
(
this
.
selectedLang
);
translate
.
use
(
this
.
selectedLang
);
switch
(
selectedLang
)
{
case
'en'
:
this
.
langEmoji
=
'🇬🇧'
;
break
;
case
'fr'
:
this
.
langEmoji
=
'🇫🇷'
;
break
;
}
pieceDetailsService
.
piece
=
this
.
scenario
;
pieceDetailsService
.
piece
=
this
.
scenario
;
...
@@ -87,14 +82,14 @@ export class AppComponent {
...
@@ -87,14 +82,14 @@ export class AppComponent {
observe
:
false
observe
:
false
})
})
}
}
/*
@
HostListener
(
'window:beforeunload'
,
[
'$event'
])
@
HostListener
(
'window:beforeunload'
,
[
'$event'
])
beforeUnloadHandler
(
event
:
any
)
{
beforeUnloadHandler
(
event
:
any
)
{
const
message
=
"Êtes vous sûr de vouloir quitter RLG Maker ?
\n
Vous risquez de perdre les données non sauvegardées."
;
const
message
=
"Êtes vous sûr de vouloir quitter RLG Maker ?
\n
Vous risquez de perdre les données non sauvegardées."
;
event
.
returnValue
=
message
;
event
.
returnValue
=
message
;
return
message
;
return
message
;
}
}
*/
@
HostListener
(
'document:keydown'
,
[
'$event'
])
@
HostListener
(
'document:keydown'
,
[
'$event'
])
onKeyDown
(
event
:
KeyboardEvent
)
{
onKeyDown
(
event
:
KeyboardEvent
)
{
if
(
event
.
ctrlKey
&&
event
.
key
===
's'
)
{
if
(
event
.
ctrlKey
&&
event
.
key
===
's'
)
{
...
@@ -123,8 +118,8 @@ export class AppComponent {
...
@@ -123,8 +118,8 @@ export class AppComponent {
changeLanguage
(
lang
:
string
):
void
{
changeLanguage
(
lang
:
string
):
void
{
if
(
lang
!==
this
.
selectedLang
)
{
if
(
lang
!==
this
.
selectedLang
)
{
switch
(
lang
)
{
switch
(
lang
)
{
case
'fr'
:
this
.
selectedLang
=
'fr'
;
this
.
translate
.
use
(
'fr'
);
this
.
langEmoji
=
'🇫🇷'
;
break
;
case
'fr'
:
this
.
selectedLang
=
'fr'
;
this
.
translate
.
use
(
'fr'
);
break
;
case
'en'
:
this
.
selectedLang
=
'en'
;
this
.
translate
.
use
(
'en'
);
this
.
langEmoji
=
'🇬🇧'
;
break
;
case
'en'
:
this
.
selectedLang
=
'en'
;
this
.
translate
.
use
(
'en'
);
break
;
}
}
this
.
minimapService
.
reset
();
this
.
minimapService
.
reset
();
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'change_lang'
,
undefined
,
undefined
,
this
.
selectedLang
,
'Scenario'
));
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'change_lang'
,
undefined
,
undefined
,
this
.
selectedLang
,
'Scenario'
));
...
...
src/assets/lang/icons/en.png
0 → 100644
View file @
00e45d3c
10.5 KB
src/assets/lang/icons/fr.png
0 → 100644
View file @
00e45d3c
3.17 KB
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