Exemplo n.º 1
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.isCameraDragging = False
     self.frame = FrameThemeColored(
         name='bgFrame',
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         bgParent=self,
         texturePath='res:/UI/Texture/Shared/windowFrame.png',
         cornerSize=10,
         fillCenter=False,
         opacity=0.5)
     FrameThemeColored(bgParent=self,
                       colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
                       opacity=0.1)
     self.outerGlow = FrameThemeColored(
         name='outerGlow',
         bgParent=self,
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         texturePath='res:/UI/Texture/Shared/boxGlow.png',
         cornerSize=5,
         offset=-2,
         opacity=0.0)
     self.blurredUnderlay = BlurredSceneUnderlay(bgParent=self,
                                                 effectOpacity=0.5,
                                                 saturation=0.5)
Exemplo n.º 2
0
 def ConstructLayout(self):
     self.frame = FrameThemeColored(
         name='frame',
         bgParent=self,
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         color=self.fixedColor,
         blendMode=trinity.TR2_SBM_ADD,
         texturePath='res:/UI/Texture/Classes/RadioButton/frame.png',
         opacity=self.OPACITY_IDLE)
     self.innerGlow = FrameThemeColored(
         name='innerGlow',
         bgParent=self,
         cornerSize=10,
         texturePath='res:/UI/Texture/Classes/RadioButton/innerGlow.png',
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         color=self.fixedColor,
         opacity=self.OPACITY_IDLE)
     self.hoverFill = SpriteThemeColored(
         name='hoverFill',
         bgParent=self,
         texturePath='res:/UI/Texture/Classes/RadioButton/frame.png',
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         opacity=self.OPACITY_IDLE,
         color=self.fixedColor)
     SpriteThemeColored(
         name='backgroundColorFill',
         bgParent=self,
         texturePath='res:/UI/Texture/Classes/RadioButton/innerGlow.png',
         colorType=uiconst.COLORTYPE_UIBASE,
         opacity=0.45)
Exemplo n.º 3
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     innerContainerPadding = self.outerFrameWidth + self.distanceFromOuterToInnerFrame_side
     innerContainer = Container(parent=self, name='innerContainer', padding=innerContainerPadding, bgColor=(0, 0, 0, 0.5))
     frameCornerSize = 2 + self.innerFrameWidth
     glowFrameTexturePath = 'res:/UI/Texture/classes/CharacterSelection/glowDotFrame.png'
     self.normalGlowFrame = Frame(parent=innerContainer, name='glowFrame', color=FRAME_GLOW_ACTIVE, frameConst=(glowFrameTexturePath,
      5,
      -2,
      0), padding=0)
     self.normalFrame = FrameThemeColored(parent=innerContainer, name='normalFrame', padding=0, frameConst=('ui_1_16_161',
      frameCornerSize,
      -2,
      0))
     self.normalFrame.opacity = 0.0
     self.selectionFrameGlow = Frame(parent=self, name='selectionFrame', color=FRAME_GLOW_ACTIVE, texturePath='res:/UI/Texture/classes/CharacterSelection/selectFrame.png', cornerSize=22)
     self.selectionFrameGlow.opacity = 0
     frameCornerSize = 2 + self.outerFrameWidth
     self.selectionFrame = Frame(parent=self, name='selectionFrame', color=OUTER_FRAME, frameConst=('ui_1_16_161',
      frameCornerSize,
      -2,
      0))
     self.selectionFrame.opacity = 0
     contentPadding = self.distanceFromInnerFrameToContent_sides + self.innerFrameWidth
     contentParent = Container(parent=innerContainer, name='contentParent', padding=contentPadding, align=uiconst.TOALL)
     self.contentTopPush = Container(name='contentTopPush', parent=contentParent, align=uiconst.TOTOP_PROP, height=0.55)
     self.contentBottomPush = Container(name='contentBottomPush', parent=contentParent, align=uiconst.TOBOTTOM_PROP, height=0.55)
     self.content = Container(parent=contentParent, name='content', align=uiconst.TOALL, pos=(0, 0, 0, 0), clipChildren=True, state=uiconst.UI_PICKCHILDREN, opacity=0.0)
     self.dotFrameTopPush = Container(name='dotFrameTopPush', parent=innerContainer, align=uiconst.TOTOP_PROP, height=0.5)
     self.dotFrameBottomPush = Container(name='dotFrameBottomPush', parent=innerContainer, align=uiconst.TOBOTTOM_PROP, height=0.5)
     self.dotFrame = FrameThemeColored(parent=innerContainer, name='dotFrame', color=FRAME_GLOW_ACTIVE, texturePath='res:/UI/Texture/classes/MapView/dotFrame.png', cornerSize=21, offset=-1)
     self.dotFrame.opacity = 0.0
Exemplo n.º 4
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.connections = {}
     self.slotsByID = {}
     self.gridBackground = Container(parent=self)
     self.treeMargin = attributes.treeMargin
     FrameThemeColored(bgParent=self, colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=0.1)
     FrameThemeColored(bgParent=self, colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=0.1, padding=3)
Exemplo n.º 5
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.btnData = attributes.btnData
     self.width = attributes.width
     self.controller = attributes.controller
     self._isDraggable = attributes.get('isDraggable',
                                        self.default_isDraggable)
     self._openNeocomPanel = None
     self.isDragging = False
     self.height = self.width
     self.SetCorrectPosition()
     self.panel = None
     self.blinkThread = None
     self.realTop = self.top
     self.dragEventCookie = None
     self.disableClick = False
     self.iconSize = self.height - 2 * self.PADVERTICAL
     self.iconTransform = uiprimitives.Transform(name='iconTransform',
                                                 parent=self,
                                                 align=uiconst.TOALL,
                                                 scalingCenter=(0.5, 0.5))
     self.iconLabelCont = None
     if self.btnData.id == 'map_beta' or self.btnData.id == 'map' and IsMapBetaExplicit(
     ):
         Sprite(parent=self.iconTransform,
                align=uiconst.TOPLEFT,
                pos=(0, 0, 11, 29),
                texturePath='res:/UI/Texture/Shared/betaTag.png',
                state=uiconst.UI_DISABLED)
     self.icon = GlowSprite(parent=self.iconTransform,
                            name='icon',
                            state=uiconst.UI_DISABLED,
                            align=uiconst.CENTER,
                            width=self.iconSize,
                            height=self.iconSize,
                            iconOpacity=1.0)
     self.UpdateIcon()
     PAD = 1
     self.blinkSprite = SpriteThemeColored(
         bgParent=self,
         name='blinkSprite',
         texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.activeFrame = FrameThemeColored(
         bgParent=self,
         name='hoverFill',
         texturePath='res:/UI/Texture/classes/Neocom/buttonActive.png',
         cornerSize=5,
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.CheckIfActive()
     self.dropFrame = uicontrols.Frame(parent=self,
                                       name='hoverFrame',
                                       color=util.Color.GetGrayRGBA(
                                           1.0, 0.5),
                                       state=uiconst.UI_HIDDEN)
     sm.RegisterNotify(self)
Exemplo n.º 6
0
 def Prepare_Underlay_(self):
     border = FrameThemeColored(parent=self,
                                frameConst=uiconst.FRAME_BORDER1_CORNER0,
                                state=uiconst.UI_DISABLED,
                                colorType=uiconst.COLORTYPE_UIHILIGHT,
                                opacity=0.25)
     frame = FrameThemeColored(parent=self,
                               frameConst=uiconst.FRAME_FILLED_CORNER4,
                               state=uiconst.UI_DISABLED)
Exemplo n.º 7
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     skinName = attributes.get('skinName', 'general')
     actualSkinClass = SKIN_NAME_TO_CLASS.get(skinName)
     if not FrameWithPointer.skinCache.get(skinName):
         FrameWithPointer.skinCache[skinName] = actualSkinClass()
     self.skin = FrameWithPointer.skinCache[skinName]
     self._pointer = SpriteThemeColored(texturePath='res:/UI/Texture/classes/FrameWithPointer/pointer_down_02.png', parent=self, colorType=attributes.colorType or uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.95)
     self._background = FrameThemeColored(name='__underlay', bgParent=self, cornerSize=self.skin.backgroundCornerSize, offset=self.skin.backgroundOffset, texturePath=self.skin.backgroundTexture, colorType=attributes.colorType or uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.95)
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.jobData = attributes.jobData
     self.oldJobData = None
     self.pattern = Frame(
         parent=self,
         texturePath=
         'res:/UI/Texture/Classes/Industry/Output/boxPattern.png',
         align=TOALL,
         state=UI_DISABLED,
         opacity=0.0,
         cornerSize=5)
     FrameThemeColored(parent=self,
                       state=UI_DISABLED,
                       align=TOALL,
                       opacity=0.3)
     FillThemeColored(bgParent=self, opacity=0.5)
     self.contentCont = Container(name='contentCont', parent=self)
     self.errorFrame = ErrorFrame(bgParent=self, padding=1)
     self.openInventoryBtn = ButtonIcon(
         name='openInventoryBtn ',
         parent=self,
         align=uiconst.TOPRIGHT,
         pos=(1, 1, 21, 21),
         iconSize=16,
         texturePath='res:/UI/Texture/Vgs/Search_icon.png',
         func=self.OnOpenInventoryBtn)
     self.UpdateState()
     self.AnimEntry()
Exemplo n.º 9
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.jobData = attributes.jobData
     self.videoThread = None
     self.iconCont = Container(name='iconCont', parent=self, align=CENTER, state=uiconst.UI_NORMAL, width=64, height=64)
     self.errorFrame = ErrorFrame(parent=self, align=uiconst.CENTER, pos=(0, 0, 64, 64), state=uiconst.UI_HIDDEN)
     self.qtyLabel = EveLabelLargeBold(parent=self, align=CENTER, top=42)
     FrameThemeColored(name='bgVignette', parent=self, texturePath='res:/UI/Texture/Classes/Industry/Output/bgVignette.png', cornerSize=30)
     self.videoCont = Container(name='videoCont', parent=self, align=uiconst.CENTER, width=324, height=199)
     self.previewContFill = FillThemeColored(parent=self)
     self.previewCont = PreviewContainer(parent=self, align=uiconst.TOALL, state=uiconst.UI_HIDDEN)
     self.leftProbabilityGradient = GradientSprite(name='leftProbabilityGradient', parent=self, align=uiconst.CENTERLEFT, state=uiconst.UI_HIDDEN, pos=(0, 0, 160, 64), rgbData=((0, (1.0, 1.0, 1.0)),), alphaData=((0.0, 0.5), (1.0, 0.0)))
     self.rightProbabilityGradient = GradientSprite(name='rightProbabilityGradient', parent=self, align=uiconst.CENTERRIGHT, state=uiconst.UI_HIDDEN, pos=(0, 0, 160, 64), rgbData=((0, (1.0, 1.0, 1.0)),), alphaData=((0.0, 0.0), (1.0, 0.5)))
     self.previewCont.navigation.LoadTooltipPanel = self.LoadIconContTooltipPanel
     self.previewCont.navigation.GetTooltipDelay = self.GetIconContTooltipDelay
     self.previewCont.navigation.GetMenu = self.GetMenu
     self.iconCont.LoadTooltipPanel = self.LoadIconContTooltipPanel
     self.iconCont.GetTooltipDelay = self.GetIconContTooltipDelay
     self.iconCont.OnMouseEnter = self.OnIconContMouseEnter
     self.iconCont.OnMouseExit = self.OnIconContMouseExit
     self.iconCont.OnClick = self.OnIconContClick
     self.iconCont.GetMenu = self.GetMenu
     self.iconCont.GetDragData = self.GetIconContDragData
     self.iconCont.isDragObject = True
     self.techIcon = Sprite(name='techIcon', parent=self.iconCont, width=16, height=16)
     self.icon = Icon(parent=self.iconCont, align=CENTER, state=uiconst.UI_DISABLED)
     self.bgCont = Container(name='bgCont', parent=self, align=uiconst.CENTER, width=201, height=192)
     self.bg = Sprite(bgParent=self.bgCont, texturePath='res:/UI/Texture/Classes/Industry/Output/itemBg.png')
     self.itemPattern = Sprite(bgParent=self.bgCont, texturePath='res:/UI/Texture/Classes/Industry/Output/itemBgColor.png')
     self.UpdateState()
     self.AnimEntry()
Exemplo n.º 10
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.isInFocus = attributes.Get('isInFocus', self.default_isInFocus)
     showFill = attributes.get('showFill', self.default_showFill)
     self.isWindowActive = True
     self.isCameraDragging = False
     self.edgeGlow = StretchSpriteVerticalThemeColored(
         name='edgeGlow',
         bgParent=self,
         texturePath='res:/UI/Texture/shared/buttonEdgeGlowFrameBottom.png',
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         blendMode=trinity.TR2_SBM_ADD,
         opacity=0.1,
         topEdgeSize=2,
         bottomEdgeSize=2)
     self.frame = FrameThemeColored(
         bgParent=self,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         texturePath='res:/UI/Texture/Shared/underlayBumped.png',
         cornerSize=6)
     if showFill:
         FillThemeColored(name='hoverFill',
                          bgParent=self,
                          colorType=uiconst.COLORTYPE_UIHILIGHT,
                          opacity=0.2)
     self.fillUnderlay = FillThemeColored(
         bgParent=self, colorType=uiconst.COLORTYPE_UIBASECONTRAST)
     self.UpdateIsActive()
     self.UpdateState(animate=False)
Exemplo n.º 11
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     callback = attributes.callback
     submit = attributes.submit
     self.oldJobData = None
     self.jobData = attributes.jobData
     self.jobsSummary = JobsSummary(parent=self,
                                    align=uiconst.CENTERLEFT,
                                    left=10)
     self.activitySelectionButtons = ActivitySelectionButtons(
         parent=self,
         align=uiconst.CENTER,
         callback=callback,
         width=248,
         height=38)
     self.submitBtn = SubmitButton(parent=self,
                                   align=uiconst.CENTERRIGHT,
                                   fixedheight=30,
                                   fixedwidth=125,
                                   left=7)
     GradientSprite(bgParent=self,
                    rotation=-math.pi / 2,
                    rgbData=[(0, (0.3, 0.3, 0.3))],
                    alphaData=[(0, 0.3), (1.0, 0.05)])
     FrameThemeColored(bgParent=self,
                       colorType=uiconst.COLORTYPE_UIBASECONTRAST)
     self.UpdateState()
Exemplo n.º 12
0
 def ApplyAttributes(self, attributes):
     attributes.align = uiconst.TOPLEFT
     attributes.width = 128
     attributes.height = 128
     ContainerAutoSize.ApplyAttributes(self, attributes)
     if attributes.GetUtilMenu:
         self._getMenuFunction = attributes.GetUtilMenu
     else:
         raise RuntimeError('GetUtilMenu has to be provided in order to use UtilMenu')
     self.controller = attributes.controller
     self.isTopLevelWindow = True
     self.menuAlign = attributes.Get('menuAlign', self.default_menuAlign)
     self.minWidth = attributes.minWidth or 0
     FrameThemeColored(bgParent=self, colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=0.35)
     FillThemeColored(bgParent=self, opacity=OPACITY_BG)
     FrameThemeColored(bgParent=self, frameConst=('ui_105_32_26', 15, 0), padding=(-12, -5, -12, -15))
     uicore.uilib.RegisterForTriuiEvents([uiconst.UI_MOUSEDOWN], self.OnGlobalMouseDown)
     self.ReloadMenu()
     self.AnimFadeIn()
     self.UpdateMenuPosition()
Exemplo n.º 13
0
 def MakeDragContainer(self):
     self.dragContainer = Container(parent=self.weekContParent,
                                    align=uiconst.TOPLEFT,
                                    idx=0)
     FrameThemeColored(parent=self.dragContainer,
                       frameConst=uiconst.FRAME_BORDER1_CORNER3,
                       colorType=uiconst.COLORTYPE_UIHILIGHT,
                       opacity=0.5)
     FillThemeColored(parent=self.dragContainer,
                      frameConst=uiconst.FRAME_FILLED_CORNER3,
                      opacity=0.3)
Exemplo n.º 14
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.frame = FrameThemeColored(name='bgFrame',
                                    colorType=attributes.frameColorType
                                    or uiconst.COLORTYPE_UIHILIGHTGLOW,
                                    bgParent=self,
                                    texturePath=attributes.frameTexturePath,
                                    cornerSize=attributes.frameCornerSize
                                    or 0,
                                    offset=attributes.frameOffset or 0,
                                    fillCenter=attributes.frameFillCenter
                                    or False,
                                    opacity=attributes.frameOpacity or 0.5)
     FrameThemeColored(bgParent=self,
                       colorType=uiconst.COLORTYPE_UIBASE,
                       texturePath=attributes.fillTexturePath,
                       cornerSize=attributes.fillCornerSize or 0,
                       offset=attributes.fillOffset or 0,
                       fillCenter=attributes.fillFillCenter or False,
                       opacity=attributes.fillOpacity or 0.1)
     sm.RegisterNotify(self)
Exemplo n.º 15
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     Frame(bgParent=self, color=(1, 1, 1, 0.1))
     self.cornerPoints = FrameThemeColored(
         name='bgFrame',
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         bgParent=self,
         texturePath='res:/UI/Texture/Shared/windowFrame.png',
         cornerSize=10,
         fillCenter=False,
         padding=1,
         opacity=0.5)
     self.whiteFill = Fill(bgParent=self, color=(1, 1, 1, 0))
Exemplo n.º 16
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     parLeft, parTop = self.parent.GetAbsolutePosition()
     self.x0 = uicore.uilib.x - parLeft
     self.y0 = uicore.uilib.y - parTop
     FrameThemeColored(parent=self,
                       frameConst=uiconst.FRAME_BORDER1_CORNER3,
                       colorType=uiconst.COLORTYPE_UIHILIGHT,
                       opacity=0.5)
     FillThemeColored(parent=self,
                      frameConst=uiconst.FRAME_FILLED_CORNER3,
                      opacity=0.15)
     uthread.new(self.UpdateThread)
Exemplo n.º 17
0
 def AddFrame(self, *args):
     self.sr.frame = FrameThemeColored(
         parent=self,
         name='frame',
         frameConst=uiconst.FRAME_BORDER1_CORNER0,
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         opacity=0.1)
     self.sr.todayFill = Frame(parent=self,
                               name='todayFill',
                               frameConst=uiconst.FRAME_FILLED_CORNER0,
                               padding=(1, 1, 1, 1),
                               color=(0.5, 0.5, 0.5, 0.75))
     self.sr.selectedFrame = Frame(parent=self,
                                   name='frame',
                                   frameConst=uiconst.FRAME_BORDER1_CORNER0,
                                   color=(0.5, 0.5, 0.5, 0.1),
                                   padding=(1, 1, 1, 1),
                                   state=uiconst.UI_HIDDEN)
Exemplo n.º 18
0
 def Prepare_Underlay_(self):
     self.barCont = Container(parent=self,
                              name='barCont',
                              align=uiconst.TOBOTTOM,
                              state=uiconst.UI_NORMAL,
                              hint=self.hint,
                              height=self.barHeight + 2 * self.barPadding)
     self.barCont.ticks = []
     self.frame = FrameThemeColored(parent=self.barCont,
                                    name='barFrame',
                                    align=uiconst.TOALL,
                                    padding=(0, self.barPadding, 0,
                                             self.barPadding),
                                    colorType=uiconst.COLORTYPE_UIHILIGHT,
                                    state=uiconst.UI_DISABLED,
                                    hint=self.hint)
     self.barCont.OnClick = self.OnSliderClicked
     self.barCont.OnMouseMove = self.OnSliderMouseMove
     self.barCont.OnMouseExit = self.OnMouseBarExit
     self.barCont.OnMouseWheel = self.OnMouseWheel
Exemplo n.º 19
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.label = LabelThemeColored(
         parent=self,
         state=uiconst.UI_DISABLED,
         fontsize=eveFontConst.EVE_MEDIUM_FONTSIZE,
         align=uiconst.CENTERLEFT,
         left=5)
     FrameThemeColored(bgParent=self,
                       colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
                       opacity=0.25,
                       frameConst=uiconst.FRAME_BORDER1_CORNER1)
     SpriteThemeColored(
         parent=self,
         texturePath='res:/UI/Texture/classes/Neocom/arrowDown.png',
         pos=(5, -1, 7, 7),
         align=uiconst.CENTERRIGHT,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         opacity=0.5,
         state=uiconst.UI_DISABLED)
     self.SetText(attributes.text)
Exemplo n.º 20
0
 def Prepare_(self):
     self.sr.label = LabelThemeColored(
         parent=self,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         opacity=OPACITY_LABEL_IDLE,
         fontsize=10)
     if self.iconPath is not None:
         if self.iconSize:
             width = self.iconSize
             height = self.iconSize
         else:
             width = height = min(self.width, self.height)
         self.icon = GlowSprite(parent=self,
                                state=uiconst.UI_DISABLED,
                                align=uiconst.CENTER,
                                pos=(0, 0, width, height),
                                texturePath=self.iconPath,
                                color=self.color,
                                iconOpacity=0.75)
         self.sr.label.state = uiconst.UI_HIDDEN
         self.width = width + 4
         self.height = height + 4
     else:
         self.icon = None
     self.sr.hilite = Fill(bgParent=self,
                           color=(0.7, 0.7, 0.7, 0.5),
                           state=uiconst.UI_HIDDEN)
     self.sr.activeframe = FrameThemeColored(
         parent=self,
         name='activeline',
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         opacity=0.1)
     self.underlay = RaisedUnderlay(name='backgroundFrame',
                                    bgParent=self,
                                    state=uiconst.UI_DISABLED,
                                    color=self.color)
Exemplo n.º 21
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.isEnabled = attributes.get('isEnabled', True)
     self.disabled = False
     FrameThemeColored(parent=self)
     btnCont = Container(parent=self)
     self.onBtn = Container(parent=self,
                            align=uiconst.TOLEFT_PROP,
                            width=0.5,
                            bgColor=COLOR_GREEN,
                            state=uiconst.UI_DISABLED)
     self.offBtn = Container(parent=self,
                             align=uiconst.TORIGHT_PROP,
                             width=0.5,
                             bgColor=COLOR_RED,
                             state=uiconst.UI_DISABLED)
     self.knob = FillThemeColored(parent=btnCont,
                                  align=uiconst.TOLEFT_PROP,
                                  width=0.5,
                                  state=uiconst.UI_DISABLED,
                                  colorType=uiconst.COLORTYPE_UIHEADER,
                                  opacity=1.0)
     self.SetStateNotAnimated()
Exemplo n.º 22
0
class ButtonBase(uiprimitives.Container):
    """
    An abstract button that others inherit from
    """
    __guid__ = 'neocom.ButtonBase'
    __notifyevents__ = ['ProcessNeocomBlinkPulse']
    default_name = 'ButtonBase'
    default_state = uiconst.UI_NORMAL
    default_align = uiconst.TOPLEFT
    default_isDraggable = True
    PADHORIZONTAL = 6
    PADVERTICAL = 4
    ACTIVEFILL_DEFAULTALPHA = 0.5
    ACTIVEFILL_HOVERALPHA = 0.8

    def ApplyAttributes(self, attributes):
        uiprimitives.Container.ApplyAttributes(self, attributes)
        self.btnData = attributes.btnData
        self.btnNum = attributes.btnNum
        self.width = attributes.width
        self._isDraggable = attributes.get('isDraggable',
                                           self.default_isDraggable)
        self._openNeocomPanel = None
        self.height = self.width
        self.top = self.height * self.btnNum
        self.panel = None
        self.blinkThread = None
        self.realTop = self.top
        self.dragEventCookie = None
        self.disableClick = False
        self.iconSize = self.height - 2 * self.PADVERTICAL
        self.iconTransform = uiprimitives.Transform(name='iconTransform',
                                                    parent=self,
                                                    align=uiconst.TOALL,
                                                    scalingCenter=(0.5, 0.5))
        self.iconLabelCont = None
        if self.btnData.id == 'map_beta':
            Sprite(parent=self.iconTransform,
                   align=uiconst.TOPLEFT,
                   pos=(0, 0, 11, 29),
                   texturePath='res:/UI/Texture/Shared/betaTag.png',
                   state=uiconst.UI_DISABLED)
        self.icon = GlowSprite(parent=self.iconTransform,
                               name='icon',
                               state=uiconst.UI_DISABLED,
                               align=uiconst.CENTER,
                               width=self.iconSize,
                               height=self.iconSize,
                               iconOpacity=1.0)
        self.UpdateIcon()
        PAD = 1
        self.blinkSprite = SpriteThemeColored(
            bgParent=self,
            name='blinkSprite',
            texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
            state=uiconst.UI_HIDDEN,
            colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
        self.activeFrame = FrameThemeColored(
            bgParent=self,
            name='hoverFill',
            texturePath='res:/UI/Texture/classes/Neocom/buttonActive.png',
            cornerSize=5,
            state=uiconst.UI_HIDDEN,
            colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
        self.CheckIfActive()
        self.dropFrame = uicontrols.Frame(parent=self,
                                          name='hoverFrame',
                                          color=util.Color.GetGrayRGBA(
                                              1.0, 0.5),
                                          state=uiconst.UI_HIDDEN)
        sm.RegisterNotify(self)

    def UpdateIcon(self):
        texturePath = self._GetPathFromIconNum(self.btnData.iconPath)
        self.icon.SetTexturePath(texturePath)

    def CheckIfActive(self):
        if self.btnData.isActive:
            self.activeFrame.Show()
        else:
            self.activeFrame.Hide()

    def GetIconPath(self):
        return self._GetPathFromIconNum(self.btnData.iconPath)

    def _GetPathFromIconNum(self, iconNum):
        if iconNum.startswith('res:/'):
            return iconNum
        parts = iconNum.split('_')
        if len(parts) == 2:
            sheet, iconNum = parts
            iconSize = uix.GetIconSize(sheet)
            return 'res:/ui/texture/icons/%s_%s_%s.png' % (
                int(sheet), int(iconSize), int(iconNum))
        elif len(parts) == 4:
            root, sheet, iconSize, iconNum = parts
            if root == 'ui':
                root = 'icons'
            return 'res:/ui/texture/%s/%s_%s_%s.png' % (
                root, int(sheet), int(iconSize), int(iconNum))
        else:
            return neocomCommon.ICONPATH_DEFAULT

    def IsDraggable(self):
        return self._isDraggable

    def SetDraggable(self, isDraggable):
        self._isDraggable = isDraggable

    def GetMenu(self):
        return self.btnData.GetMenu()

    def LoadTooltipPanel(self, tooltipPanel, *args):
        isOpen = self._openNeocomPanel and not self._openNeocomPanel.destroyed
        if isOpen:
            return
        tooltipPanel.LoadGeneric3ColumnTemplate()
        blinkHintStr = None
        if getattr(self.btnData, 'cmdName', None):
            cmd = uicore.cmd.commandMap.GetCommandByName(self.btnData.cmdName)
            tooltipPanel.AddCommandTooltip(cmd)
            blinkHintStr = self.btnData.blinkHint
        else:
            label = None
            if self.IsSingleWindow():
                wnd = self.GetWindow()
                if not wnd.destroyed:
                    label = wnd.GetCaption()
            elif self.btnData.children:
                label = self.btnData.children[0].wnd.GetNeocomGroupLabel()
            mainStr = label or self.btnData.label
            tooltipPanel.AddLabelMedium(text=mainStr)
        self.LoadTooltipPanelDetails(tooltipPanel, self.btnData)
        if blinkHintStr:
            tooltipPanel.AddLabelMedium(text=blinkHintStr,
                                        width=200,
                                        colSpan=tooltipPanel.columns)

    def LoadTooltipPanelDetails(cls, tooltipPanel, btnData):
        if btnData.id == 'wallet':
            showFractions = settings.char.ui.Get('walletShowCents', False)
            personalWealth = util.FmtISK(
                sm.GetService('wallet').GetWealth(), showFractions)
            tooltipPanel.AddLabelValue(
                label=localization.GetByLabel('Tooltips/Neocom/Balance'),
                value=personalWealth)
            canAccess = sm.GetService(
                'wallet').HaveReadAccessToCorpWalletDivision(
                    session.corpAccountKey)
            if canAccess:
                corpWealth = util.FmtISK(
                    sm.GetService('wallet').GetCorpWealthCached1Min(
                        session.corpAccountKey), showFractions)
                tooltipPanel.AddLabelValue(label=localization.GetByLabel(
                    'Tooltips/Neocom/CorporationBalance'),
                                           value=corpWealth)

    def GetTooltipPointer(self):
        return uiconst.POINT_LEFT_2

    def IsSingleWindow(self):
        return False

    def OnMouseEnter(self, *args):
        self.btnData.SetBlinkingOff()
        self.icon.OnMouseEnter()

    def OnMouseExit(self, *args):
        self.icon.OnMouseExit()

    def OnMouseDown(self, *args):
        if not self.IsDraggable():
            return
        if not uicore.uilib.leftbtn:
            return
        self.isDragging = False
        self.mouseDownY = uicore.uilib.y
        if self.dragEventCookie is not None:
            uicore.event.UnregisterForTriuiEvents(self.dragEventCookie)
        self.dragEventCookie = uicore.event.RegisterForTriuiEvents(
            uiconst.UI_MOUSEMOVE, self.OnDrag)
        uicore.animations.Tr2DScaleTo(self.iconTransform,
                                      self.iconTransform.scale, (0.95, 0.95),
                                      duration=0.1)
        self.icon.OnMouseDown()

    def OnMouseUp(self, *args):
        if uicore.uilib.mouseOver == self:
            uicore.animations.Tr2DScaleTo(self.iconTransform,
                                          self.iconTransform.scale, (1.0, 1.0),
                                          duration=0.1)
        if self.dragEventCookie is not None:
            uicore.event.UnregisterForTriuiEvents(self.dragEventCookie)
            self.dragEventCookie = None
        self.icon.OnMouseUp()

    def OnDragEnd(self, *args):
        uicore.event.UnregisterForTriuiEvents(self.dragEventCookie)
        self.dragEventCookie = None
        self.isDragging = False
        sm.GetService('neocom').OnButtonDragEnd(self)
        self.CheckIfActive()

    def OnDrag(self, *args):
        if math.fabs(self.mouseDownY - uicore.uilib.y) > 5 or self.isDragging:
            if not self.isDragging:
                uicore.event.RegisterForTriuiEvents(uiconst.UI_MOUSEUP,
                                                    self.OnDragEnd)
            self.disableClick = True
            self.isDragging = True
            sm.GetService('neocom').OnButtonDragged(self)
        return True

    def OnClick(self, *args):
        if not self or self.destroyed:
            return
        self.btnData.CheckContinueBlinking()
        if not self.disableClick:
            self.OnClickCommand()
        if not self or self.destroyed:
            return
        self.disableClick = False
        if self.dragEventCookie:
            uicore.event.UnregisterForTriuiEvents(self.dragEventCookie)

    def OnDblClick(self, *args):
        """ Swallow double click event so that we don't get two OnClick events """
        pass

    def OnClickCommand(self):
        """
        Overridden by subclasses
        """
        pass

    def OnSwitched(self):
        uicore.effect.MorphUIMassSpringDamper(item=self,
                                              attrname='opacity',
                                              float=1,
                                              newVal=1.0,
                                              minVal=0,
                                              maxVal=2.0,
                                              dampRatio=0.45,
                                              frequency=15.0,
                                              initSpeed=0,
                                              maxTime=4.0,
                                              callback=None,
                                              initVal=0.0)
        self.isDragging = False
        self.disableClick = False

    def GetDragData(self, *args):
        if self.btnData.isDraggable:
            return [self.btnData]

    def BlinkOnce(self, duration=0.7):
        self.blinkSprite.Show()
        uicore.animations.SpSwoopBlink(self.blinkSprite,
                                       rotation=math.pi * 0.75,
                                       duration=duration)

    def ProcessNeocomBlinkPulse(self):
        if self.btnData.isBlinking:
            self.BlinkOnce()

    def OnDropData(self, source, dropData):
        if not sm.GetService('neocom').IsValidDropData(dropData):
            return
        index = self.btnData.parent.children.index(self.btnData)
        sm.GetService('neocom').OnBtnDataDropped(dropData[0], index)

    def OnDragEnter(self, panelEntry, dropData):
        if not sm.GetService('neocom').IsValidDropData(dropData):
            return
        sm.GetService('neocom').OnButtonDragEnter(self.btnData, dropData[0])
        uthread.new(self.ShowPanelOnMouseHoverThread)

    def OnDragExit(self, *args):
        sm.GetService('neocom').OnButtonDragExit(self.btnData, args)

    def ToggleNeocomPanel(self):
        isOpen = self._openNeocomPanel and not self._openNeocomPanel.destroyed
        sm.GetService('neocom').CloseAllPanels()
        if isOpen:
            self._openNeocomPanel = None
        else:
            self._openNeocomPanel = sm.GetService('neocom').ShowPanel(
                triggerCont=self,
                panelClass=self.GetPanelClass(),
                panelAlign=neocomCommon.PANEL_SHOWONSIDE,
                parent=uicore.layer.abovemain,
                btnData=self.btnData)
        RefreshTooltipForOwner(self)

    def ShowPanelOnMouseHoverThread(self):
        if len(self.btnData.children) <= 1:
            return
        blue.pyos.synchro.Sleep(500)
        if not self or self.destroyed:
            return
        if uicore.uilib.mouseOver == self:
            self.ToggleNeocomPanel()

    def GetPanelClass(self):
        return neocomPanels.PanelGroup

    def SetAsActive(self):
        self.btnData.isActive = True
        self.activeFrame.state = uiconst.UI_DISABLED

    def SetAsInactive(self):
        self.btnData.isActive = False
        self.activeFrame.state = uiconst.UI_HIDDEN
Exemplo n.º 23
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     FrameThemeColored(bgParent=self,
                       colorType=uiconst.COLORTYPE_UIHILIGHT,
                       opacity=0.35)
     FillThemeColored(bgParent=self, opacity=0.93)
Exemplo n.º 24
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.abortbtn = None
     self.abortbtnpar = None
     self.confirmbtn = None
     self.abortconfirmbtnpar = None
     self.sr.progresstext = None
     self.sr.readprogress = util.KeyVal(text='', prev=0)
     self.scope = 'all'
     self.sr.main = uiprimitives.Container(parent=self,
                                           pos=(0, 0, 0, 0),
                                           name='maincontainer',
                                           state=uiconst.UI_PICKCHILDREN,
                                           align=uiconst.TOALL)
     self.sr.wndUnderlay = uicontrols.WindowUnderlay(parent=self,
                                                     transparent=False)
     par = uiprimitives.Container(name='progressParent',
                                  parent=self.sr.main,
                                  align=uiconst.TOBOTTOM,
                                  height=32)
     progress = uiprimitives.Container(parent=par,
                                       pos=(25, 10, self.width - 50, 10),
                                       name='progressbar',
                                       state=uiconst.UI_DISABLED,
                                       align=uiconst.RELATIVE)
     self.sr.glowClipper = uiprimitives.Container(parent=progress,
                                                  pos=(0, 0, 0, 10),
                                                  name='glowclipper',
                                                  state=uiconst.UI_DISABLED,
                                                  clipChildren=True,
                                                  align=uiconst.RELATIVE)
     self.sr.glow = uiprimitives.Container(parent=self.sr.glowClipper,
                                           pos=(0, 0, progress.width, 10),
                                           name='glow',
                                           state=uiconst.UI_DISABLED,
                                           align=uiconst.RELATIVE)
     glowFill = FillThemeColored(parent=self.sr.glow,
                                 name='glowFill',
                                 state=uiconst.UI_DISABLED,
                                 colorType=uiconst.COLORTYPE_UIHILIGHT,
                                 align=uiconst.TOALL,
                                 opacity=0.4)
     shade = uiprimitives.Container(parent=progress,
                                    pos=(0, 0, 0, 0),
                                    name='shade',
                                    state=uiconst.UI_DISABLED,
                                    align=uiconst.TOALL)
     shadeFill = FillThemeColored(parent=shade,
                                  name='shadeFill',
                                  state=uiconst.UI_DISABLED,
                                  colorType=uiconst.COLORTYPE_UIHILIGHT,
                                  align=uiconst.TOALL)
     FrameThemeColored(parent=progress,
                       colorType=uiconst.COLORTYPE_UIHILIGHT)
     self.sr.loading_progress = progress
     self.sr.progresstext = uicontrols.EveLabelMedium(
         text='',
         parent=progress,
         width=270,
         left=2,
         top=4,
         state=uiconst.UI_NORMAL)
     self.state = uiconst.UI_PICKCHILDREN
Exemplo n.º 25
0
class RaisedUnderlay(Container):
    """ A raised underlay Frame used by various UI controls. Color is affected by "Background color" setting """
    __guid__ = 'uicontrols.RaisedUnderlay'
    default_fixedColor = None
    default_isGlowEdgeRotated = False
    default_clipChildren = True
    default_hideFrame = False
    OPACITY_DISABLED = 0.2
    OPACITY_IDLE = 0.4
    OPACITY_HOVER = 0.7
    OPACITY_SELECTED = 1.0
    OPACITY_MOUSEDOWN = 1.1

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.fixedColor = attributes.Get('color', self.default_fixedColor)
        self.isGlowEdgeRotated = attributes.Get('isGlowEdgeRotated',
                                                self.default_isGlowEdgeRotated)
        hideFrame = attributes.get('hideFrame', self.default_hideFrame)
        self.isSelected = False
        self.isDisabled = False
        self.ConstructLayout()
        if hideFrame:
            self.frame.Hide()

    def ConstructLayout(self):
        self.frame = FrameThemeColored(
            name='frame',
            bgParent=self,
            colorType=uiconst.COLORTYPE_UIHILIGHT,
            color=self.fixedColor,
            blendMode=trinity.TR2_SBM_ADD,
            texturePath='res:/UI/Texture/Classes/Button/frame.png',
            opacity=0.2)
        self.innerGlow = FrameThemeColored(
            name='innerGlow',
            bgParent=self,
            cornerSize=10,
            texturePath='res:/UI/Texture/Classes/Button/innerGlow.png',
            colorType=uiconst.COLORTYPE_UIHILIGHT,
            color=self.fixedColor,
            opacity=0.2)
        self.hoverFill = FillThemeColored(
            name='hoverFill',
            bgParent=self,
            colorType=uiconst.COLORTYPE_UIHILIGHT,
            opacity=self.OPACITY_IDLE,
            color=self.fixedColor)
        FillThemeColored(name='backgroundColorFill',
                         bgParent=self,
                         opacity=0.45)

    def SetFixedColor(self, fixedColor):
        self.fixedColor = fixedColor
        self.innerGlow.SetFixedColor(fixedColor)
        self.hoverFill.SetFixedColor(fixedColor)

    def OnMouseEnter(self, *args):
        self.ShowHilite()

    def OnMouseExit(self, *args):
        self.HideHilite()

    def GetColor(self):
        return self.fixedColor or sm.GetService('uiColor').GetUIColor(
            uiconst.COLORTYPE_UIHILIGHT)

    def ShowHilite(self, animate=True):
        if self.isSelected or self.isDisabled:
            return
        color = self.GetColor()
        if animate:
            uicore.animations.FadeTo(self.hoverFill,
                                     self.hoverFill.opacity,
                                     self.OPACITY_HOVER,
                                     duration=uiconst.TIME_ENTRY)
            uicore.animations.SpColorMorphTo(self.frame,
                                             self.frame.GetRGBA(),
                                             color,
                                             includeAlpha=False,
                                             duration=uiconst.TIME_ENTRY)
        else:
            self.hoverFill.opacity = OPACITY_HOVER
            color = color[:3] + (self.frame.opacity, )
            self.frame.SetRGB(*color)

    def HideHilite(self, animate=True):
        if self.isSelected or self.isDisabled:
            return
        color = self.GetColor()
        if animate:
            uicore.animations.FadeTo(self.hoverFill,
                                     self.hoverFill.opacity,
                                     self.OPACITY_IDLE,
                                     duration=uiconst.TIME_EXIT)
            uicore.animations.SpColorMorphTo(self.frame,
                                             self.frame.GetRGBA(),
                                             color,
                                             includeAlpha=False,
                                             duration=uiconst.TIME_ENTRY)
        else:
            self.hoverFill.opacity = OPACITY_IDLE
            color = color[:3] + (self.frame.opacity, )
            self.frame.SetRGB(*color)

    def OnMouseDown(self, *args):
        if self.isSelected or self.isDisabled:
            return
        uicore.animations.FadeTo(self.hoverFill,
                                 self.hoverFill.opacity,
                                 self.OPACITY_MOUSEDOWN,
                                 duration=0.1)

    def OnMouseUp(self, *args):
        if self.isSelected or self.isDisabled:
            return
        uicore.animations.FadeTo(self.hoverFill,
                                 self.hoverFill.opacity,
                                 self.OPACITY_HOVER,
                                 duration=0.3)

    def Blink(self, loops=1):
        uicore.animations.FadeTo(self.hoverFill,
                                 self.OPACITY_MOUSEDOWN,
                                 self.OPACITY_IDLE,
                                 curveType=uiconst.ANIM_WAVE,
                                 duration=0.6,
                                 loops=loops)

    def StopBlink(self):
        uicore.animations.FadeTo(self.hoverFill,
                                 self.hoverFill.opacity,
                                 self.OPACITY_IDLE,
                                 duration=0.3)

    def Select(self, animate=True):
        if self.isSelected:
            return
        self.innerGlow.StopAnimations()
        if self.fixedColor:
            self.innerGlow.SetFixedColor(self.fixedColor)
        else:
            self.innerGlow.SetColorType(uiconst.COLORTYPE_UIHILIGHT)
        if animate:
            uicore.animations.FadeTo(self.hoverFill,
                                     self.hoverFill.opacity,
                                     self.OPACITY_SELECTED,
                                     duration=0.15)
        else:
            self.hoverFill.opacity = self.OPACITY_SELECTED
        self.isSelected = True

    def Deselect(self, animate=True):
        if not self.isSelected:
            return
        self.isSelected = False
        self.HideHilite(animate=animate)

    def SetDisabled(self):
        self.isDisabled = True
        self.hoverFill.opacity = self.OPACITY_DISABLED

    def SetEnabled(self):
        self.isDisabled = False
        self.hoverFill.opacity = self.OPACITY_IDLE
Exemplo n.º 26
0
 def ConstructBackground(self):
     Frame(name='bgFrame',
           parent=self,
           align=uiconst.CENTER,
           state=uiconst.UI_DISABLED,
           width=75,
           height=75,
           opacity=0.1)
     blueprintBg = FrameThemeColored(
         name='blueprintBgFill',
         parent=self,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/Industry/Center/bgFrame.png',
         width=90,
         height=90)
     self.dashesCont = Container(name='dashesCont',
                                 parent=self,
                                 state=uiconst.UI_DISABLED,
                                 pos=(75, 0, 150, 150),
                                 align=uiconst.CENTER)
     self.bgCont = Container(name='bgCont',
                             parent=self,
                             state=uiconst.UI_DISABLED,
                             width=150,
                             height=150,
                             align=uiconst.CENTER)
     self.topWedge = Container(name='topWedge',
                               parent=self.bgCont,
                               align=uiconst.CENTERTOP,
                               pos=(0, 0, 84, 60))
     topLines = Sprite(
         bgParent=self.topWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/wedgeTopBottom.png')
     topDots = Sprite(
         bgParent=self.topWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/dotsTopBottom.png')
     topBg = Sprite(
         bgParent=self.topWedge,
         texturePath='res:/UI/Texture/classes/Industry/Center/bgTop.png',
         color=COLOR_FRAME)
     self.bottomWedge = Container(name='bottomWedge',
                                  parent=self.bgCont,
                                  align=uiconst.CENTERBOTTOM,
                                  pos=(0, 0, 84, 60))
     bottomLines = Sprite(
         bgParent=self.bottomWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/wedgeTopBottom.png',
         rotation=pi)
     bottomDots = Sprite(
         bgParent=self.bottomWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/dotsTopBottom.png',
         rotation=pi)
     bottomBg = Sprite(
         bgParent=self.bottomWedge,
         texturePath='res:/UI/Texture/classes/Industry/Center/bgBottom.png',
         color=COLOR_FRAME)
     self.leftWedge = Container(name='leftWedge',
                                parent=self.bgCont,
                                align=uiconst.CENTERLEFT,
                                pos=(0, 0, 60, 84))
     leftLines = Sprite(
         bgParent=self.leftWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/wedgeLeftRight.png')
     leftDots = Sprite(
         bgParent=self.leftWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/dotsLeftRight.png')
     leftBg = Sprite(
         bgParent=self.leftWedge,
         texturePath='res:/UI/Texture/classes/Industry/Center/bgLeft.png',
         color=COLOR_FRAME)
     self.rightWedge = Container(name='rightWedge',
                                 parent=self.bgCont,
                                 align=uiconst.CENTERRIGHT,
                                 pos=(0, 0, 60, 84))
     rightLines = Sprite(
         bgParent=self.rightWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/wedgeLeftRight.png',
         rotation=pi)
     rightDots = Sprite(
         bgParent=self.rightWedge,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/dotsLeftRight.png',
         rotation=pi)
     rightBg = Sprite(
         bgParent=self.rightWedge,
         texturePath='res:/UI/Texture/classes/Industry/Center/bgRight.png',
         color=COLOR_FRAME)
     self.wedgeLines = [topLines, bottomLines, leftLines, rightLines]
     self.wedgeDots = [topDots, bottomDots, leftDots, rightDots]
     self.wedgeBg = [topBg, bottomBg, leftBg, rightBg]
Exemplo n.º 27
0
class FrameWithPointer(Container):
    pointerOffset = None
    skinCache = {}

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        skinName = attributes.get('skinName', 'general')
        actualSkinClass = SKIN_NAME_TO_CLASS.get(skinName)
        if not FrameWithPointer.skinCache.get(skinName):
            FrameWithPointer.skinCache[skinName] = actualSkinClass()
        self.skin = FrameWithPointer.skinCache[skinName]
        self._pointer = SpriteThemeColored(texturePath='res:/UI/Texture/classes/FrameWithPointer/pointer_down_02.png', parent=self, colorType=attributes.colorType or uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.95)
        self._background = FrameThemeColored(name='__underlay', bgParent=self, cornerSize=self.skin.backgroundCornerSize, offset=self.skin.backgroundOffset, texturePath=self.skin.backgroundTexture, colorType=attributes.colorType or uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.95)

    def SetColor(self, color):
        self._background.color = color
        self._pointer.color = color

    def SetAlpha(self, alphaValue):
        self._background.SetAlpha(alphaValue)
        self._pointer.SetAlpha(alphaValue)

    def UpdatePointerPosition(self, positionFlag):
        if positionFlag == uiconst.POINTER_NONE:
            self._pointer.display = False
            return (0, 0)
        SIZE = 24
        BACKOFFSET = 8
        x, y = positionFlag
        self._pointer.displayX = [-SIZE + BACKOFFSET,
         0,
         (self.displayWidth - SIZE) / 2,
         self.displayWidth - SIZE,
         self.displayWidth - BACKOFFSET][x]
        self._pointer.displayY = [-SIZE + BACKOFFSET,
         0,
         (self.displayHeight - SIZE) / 2,
         self.displayHeight - SIZE,
         self.displayHeight - BACKOFFSET][y]
        self._pointer.displayWidth = SIZE
        self._pointer.displayHeight = SIZE
        if y == 0:
            if x == 0:
                self._pointer.displayX = -11
                self._pointer.displayY = -11
                resPath = self.skin.topLeftTexture
                self.pointerOffset = [self._pointer.displayX + 5, self._pointer.displayY + 5]
            elif x == 4:
                self._pointer.displayX = self.displayWidth - 13
                self._pointer.displayY = -11
                resPath = self.skin.topRightTexture
                self.pointerOffset = [self._pointer.displayX + 19, self._pointer.displayY + 5]
            else:
                resPath = self.skin.upTexture
                self.pointerOffset = [self._pointer.displayX + SIZE / 2, self._pointer.displayY + 10]
        elif y == 4:
            if x == 0:
                self._pointer.displayX = -11
                self._pointer.displayY = self.displayHeight - 13
                resPath = self.skin.bottomLeftTexture
                self.pointerOffset = [self._pointer.displayX + 5, self._pointer.displayY + 19]
            elif x == 4:
                self._pointer.displayX = self.displayWidth - 13
                self._pointer.displayY = self.displayHeight - 13
                resPath = self.skin.bottomRightTexture
                self.pointerOffset = [self._pointer.displayX + 19, self._pointer.displayY + 19]
            else:
                resPath = self.skin.downTexture
                self.pointerOffset = [self._pointer.displayX + SIZE / 2, self._pointer.displayY + 14]
        elif x == 0:
            resPath = self.skin.leftTexture
            self.pointerOffset = [self._pointer.displayX + 10, self._pointer.displayY + SIZE / 2]
        elif x == 4:
            resPath = self.skin.rightTexture
            self.pointerOffset = [self._pointer.displayX + 14, self._pointer.displayY + SIZE / 2]
        self._pointer.SetTexturePath(resPath)
        self._pointer.display = True
        return self.pointerOffset
Exemplo n.º 28
0
 def SetupStuff(self):
     options = [
         (localization.GetByLabel(
             'UI/Fleet/FleetRegistry/MyAvailableFleets'),
          fleetConst.INVITE_ALL),
         (localization.GetByLabel('UI/Fleet/FleetRegistry/MyCorpFleets'),
          fleetConst.INVITE_CORP)
     ]
     selected = settings.user.ui.Get('fleetfinder_scopeFilter', None)
     if session.allianceid is not None:
         options.append((localization.GetByLabel(
             'UI/Fleet/FleetRegistry/MyAllianceFleets'),
                         fleetConst.INVITE_ALLIANCE))
     elif selected == fleetConst.INVITE_ALLIANCE:
         selected = None
     if session.warfactionid is not None:
         options.append((localization.GetByLabel(
             'UI/Fleet/FleetRegistry/MyMilitiaFleets'),
                         fleetConst.INVITE_MILITIA))
     elif selected == fleetConst.INVITE_MILITIA:
         selected = None
     options.append((
         localization.GetByLabel('UI/Fleet/FleetRegistry/BasedOnStandings'),
         fleetConst.INVITE_PUBLIC))
     l = 1
     combo = self.sr.scopeCombo = uicontrols.Combo(
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/Scope'),
         parent=self.sr.filterCont,
         options=options,
         name='fleetfinder_scopeFilter',
         select=selected,
         pos=(l, 14, 0, 0),
         width=COMBO_SIZES[0])
     self.sr.scopeCombo.OnChange = self.OnComboChange
     l += combo.width + 3
     selected = settings.user.ui.Get('fleetfinder_rangeFilter', None)
     options = [
         (localization.GetByLabel('UI/Common/Any'), None),
         (localization.GetByLabel('UI/Fleet/FleetRegistry/NumberOfJumps',
                                  numJumps=5), 5),
         (localization.GetByLabel('UI/Fleet/FleetRegistry/NumberOfJumps',
                                  numJumps=10), 10),
         (localization.GetByLabel('UI/Common/LocationTypes/Region'), -1)
     ]
     combo = self.sr.rangeCombo = uicontrols.Combo(
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/Range'),
         parent=self.sr.filterCont,
         options=options,
         name='fleetfinder_rangeFilter',
         select=selected,
         pos=(l, 14, 0, 0),
         width=COMBO_SIZES[1])
     self.sr.rangeCombo.OnChange = self.OnComboChange
     l += combo.width + 3
     selected = settings.user.ui.Get('fleetfinder_standingFilter', None)
     options = [(localization.GetByLabel('UI/Common/Any'), None),
                (localization.GetByLabel('UI/Standings/Good'),
                 contactGoodStanding),
                (localization.GetByLabel('UI/Standings/Excellent'),
                 contactHighStanding)]
     combo = self.sr.standingCombo = uicontrols.Combo(
         label=localization.GetByLabel(
             'UI/Fleet/FleetRegistry/RequireStanding'),
         parent=self.sr.filterCont,
         options=options,
         name='fleetfinder_standingFilter',
         select=selected,
         pos=(l, 14, 0, 0),
         width=COMBO_SIZES[2])
     self.sr.standingCombo.OnChange = self.OnComboChange
     l += combo.width + 3
     self.sr.getFleetsBtn = uicontrols.Button(
         parent=self.sr.filterCont,
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/FindFleets'),
         pos=(0, 14, 0, 0),
         func=self.GetFleetsClick,
         align=uiconst.TOPRIGHT)
     self.sr.scroll = uicontrols.Scroll(parent=self.sr.scrollCont)
     self.sr.scroll.sr.id = 'fleetfinderScroll'
     self.sr.scroll.multiSelect = 0
     self.sr.scroll.Load(contentList=[],
                         headers=[],
                         scrolltotop=0,
                         noContentHint=localization.GetByLabel(
                             'UI/Fleet/FleetRegistry/SearchHint'))
     self.sr.caption = uicontrols.EveLabelMediumBold(
         text='',
         parent=self.sr.topInfoCont,
         align=uiconst.RELATIVE,
         left=4,
         top=2,
         state=uiconst.UI_NORMAL)
     self.sr.detailsText = uicls.EditPlainText(name='detailsText',
                                               parent=self.sr.descrCont,
                                               padTop=2,
                                               padBottom=4,
                                               state=uiconst.UI_NORMAL,
                                               readonly=1)
     self.sr.detailsText.HideBackground()
     self.sr.detailsText.RemoveActiveFrame()
     FrameThemeColored(parent=self.sr.detailsText,
                       colorType=uiconst.COLORTYPE_UIHILIGHT)
     tabs = [110, 540]
     self.sr.infoText = uicontrols.EveLabelMedium(name='infoText',
                                                  text='',
                                                  parent=self.sr.descrCont,
                                                  top=defaultPadding,
                                                  idx=0,
                                                  tabs=tabs,
                                                  state=uiconst.UI_NORMAL)
     self.sr.joinBtn = uicontrols.Button(
         parent=self.sr.topInfoCont,
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/JoinFleet'),
         pos=(0, 1, 0, 0),
         func=self.JoinFleet,
         align=uiconst.CENTERRIGHT)
     self.sr.joinRequestBtn = uicontrols.Button(
         parent=self.sr.topInfoCont,
         label=localization.GetByLabel(
             'UI/Fleet/FleetRegistry/RequestJoinFleet'),
         pos=(0, 1, 0, 0),
         func=self.JoinFleet,
         align=uiconst.CENTERRIGHT)
     self.sr.myAdvertMainCont = uiprimitives.Container(
         name='myAdvertMainCont',
         parent=self.sr.myAdvertCont,
         align=uiconst.TOALL,
         pos=(0, 0, 0, 0))
     self.myAdvertButtons = [
         (localization.GetByLabel('UI/Fleet/FleetWindow/EditAdvert'),
          sm.GetService('fleet').OpenRegisterFleetWindow, (), 84),
         (localization.GetByLabel('UI/Fleet/FleetWindow/RemoveAdvert'),
          sm.GetService('fleet').UnregisterFleet, (), 84)
     ]
     self.sr.myAdvertButtonWnd = uicontrols.ButtonGroup(
         btns=self.myAdvertButtons,
         parent=self.sr.myAdvertButtons,
         unisize=1)
     self.sr.myAdvertCaption = uicontrols.EveCaptionMedium(
         text='',
         parent=self.sr.myAdvertCont,
         align=uiconst.TOTOP,
         left=0,
         top=7,
         state=uiconst.UI_DISABLED)
     self.sr.myAdvertDescCont = uiprimitives.Container(
         name='myAdvertDescCont',
         parent=self.sr.myAdvertCont,
         align=uiconst.TOALL,
         pos=(0, 0, 0, 0))
     self.sr.myAdvertText = uicontrols.EveLabelMedium(
         text='',
         parent=self.sr.myAdvertCont,
         top=defaultPadding,
         tabs=tabs,
         align=uiconst.TOTOP,
         state=uiconst.UI_NORMAL)
     self.sr.myAdvertDesc = uicls.EditPlainText(
         parent=self.sr.myAdvertDescCont,
         padTop=2,
         state=uiconst.UI_NORMAL,
         readonly=1)
     self.myAdvertButtons_Register = [
         (localization.GetByLabel('UI/Fleet/FleetWindow/CreateAdvert'),
          sm.GetService('fleet').OpenRegisterFleetWindow, (), 84)
     ]
     self.sr.myAdvertButtonWnd_Register = uicontrols.ButtonGroup(
         btns=self.myAdvertButtons_Register,
         parent=self.sr.myAdvertButtons,
         unisize=1)
     self.sr.myAdvertButtonWnd_Register.state = uiconst.UI_HIDDEN