@@ -119,6 +119,15 @@ def _extractSystemsFromSoup(self, soup):
119
119
for element in symbol .select (".sys" ):
120
120
name = element .select ("text" )[0 ].text .strip ().upper ()
121
121
mapCoordinates = {}
122
+ sov = {}
123
+ sovData = element .select ("text" )[1 ].text .strip ().upper ()
124
+ try :
125
+ sov ["name" ] = sovData [0 :(sovData .index ('(' )- 1 )]
126
+ sov ["sov_level" ] = sovData [sovData .index ('(' )+ 1 :len (sovData )- 1 ]
127
+ except :
128
+ # If system SOV is NPC index isn't set
129
+ sov ["name" ] = sovData
130
+
122
131
for keyname in ("x" , "y" , "width" , "height" ):
123
132
mapCoordinates [keyname ] = float (uses [symbolId ][keyname ])
124
133
mapCoordinates ["center_x" ] = (mapCoordinates ["x" ] + (mapCoordinates ["width" ] / 2 ))
@@ -127,8 +136,9 @@ def _extractSystemsFromSoup(self, soup):
127
136
transform = uses [symbolId ]["transform" ]
128
137
except KeyError :
129
138
transform = "translate(0,0)"
130
- systems [name ] = System (name , element , self .soup , mapCoordinates , transform , systemId )
139
+ systems [name ] = System (name , element , self .soup , mapCoordinates , transform , systemId , sov )
131
140
return systems
141
+
132
142
133
143
def _prepareSvg (self , soup , systems ):
134
144
svg = soup .select ("svg" )[0 ]
@@ -291,7 +301,7 @@ class System(object):
291
301
UNKNOWN_COLOR = "#FFFFFF"
292
302
CLEAR_COLOR = "#59FF6C"
293
303
294
- def __init__ (self , name , svgElement , mapSoup , mapCoordinates , transform , systemId ):
304
+ def __init__ (self , name , svgElement , mapSoup , mapCoordinates , transform , systemId , sovData ):
295
305
self .status = states .UNKNOWN
296
306
self .name = name
297
307
self .svgElement = svgElement
@@ -301,6 +311,8 @@ def __init__(self, name, svgElement, mapSoup, mapCoordinates, transform, systemI
301
311
self .secondLine = svgElement .select ("text" )[1 ]
302
312
self .lastAlarmTime = 0
303
313
self .messages = []
314
+ self .sovData = sovData
315
+ self .sovShown = False
304
316
self .setStatus (states .UNKNOWN )
305
317
self .__locatedCharacters = []
306
318
self .backgroundColor = "#FFFFFF"
@@ -440,8 +452,15 @@ def setStatus(self, newStatus):
440
452
self .secondLine ["style" ] = "fill: #000000;"
441
453
elif newStatus == states .UNKNOWN :
442
454
self .setBackgroundColor (self .UNKNOWN_COLOR )
443
- # second line in the rects is reserved for the clock
444
- self .secondLine .string = "?"
455
+ # second line in the rects is reserved for the clock and SOV
456
+ if self .sovShown is False :
457
+ self .SovShown = True
458
+ self .secondLine .string = self .sovData ["name" ]
459
+ try :
460
+ self .secondLine .string += " (" + self .sovData ["sov_level" ] + ")"
461
+ except KeyError :
462
+ pass # System is NPC owned
463
+
445
464
self .secondLine ["style" ] = "fill: #000000;"
446
465
if newStatus not in (states .NOT_CHANGE , states .REQUEST ): # unknown not affect system status
447
466
self .status = newStatus
@@ -473,15 +492,26 @@ def update(self):
473
492
seconds = int (diff - minutes * 60 )
474
493
string = "{m:02d}:{s:02d}" .format (m = minutes , s = seconds )
475
494
if self .status == states .CLEAR :
495
+
476
496
secondsUntilWhite = 10 * 60
477
497
calcValue = int (diff / (secondsUntilWhite / 255.0 ))
478
498
if calcValue > 255 :
479
499
calcValue = 255
480
500
self .secondLine ["style" ] = "fill: #008100;"
481
- string = "clr: {m:02d}:{s:02d}" .format (m = minutes , s = seconds )
482
- self .setBackgroundColor ("rgb({r},{g},{b})" .format (r = calcValue , g = 255 , b = calcValue ))
483
- self .secondLine .string = string
484
-
501
+ if minutes > 30 and self .sovShown is False :
502
+ self .SovShown = True
503
+ self .secondLine .string = self .sovData ["name" ]
504
+ try :
505
+ self .secondLine .string += " (" + self .sovData ["sov_level" ] + ")"
506
+ except KeyError :
507
+ pass # System is NPC owned
508
+ else :
509
+ self .sovShown = False
510
+ string = "clr: {m:02d}:{s:02d}" .format (m = minutes , s = seconds )
511
+ self .setBackgroundColor ("rgb({r},{g},{b})" .format (r = calcValue , g = 255 , b = calcValue ))
512
+ self .secondLine .string = string
513
+
514
+
485
515
486
516
def convertRegionName (name ):
487
517
"""
0 commit comments