buyButton.py (3086B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\skins\buyButton.py 2 from eve.client.script.ui.shared.skins.event import LogBuySkinAur, LogBuySkinIsk 3 from eve.client.script.ui.shared.vgs.button import BuyButtonAurSmall, BuyButtonIskSmall 4 5 class SkinLicenseBuyButtonAur(BuyButtonAurSmall): 6 7 def ApplyAttributes(self, attributes): 8 self.logContext = attributes.logContext 9 super(SkinLicenseBuyButtonAur, self).ApplyAttributes(attributes) 10 11 def OpenOfferWindow(self): 12 super(SkinLicenseBuyButtonAur, self).OpenOfferWindow() 13 LogBuySkinAur(None, None, self.logContext) 14 15 16 class SkinLicenseBuyButtonIsk(BuyButtonIskSmall): 17 default_name = 'SkinMaterialBuyButtonIsk' 18 19 def ApplyAttributes(self, attributes): 20 super(SkinLicenseBuyButtonIsk, self).ApplyAttributes(attributes) 21 self.logContext = attributes.logContext 22 23 def OpenMarketWindow(self): 24 super(SkinLicenseBuyButtonIsk, self).OpenMarketWindow() 25 LogBuySkinIsk(None, None, self.logContext) 26 27 28 class SkinMaterialBuyButtonAur(BuyButtonAurSmall): 29 default_name = 'SkinMaterialBuyButtonAur' 30 COLOR_DISABLED = (0.2, 0.2, 0.2, 0.8) 31 COLOR_DISABLED_TEXT = (0.6, 0.6, 0.6, 1.0) 32 COLOR_DISABLED_ICON = (0.6, 0.6, 0.6, 1.0) 33 34 def ApplyAttributes(self, attributes): 35 self.typeID = attributes.typeID 36 self.materialID = attributes.materialID 37 self.logContext = attributes.logContext 38 attributes.types = self.GetLicenseTypesForMaterial() 39 if attributes.disabled: 40 attributes.color = self.COLOR_DISABLED 41 attributes.iconColor = self.COLOR_DISABLED_ICON 42 attributes.labelColor = self.COLOR_DISABLED_TEXT 43 super(SkinMaterialBuyButtonAur, self).ApplyAttributes(attributes) 44 45 def GetLicenseTypesForMaterial(self): 46 cosmeticsSvc = sm.GetService('cosmeticsSvc') 47 licenses = cosmeticsSvc.static.GetLicensesForTypeWithMaterial(self.typeID, self.materialID) 48 return [ l.licenseTypeID for l in licenses ] 49 50 def OpenOfferWindow(self): 51 super(SkinMaterialBuyButtonAur, self).OpenOfferWindow() 52 LogBuySkinAur(self.typeID, self.materialID, self.logContext) 53 54 55 class SkinMaterialBuyButtonIsk(BuyButtonIskSmall): 56 default_name = 'SkinMaterialBuyButtonIsk' 57 COLOR_DISABLED = (0.2, 0.2, 0.2, 0.8) 58 COLOR_DISABLED_TEXT = (0.6, 0.6, 0.6, 1.0) 59 COLOR_DISABLED_ICON = (0.6, 0.6, 0.6, 1.0) 60 61 def ApplyAttributes(self, attributes): 62 if attributes.disabled: 63 attributes.color = self.COLOR_DISABLED 64 attributes.iconColor = self.COLOR_DISABLED_ICON 65 attributes.labelColor = self.COLOR_DISABLED_TEXT 66 super(SkinMaterialBuyButtonIsk, self).ApplyAttributes(attributes) 67 self.materialID = attributes.materialID 68 self.logContext = attributes.logContext 69 70 def OpenMarketWindow(self): 71 sm.GetService('cosmeticsSvc').OpenMarketForTypeWithMaterial(self.typeID, self.materialID) 72 LogBuySkinIsk(self.typeID, self.materialID, self.logContext)