NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

saveSkillPlanButton.py (1360B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\skillPlan\skillPlanEditor\saveSkillPlanButton.py
      2 from carbonui import ButtonVariant, uiconst
      3 from carbonui.control.button import Button
      4 from eve.client.script.ui.control.eveLoadingWheel import LoadingWheel
      5 from localization import GetByLabel
      6 
      7 class SkillPlanEditorSaveButton(Button):
      8     default_variant = ButtonVariant.PRIMARY
      9 
     10     def ApplyAttributes(self, attributes):
     11         super(SkillPlanEditorSaveButton, self).ApplyAttributes(attributes)
     12         self.loadingWheel = LoadingWheel(parent=self, align=uiconst.CENTERLEFT, pos=(-8, 0, 50, 50), state=uiconst.UI_HIDDEN)
     13 
     14     def UpdateState(self, skillPlan, name):
     15         if skillPlan:
     16             noSkills = len(skillPlan.GetSkillRequirements()) == 0
     17             noName = len(name) == 0
     18             if noSkills or noName:
     19                 self.Disable()
     20             else:
     21                 self.Enable()
     22         else:
     23             self.Enable()
     24 
     25     def GetHint(self):
     26         if self.disabled:
     27             return GetByLabel('Tooltips/SkillPlanner/CantSaveTooltip')
     28 
     29     def _CallFunction(self):
     30         self.Disable()
     31         self.loadingWheel.Show()
     32         try:
     33             super(SkillPlanEditorSaveButton, self)._CallFunction()
     34         finally:
     35             self.Enable()
     36             self.loadingWheel.Hide()