def load(self): self.notify.debug('load') masterScale = 0.8 textScale = 0.1 * masterScale entryScale = 0.08 * masterScale lineHeight = 0.21 * masterScale buttonScale = 1.15 * masterScale buttonLineHeight = 0.14 * masterScale self.frame = DirectFrame(parent=aspect2d, relief=None, sortOrder=20) self.frame.hide() linePos = -0.26 self.nameLabel = DirectLabel(parent=self.frame, relief=None, pos=(-0.21, 0, linePos), text=OTPLocalizer.LoginScreenUserName, text_scale=textScale, text_align=TextNode.ARight) self.nameEntry = DirectEntry(parent=self.frame, relief=DGG.SUNKEN, borderWidth=(0.1, 0.1), scale=entryScale, pos=(-0.125, 0.0, linePos), width=OTPGlobals.maxLoginWidth, numLines=1, focus=0, cursorKeys=1) linePos -= lineHeight self.passwordLabel = DirectLabel(parent=self.frame, relief=None, pos=(-0.21, 0, linePos), text=OTPLocalizer.LoginScreenPassword, text_scale=textScale, text_align=TextNode.ARight) self.passwordEntry = DirectEntry(parent=self.frame, relief=DGG.SUNKEN, borderWidth=(0.1, 0.1), scale=entryScale, pos=(-0.125, 0.0, linePos), width=OTPGlobals.maxLoginWidth, numLines=1, focus=0, cursorKeys=1, obscured=1, command=self.__handleLoginPassword) linePos -= lineHeight buttonImageScale = (1.7, 1.1, 1.1) self.loginButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.LoginScreenLogin, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleLoginButton) linePos -= buttonLineHeight self.createAccountButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.LoginScreenCreateAccount, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleCreateAccount) linePos -= buttonLineHeight self.quitButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.LoginScreenQuit, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleQuit) linePos -= buttonLineHeight self.dialogDoneEvent = 'loginDialogAck' dialogClass = OTPGlobals.getGlobalDialogClass() self.dialog = dialogClass(dialogName='loginDialog', doneEvent=self.dialogDoneEvent, message='', style=OTPDialog.Acknowledge, sortOrder=NO_FADE_SORT_INDEX + 100) self.dialog.hide() self.failDialog = DirectFrame(parent=aspect2dp, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0.1, 0), text='', text_scale=0.08, text_pos=(0.0, 0.3), text_wordwrap=15, sortOrder=NO_FADE_SORT_INDEX) linePos = -0.05 self.failTryAgainButton = DirectButton(parent=self.failDialog, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=0.9, text=OTPLocalizer.LoginScreenTryAgain, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleFailTryAgain) linePos -= buttonLineHeight self.failCreateAccountButton = DirectButton(parent=self.failDialog, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=0.9, text=OTPLocalizer.LoginScreenCreateAccount, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleFailCreateAccount) linePos -= buttonLineHeight self.failDialog.hide() self.connectionProblemDialogDoneEvent = 'loginConnectionProblemDlgAck' dialogClass = OTPGlobals.getGlobalDialogClass() self.connectionProblemDialog = dialogClass(dialogName='connectionProblemDialog', doneEvent=self.connectionProblemDialogDoneEvent, message='', style=OTPDialog.Acknowledge, sortOrder=NO_FADE_SORT_INDEX + 100) self.connectionProblemDialog.hide() return
def load(self): self.notify.debug('load') masterScale = 0.80000000000000004 textScale = 0.10000000000000001 * masterScale entryScale = 0.080000000000000002 * masterScale lineHeight = 0.20999999999999999 * masterScale buttonScale = 1.3 * masterScale buttonLineHeight = 0.16 * masterScale self.frame = DirectFrame(parent = aspect2d, relief = None) self.frame.hide() linePos = 0.5 linePos -= lineHeight self.nameLabel = DirectLabel(parent = self.frame, relief = None, pos = (-0.20999999999999999, 0, linePos), text = OTPLocalizer.CreateAccountScreenUserName, text_scale = textScale, text_align = TextNode.ARight, text_fg = self.labelFg, text_shadow = (0, 0, 0, 1), text_shadowOffset = (0.080000000000000002, 0.080000000000000002)) self.nameEntry = DirectEntry(parent = self.frame, relief = DGG.SUNKEN, borderWidth = (0.10000000000000001, 0.10000000000000001), scale = entryScale, pos = (-0.125, 0.0, linePos), width = OTPGlobals.maxLoginWidth, numLines = 1, focus = 0, cursorKeys = 1) self.nameEntry.label = self.nameLabel linePos -= lineHeight self.passwordLabel = DirectLabel(parent = self.frame, relief = None, pos = (-0.20999999999999999, 0, linePos), text = OTPLocalizer.CreateAccountScreenPassword, text_scale = textScale, text_align = TextNode.ARight, text_fg = self.labelFg, text_shadow = (0, 0, 0, 1), text_shadowOffset = (0.080000000000000002, 0.080000000000000002)) self.passwordEntry = DirectEntry(parent = self.frame, relief = DGG.SUNKEN, borderWidth = (0.10000000000000001, 0.10000000000000001), scale = entryScale, pos = (-0.125, 0.0, linePos), width = OTPGlobals.maxLoginWidth, numLines = 1, focus = 0, cursorKeys = 1, obscured = 1) self.passwordEntry.label = self.passwordLabel linePos -= lineHeight self.passwordConfirmLabel = DirectLabel(parent = self.frame, relief = None, pos = (-0.20999999999999999, 0, linePos), text = OTPLocalizer.CreateAccountScreenConfirmPassword, text_scale = textScale, text_align = TextNode.ARight, text_fg = self.labelFg, text_shadow = (0, 0, 0, 1), text_shadowOffset = (0.080000000000000002, 0.080000000000000002)) self.passwordConfirmEntry = DirectEntry(parent = self.frame, relief = DGG.SUNKEN, borderWidth = (0.10000000000000001, 0.10000000000000001), scale = entryScale, pos = (-0.125, 0.0, linePos), width = OTPGlobals.maxLoginWidth, numLines = 1, focus = 0, cursorKeys = 1, obscured = 1) self.passwordConfirmEntry.label = self.passwordConfirmLabel linePos -= lineHeight linePos -= lineHeight self.submitButton = DirectButton(parent = self.frame, relief = DGG.RAISED, borderWidth = (0.01, 0.01), pos = (0, 0, linePos), scale = buttonScale, text = OTPLocalizer.CreateAccountScreenSubmit, text_scale = 0.059999999999999998, text_pos = (0, -0.02), command = self._CreateAccountScreen__handleSubmit) linePos -= buttonLineHeight self.cancelButton = DirectButton(parent = self.frame, relief = DGG.RAISED, borderWidth = (0.01, 0.01), pos = (0, 0, linePos), scale = buttonScale, text = OTPLocalizer.CreateAccountScreenCancel, text_scale = 0.059999999999999998, text_pos = (0, -0.02), command = self._CreateAccountScreen__handleCancel) linePos -= buttonLineHeight self.dialogDoneEvent = 'createAccountDialogAck' dialogClass = OTPGlobals.getGlobalDialogClass() self.dialog = dialogClass(dialogName = 'createAccountDialog', doneEvent = self.dialogDoneEvent, message = '', style = OTPDialog.Acknowledge, sortOrder = NO_FADE_SORT_INDEX + 100) self.dialog.hide()
def load(self): self.notify.debug('load') masterScale = 0.8 textScale = 0.1 * masterScale entryScale = 0.08 * masterScale lineHeight = 0.21 * masterScale buttonScale = 1.3 * masterScale buttonLineHeight = 0.16 * masterScale self.frame = DirectFrame(parent=aspect2d, relief=None) self.frame.hide() linePos = 0.5 linePos -= lineHeight self.nameLabel = DirectLabel(parent=self.frame, relief=None, pos=(-0.21, 0, linePos), text=OTPLocalizer.CreateAccountScreenUserName, text_scale=textScale, text_align=TextNode.ARight, text_fg=self.labelFg, text_shadow=(0, 0, 0, 1), text_shadowOffset=(0.08, 0.08)) self.nameEntry = DirectEntry(parent=self.frame, relief=DGG.SUNKEN, borderWidth=(0.1, 0.1), scale=entryScale, pos=(-0.125, 0.0, linePos), width=OTPGlobals.maxLoginWidth, numLines=1, focus=0, cursorKeys=1) self.nameEntry.label = self.nameLabel linePos -= lineHeight self.passwordLabel = DirectLabel(parent=self.frame, relief=None, pos=(-0.21, 0, linePos), text=OTPLocalizer.CreateAccountScreenPassword, text_scale=textScale, text_align=TextNode.ARight, text_fg=self.labelFg, text_shadow=(0, 0, 0, 1), text_shadowOffset=(0.08, 0.08)) self.passwordEntry = DirectEntry(parent=self.frame, relief=DGG.SUNKEN, borderWidth=(0.1, 0.1), scale=entryScale, pos=(-0.125, 0.0, linePos), width=OTPGlobals.maxLoginWidth, numLines=1, focus=0, cursorKeys=1, obscured=1) self.passwordEntry.label = self.passwordLabel linePos -= lineHeight self.passwordConfirmLabel = DirectLabel(parent=self.frame, relief=None, pos=(-0.21, 0, linePos), text=OTPLocalizer.CreateAccountScreenConfirmPassword, text_scale=textScale, text_align=TextNode.ARight, text_fg=self.labelFg, text_shadow=(0, 0, 0, 1), text_shadowOffset=(0.08, 0.08)) self.passwordConfirmEntry = DirectEntry(parent=self.frame, relief=DGG.SUNKEN, borderWidth=(0.1, 0.1), scale=entryScale, pos=(-0.125, 0.0, linePos), width=OTPGlobals.maxLoginWidth, numLines=1, focus=0, cursorKeys=1, obscured=1) self.passwordConfirmEntry.label = self.passwordConfirmLabel linePos -= lineHeight linePos -= lineHeight self.submitButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.CreateAccountScreenSubmit, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleSubmit) linePos -= buttonLineHeight self.cancelButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.CreateAccountScreenCancel, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleCancel) linePos -= buttonLineHeight self.dialogDoneEvent = 'createAccountDialogAck' dialogClass = OTPGlobals.getGlobalDialogClass() self.dialog = dialogClass(dialogName='createAccountDialog', doneEvent=self.dialogDoneEvent, message='', style=OTPDialog.Acknowledge, sortOrder=NO_FADE_SORT_INDEX + 100) self.dialog.hide() return
def avatarListFailed(self, reason): self.ignore('avatarListFailed') self.ignore('avatarList') dialogClass = OTPGlobals.getGlobalDialogClass() self.avatarListFailedBox = dialogClass(message = PLocalizer.CRAvatarListFailed, doneEvent = 'avatarListFailedAck', text_wordwrap = 18, style = OTPDialog.Acknowledge) self.avatarListFailedBox.show() self.acceptOnce('avatarListFailedAck', self._PiratesClientRepository__handleAvatarListFailedAck)
def avatarListFailed(self, reason): dialogClass = OTPGlobals.getGlobalDialogClass() self.avatarListFailedBox = dialogClass( message=PLocalizer.CRAvatarListFailed, doneEvent='avatarListFailedAck', text_wordwrap=18, style=OTPDialog.Acknowledge) self.avatarListFailedBox.show() self.acceptOnce('avatarListFailedAck', self.__handleAvatarListFailedAck)
def load(self): self.notify.debug('load') masterScale = 0.8 textScale = 0.1 * masterScale entryScale = 0.08 * masterScale lineHeight = 0.21 * masterScale buttonScale = 1.15 * masterScale buttonLineHeight = 0.14 * masterScale self.frame = DirectFrame(parent=aspect2d, relief=None, sortOrder=20) self.frame.hide() linePos = -0.26 self.nameLabel = DirectLabel(parent=self.frame, relief=None, pos=(-0.21, 0, linePos), text=OTPLocalizer.LoginScreenUserName, text_scale=textScale, text_align=TextNode.ARight) self.nameEntry = DirectEntry(parent=self.frame, relief=DGG.SUNKEN, borderWidth=(0.1, 0.1), scale=entryScale, pos=(-0.125, 0.0, linePos), width=OTPGlobals.maxLoginWidth, numLines=1, focus=0, cursorKeys=1) linePos -= lineHeight self.passwordLabel = DirectLabel(parent=self.frame, relief=None, pos=(-0.21, 0, linePos), text=OTPLocalizer.LoginScreenPassword, text_scale=textScale, text_align=TextNode.ARight) self.passwordEntry = DirectEntry(parent=self.frame, relief=DGG.SUNKEN, borderWidth=(0.1, 0.1), scale=entryScale, pos=(-0.125, 0.0, linePos), width=OTPGlobals.maxLoginWidth, numLines=1, focus=0, cursorKeys=1, obscured=1, command=self.__handleLoginPassword) linePos -= lineHeight buttonImageScale = (1.7, 1.1, 1.1) self.loginButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.LoginScreenLogin, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleLoginButton) linePos -= buttonLineHeight self.createAccountButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.LoginScreenCreateAccount, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleCreateAccount) linePos -= buttonLineHeight self.quitButton = DirectButton(parent=self.frame, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=buttonScale, text=OTPLocalizer.LoginScreenQuit, text_scale=0.06, text_pos=(0, -0.02), command=self.__handleQuit) linePos -= buttonLineHeight self.dialogDoneEvent = 'loginDialogAck' dialogClass = OTPGlobals.getGlobalDialogClass() self.dialog = dialogClass(dialogName='loginDialog', doneEvent=self.dialogDoneEvent, message='', style=OTPDialog.Acknowledge, sortOrder=NO_FADE_SORT_INDEX + 100) self.dialog.hide() self.failDialog = DirectFrame(parent=aspect2dp, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0.1, 0), text='', text_scale=0.08, text_pos=(0.0, 0.3), text_wordwrap=15, sortOrder=NO_FADE_SORT_INDEX) linePos = -.05 self.failTryAgainButton = DirectButton(parent=self.failDialog, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=0.9, text=OTPLocalizer.LoginScreenTryAgain, text_scale=0.06, text_pos=(0, -.02), command=self.__handleFailTryAgain) linePos -= buttonLineHeight self.failCreateAccountButton = DirectButton(parent=self.failDialog, relief=DGG.RAISED, borderWidth=(0.01, 0.01), pos=(0, 0, linePos), scale=0.9, text=OTPLocalizer.LoginScreenCreateAccount, text_scale=0.06, text_pos=(0, -.02), command=self.__handleFailCreateAccount) linePos -= buttonLineHeight self.failDialog.hide() self.connectionProblemDialogDoneEvent = 'loginConnectionProblemDlgAck' dialogClass = OTPGlobals.getGlobalDialogClass() self.connectionProblemDialog = dialogClass(dialogName='connectionProblemDialog', doneEvent=self.connectionProblemDialogDoneEvent, message='', style=OTPDialog.Acknowledge, sortOrder=NO_FADE_SORT_INDEX + 100) self.connectionProblemDialog.hide() return