1
1
import * as config from '../config.js'
2
- import { ErrorLog } from '../core/ErrorLog.js'
3
- import { demo as defaultDemo } from '../demo.js'
2
+ import { ErrorLog } from '../core/ErrorLog.js'
3
+ import { demo as defaultDemo } from '../demo.js'
4
4
import Parser from './lib/Parser.js'
5
5
import './player.js'
6
6
@@ -38,6 +38,10 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
38
38
39
39
$interval ( checkSize , 1000 )
40
40
41
+ $scope . isEmptyObject = function ( obj ) {
42
+ return angular . equals ( obj , { } )
43
+ }
44
+
41
45
$scope . errors = { }
42
46
ErrorLog . listen ( function ( error ) {
43
47
addError ( error )
@@ -49,7 +53,7 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
49
53
errorText += error . cause + '\n'
50
54
}
51
55
if ( ! $scope . errors [ errorText ] ) {
52
- $scope . errors [ errorText ] = { quantity : 1 }
56
+ $scope . errors [ errorText ] = { quantity : 1 }
53
57
} else {
54
58
$scope . errors [ errorText ] . quantity += 1
55
59
}
@@ -101,7 +105,7 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
101
105
$scope . gameLoaded = true
102
106
$scope . uinput = ctrl . data . uinput
103
107
ctrl . gameInfo = convertFrameFormat ( ctrl . data )
104
- $scope . agents = { ...ctrl . data . agents }
108
+ $scope . agents = { ...ctrl . data . agents }
105
109
106
110
cgPlayer . sendFrames ( ctrl . gameInfo )
107
111
cgPlayer . subscribe ( onUpdate )
@@ -151,7 +155,7 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
151
155
let f = v . split ( '\n' )
152
156
let header = f [ 0 ] . split ( ' ' )
153
157
154
- return { view : v . replace ( / ^ ( K E Y _ F R A M E ) | ( I N T E R M E D I A T E _ F R A M E ) / , '' ) , keyframe : header [ 0 ] === 'KEY_FRAME' }
158
+ return { view : v . replace ( / ^ ( K E Y _ F R A M E ) | ( I N T E R M E D I A T E _ F R A M E ) / , '' ) , keyframe : header [ 0 ] === 'KEY_FRAME' }
155
159
} )
156
160
for ( let i = 0 ; i < frames . length ; i ++ ) {
157
161
frames [ i ] . gameSummary = data . summaries [ i ]
@@ -161,9 +165,9 @@ function PlayerCtrl ($scope, $timeout, $interval, $filter, $element) {
161
165
}
162
166
frames [ i ] . agentId = - 1
163
167
}
164
- const agents = data . agents . map ( a => Object . assign ( a , { avatarUrl : a . avatar } ) )
168
+ const agents = data . agents . map ( a => Object . assign ( a , { avatarUrl : a . avatar } ) )
165
169
const tooltips = data . tooltips . map ( JSON . stringify )
166
- return { agents : agents , frames : frames , tooltips : tooltips }
170
+ return { agents : agents , frames : frames , tooltips : tooltips }
167
171
}
168
172
169
173
function checkSize ( ) {
0 commit comments