add vehicle kill stats for cmpaign player view
parent
840695bf0e
commit
40931645d1
|
@ -81,6 +81,26 @@
|
||||||
</ngx-charts-line-chart>
|
</ngx-charts-line-chart>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="chart-container">
|
||||||
|
<ngx-charts-line-chart
|
||||||
|
[results]="vehicleKillData"
|
||||||
|
[showRefLines]="showRefLines"
|
||||||
|
[showRefLabels]="showRefLabels"
|
||||||
|
[referenceLines]="killRefLines"
|
||||||
|
[scheme]="colorScheme"
|
||||||
|
[gradient]="gradient"
|
||||||
|
[xAxis]="xAxis"
|
||||||
|
[yAxis]="yAxis"
|
||||||
|
[legend]="legend"
|
||||||
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
[showYAxisLabel]="showYAxisLabel"
|
||||||
|
[yAxisLabel]="yAxisVehicleKill"
|
||||||
|
[autoScale]="autoscale"
|
||||||
|
[timeline]="timeline"
|
||||||
|
[roundDomains]="roundDomains">
|
||||||
|
</ngx-charts-line-chart>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<ngx-charts-line-chart
|
<ngx-charts-line-chart
|
||||||
[results]="deathData"
|
[results]="deathData"
|
||||||
|
|
|
@ -25,6 +25,7 @@ export class CampaignPlayerDetailComponent {
|
||||||
sumData: any[] = [];
|
sumData: any[] = [];
|
||||||
killData: any[] = [];
|
killData: any[] = [];
|
||||||
friendlyFireData: any[] = [];
|
friendlyFireData: any[] = [];
|
||||||
|
vehicleKillData: any[] = [];
|
||||||
deathData: any[] = [];
|
deathData: any[] = [];
|
||||||
respawnData: any[] = [];
|
respawnData: any[] = [];
|
||||||
reviveData: any[] = [];
|
reviveData: any[] = [];
|
||||||
|
@ -32,6 +33,7 @@ export class CampaignPlayerDetailComponent {
|
||||||
|
|
||||||
yAxisKill = 'Kills';
|
yAxisKill = 'Kills';
|
||||||
yAxisFriendlyFire = 'FriendlyFire';
|
yAxisFriendlyFire = 'FriendlyFire';
|
||||||
|
yAxisVehicleKill = 'Farzeug-Kills';
|
||||||
yAxisDeath = 'Tode';
|
yAxisDeath = 'Tode';
|
||||||
yAxisRespawn = 'Respawn';
|
yAxisRespawn = 'Respawn';
|
||||||
yAxisRevive = 'Revive';
|
yAxisRevive = 'Revive';
|
||||||
|
@ -49,6 +51,7 @@ export class CampaignPlayerDetailComponent {
|
||||||
showRefLines = true;
|
showRefLines = true;
|
||||||
showRefLabels = true;
|
showRefLabels = true;
|
||||||
killRefLines = [];
|
killRefLines = [];
|
||||||
|
vehicleKillRefLines = [];
|
||||||
deathRefLines = [];
|
deathRefLines = [];
|
||||||
captureRefLines = [];
|
captureRefLines = [];
|
||||||
friendlyFireRefLines = [];
|
friendlyFireRefLines = [];
|
||||||
|
@ -67,6 +70,7 @@ export class CampaignPlayerDetailComponent {
|
||||||
|
|
||||||
totalKills;
|
totalKills;
|
||||||
totalFriendlyFire;
|
totalFriendlyFire;
|
||||||
|
totalVehicleKills;
|
||||||
totalDeath;
|
totalDeath;
|
||||||
totalRespawn;
|
totalRespawn;
|
||||||
totalRevive;
|
totalRevive;
|
||||||
|
@ -87,6 +91,7 @@ export class CampaignPlayerDetailComponent {
|
||||||
.subscribe(campaignPlayer => {
|
.subscribe(campaignPlayer => {
|
||||||
this.campaignPlayer = campaignPlayer;
|
this.campaignPlayer = campaignPlayer;
|
||||||
this.killData = this.assignData(this.yAxisKill, "kill");
|
this.killData = this.assignData(this.yAxisKill, "kill");
|
||||||
|
this.vehicleKillData = this.assignData(this.yAxisVehicleKill, "vehicle");
|
||||||
this.friendlyFireData = this.assignData(this.yAxisFriendlyFire, "friendlyFire");
|
this.friendlyFireData = this.assignData(this.yAxisFriendlyFire, "friendlyFire");
|
||||||
this.deathData = this.assignData(this.yAxisDeath, "death");
|
this.deathData = this.assignData(this.yAxisDeath, "death");
|
||||||
this.respawnData = this.assignData(this.yAxisRespawn, "respawn");
|
this.respawnData = this.assignData(this.yAxisRespawn, "respawn");
|
||||||
|
@ -107,6 +112,10 @@ export class CampaignPlayerDetailComponent {
|
||||||
name: this.yAxisFriendlyFire,
|
name: this.yAxisFriendlyFire,
|
||||||
value: this.totalFriendlyFire
|
value: this.totalFriendlyFire
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: this.yAxisVehicleKill,
|
||||||
|
value: this.totalVehicleKills
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: this.yAxisDeath,
|
name: this.yAxisDeath,
|
||||||
value: this.totalDeath
|
value: this.totalDeath
|
||||||
|
@ -125,7 +134,7 @@ export class CampaignPlayerDetailComponent {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.deathData, this.respawnData, this.reviveData, this.captureData]);
|
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData, this.deathData, this.respawnData, this.reviveData, this.captureData]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,12 +147,12 @@ export class CampaignPlayerDetailComponent {
|
||||||
let total = 0;
|
let total = 0;
|
||||||
for (let i = 0; i < playerLength; i++) {
|
for (let i = 0; i < playerLength; i++) {
|
||||||
const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date);
|
const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date);
|
||||||
const warKills = this.campaignPlayer.players[i][field];
|
const value = this.campaignPlayer.players[i][field];
|
||||||
killObj.series.push({
|
killObj.series.push({
|
||||||
name: warDateString,
|
name: warDateString,
|
||||||
value: warKills
|
value: value
|
||||||
});
|
});
|
||||||
total += warKills;
|
total += value;
|
||||||
}
|
}
|
||||||
switch (field) {
|
switch (field) {
|
||||||
case 'kill':
|
case 'kill':
|
||||||
|
@ -154,6 +163,10 @@ export class CampaignPlayerDetailComponent {
|
||||||
this.friendlyFireRefLines.push({value: total / playerLength, name: this.avgLabel});
|
this.friendlyFireRefLines.push({value: total / playerLength, name: this.avgLabel});
|
||||||
this.totalFriendlyFire = total;
|
this.totalFriendlyFire = total;
|
||||||
break;
|
break;
|
||||||
|
case 'vehicle':
|
||||||
|
this.vehicleKillRefLines.push({value: total / playerLength, name: this.avgLabel});
|
||||||
|
this.totalVehicleKills = total;
|
||||||
|
break;
|
||||||
case 'death':
|
case 'death':
|
||||||
this.deathRefLines.push({value: total / playerLength, name: this.avgLabel});
|
this.deathRefLines.push({value: total / playerLength, name: this.avgLabel});
|
||||||
this.totalDeath = total;
|
this.totalDeath = total;
|
||||||
|
|
Loading…
Reference in New Issue