Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout de l'affichage du nom de joueur au niveau du Titre de Lindo #190

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/services/tab-game.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/windows/main/layout/toolbar/toolbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<mat-icon class="pointer window-maximize mat-16" (click)="fullScreenWindow()">lens</mat-icon>
</div>

<span class="title">{{ appName }}</span>
<span class="title">{{ appName }} : {{ playerName }}</span>
<img src="https://raw.githubusercontent.com/prixe/lindo/master/build/icon.png" width="25" height="25">

<div class="system-buttons all">
<mat-icon class="pointer text-danger mat-22" *ngIf="isAudioMuted" (click)="toggleSound(false)" matTooltip="{{ 'app.main.head.toggle-audio-on' | translate }}">audiotrack</mat-icon>
Expand Down
18 changes: 17 additions & 1 deletion src/app/windows/main/layout/toolbar/toolbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -16,6 +17,7 @@ export class ToolbarComponent implements OnInit {
public isFullscreen: boolean = false;

constructor(
public tabGameService: TabGameService,
private soundService: SoundService,
private applicationService: ApplicationService
) {
Expand All @@ -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() {
Expand Down