Skip to content

Commit

Permalink
fix: disable invite button if in party
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Jun 22, 2022
1 parent 17b4140 commit f956f95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<td>{{ player.value.level }}</td>
<td>{{ player.value.name }}</td>
<td>{{ player.value.cellName }}</td>
<td><button (click)="sendPartyInvite(player.value.id)" [disabled]="player.value.hasBeenInvited || !isPartyLeader" class="teleBtn">Invite</button></td>
<td><button (click)="sendPartyInvite(player.value.id)" [disabled]="player.value.hasBeenInvited || isMember(player.value.id) || !isPartyLeader" class="teleBtn">Invite</button></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export class PlayerListComponent implements OnInit, OnDestroy {
return this.groupService.group.value.isEnabled && this.groupService.group.value.owner == this.clientService.localPlayerId;
}

public isMember(playerId: number): boolean {
return this.groupService.group.value.members.includes(playerId);
}

public teleportToPlayer(playerId: number) {
this.clientService.teleportToPlayer(playerId);
}
Expand Down
2 changes: 0 additions & 2 deletions Code/skyrim_ui/src/app/components/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ export class RootComponent implements OnInit, OnDestroy {

this.client.messageReception.next({ name, content: message, dialogue: dialogue })
}


}
}

Expand Down

0 comments on commit f956f95

Please sign in to comment.