class OutcomeItemContainer(Container): default_state = uiconst.UI_NORMAL default_clipChildren = True __notifyevents__ = ['OnIndustryViewExpandCollapse'] 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() def OnIndustryViewExpandCollapse(self): if not self.previewCont or self.jobData and self.jobData.activityID != industry.MANUFACTURING: return isCollapsed = settings.user.ui.Get('industryWndIsViewCollapsed', False) if not isCollapsed: self.AnimFadeSceneContIn() else: self.previewCont.Hide() self.previewContFill.opacity = 1.0 def AnimFadeSceneContIn(self): self.previewCont.Hide() self.previewContFill.opacity = 1.0 blue.synchro.SleepWallclock(250) self.previewCont.Show() uicore.animations.FadeTo(self.previewContFill, 1.0, 0.0, duration=0.6) def OnNewJobData(self, jobData): self.jobData = jobData self.UpdateState() if self.jobData: self.jobData.on_updated.connect(self.UpdateState) self.AnimEntry() def UpdateState(self, *args): if not self.jobData: self.previewCont.Hide() return typeID = self.jobData.GetProductTypeID() if IsPreviewable(typeID) and self.jobData.activityID == industry.MANUFACTURING: self.previewCont.Show() self.iconCont.Hide() newModel = self.previewCont.PreviewType(typeID) if newModel: self.previewContFill.Show() self.previewContFill.opacity = 1.0 self.previewCont.AnimEntry(1.5, 0.0, 0.5, -0.3) self.previewCont.sceneContainer.scene.sunDirection = (-0.5, -1.0, -1.0) self.bg.Hide() self.qtyLabel.top = 86 self.leftProbabilityGradient.Hide() self.rightProbabilityGradient.Hide() else: self.iconCont.Show() self.previewCont.Hide() self.bg.Show() self.qtyLabel.top = 42 if self.jobData.activityID == industry.RESEARCH_MATERIAL: self.icon.LoadIcon('res:/UI/Texture/Classes/Industry/iconME.png') self.icon.width = self.icon.height = 17 self.techIcon.texturePath = None elif self.jobData.activityID == industry.RESEARCH_TIME: self.icon.LoadIcon('res:/UI/Texture/Classes/Industry/iconTE.png') self.techIcon.texturePath = None self.icon.width = self.icon.height = 16 else: isCopy = self.jobData.activityID in (industry.COPYING, industry.INVENTION) oldTypeID = self.icon.typeID self.icon.LoadIconByTypeID(typeID, ignoreSize=True, isCopy=isCopy) self.icon.width = self.icon.height = 64 texturePath, hint = GetTechLevelIconPathAndHint(typeID) self.techIcon.texturePath = texturePath self.techIcon.hint = hint if oldTypeID != typeID: uicore.animations.FadeTo(self.icon, 0.0, 1.0, duration=0.6) if self.jobData.activityID == industry.INVENTION: width = self.jobData.probability * 160 color = GetJobColor(self.jobData) for gradient in (self.leftProbabilityGradient, self.rightProbabilityGradient): gradient.Show() gradient.SetRGBA(*color) uicore.animations.MorphScalar(gradient, 'width', gradient.width, width, duration=0.6) else: self.leftProbabilityGradient.Hide() self.rightProbabilityGradient.Hide() if self.jobData and self.jobData.product: self.iconCont.opacity = 1.0 uicore.animations.FadeTo(self.bgCont, self.bgCont.opacity, 1.0, duration=0.3) self.errorFrame.Hide() else: self.iconCont.opacity = 0.0 uicore.animations.FadeTo(self.bgCont, 0.3, 1.0, duration=2.0, curveType=uiconst.ANIM_WAVE, loops=uiconst.ANIM_REPEAT) self.errorFrame.Show() self.UpdateOutputQty() self.StopVideo() if self.jobData.status == industry.STATUS_DELIVERED: self.PlayVideoDelivered() def PlayVideoDelivered(self): self.PlayVideo('res:/video/Industry/deliveredIntro.bk2', 'res:/video/Industry/deliveredOutro.bk2', industryUIConst.GetActivityColor(self.jobData.activityID)) def PlayVideoFailed(self): self.PlayVideo('res:/video/Industry/failedIntro.bk2', 'res:/video/Industry/failedOutro.bk2', industryUIConst.COLOR_NOTREADY) def StopVideo(self): if self.videoThread: self.videoThread.kill() self.videoCont.Flush() def PlayVideo(self, introPath, outroPath, color): self.videoThread = uthread.new(self._PlayVideo, introPath, outroPath, color) def _PlayVideo(self, introPath, outroPath, color): self.videoCont.Flush() videoSprite = VideoSprite(parent=self.videoCont, align=uiconst.TOALL, spriteEffect=trinity.TR2_SFX_COPY, videoPath=introPath, color=color) while not videoSprite.isFinished: blue.synchro.Yield() blue.synchro.SleepWallclock(3000) videoSprite.Close() videoSprite = VideoSprite(parent=self.videoCont, align=uiconst.TOALL, spriteEffect=trinity.TR2_SFX_COPY, videoPath=outroPath, color=color) while not videoSprite.isFinished: blue.synchro.Yield() uicore.animations.FadeOut(videoSprite, callback=videoSprite.Close) def GetMenu(self): abstractInfo = KeyVal(bpData=self.GetBpData()) return sm.GetService('menu').GetMenuFormItemIDTypeID(None, self.jobData.product.typeID, ignoreMarketDetails=False, abstractInfo=abstractInfo) def LoadIconContTooltipPanel(self, tooltipPanel, *args): if self.jobData.activityID in (industry.RESEARCH_TIME, industry.RESEARCH_MATERIAL): return self.tooltipPanel = OutcomeTooltipPanel(jobData=self.jobData, tooltipPanel=tooltipPanel) def GetIconContTooltipDelay(self): return TOOLTIP_DELAY_GAMEPLAY def GetIconContDragData(self, *args): typeID = self.jobData.GetProductTypeID() if not typeID: return if isinstance(self.jobData.product, industry.Blueprint): bpData = self.jobData.product.GetCopy() else: bpData = None return [KeyVal(__guid__='uicls.GenericDraggableForTypeID', typeID=typeID, label=cfg.invtypes.Get(typeID).name, bpData=bpData)] def UpdateOutputQty(self): if not self.jobData or not self.jobData.product: self.qtyLabel.text = '' return self.qtyLabel.text = self.jobData.GetProductAmountLabel() def AnimEntry(self): if not self.jobData: return uicore.animations.FadeTo(self.itemPattern, 0.0, 1.0, duration=0.6, timeOffset=1.35) uicore.animations.FadeTo(self.previewContFill, self.previewContFill.opacity, 0.0, duration=0.6, timeOffset=0, callback=self.previewContFill.Hide) def GetBpData(self): if not isinstance(self.jobData.product, industry.Blueprint): return None return self.jobData.product.GetCopy() def OnIconContClick(self, *args): if not self.jobData: return if self.jobData.activityID in (industry.RESEARCH_MATERIAL, industry.RESEARCH_TIME): return typeID = self.jobData.GetProductTypeID() if not typeID: return sm.GetService('info').ShowInfo(typeID, abstractinfo=KeyVal(bpData=self.GetBpData())) sm.GetService('audio').SendUIEvent('ind_click') def OnIconContMouseEnter(self, *args): uicore.animations.FadeTo(self.bg, self.bg.opacity, 1.5, duration=0.15) sm.GetService('audio').SendUIEvent('ind_mouseEnter') def OnIconContMouseExit(self, *args): uicore.animations.FadeTo(self.bg, self.bg.opacity, 1.0, duration=0.3)
class SeasonReward(Container): default_padLeft = REWARD_CONTAINER_DEFAULT_PADDING default_padTop = REWARD_CONTAINER_DEFAULT_PADDING default_padRight = REWARD_CONTAINER_DEFAULT_PADDING default_padBottom = REWARD_CONTAINER_DEFAULT_PADDING default_align = uiconst.TOALL def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.Hide() self.season_service = attributes.season_service self.width = min( self.width, REWARD_CONTAINER_WIDTH) - 2 * REWARD_CONTAINER_DEFAULT_PADDING self.finished_goals = [] self._create_reward_view() self._create_finished_background_overlay() self.show_finished_goals() def show_finished_goals(self): self.finished_goals += self.season_service.get_and_clear_recently_finished_goals( ).values() if self.display or not self.finished_goals: return self._display_reward(self.finished_goals.pop(0)) def _create_reward_view(self): self.reward_container = Container(name='reward_container', parent=self, align=uiconst.CENTER, width=self.parent.width, height=REWARD_CONTAINER_HEIGHT) self.reward_main_container = Container(name='reward_main_container', parent=self.reward_container, align=uiconst.TOALL) self._create_reward_header() self._create_reward_content_container() self._create_reward_content() self.reward_event_banner_container = Container( name='reward_event_banner_container', parent=self.reward_main_container, align=uiconst.CENTERTOP, width=self.width, height=REWARD_BANNER_HEIGHT, opacity=ANIMATED_DEFAULT_OPACITY, top=REWARD_BANNER_TOP) self.reward_event_banner = CurrentEventBanner( name='reward_event_banner', parent=self.reward_event_banner_container, banner_texture=self.season_service.get_season_background_no_logo(), align=uiconst.CENTER, opacity=REWARD_BACKGROUND_BANNER_OPACITY) self.reward_main_container.Hide() def _create_finished_background_overlay(self): GradientSprite(name='finished_gradient_overlay', align=uiconst.TOALL, parent=self, rgbData=REWARD_BACKGROUND_OVERLAY_RGB_DATA, alphaData=REWARD_BACKGROUND_OVERLAY_ALPHA_DATA, radial=True) finished_fill_container = Container(name='finished_fill_container', parent=self, align=uiconst.TOALL) Fill(bgParent=finished_fill_container, color=REWARD_BACKGROUND_FILL_COLOR) def _create_reward_header(self): self.reward_header_label_container = Container( name='reward_header_label_container', parent=self.reward_main_container, align=uiconst.TOTOP, width=self.width, height=REWARD_HEADER_LABEL_HEIGHT, opacity=ANIMATED_DEFAULT_OPACITY) EveCaptionLarge(name='reward_header_label', parent=self.reward_header_label_container, align=uiconst.CENTERTOP, text=get_reward_unlocked_header(), bold=True) self.reward_header_line = Sprite( name='reward_header_container_line', parent=self.reward_header_label_container, texturePath=SEASON_LINE_BREAK_GRADIENT, align=uiconst.BOTTOMLEFT, width=self.width, height=REWARD_ITEM_LABEL_LINE_HEIGHT, opacity=REWARD_ITEM_LABEL_LINE_OPACITY, useSizeFromTexture=False) def _create_reward_content_container(self): self.reward_content_container = Container( name='reward_content_container', parent=self.reward_main_container, align=uiconst.TOTOP, height=REWARD_CONTENT_HEIGHT) def _create_reward_content(self): self._create_item_reward_icon() self._create_reward_season_points() self._create_item_reward_label() self._create_reward_bottom_container() def _create_reward_season_points(self): self.reward_season_points_container = Container( name='reward_season_points_container', parent=self.reward_content_container, align=uiconst.TOTOP, height=REWARD_SEASON_POINTS_HEIGHT, opacity=ANIMATED_DEFAULT_OPACITY) self.reward_season_points_top_container = Container( name='reward_season_points_top_container', parent=self.reward_season_points_container, align=uiconst.TOTOP, height=REWARD_SEASON_POINTS_BACKGROUND_HEIGHT) reward_season_points_label_container = Container( name='reward_season_points_label_container', parent=self.reward_season_points_top_container, align=uiconst.TOTOP, height=REWARD_SEASON_POINT_LABEL_SIZE, padTop=REWARD_SEASON_TOP_PADDING) self.reward_points = SeasonPoints( name='reward_season_points_label', parent=reward_season_points_label_container, align=uiconst.CENTER, height=REWARD_SEASON_POINTS_HEIGHT, points=0, reward_label_class=REWARD_SEASON_POINTS_LABEL_CLASS, season_points_size=REWARD_SEASON_POINT_LABEL_SIZE) self.reward_season_points_background_container = None self._create_reward_season_points_background() def _create_reward_season_points_background(self): if self.reward_season_points_background_container: self.reward_season_points_background_container.Flush() self.reward_season_points_background_container.Close() self.reward_season_points_background_container = Container( name='reward_season_points_background_container', parent=self.reward_season_points_top_container, align=uiconst.CENTER, width=self.width, height=REWARD_SEASON_POINTS_BACKGROUND_HEIGHT) self.season_points_background = self._add_gradient_reward_background( self.reward_season_points_background_container) def _create_item_reward_icon(self): self.reward_item_icon_glow_container = Transform( name='reward_item_icon_glow_container', parent=self.reward_content_container, align=uiconst.CENTER, height=REWARD_ITEM_ICON_SIZE, width=REWARD_ITEM_ICON_SIZE, top=REWARD_ITEM_ICON_TOP_MARGIN, scalingCenter=REWARD_ITEM_ICON_SCALING_CENTER) self.reward_item_icon_glow_container.Hide() self.reward_item_icon_container = Container( name='reward_item_icon_container', parent=self.reward_item_icon_glow_container, align=uiconst.TOALL, padding=REWARD_ITEM_ICON_GLOW_PADDING) self.reward_item_icon_overlay_fill = Fill( parent=self.reward_item_icon_container, color=Color.WHITE, opacity=ANIMATED_ICON_OVERLAY_OPACITY) Fill(bgParent=self.reward_item_icon_container, color=REWARD_BACKGROUND_FILL_COLOR) def _create_item_reward_label(self): self.reward_item_label_container = Container( name='reward_item_label_container', parent=self.reward_content_container, align=uiconst.TOTOP, width=self.width, height=REWARD_ITEM_LABEL_HEIGHT, opacity=ANIMATED_DEFAULT_OPACITY) Sprite(name='reward_item_label_line', parent=self.reward_item_label_container, texturePath=SEASON_LINE_BREAK_GRADIENT, align=uiconst.TOBOTTOM, width=self.width - REWARD_ITEM_BACKGROUND_PADDING * 2, height=REWARD_ITEM_LABEL_LINE_HEIGHT, opacity=REWARD_ITEM_LABEL_LINE_OPACITY, useSizeFromTexture=False) self.reward_item_label = EveLabelLargeBold( name='reward_item_label', parent=self.reward_item_label_container, align=uiconst.CENTER, text='') self.reward_label_background_container = None self._create_reward_label_background() def _create_reward_label_background(self): if self.reward_label_background_container: self.reward_label_background_container.Flush() self.reward_label_background_container.Close() self.reward_label_background_container = Container( name='reward_label_background_container', parent=self.reward_item_label_container, align=uiconst.TOTOP, width=self.width, height=REWARD_ITEM_LABEL_HEIGHT) self.reward_label_background = self._add_gradient_reward_background( self.reward_label_background_container) def _create_reward_bottom_container(self): self.reward_bottom_container = Container( name='reward_bottom_container', parent=self.reward_content_container, align=uiconst.TOTOP, height=REWARD_BOTTOM_CONTAINER_HEIGHT) self.reward_note_label_container = Container( name='reward_note_label_container', parent=self.reward_bottom_container, align=uiconst.TOTOP, height=REWARD_NOTE_LABEL_HEIGHT, padLeft=REWARD_BOTTOM_CONTAINER_LABEL_SIDE_PAD, padRight=REWARD_BOTTOM_CONTAINER_LABEL_SIDE_PAD, padTop=REWARD_BOTTOM_CONTAINER_LABEL_PAD_TOP, opacity=ANIMATED_DEFAULT_OPACITY) EveLabelSmall(name='reward_note_label', parent=self.reward_note_label_container, align=uiconst.TOTOP, text=get_reward_unlocked_body()) self.reward_close_button_container = Container( name='reward_close_button_container', parent=self.reward_bottom_container, align=uiconst.TOTOP, height=REWARD_CONTINUE_BUTTON_HEIGHT, opacity=ANIMATED_DEFAULT_OPACITY) Button(name='reward_close_button', parent=self.reward_close_button_container, align=uiconst.CENTER, label=GetByLabel('UI/Generic/Close'), func=self._close_reward) Sprite(name='reward_bottom_container_line', parent=self.reward_bottom_container, texturePath=SEASON_LINE_BREAK_GRADIENT, align=uiconst.TOBOTTOM, width=self.width, height=REWARD_ITEM_LABEL_LINE_HEIGHT, opacity=REWARD_ITEM_LABEL_LINE_OPACITY, useSizeFromTexture=False) self.reward_bottom_background_container = None self._create_reward_bottom_background() def _create_reward_bottom_background(self): if self.reward_bottom_background_container: self.reward_bottom_background_container.Flush() self.reward_bottom_background_container.Close() self.reward_bottom_background_container = Container( name='reward_bottom_background_container', parent=self.reward_bottom_container, align=uiconst.CENTER, width=self.width, height=REWARD_BOTTOM_CONTAINER_HEIGHT) def _add_gradient_reward_background(self, parent_container): return GradientSprite(name='gradient_reward_background', align=uiconst.TOTOP_NOPUSH, parent=parent_container, width=parent_container.width, height=parent_container.height, rgbData=REWARD_GRADIENT_RGB_DATA, alphaData=REWARD_GRADIENT_ALPHA_DATA) def _close_reward(self, *args): if self.finished_goals: self.reward_main_container.Hide() self._show_next_reward() else: self._hide_rewards() def _show_next_reward(self): self.reward_content_container.Flush() self.animated_gradient_background.Close() self._create_reward_content() self._display_reward(self.finished_goals.pop(0)) def _play_reward_audio(self): sm.GetService('audio').SendUIEvent('scope_earn_rewards_play') def _hide_and_reset(self): self.Hide() self.opacity = 1.0 def _hide_rewards(self): animations.FadeOut(self, duration=REWARD_DISAPPEAR_ANIMATION_DURATION, callback=self._hide_and_reset) def _display_reward(self, reward): self.Show() self._update_reward_info(reward) self._animate_reward() self._play_reward_audio() def _update_reward_info(self, reward): reward_type = reward['reward_type_id'] reward_points = reward['points_required'] try: self.reward_item_icon = get_reward_icon_in_size( reward_type_id=reward_type, size=REWARD_ICON_TEXTURE_SIZE, name='reward_item_icon', parent=self.reward_item_icon_container, align=uiconst.TOALL) except Exception: self.reward_item_icon = None log.LogError( 'Failed to load Scope Network reward unlocked icon for item type %d' % reward_type) self.reward_item_label.text = evetypes.GetName(reward_type) self.reward_points.update_points(reward_points) def _animate_reward(self): self.animated_gradient_background = GradientSprite( name='animated_gradient_background', parent=self.reward_container, align=uiconst.TOALL, rgbData=ANIMATED_GRADIENT_BACKGROUND_RGD_DATA, alphaData=ANIMATED_GRADIENT_BACKGROUND_ALPHA_DATA, opacity=ANIMATED_GRADIENT_BACKGROUND_OPACITY) animations.MorphScalar(self.reward_container, 'width', endVal=self.width, duration=ANIMATED_GRADIENT_BACKGROUND_DURATION, timeOffset=ANIMATED_GRADIENT_BACKGROUND_OFFSET, callback=self._show_reward) def _show_reward(self): self.reward_main_container.Show() self._animate_reward_content() self._animate_icon() self._remove_animated_gradient_background() def _animate_reward_content(self): animations.FadeIn(self.reward_event_banner_container, duration=ANIMATED_DEFAULT_FADE_IN_DURATION) animations.FadeIn(self.reward_item_label_container, duration=ANIMATED_DEFAULT_FADE_IN_DURATION) animations.FadeIn(self.reward_header_label_container, duration=ANIMATED_DEFAULT_FADE_IN_DURATION) animations.FadeIn(self.reward_season_points_container, duration=ANIMATED_DEFAULT_FADE_IN_DURATION, callback=self._animate_bottom_container) def _animate_bottom_container(self): animations.FadeIn(self.reward_close_button_container, duration=ANIMATED_BOTTOM_CONTAINER_FADE_IN_DURATION) animations.FadeIn(self.reward_note_label_container, duration=ANIMATED_BOTTOM_CONTAINER_FADE_IN_DURATION) def _animate_icon(self): self.reward_item_icon_glow_container.width *= ANIMATED_ICON_SIZE_FACTOR self.reward_item_icon_glow_container.height *= ANIMATED_ICON_SIZE_FACTOR self.reward_item_icon_glow_container.Show() animations.MorphVector2(self.reward_item_icon_glow_container, 'scale', startVal=ANIMATED_ICON_SIZE_START_SCALE_SIZE, endVal=ANIMATED_ICON_SIZE_END_SCALE_SIZE, duration=ANIMATED_ICON_SIZE_DURATION) animations.MorphScalar(self.reward_item_icon_overlay_fill, 'opacity', startVal=ANIMATED_ICON_OVERLAY_OPACITY, endVal=ANIMATED_DEFAULT_OPACITY, duration=ANIMATED_ICON_OVERLAY_FILL_DURATION) self._animate_icon_glow() def _animate_icon_glow(self): animation_video_container = Container( parent=self.reward_item_icon_glow_container, name='animation_video_container', align=uiconst.CENTER, width=ICON_GLOW_ANIMATION_SIZE, height=ICON_GLOW_ANIMATION_SIZE) StreamingVideoSprite(bgParent=animation_video_container, name='animation_video', videoPath=ICON_GLOW_ANIMATION_VIDEO_PATH, videoLoop=True, spriteEffect=trinity.TR2_SFX_COPY) def _remove_animated_gradient_background(self): self.animated_gradient_background.Hide() def resize(self, width, height): default_width = REWARD_CONTAINER_WIDTH - 2 * REWARD_CONTAINER_DEFAULT_PADDING new_width = width - 2 * REWARD_CONTAINER_DEFAULT_PADDING self.width = min(new_width, default_width) self.height = height - 2 * REWARD_CONTAINER_DEFAULT_PADDING - TOP_PADDING self.width = min(new_width, default_width) self.reward_container.width = self.width self.reward_event_banner_container.width = self.width self.reward_event_banner.width = self.width self.reward_header_line.width = self.width self._create_reward_season_points_background() self._create_reward_label_background() self._create_reward_bottom_background() self.season_points_background.width = self.width self.reward_label_background.width = self.width