skillPlanEditorPanel.py (2874B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\skillPlan\skillPlanEditor\skillPlanEditorPanel.py 2 from carbonui import uiconst 3 from carbonui.control.button import Button 4 from carbonui.primitives.container import Container 5 from eve.client.script.ui.skillPlan import skillPlanUISignals 6 from eve.client.script.ui.skillPlan.skillPlanEditor.skillPlanEditorContents import SkillPlanEditorContents 7 from eve.client.script.ui.skillPlan.skillPlanEditor.skillPlanEditorOverview import SkillPlanEditorOverview 8 from eve.client.script.ui.skillPlan.skillPlanEditor.skillPlanSkillsCatalogue import SkillPlanEditorSkillsCataloguePanel 9 from player_messaging.client.ui_message import prompt_player_fsd_dialog 10 from skills.skillplan.skillPlanDiff import IsEditedPlanDifferentFromOriginal 11 12 class SkillPlanEditorPanel(Container): 13 14 def ApplyAttributes(self, attributes): 15 super(SkillPlanEditorPanel, self).ApplyAttributes(attributes) 16 skillPlan = attributes.skillPlan 17 rightCont = Container(name='rightCont', parent=self, align=uiconst.TORIGHT_PROP, width=0.5) 18 leftCont = Container(name='mainCont', parent=self, align=uiconst.TOALL, padRight=32) 19 self.ConstructSkillCatalogue(leftCont, skillPlan) 20 self.skillPlanOverview = SkillPlanEditorOverview(parent=rightCont, align=uiconst.TORIGHT_PROP, width=0.5, maxWidth=350, padding=(32, 50, 0, 0)) 21 self.skillPlanContents = SkillPlanEditorContents(parent=rightCont, padTop=44) 22 self.SetSkillPlan(skillPlan) 23 24 def ConstructSkillCatalogue(self, leftCont, skillPlan): 25 backButtonCont = Container(parent=leftCont, align=uiconst.TOTOP, height=44) 26 self.backButton = Button(parent=backButtonCont, name='backButton', align=uiconst.TOPLEFT, iconSize=20, texturePath='res:/UI/Texture/classes/SkillPlan/buttonIcons/backIcon.png', func=self.OnBack) 27 self.skillCatalogue = SkillPlanEditorSkillsCataloguePanel(name='skillsCatalogue', parent=leftCont, skillPlan=skillPlan) 28 self.skillCatalogue.ConstructLayout() 29 30 def SetSkillPlan(self, skillPlan): 31 self.skillPlanContents.SetSkillPlan(skillPlan) 32 self.skillCatalogue.SetSkillPlan(skillPlan) 33 self.skillPlanOverview.SetSkillPlan(skillPlan) 34 35 def OnBack(self, *args): 36 if not self.ShouldContinueAfterAskingAboutLeavingEditor(): 37 return 38 skillPlanUISignals.on_close_new_button() 39 40 def ShouldContinueAfterAskingAboutLeavingEditor(self): 41 skillPlan = self.skillPlanOverview.skillPlan 42 if skillPlan: 43 self.skillPlanOverview.SetNameAndDescriptionInPlan() 44 if IsEditedPlanDifferentFromOriginal(skillPlan): 45 if prompt_player_fsd_dialog('AskCloseSkillPlanEditor', {}, uiconst.YESNO, suppress=uiconst.ID_YES) != uiconst.ID_YES: 46 return False 47 return True