warZoneMap.py (2657B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\theatersOfWar\landingPage\warZoneMap.py 2 from carbon.common.script.util.format import FmtDate 3 from carbonui.uianimations import animations 4 from eve.client.script.ui.shared.theatersOfWar.landingPage.landingPageWidgets import WidgetCont, TOP_BOTTOM_HEIGHT 5 from eveformat.client import solar_system_security_status 6 from fwwarzone.client.dashboard.mapData import WarzoneMapData 7 from fwwarzone.client.dashboard.warzoneMap import WarzoneMap 8 from localization import GetByLabel 9 VIEW_SIZE = 3000 10 11 class WarzoneMapCont(WidgetCont): 12 default_name = 'WarzoneMapCont' 13 14 def ApplyAttributes(self, attributes): 15 self.fwWarzoneSvc = sm.GetService('fwWarzoneSvc') 16 super(WarzoneMapCont, self).ApplyAttributes(attributes) 17 self.set_header(GetByLabel('UI/TheatersOfWar/FwOccupancyChanges')) 18 19 def load_fw_maps(self, warzone_id, sub_header_text, war_zone_map_data): 20 self.center_cont.Flush() 21 self.set_sub_header(sub_header_text) 22 map_data = war_zone_map_data.GetWarzoneSystems(warzone_id) 23 systems = map_data.systems 24 warzone_map = WarzoneMap(parent=self.center_cont, viewSize=VIEW_SIZE, warzoneId=warzone_id, opacity=0.0) 25 focus_system_id, focus_occupation_state = war_zone_map_data.GetSolarsystemWithMostRecentOccupancyChange(warzone_id) 26 if focus_system_id is not None and focus_occupation_state is not None: 27 location_text = '%s %s' % (cfg.evelocations.Get(focus_system_id).name, solar_system_security_status(focus_system_id)) 28 self.set_footer_left(location_text) 29 self.set_footer_right(FmtDate(focus_occupation_state.dateTaken, 'ln')) 30 x = systems[focus_system_id].position[0] / float(map_data.mapWidth) * VIEW_SIZE 31 y = systems[focus_system_id].position[1] / float(map_data.mapHeight) * VIEW_SIZE 32 warzone_map.PanTo(x / VIEW_SIZE, y / VIEW_SIZE, duration=0.15) 33 else: 34 warzone_map.PanTo(0.5, 0.5, duration=0.15) 35 self.set_footer_left('[ NO SYSTEM WITH OCCUPANCY-CHANGE DATE FOUND ]') 36 ret = warzone_map.LoadSystems(systems, map_data.mapWidth, map_data.mapHeight) 37 for solar_system_id, element in ret.systemNameLabels.iteritems(): 38 if solar_system_id != focus_system_id: 39 element.Hide() 40 41 animations.FadeIn(warzone_map, duration=2.0) 42 return warzone_map 43 44 def get_center_cont_padding(self): 45 return (-self.padLeft, 46 -self.padTop - TOP_BOTTOM_HEIGHT, 47 -self.padRight, 48 -self.padBottom - TOP_BOTTOM_HEIGHT)