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

recommendationWnd.py (3935B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\recommendation\recommendationWnd.py
      2 from carbon.client.script.environment.AudioUtil import PlaySound
      3 from carbon.common.script.sys.serviceConst import ROLE_PROGRAMMER
      4 from carbonui import uiconst
      5 from carbonui.primitives.frame import Frame
      6 from carbonui.uianimations import animations
      7 from contextualOffers.client.UI.bracketBorderWindow import BracketBorderWindow
      8 from carbonui.control.button import Button
      9 from carbonui.decorative.blurredSceneUnderlay import BlurredSceneUnderlay
     10 from eve.client.script.ui.shared.recommendation.const import Sounds
     11 from eve.client.script.ui.shared.recommendation.recommendationCont import RecommendationsCont
     12 
     13 class RecommendationWnd(BracketBorderWindow):
     14     __notifyevents__ = ['OnTreatmentWndOpenedOtherWnd', 'OnRecommendationAccepted']
     15     default_windowID = 'recommendationWnd'
     16     default_fixedWidth = 1068
     17     default_fixedHeight = 500
     18     mainContentWidth = 950
     19     mainContentHeight = 415
     20     innerContWidth = 1050
     21     innerContHeight = 500
     22     bracketWidth = 1068
     23     bracketHeadWidth = 500
     24     bottomBracketOffset = 0
     25     openingDurationSec = 0.05
     26     openingDuration2Sec = 0.2
     27     closingDurationSec = 0.2
     28     closingDuration2Sec = 0.2
     29     fadeOutDurationSec = 0.1
     30     fadeInDurationSec = 0.3
     31 
     32     def DebugReload(self, *args):
     33         self.Close()
     34         wnd = RecommendationWnd.Open()
     35         wnd.ShowDialog(modal=True, state=uiconst.UI_PICKCHILDREN, closeWhenClicked=True)
     36 
     37     def ApplyAttributes(self, attributes):
     38         super(RecommendationWnd, self).ApplyAttributes(attributes)
     39         self.recommendationSvc = sm.GetService('recommendationSvc')
     40         self.innerCont.topPad = 40
     41         self.innerCont.bgFill.opacity = 0.2
     42         self.outerCont.state = uiconst.UI_NORMAL
     43         if session.role & ROLE_PROGRAMMER:
     44             self._ConstructDebugButtons()
     45 
     46     def _ConstructDebugButtons(self):
     47         Button(parent=self.sr.main, label='Reload', align=uiconst.TOPRIGHT, func=self.DebugReload, top=14, idx=0)
     48 
     49     def _AnimEnter(self):
     50         BracketBorderWindow._AnimEnter(self)
     51         animations.MorphScalar(self.blurredUnderlay, 'padTop', startVal=self.innerContHeight / 2, endVal=0.0, duration=self.openingDuration2Sec, timeOffset=self.openingDurationSec)
     52         animations.MorphScalar(self.blurredUnderlay, 'padBottom', startVal=self.innerContHeight / 2, endVal=0.0, duration=self.openingDuration2Sec, timeOffset=self.openingDurationSec)
     53 
     54     def _AnimExit(self):
     55         BracketBorderWindow._AnimExit(self)
     56         animations.MorphScalar(self.blurredUnderlay, 'padTop', startVal=0.0, endVal=self.innerContHeight / 2, duration=self.closingDuration2Sec, timeOffset=self.closingDurationSec)
     57         animations.MorphScalar(self.blurredUnderlay, 'padBottom', startVal=0.0, endVal=self.innerContHeight / 2, duration=self.closingDuration2Sec, timeOffset=self.closingDurationSec)
     58 
     59     def ConstructInnerFrame(self):
     60         BracketBorderWindow.ConstructInnerFrame(self)
     61         self.blurredUnderlay = BlurredSceneUnderlay(name='blurredUnderlay2', parent=self.innerCont, align=uiconst.TOALL, opacity=0.9)
     62         Frame(name='bgFillSprite', parent=self.frameCont, color=(0, 0, 0, 0.25), texturePath='res:/UI/Texture/Shared/BracketBorderWindow/mask_Window770.png', cornerSize=16, padding=1)
     63 
     64     def ConstructContent(self):
     65         RecommendationsCont(parent=self.frameCont)
     66         PlaySound(Sounds.ATMOSPHERE_START)
     67 
     68     def OnTreatmentWndOpenedOtherWnd(self, newWnd):
     69         self.Close()
     70 
     71     def OnRecommendationAccepted(self, *args, **kwargs):
     72         self.CloseButtonClicked()
     73 
     74     def CloseByUser(self, *args):
     75         self.CloseButtonClicked()
     76 
     77     def DeferredClose(self):
     78         super(RecommendationWnd, self).CloseByUser()
     79 
     80     def Close(self, *args, **kwargs):
     81         PlaySound(Sounds.ATMOSPHERE_STOP)
     82         BracketBorderWindow.Close(self, *args, **kwargs)