neocomBtn.py (1710B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\loginRewards\neocomBtn.py 2 from neocom2.btnIDs import LOGIN_REWARDS_ID 3 from eve.client.script.ui.shared.neocom.neocom import neocomConst 4 from eve.client.script.ui.shared.neocom.neocom.btnData.btnDataNodeNotification import BtnDataNodeNotification 5 from eve.client.script.ui.shared.neocom.neocom.btnData.btnDataRaw import BTNDATARAW_BY_ID 6 from eve.client.script.ui.shared.neocom.neocom.fixedButtonExtension import UnseenItemsExtension 7 from localization import GetByLabel 8 btnID = LOGIN_REWARDS_ID 9 btnData = BTNDATARAW_BY_ID[btnID] 10 11 class RewardsBtnData(BtnDataNodeNotification): 12 default_btnType = neocomConst.BTNTYPE_REWARD 13 default_cmdName = btnData.cmdName 14 default_iconPath = btnData.iconPath 15 default_btnID = btnID 16 descriptionPath = 'UI/LoginRewards/WindowDescription' 17 __notifyevents__ = ['OnDailyCampaignAwardClaimed', 'OnLoginRewardWindowOpened'] 18 19 def OnDailyCampaignAwardClaimed(self, *args): 20 self.OnBadgeCountChanged() 21 22 def OnLoginRewardWindowOpened(self): 23 self.OnBadgeCountChanged() 24 25 @property 26 def default_label(self): 27 return GetByLabel('UI/LoginRewards/WindowCaption') 28 29 def GetItemCount(self): 30 return len(sm.GetService('loginCampaignService').get_rewards_available()) 31 32 33 class UnseenRewardsItemsExtension(UnseenItemsExtension): 34 35 def __init__(self, button_data_class, get_badge_count, is_visible_function): 36 self.is_visible_function = is_visible_function 37 UnseenItemsExtension.__init__(self, button_data_class, get_badge_count) 38 39 @property 40 def is_visible(self): 41 return self.is_visible_function()