iskTab.py (1527B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\neocom\wallet\tabs\iskTab.py 2 import blue 3 from carbon.common.script.util.format import FmtAmt 4 from carbonui.util.color import Color 5 from eve.client.script.ui.shared.neocom.wallet.tabs.baseWalletTab import BaseWalletTab 6 from localization import GetByLabel 7 8 class IskTab(BaseWalletTab): 9 default_name = 'IskTab' 10 default_texturePath = 'res:/UI/Texture/WindowIcons/wallet.png' 11 tabNamePath = 'UI/Wallet/WalletWindow/ISK' 12 default_underlayColor = Color.HextoRGBA('#6E966B') 13 default_hint = GetByLabel('UI/Wallet/WalletWindow/ISKDescription') 14 default_padding = (2, 2, 2, 2) 15 amountFontSize = 14 16 __notifyevents__ = ['OnPersonalAccountChangedClient'] 17 18 def ApplyAttributes(self, attributes): 19 super(IskTab, self).ApplyAttributes(attributes) 20 sm.RegisterNotify(self) 21 22 def PopulateBottomContainer(self): 23 self.bottomLabel.SetText(FmtAmt(sm.GetService('wallet').GetWealth())) 24 25 def OnPersonalAccountChangedClient(self, balance, difference): 26 self.AnimateBalanceChange(balance, difference) 27 28 def AnimateBalanceChange(self, balance, difference): 29 totalIterations = 20 30 originalBalance = balance - difference 31 for i in range(totalIterations): 32 increment = (i + 1) / (1.0 * totalIterations) 33 value = originalBalance + difference * increment 34 self.bottomLabel.SetText(FmtAmt(value)) 35 blue.synchro.Sleep(25)