Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…Evolution into feat/hud-ui
  • Loading branch information
RobbeBryssinck committed May 16, 2022
2 parents e9962ce + b0b54fd commit 01dc637
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div id="app-player-list-container" *ngIf="playerList">
<div *ngFor="let player of playerList!.players | keyvalue" [title]="player.value.cellName">
{{ player.value.name }} Id:{{ player.value.serverId }}
{{ player.value.name }} Id:{{ player.value.serverId }} <button class="btnCancel" (click)="teleportToPlayer(player.value.serverId)">Teleport to</button>
<hr>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export class PlayerListComponent implements OnInit, OnDestroy {
return this.clientService.connectionStateChange.value;
}

public teleportToPlayer(playerId: number) {
this.clientService.teleportToPlayer(playerId);
}

public cancel(): void {
this.done.next();
}
Expand Down
9 changes: 9 additions & 0 deletions Code/skyrim_ui/src/app/services/client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ export class ClientService implements OnDestroy {
this.disconnect();
}

public teleportToPlayer(playerId: number): void {
if (environment.game) {
skyrimtogether.teleportToPlayer(playerId);
}
else {
this.messageReception.next({ content: "Youre not ingame, duh" });
}
}

/**
* Called when the UI is first initialized.
*/
Expand Down
5 changes: 5 additions & 0 deletions Code/skyrim_ui/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,9 @@ interface SkyrimTogether {
* Deactivate UI and release control.
*/
deactivate(): void;

/**
* Teleport to given player
*/
teleportToPlayer(playerId: number): void;
}

0 comments on commit 01dc637

Please sign in to comment.