diff --git a/package.json b/package.json index 5658cf1..68b3332 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opt-cc", - "version": "1.7.3", + "version": "1.7.4", "author": "Florian Hartwich ", "private": true, "scripts": { diff --git a/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.html b/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.html index 2e682c5..51fb3e7 100644 --- a/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.html +++ b/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.html @@ -41,12 +41,12 @@
-
+
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- diff --git a/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.ts b/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.ts index acecd7d..938579b 100644 --- a/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.ts +++ b/static/src/app/statistic/campaign-player-detail/campaign-player-detail.component.ts @@ -20,16 +20,8 @@ export class CampaignPlayerDetailComponent implements OnInit { campaignPlayer: CampaignPlayer = {campaign: {}, players: []}; + graphData: any[] = []; sumData: any[] = []; - killData: any[] = []; - friendlyFireData: any[] = []; - vehicleLightData: any[] = []; - vehicleHeavyData: any[] = []; - vehicleAirData: any[] = []; - deathData: any[] = []; - respawnData: any[] = []; - reviveData: any[] = []; - captureData: any[] = []; yAxisKill = 'Kills'; yAxisFriendlyFire = 'FriendlyFire'; @@ -96,15 +88,63 @@ export class CampaignPlayerDetailComponent implements OnInit { this.playerService.getCampaignPlayer(this.campaignId, encodeURIComponent(this.playerName)) .subscribe(campaignPlayer => { this.campaignPlayer = campaignPlayer; - this.killData = this.assignData(this.yAxisKill, 'kill'); - this.friendlyFireData = this.assignData(this.yAxisFriendlyFire, 'friendlyFire'); - this.deathData = this.assignData(this.yAxisDeath, 'death'); - this.respawnData = this.assignData(this.yAxisRespawn, 'respawn'); - this.reviveData = this.assignData(this.yAxisRevive, 'revive'); - this.captureData = this.assignData(this.yAxisCapture, 'flagTouch'); - this.vehicleLightData = this.assignData(this.yAxisVehicleLight, 'vehicleLight'); - this.vehicleHeavyData = this.assignData(this.yAxisVehicleHeavy, 'vehicleHeavy'); - this.vehicleAirData = this.assignData(this.yAxisVehicleAir, 'vehicleAir'); + + this.graphData = [ + { + data: this.assignData(this.yAxisKill, 'kill'), + refLine: this.killRefLines, + label: this.yAxisKill, + total: this.totalKills + }, + { + data: this.assignData(this.yAxisFriendlyFire, 'friendlyFire'), + refLine: this.friendlyFireRefLines, + label: this.yAxisFriendlyFire, + total: this.totalFriendlyFire + }, + { + data: this.assignData(this.yAxisDeath, 'death'), + refLine: this.deathRefLines, + label: this.yAxisDeath, + total: this.totalDeath + }, + { + data: this.assignData(this.yAxisRespawn, 'respawn'), + refLine: this.respawnRefLines, + label: this.yAxisRespawn, + total: this.totalRespawn + }, + { + data: this.assignData(this.yAxisRevive, 'revive'), + refLine: this.reviveRefLines, + label: this.yAxisRevive, + total: this.totalRevive + }, + { + data: this.assignData(this.yAxisCapture, 'flagTouch'), + refLine: this.captureRefLines, + label: this.yAxisCapture, + total: this.totalCapture + }, + { + data: this.assignData(this.yAxisVehicleLight, 'vehicleLight'), + refLine: this.vehicleLightRefLines, + label: this.yAxisVehicleLight, + total: this.totalVehicleLight + }, + { + data: this.assignData(this.yAxisVehicleHeavy, 'vehicleHeavy'), + refLine: this.vehicleHeavyRefLines, + label: this.yAxisVehicleHeavy, + total: this.totalVehicleHeavy + }, + { + data: this.assignData(this.yAxisVehicleAir, 'vehicleAir'), + refLine: this.vehicleAirRefLines, + label: this.yAxisVehicleAir, + total: this.totalVehicleAir + }, + ]; const totalDeathDiv = this.totalDeath === 0 ? 1 : this.totalDeath; this.kdRatio = parseFloat((this.totalKills / totalDeathDiv).toFixed(2)); @@ -114,48 +154,12 @@ export class CampaignPlayerDetailComponent implements OnInit { this.respawnDeathRatio = parseFloat((this.totalRespawn / totalDeathDiv).toFixed(2)); - this.sumData = [ - { - name: this.yAxisKill, - value: this.totalKills - }, - { - name: this.yAxisFriendlyFire, - value: this.totalFriendlyFire - }, - { - name: this.yAxisDeath, - value: this.totalDeath - }, - { - name: this.yAxisRespawn, - value: this.totalRespawn - }, - { - name: this.yAxisRevive, - value: this.totalRevive - }, - { - name: this.yAxisCapture, - value: this.totalCapture - }, - { - name: this.yAxisVehicleLight, - value: this.totalVehicleLight - }, - { - name: this.yAxisVehicleHeavy, - value: this.totalVehicleHeavy - }, - { - name: this.yAxisVehicleAir, - value: this.totalVehicleAir - }, - ]; - - Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleLightData, - this.vehicleHeavyData, this.vehicleAirData, this.deathData, this.respawnData, this.reviveData, - this.captureData]); + // we can not directly push to target array, since only full reference changes trigger the refresh of data + const tmpSumData = []; + this.graphData.forEach(dataSet => { + tmpSumData.push({name: dataSet.label, value: dataSet.total}) + }); + this.sumData = tmpSumData; }); } diff --git a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.html b/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.html index 5284f6e..5a8595b 100644 --- a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.html +++ b/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.html @@ -29,18 +29,12 @@ - + {{column.head}}
- - - - - -