NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

empireSelectionStep.py (4228B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\login\charcreation_new\steps\empireSelectionStep.py
      2 import uthread
      3 from carbon.client.script.environment.AudioUtil import PlaySound
      4 from carbonui import uiconst
      5 from carbonui.primitives.container import Container
      6 from carbonui.uianimations import animations
      7 from carbonui.uicore import uicore
      8 from carbonui.control.window import Window
      9 from eve.client.script.ui.login.charcreation_new import soundConst
     10 from eve.client.script.ui.login.charcreation_new.charCreation import BaseCharacterCreationStep
     11 from eve.client.script.ui.login.charcreation_new.steps.empireSelection import empireSelectionConst
     12 from eve.client.script.ui.login.charcreation_new.steps.empireSelection.empireSelectionConst import MINIMIZE_ANIMATION_DURATION
     13 from eve.client.script.ui.login.charcreation_new.steps.empireSelection.empireSelectionHeader import EmpireSelectionHeader
     14 from eve.client.script.ui.login.charcreation_new.steps.empireSelection.empireSelectionMapView import EmpireSelectionMapView
     15 from eve.client.script.ui.login.charcreation_new.steps.empireSelection.empireSelectionMenu import EmpireSelectionMenu
     16 from eve.client.script.ui.login.charcreation_new.charCreationSignals import onEmpireFactionSelected
     17 import charactercreator.const as ccConst
     18 from eve.client.script.ui.login.charcreation_new.steps.empireSelection.sidePanelFactionAndSchool import SidePanelFactionAndSchool
     19 from eve.client.script.ui.login.charcreation_new.steps.empireSelection.sidePanelShip import SidePanelShip
     20 
     21 class EmpireSelectionStep(BaseCharacterCreationStep):
     22     stepID = ccConst.EMPIRESTEP
     23 
     24     def ApplyAttributes(self, attributes):
     25         super(EmpireSelectionStep, self).ApplyAttributes(attributes)
     26         self.mainCont = Container(name='mainCont', parent=self, clipChildren=True)
     27         self.header = EmpireSelectionHeader(parent=self, align=uiconst.CENTERTOP, top=60)
     28         SidePanelShip(parent=self, align=uiconst.TOPLEFT_PROP, pos=(0.05, 0.2, 332, 391), opacity=0.0)
     29         SidePanelFactionAndSchool(parent=self, align=uiconst.TOPLEFT_PROP, pos=(0.95, 0.35, 436, 0))
     30         onEmpireFactionSelected.connect(self.OnEmpireFactionSelected)
     31         self.empireSelectMenu = EmpireSelectionMenu(parent=self.mainCont, align=uiconst.TOPLEFT_PROP, state=uiconst.UI_DISABLED, pos=(0.5, 0.75, 0.7, 208))
     32         animEntry = not self.IsSchoolSelected()
     33         self.mapView = EmpireSelectionMapView(parent=self, animEntry=animEntry)
     34         if animEntry:
     35             animations.FadeTo(self.header, 0.0, 1.0, duration=1.0, timeOffset=empireSelectionConst.ENTRY_ANIMATION_DURATION, callback=self.PlayEmpireSelectRenderedSound)
     36             animations.FadeTo(self.empireSelectMenu, 0.0, 1.0, duration=1.0, timeOffset=empireSelectionConst.ENTRY_ANIMATION_DURATION + 1.0, callback=self.empireSelectMenu.Enable)
     37         else:
     38             self.header.opacity = 1.0
     39             self.empireSelectMenu.opacity = 1.0
     40             self.empireSelectMenu.Enable()
     41         PlaySound(soundConst.BACKGROUND_LOOP)
     42 
     43     @staticmethod
     44     def PlayEmpireSelectRenderedSound():
     45         PlaySound(soundConst.RACE_BAR)
     46 
     47     def IsSchoolSelected(self):
     48         controller = uicore.layer.charactercreation.controller
     49         if controller:
     50             return bool(controller.schoolID)
     51         else:
     52             return False
     53 
     54     def OnEmpireFactionSelected(self, factionID):
     55         animations.MorphScalar(self.empireSelectMenu, 'top', self.empireSelectMenu.top, 0.9, duration=MINIMIZE_ANIMATION_DURATION)
     56         animations.MorphScalar(self.empireSelectMenu, 'height', self.empireSelectMenu.height, 100, duration=MINIMIZE_ANIMATION_DURATION)
     57         animations.MorphScalar(self.empireSelectMenu, 'width', self.empireSelectMenu.width, 0.5, duration=MINIMIZE_ANIMATION_DURATION)
     58 
     59     def Close(self):
     60         PlaySound(soundConst.BACKGROUND_LOOP_STOP)
     61         super(EmpireSelectionStep, self).Close()
     62 
     63 
     64 class EmpireSelectionTestWindow(Window):
     65     default_windowID = 'EmpireSelectionTestWindow'
     66     default_minSize = (1024, 768)
     67 
     68     def ApplyAttributes(self, attributes):
     69         super(EmpireSelectionTestWindow, self).ApplyAttributes(attributes)
     70         EmpireSelectionStep(parent=self.sr.main)