def setupGui(self): self.destroyGui() if not self.guiSetup: self.button = DialogButton(parent = self, buttonStyle = DialogButton.NO, pos = (0.25, 0, 0.080000000000000002), text = PLocalizer.lClose, helpPos = (-0.40000000000000002, 0, 0.029999999999999999), helpDelay = 0.29999999999999999, command = self['command'], extraArgs = self['extraArgs']) self.background = BorderFrame(parent = self, pos = (0.050000000000000003, 0, 0.050000000000000003), frameSize = [ 0.0, 0.40000000000000002, 0.10000000000000001, 0.59999999999999998], bgColorScale = VBase4(0, 0, 0, 0.75), bgTransparency = 1, flatten = 0) if self['ownShip']: state = DGG.NORMAL else: state = DGG.DISABLED ship = localAvatar.getShip() if ship: friendState = ship.getAllowFriendState() crewState = ship.getAllowCrewState() guildState = ship.getAllowGuildState() publicState = ship.getAllowPublicState() else: friendState = 0 crewState = 0 guildState = 0 publicState = 0 buttonOptions = { 'parent': self.background, 'state': state, 'relief': None, 'pos': (0.059999999999999998, 0, 0.53000000000000003), 'scale': 0.29999999999999999, 'text': PLocalizer.CrewBoardingAccessAllowFriends, 'value': friendState, 'text_pos': (0.16700000000000001, -0.059999999999999998, 0), 'text0_fg': PiratesGuiGlobals.TextFG1, 'text1_fg': PiratesGuiGlobals.TextFG1, 'text2_fg': PiratesGuiGlobals.TextFG1, 'text3_fg': PiratesGuiGlobals.TextFG9, 'text_font': PiratesGlobals.getInterfaceFont(), 'text_scale': 0.14999999999999999, 'text_shadow': (0, 0, 0, 1), 'text_align': TextNode.ALeft, 'command': self.allowFriends } self.friendsButton = CheckButton(**None) buttonOptions['text'] = PLocalizer.CrewBoardingAccessAllowCrew buttonOptions['pos'] = (buttonOptions['pos'][0], buttonOptions['pos'][1], buttonOptions['pos'][2] - 0.12) buttonOptions['command'] = self.allowCrew buttonOptions['value'] = crewState self.crewButton = CheckButton(**None) buttonOptions['text'] = PLocalizer.CrewBoardingAccessAllowGuild buttonOptions['pos'] = (buttonOptions['pos'][0], buttonOptions['pos'][1], buttonOptions['pos'][2] - 0.12) buttonOptions['command'] = self.allowGuild buttonOptions['value'] = guildState self.guildButton = CheckButton(**None) buttonOptions['text'] = PLocalizer.CrewBoardingAccessAllowPublic buttonOptions['pos'] = (buttonOptions['pos'][0], buttonOptions['pos'][1], buttonOptions['pos'][2] - 0.12) buttonOptions['command'] = self.allowPublic buttonOptions['value'] = publicState self.publicButton = CheckButton(**None) self.guiSetup = True