Skip to content

Commit e87d121

Browse files
committed
Fix engagements on stat charts.
1 parent 582b7d9 commit e87d121

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

app/assets/javascripts/angular/directives/chart.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,15 @@ gg.directive('chart', ['$compile', function($compile) {
125125

126126
if (scope.$parent.match.engagements) {
127127
options.xAxis.plotBands = [];
128+
speed_multiplier = 1;
129+
if (scope.$parent.match.expansion_tag == 'LotV') {
130+
speed_multiplier = 1.4;
131+
}
128132
_.each(scope.$parent.match.engagements, function(engagement) {
129133
options.xAxis.plotBands.push({
130134
color: 'rgba(150, 50, 50, 0.10)',
131-
from: engagement[0] / 960.0,
132-
to: engagement[1] / 960.0,
135+
from: engagement[0] / 960.0 / speed_multiplier,
136+
to: engagement[1] / 960.0 / speed_multiplier,
133137
zIndex: 10
134138
});
135139
});

app/assets/javascripts/angular/directives/macrochart.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,15 @@ gg.directive('macrochart', [function() {
7575

7676
if (scope.$parent.match.engagements) {
7777
options.yAxis.plotBands = [];
78+
speed_multiplier = 1;
79+
if (scope.$parent.match.expansion_tag == 'LotV') {
80+
speed_multiplier = 1.4;
81+
}
7882
_.each(scope.$parent.match.engagements, function(engagement) {
7983
options.yAxis.plotBands.push({
8084
color: 'rgba(150, 50, 50, 0.1)',
81-
from: engagement[0] / 960.0,
82-
to: engagement[1] / 960.0,
85+
from: engagement[0] / 960.0 / speed_multiplier,
86+
to: engagement[1] / 960.0 / speed_multiplier,
8387
zIndex: 10
8488
});
8589
});

app/assets/javascripts/angular/directives/protosschart.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,15 @@ gg.directive('protosschart', [function() {
9898

9999
if (scope.$parent.match.engagements) {
100100
options.yAxis.plotBands = [];
101+
speed_multiplier = 1;
102+
if (scope.$parent.match.expansion_tag == 'LotV') {
103+
speed_multiplier = 1.4;
104+
}
101105
_.each(scope.$parent.match.engagements, function(engagement) {
102106
options.yAxis.plotBands.push({
103107
color: 'rgba(150, 50, 50, 0.1)',
104-
from: engagement[0] / 960.0,
105-
to: engagement[1] / 960.0,
108+
from: engagement[0] / 960.0 / speed_multiplier,
109+
to: engagement[1] / 960.0 / speed_multiplier,
106110
zIndex: 10
107111
});
108112
});

app/assets/javascripts/angular/directives/terranchart.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,15 @@ gg.directive('terranchart', [function() {
130130

131131
if (scope.$parent.match.engagements) {
132132
options.yAxis.plotBands = [];
133+
speed_multiplier = 1;
134+
if (scope.$parent.match.expansion_tag == 'LotV') {
135+
speed_multiplier = 1.4;
136+
}
133137
_.each(scope.$parent.match.engagements, function(engagement) {
134138
options.yAxis.plotBands.push({
135139
color: 'rgba(150, 50, 50, 0.1)',
136-
from: engagement[0] / 960.0,
137-
to: engagement[1] / 960.0,
140+
from: engagement[0] / 960.0 / speed_multiplier,
141+
to: engagement[1] / 960.0 / speed_multiplier,
138142
zIndex: 10
139143
});
140144
});

app/assets/javascripts/angular/resources/match.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,11 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc
554554
// don't graph the last base-time; its y-value is zero by definition
555555
_bases_x.pop();
556556

557-
_bases_x_minutes = _.map(_bases_x, function(_frame_x) { return _frame_x / 960.0 });
557+
speed_multiplier = 1.0;
558+
if (this.expansion_tag == 'LotV') {
559+
speed_multiplier = Sc2.LOTV_SPEEDUP;
560+
}
561+
_bases_x_minutes = _.map(_bases_x, function(_frame_x) { return _frame_x / 960.0 / speed_multiplier });
558562

559563
_series_y = [];
560564
_.each(_bases_x, function(_x) {

0 commit comments

Comments
 (0)