shipsViewData.py (3952B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\login\charcreation\empireTechnologyViews\shipsViewData.py 2 from eve.common.lib.appConst import raceAmarr, raceCaldari, raceGallente, raceMinmatar 3 import log 4 AMARR_SHIP_DATA = {1: {'color_code': (0, 0, 1, 1), 5 'description': 'Amarr battleship', 6 'tooltip_top': 186, 7 'tooltip_left': -1}, 8 2: {'color_code': (0, 1, 0, 1), 9 'description': 'Amarr frigate', 10 'tooltip_top': 449, 11 'tooltip_left': -106}, 12 3: {'color_code': (1, 1, 1, 1), 13 'description': 'Amarr industrial', 14 'tooltip_top': 445, 15 'tooltip_left': 159}, 16 4: {'color_code': (1, 0, 1, 1), 17 'description': 'Amarr ewar', 18 'tooltip_top': 160, 19 'tooltip_left': 775}, 20 5: {'color_code': (1, 0, 0, 1), 21 'description': 'Amarr corvette', 22 'tooltip_top': 427, 23 'tooltip_left': 609}} 24 CALDARI_SHIP_DATA = {1: {'color_code': (0, 0, 1, 1), 25 'description': 'Caldari battleship', 26 'tooltip_top': 190, 27 'tooltip_left': 213}, 28 2: {'color_code': (0, 1, 0, 1), 29 'description': 'Caldari frigate', 30 'tooltip_top': 250, 31 'tooltip_left': -136}, 32 3: {'color_code': (1, 1, 1, 1), 33 'description': 'Caldari industrial', 34 'tooltip_top': 443, 35 'tooltip_left': -3}, 36 4: {'color_code': (1, 0, 1, 1), 37 'description': 'Caldari ewar', 38 'tooltip_top': 167, 39 'tooltip_left': 380}, 40 5: {'color_code': (1, 0, 0, 1), 41 'description': 'Caldari corvette', 42 'tooltip_top': 349, 43 'tooltip_left': 244}} 44 GALLENTE_SHIP_DATA = {1: {'color_code': (0, 0, 1, 1), 45 'description': 'Gallente battleship', 46 'tooltip_top': 6, 47 'tooltip_left': -143}, 48 2: {'color_code': (0, 1, 0, 1), 49 'description': 'Gallente frigate', 50 'tooltip_top': 247, 51 'tooltip_left': 58}, 52 3: {'color_code': (1, 1, 1, 1), 53 'description': 'Gallente industrial', 54 'tooltip_top': 364, 55 'tooltip_left': 97}, 56 4: {'color_code': (1, 0, 1, 1), 57 'description': 'Gallente ewar', 58 'tooltip_top': 46, 59 'tooltip_left': 660}, 60 5: {'color_code': (1, 0, 0, 1), 61 'description': 'Gallente corvette', 62 'tooltip_top': 415, 63 'tooltip_left': 800}} 64 MINMATAR_SHIP_DATA = {1: {'color_code': (0, 0, 1, 1), 65 'description': 'Minmatar battleship', 66 'tooltip_top': 127, 67 'tooltip_left': -51}, 68 2: {'color_code': (0, 1, 0, 1), 69 'description': 'Minmatar frigate', 70 'tooltip_top': 326, 71 'tooltip_left': -173}, 72 3: {'color_code': (1, 1, 1, 1), 73 'description': 'Minmatar industrial', 74 'tooltip_top': 387, 75 'tooltip_left': -120}, 76 4: {'color_code': (1, 0, 1, 1), 77 'description': 'Minmatar ewar', 78 'tooltip_top': 174, 79 'tooltip_left': 605}, 80 5: {'color_code': (1, 0, 0, 1), 81 'description': 'Minmatar corvette', 82 'tooltip_top': 280, 83 'tooltip_left': 622}} 84 SHIP_DATA = {raceAmarr: AMARR_SHIP_DATA, 85 raceCaldari: CALDARI_SHIP_DATA, 86 raceGallente: GALLENTE_SHIP_DATA, 87 raceMinmatar: MINMATAR_SHIP_DATA} 88 89 class ShipData(object): 90 91 def __init__(self, technology, raceID): 92 self.ship_data = {} 93 self.build_ship_data(technology, raceID) 94 95 def build_ship_data(self, technology, raceID): 96 for order, tech_example in technology.GetTechExamples(): 97 try: 98 base_data = SHIP_DATA[raceID][order] 99 icon = tech_example.GetIcon(raceID) 100 title = tech_example.GetTitle(raceID) 101 subtitle = tech_example.GetSubtitle(raceID) 102 self.ship_data[order] = {'color_code': base_data['color_code'], 103 'tooltip_top': base_data['tooltip_top'], 104 'tooltip_left': base_data['tooltip_left'], 105 'icon': icon, 106 'title': title, 107 'subtitle': subtitle} 108 except KeyError: 109 log.LogWarn('Ship data not available for ship example with id %d' % order) 110 111 def get_ship_data(self): 112 return self.ship_data