1
- /* global CustomNetTables $ */
1
+ /* global CustomNetTables $ FindDotaHudElement */
2
+ var topBar = FindDotaHudElement ( 'topbar' ) ;
3
+ var extraInfo = FindDotaHudElement ( 'ExtraInfo' ) ;
4
+ var killLimit = FindDotaHudElement ( 'KillLimitValue' ) ;
5
+ var nextDuel = FindDotaHudElement ( 'TimeToNextDuelValue' ) ;
6
+ var nextCapture = FindDotaHudElement ( 'TimeToNextCaptureValue' ) ;
7
+
8
+ if ( extraInfo . GetParent ( ) . id !== 'topbar' ) {
9
+ extraInfo . SetParent ( topBar ) ;
10
+ extraInfo = null ;
11
+ killLimit = null ;
12
+ nextDuel = null ;
13
+ nextCapture = null ;
14
+ }
2
15
3
16
( function ( ) {
4
17
CustomNetTables . SubscribeNetTableListener ( 'timer' , UpdateClock ) ;
@@ -9,8 +22,21 @@ function UpdateClock (table, name, data) {
9
22
if ( ! data || data . time === undefined ) {
10
23
return ;
11
24
}
12
- $ ( '#TimeHider' ) . style . visibility = 'visible' ;
25
+ if ( killLimit === null ) {
26
+ killLimit = FindDotaHudElement ( 'KillLimitValue' ) ;
27
+ }
28
+ if ( nextDuel === null ) {
29
+ nextDuel = FindDotaHudElement ( 'TimeToNextDuelValue' ) ;
30
+ }
31
+ if ( nextCapture === null ) {
32
+ nextCapture = FindDotaHudElement ( 'TimeToNextCaptureValue' ) ;
33
+ }
13
34
35
+ killLimit . text = data . killLimit ;
36
+ nextDuel . text = formatTime ( data . timeToNextDuel ) ;
37
+ nextCapture . text = formatTime ( data . timeToNextCapture ) ;
38
+
39
+ $ ( '#TimeHider' ) . style . visibility = 'visible' ;
14
40
$ ( '#GameTime' ) . text = formatTime ( data . time ) ;
15
41
var dayTime = $ ( '#DayTime' ) ;
16
42
var nightTime = $ ( '#NightTime' ) ;
0 commit comments