add vehicle class kills to highscore and player details

pull/33/head
HardiReady 2018-04-14 18:05:37 +02:00
parent 9767e1bf25
commit 5e8a2b4db2
6 changed files with 137 additions and 20 deletions

View File

@ -46,7 +46,9 @@ campaignPlayer.route('/ranking/:campaignId')
const resItem = { const resItem = {
name: usesUUID ? playerInstances[playerInstances.length - 1].name : player, name: usesUUID ? playerInstances[playerInstances.length - 1].name : player,
kill: 0, kill: 0,
vehicle: 0, vehicleLight: 0,
vehicleHeavy: 0,
vehicleAir: 0,
death: 0, death: 0,
friendlyFire: 0, friendlyFire: 0,
revive: 0, revive: 0,
@ -57,7 +59,9 @@ campaignPlayer.route('/ranking/:campaignId')
resItem.kill += playerInstances[i].kill; resItem.kill += playerInstances[i].kill;
resItem.death += playerInstances[i].death; resItem.death += playerInstances[i].death;
resItem.friendlyFire += playerInstances[i].friendlyFire; resItem.friendlyFire += playerInstances[i].friendlyFire;
resItem.vehicle += playerInstances[i].vehicle; resItem.vehicleLight += playerInstances[i].vehicleLight;
resItem.vehicleHeavy += playerInstances[i].vehicleHeavy;
resItem.vehicleAir += playerInstances[i].vehicleAir;
resItem.revive += playerInstances[i].revive; resItem.revive += playerInstances[i].revive;
resItem.respawn += playerInstances[i].respawn; resItem.respawn += playerInstances[i].respawn;
resItem.flagTouch += playerInstances[i].flagTouch; resItem.flagTouch += playerInstances[i].flagTouch;
@ -80,7 +84,9 @@ campaignPlayer.route('/ranking/:campaignId')
kill: getSortedField('kill'), kill: getSortedField('kill'),
death: getSortedField('death'), death: getSortedField('death'),
friendlyFire: getSortedField('friendlyFire'), friendlyFire: getSortedField('friendlyFire'),
vehicle: getSortedField('vehicle'), vehicleLight: getSortedField('vehicleLight'),
vehicleHeavy: getSortedField('vehicleHeavy'),
vehicleAir: getSortedField('vehicleAir'),
revive: getSortedField('revive'), revive: getSortedField('revive'),
respawn: getSortedField('respawn'), respawn: getSortedField('respawn'),
flagTouch: getSortedField('flagTouch'), flagTouch: getSortedField('flagTouch'),

View File

@ -83,7 +83,7 @@
<div class="chart-container"> <div class="chart-container">
<ngx-charts-line-chart <ngx-charts-line-chart
[results]="vehicleKillData" [results]="vehicleLightData"
[showRefLines]="showRefLines" [showRefLines]="showRefLines"
[showRefLabels]="showRefLabels" [showRefLabels]="showRefLabels"
[referenceLines]="killRefLines" [referenceLines]="killRefLines"
@ -94,7 +94,47 @@
[legend]="legend" [legend]="legend"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisVehicleKill" [yAxisLabel]="yAxisVehicleLight"
[autoScale]="autoscale"
[timeline]="timeline"
[roundDomains]="roundDomains">
</ngx-charts-line-chart>
</div>
<div class="chart-container">
<ngx-charts-line-chart
[results]="vehicleHeavyData"
[showRefLines]="showRefLines"
[showRefLabels]="showRefLabels"
[referenceLines]="killRefLines"
[scheme]="colorScheme"
[gradient]="gradient"
[xAxis]="xAxis"
[yAxis]="yAxis"
[legend]="legend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisVehicleHeavy"
[autoScale]="autoscale"
[timeline]="timeline"
[roundDomains]="roundDomains">
</ngx-charts-line-chart>
</div>
<div class="chart-container">
<ngx-charts-line-chart
[results]="vehicleAirData"
[showRefLines]="showRefLines"
[showRefLabels]="showRefLabels"
[referenceLines]="killRefLines"
[scheme]="colorScheme"
[gradient]="gradient"
[xAxis]="xAxis"
[yAxis]="yAxis"
[legend]="legend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisVehicleAir"
[autoScale]="autoscale" [autoScale]="autoscale"
[timeline]="timeline" [timeline]="timeline"
[roundDomains]="roundDomains"> [roundDomains]="roundDomains">

View File

@ -23,7 +23,9 @@ export class CampaignPlayerDetailComponent implements OnInit {
sumData: any[] = []; sumData: any[] = [];
killData: any[] = []; killData: any[] = [];
friendlyFireData: any[] = []; friendlyFireData: any[] = [];
vehicleKillData: any[] = []; vehicleLightData: any[] = [];
vehicleHeavyData: any[] = [];
vehicleAirData: any[] = [];
deathData: any[] = []; deathData: any[] = [];
respawnData: any[] = []; respawnData: any[] = [];
reviveData: any[] = []; reviveData: any[] = [];
@ -31,7 +33,9 @@ export class CampaignPlayerDetailComponent implements OnInit {
yAxisKill = 'Kills'; yAxisKill = 'Kills';
yAxisFriendlyFire = 'FriendlyFire'; yAxisFriendlyFire = 'FriendlyFire';
yAxisVehicleKill = 'Fahrzeug-Kills'; yAxisVehicleLight = 'Fahrzeug (Leicht)';
yAxisVehicleHeavy = 'Fahrzeug (Schwer)';
yAxisVehicleAir = 'Fahrzeug (Luft)';
yAxisDeath = 'Tode'; yAxisDeath = 'Tode';
yAxisRespawn = 'Respawn'; yAxisRespawn = 'Respawn';
yAxisRevive = 'Revive'; yAxisRevive = 'Revive';
@ -49,7 +53,9 @@ export class CampaignPlayerDetailComponent implements OnInit {
showRefLines = true; showRefLines = true;
showRefLabels = true; showRefLabels = true;
killRefLines = []; killRefLines = [];
vehicleKillRefLines = []; vehicleLightRefLines = [];
vehicleHeavyRefLines = [];
vehicleAirRefLines = [];
deathRefLines = []; deathRefLines = [];
captureRefLines = []; captureRefLines = [];
friendlyFireRefLines = []; friendlyFireRefLines = [];
@ -68,7 +74,9 @@ export class CampaignPlayerDetailComponent implements OnInit {
totalKills; totalKills;
totalFriendlyFire; totalFriendlyFire;
totalVehicleKills; totalVehicleLight;
totalVehicleHeavy;
totalVehicleAir;
totalDeath; totalDeath;
totalRespawn; totalRespawn;
totalRevive; totalRevive;
@ -89,7 +97,9 @@ export class CampaignPlayerDetailComponent implements OnInit {
.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.vehicleLightData = this.assignData(this.yAxisVehicleLight, 'vehicleLight');
this.vehicleHeavyData = this.assignData(this.yAxisVehicleHeavy, 'vehicleHeavy');
this.vehicleAirData = this.assignData(this.yAxisVehicleAir, 'vehicleAir');
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');
@ -114,8 +124,16 @@ export class CampaignPlayerDetailComponent implements OnInit {
value: this.totalFriendlyFire value: this.totalFriendlyFire
}, },
{ {
name: this.yAxisVehicleKill, name: this.yAxisVehicleLight,
value: this.totalVehicleKills value: this.totalVehicleLight
},
{
name: this.yAxisVehicleHeavy,
value: this.totalVehicleHeavy
},
{
name: this.yAxisVehicleAir,
value: this.totalVehicleAir
}, },
{ {
name: this.yAxisDeath, name: this.yAxisDeath,
@ -135,8 +153,9 @@ export class CampaignPlayerDetailComponent implements OnInit {
} }
]; ];
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData, Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleLightData,
this.deathData, this.respawnData, this.reviveData, this.captureData]); this.vehicleHeavyData, this.vehicleAirData, this.deathData, this.respawnData, this.reviveData,
this.captureData]);
}); });
} }
@ -165,9 +184,17 @@ export class CampaignPlayerDetailComponent implements OnInit {
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': case 'vehicleLight':
this.vehicleKillRefLines.push({value: total / playerLength, name: this.avgLabel}); this.vehicleLightRefLines.push({value: total / playerLength, name: this.avgLabel});
this.totalVehicleKills = total; this.totalVehicleLight = total;
break;
case 'vehicleHeavy':
this.vehicleHeavyRefLines.push({value: total / playerLength, name: this.avgLabel});
this.totalVehicleHeavy = total;
break;
case 'vehicleAir':
this.vehicleAirRefLines.push({value: total / playerLength, name: this.avgLabel});
this.totalVehicleAir = total;
break; break;
case 'death': case 'death':
this.deathRefLines.push({value: total / playerLength, name: this.avgLabel}); this.deathRefLines.push({value: total / playerLength, name: this.avgLabel});

View File

@ -58,7 +58,7 @@
</ngx-datatable> </ngx-datatable>
<ngx-datatable <ngx-datatable
[rows]="players.vehicle" [rows]="players.vehicleLight"
[messages]="emptyMessage" [messages]="emptyMessage"
[headerHeight]="cellHeight" [headerHeight]="cellHeight"
[rowHeight]="cellHeight" [rowHeight]="cellHeight"
@ -75,7 +75,49 @@
</span> </span>
</ng-template> </ng-template>
</ngx-datatable-column> </ngx-datatable-column>
<ngx-datatable-column [width]="valueColWidth" name="FahrzeugKill" prop="vehicle"></ngx-datatable-column> <ngx-datatable-column [width]="valueColWidth" name="Fahrzeug (Leicht)" prop="vehicleLight"></ngx-datatable-column>
</ngx-datatable>
<ngx-datatable
[rows]="players.vehicleHeavy"
[messages]="emptyMessage"
[headerHeight]="cellHeight"
[rowHeight]="cellHeight"
[cssClasses]='customClasses'
[columnMode]="'force'"
[scrollbarV]="true"
[selectionType]="'single'">
<ngx-datatable-column [width]="numberColWidth" name="#" prop="num"></ngx-datatable-column>
<ngx-datatable-column name="Spieler" prop="name" [width]="nameColWidth" style="padding-left:10px">
<ng-template ngx-datatable-cell-template let-row="row" let-value="value">
<span class="player-name"
[style.color]="row['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{value}}
</span>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column [width]="valueColWidth" name="Fahrzeug (Schwer)" prop="vehicleHeavy"></ngx-datatable-column>
</ngx-datatable>
<ngx-datatable
[rows]="players.vehicleAir"
[messages]="emptyMessage"
[headerHeight]="cellHeight"
[rowHeight]="cellHeight"
[cssClasses]='customClasses'
[columnMode]="'force'"
[scrollbarV]="true"
[selectionType]="'single'">
<ngx-datatable-column [width]="numberColWidth" name="#" prop="num"></ngx-datatable-column>
<ngx-datatable-column name="Spieler" prop="name" [width]="nameColWidth" style="padding-left:10px">
<ng-template ngx-datatable-cell-template let-row="row" let-value="value">
<span class="player-name"
[style.color]="row['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{value}}
</span>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column [width]="valueColWidth" name="Fahrzeug (Luft)" prop="vehicleAir"></ngx-datatable-column>
</ngx-datatable> </ngx-datatable>
<ngx-datatable <ngx-datatable

View File

@ -88,6 +88,8 @@ export class StatisticHighScoreComponent implements OnInit {
kill: this.filterPlayerAttribute('kill'), kill: this.filterPlayerAttribute('kill'),
friendlyFire: this.filterPlayerAttribute('friendlyFire'), friendlyFire: this.filterPlayerAttribute('friendlyFire'),
vehicleLight: this.filterPlayerAttribute('vehicleLight'), vehicleLight: this.filterPlayerAttribute('vehicleLight'),
vehicleHeavy: this.filterPlayerAttribute('vehicleLight'),
vehicleAir: this.filterPlayerAttribute('vehicleLight'),
death: this.filterPlayerAttribute('death'), death: this.filterPlayerAttribute('death'),
respawn: this.filterPlayerAttribute('respawn'), respawn: this.filterPlayerAttribute('respawn'),
revive: this.filterPlayerAttribute('revive'), revive: this.filterPlayerAttribute('revive'),

View File

@ -5,7 +5,7 @@
/* ########### DATATABLE ########### */ /* ########### DATATABLE ########### */
ngx-datatable { ngx-datatable {
width: 1020px; width: 1030px;
margin: auto; margin: auto;
height: 68vh; height: 68vh;
} }