diff --git a/src/app/services/tab-game.service.ts b/src/app/services/tab-game.service.ts index fa20721d..b1cb753b 100644 --- a/src/app/services/tab-game.service.ts +++ b/src/app/services/tab-game.service.ts @@ -93,7 +93,8 @@ export class TabGameService extends EventEmitter { tab.isFocus = true; tab.notification = false; game.isFocus = true; - + // Event pour faire changer le nom du pseudo [toolbar.component] lors d'un changement de fenetre. + this.emit('tab-change', tab.character); if (tab.isLogged) { game.window.focus(); } diff --git a/src/app/windows/main/layout/toolbar/toolbar.component.html b/src/app/windows/main/layout/toolbar/toolbar.component.html index bf813754..836fc233 100644 --- a/src/app/windows/main/layout/toolbar/toolbar.component.html +++ b/src/app/windows/main/layout/toolbar/toolbar.component.html @@ -6,7 +6,8 @@ lens - {{ appName }} + {{ appName }} : {{ playerName }} +
audiotrack diff --git a/src/app/windows/main/layout/toolbar/toolbar.component.ts b/src/app/windows/main/layout/toolbar/toolbar.component.ts index 424113ac..c2754b96 100644 --- a/src/app/windows/main/layout/toolbar/toolbar.component.ts +++ b/src/app/windows/main/layout/toolbar/toolbar.component.ts @@ -2,7 +2,8 @@ import {Component, OnInit} from '@angular/core'; import {SoundService} from '@services/sound.service'; import {ApplicationService} from "@services/electron/application.service"; import {ElectronService as electron} from '@services/electron/electron.service'; - +import {TabGameService} from '@services/tab-game.service'; +import {Tab} from "@helpers/tab"; @Component({ selector: 'app-main-toolbar-component', templateUrl: './toolbar.component.html' @@ -16,6 +17,7 @@ export class ToolbarComponent implements OnInit { public isFullscreen: boolean = false; constructor( + public tabGameService: TabGameService, private soundService: SoundService, private applicationService: ApplicationService ) { @@ -36,6 +38,20 @@ export class ToolbarComponent implements OnInit { } this.window = electron.getCurrentWindow(); +// Changement du pseudo lors de changement de fenetre + this.tabGameService.on('tab-change', (id: Tab) => { + if(id){ + this.playerName = String(id); + } + }) +// Changement du pseudo lors de changement de perso + this.tabGameService.on('icon-change', (tab: Tab) => { + + if(tab.character){ + this.playerName = tab.character; + } + }) + } } public minimizeWindow() {