seasonRewardPanel.py (1831B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\loginRewards\seasonRewardPanel.py 2 from carbon.client.script.environment.AudioUtil import PlaySound 3 from eve.client.script.ui.shared.loginRewards.panelControllers import SeasonalPanelController 4 from eve.client.script.ui.shared.loginRewards.twoTrackRewardPanel import GetGiftsReceivedConst, BaseTwoTrackRewardPanel 5 import eve.client.script.ui.shared.loginRewards.rewardUiConst as rewardUiConst 6 import mathext 7 8 class SeasonRewardPanel(BaseTwoTrackRewardPanel): 9 __notifyevents__ = ['OnDailyRewardClaimed'] 10 11 def GetPanelController(self): 12 seasonalLoginCampaignService = sm.GetService('seasonalLoginCampaignService') 13 isOmega = seasonalLoginCampaignService.is_omega() 14 return SeasonalPanelController(seasonalLoginCampaignService, rewardUiConst.SeasonRewardPanelConst, isOmega) 15 16 def OnDailyRewardClaimed(self, todays_alpha_rewards, todays_omega_rewards, retroactive_rewards): 17 giftsReceivedConst = GetGiftsReceivedConst(todays_alpha_rewards, todays_omega_rewards, retroactive_rewards) 18 if giftsReceivedConst in (rewardUiConst.ONLY_ALPHA_GIFT_REWARDED, rewardUiConst.ONLY_OMEGA_GIFT_REWARDED): 19 PlaySound('daily_login_gift_single_play') 20 else: 21 PlaySound('daily_login_gift_play') 22 selectedDay = self.panelController.GetNumDaysClaimed() 23 if self.panelController.CanRetroClaimNow(): 24 selectedDay = max(selectedDay - 1, 0) 25 self.SetDayAsCurrent(selectedDay, True, giftsReceivedConst=giftsReceivedConst) 26 daysScrolling = abs(self.currentFirstVisibleDay - 1 - selectedDay) 27 scrollTime = mathext.clamp(daysScrolling * rewardUiConst.SCROLL_ANIMATION_AUTO_STEP, 0.5, 1.5) 28 self.GoToToday(animationTime=scrollTime)