technologyStep.py (3201B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\login\charcreation\steps\technologyStep.py 2 import carbonui.const as uiconst 3 from carbonui.primitives.container import Container 4 from carbonui.uicore import uicore 5 import charactercreator.client.scalingUtils as ccScalingUtils 6 import charactercreator.const as ccConst 7 from eve.client.script.ui.login.charcreation.charCreation import BaseCharacterCreationStep 8 from eve.client.script.ui.login.charcreation.charCreationButtons import GetEmpireTabSizeLarge 9 from eve.client.script.ui.login.charcreation.technologiesView import EmpireTechnologiesView 10 from eve.client.script.ui.shared.colorThemes import DEFAULT_COLORTHEMEID, COLOR_THEME_ID_BY_RACE 11 from characterdata.races import CHARACTER_CREATION_RACE_IDS 12 13 def GetEmpireNavigationWidth(): 14 return 4 * GetEmpireTabSizeLarge() 15 16 17 def GetEmpireNavigationHeight(): 18 return GetEmpireTabSizeLarge() 19 20 21 class TechnologyStep(BaseCharacterCreationStep): 22 __guid__ = 'uicls.TechnologyStep' 23 stepID = ccConst.TECHNOLOGYSTEP 24 25 def ApplyAttributes(self, attributes): 26 self.raceID = None 27 self.techCont = None 28 shouldGoBackToStart = attributes.Get('shouldGoBackToStart', True) 29 technologyViewsTracker = attributes.Get('technologyViewsTracker') 30 BaseCharacterCreationStep.ApplyAttributes(self, attributes) 31 info = self.GetInfo() 32 self.techCont = Container(name='techCont', parent=self, align=uiconst.CENTER, width=ccScalingUtils.GetMainPanelWidth(), height=ccScalingUtils.GetMainPanelHeight(), state=uiconst.UI_PICKCHILDREN, padding=(0, 0, 0, 0)) 33 self.buttonCont = Container(parent=self.techCont, name='buttonContainer', align=uiconst.TOALL) 34 self.raceID = info.raceID if info.raceID else self._GetFirstRace() 35 self.techView = EmpireTechnologiesView(name='raceBtn', parent=self.buttonCont, align=uiconst.TOLEFT, width=ccScalingUtils.GetMainPanelWidth(), height=ccScalingUtils.GetMainPanelHeight(), raceID=info.raceID, stepContainer=self.parent, buttonContainer=uicore.layer.charactercreation.controller.empireNavigationButtonContainer, shouldGoBackToStart=shouldGoBackToStart, technologyViewsTracker=technologyViewsTracker) 36 self.UpdateLayout() 37 38 def _GetFirstRace(self): 39 for raceID in CHARACTER_CREATION_RACE_IDS: 40 return raceID 41 42 return const.raceAmarr 43 44 def UpdateLayout(self): 45 if self.raceID: 46 raceTheme = COLOR_THEME_ID_BY_RACE.get(self.raceID, DEFAULT_COLORTHEMEID) 47 sm.GetService('uiColor').SetNoCharTheme(raceTheme) 48 bannerWidth = ccScalingUtils.GetMainPanelWidth() 49 bannerHeight = ccScalingUtils.GetMainPanelHeight() 50 self.techView.UpdateLayout(bannerWidth, bannerHeight) 51 self.techCont.width = ccScalingUtils.GetMainPanelWidth() 52 self.techCont.height = ccScalingUtils.GetMainPanelHeight() 53 54 def OnRaceSelected(self, raceID, *args): 55 self.raceID = raceID 56 uicore.layer.charactercreation.controller.SwitchStep(ccConst.TECHNOLOGYSTEP) 57 58 def UpdateRaceInfo(self, raceID): 59 self.raceID = raceID 60 uicore.layer.charactercreation.controller.Approve()