def _getButtonsStates(self, entity): if not g_clanCtrl.isEnabled(): submit = NOTIFICATION_BUTTON_STATE.HIDDEN elif not g_clanCtrl.isAvailable(): submit = NOTIFICATION_BUTTON_STATE.VISIBLE else: submit = NOTIFICATION_BUTTON_STATE.DEFAULT return {'submit': submit}
def _getButtonsStates(self, entity): if self._state in (CLAN_INVITE_STATES.ACCEPTED, CLAN_INVITE_STATES.DECLINED) or g_clanCtrl.getAccountProfile().isInClan() or not g_clanCtrl.isEnabled() or self.__isInClanEnterCooldown(): submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN elif not g_clanCtrl.isAvailable(): submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE else: submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT return {'submit': submit, 'cancel': cancel}
def _getButtonsStates(self, entity): if self._state in (CLAN_APPLICATION_STATES.ACCEPTED, CLAN_APPLICATION_STATES.DECLINED) or not g_clanCtrl.getAccountProfile().getMyClanPermissions().canHandleClanInvites() or not g_clanCtrl.isEnabled(): submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN elif not g_clanCtrl.isAvailable(): submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE else: submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT return {'submit': submit, 'cancel': cancel}
def _addClanProfileInfo(self, options, userCMInfo): if g_lobbyContext.getServerSettings().clanProfile.isEnabled( ) and userCMInfo.hasClan and self.showClanProfile: options.append( self._makeItem( USER.CLAN_INFO, MENU.contextmenu(USER.CLAN_INFO), optInitData={'enabled': g_clanCtrl.isAvailable()})) return options
def _getButtonsStates(self, entity): if self._state in ( CLAN_INVITE_STATES.ACCEPTED, CLAN_INVITE_STATES.DECLINED ) or g_clanCtrl.getAccountProfile().isInClan( ) or not g_clanCtrl.isEnabled() or self.__isInClanEnterCooldown(): submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN elif not g_clanCtrl.isAvailable(): submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE else: submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT return {'submit': submit, 'cancel': cancel}
def _getButtonsStates(self, entity): if self._state in ( CLAN_APPLICATION_STATES.ACCEPTED, CLAN_APPLICATION_STATES.DECLINED ) or not g_clanCtrl.getAccountProfile().getMyClanPermissions( ).canHandleClanInvites() or not g_clanCtrl.isEnabled(): submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN elif not g_clanCtrl.isAvailable(): submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE else: submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT return {'submit': submit, 'cancel': cancel}
def _addInviteClanInfo(self, options, userCMInfo): if g_lobbyContext.getServerSettings().clanProfile.isEnabled() and not userCMInfo.hasClan: profile = g_clanCtrl.getAccountProfile() canHandleClanInvites = profile.getMyClanPermissions().canHandleClanInvites() if profile.isInClan() and canHandleClanInvites: isEnabled = g_clanCtrl.isAvailable() canHandleClanInvites = profile.getMyClanPermissions().canHandleClanInvites() if isEnabled: profile = g_clanCtrl.getAccountProfile() dossier = profile.getClanDossier() isEnabled = canHandleClanInvites and not dossier.isClanInviteSent(userCMInfo.databaseID) and not dossier.hasClanApplication(userCMInfo.databaseID) options.append(self._makeItem(USER.SEND_CLAN_INVITE, MENU.contextmenu(USER.SEND_CLAN_INVITE), optInitData={'enabled': isEnabled})) return options
def _addClanProfileInfo(self, options, userCMInfo): if g_lobbyContext.getServerSettings().clanProfile.isEnabled() and userCMInfo.hasClan and self.showClanProfile: options.append(self._makeItem(USER.CLAN_INFO, MENU.contextmenu(USER.CLAN_INFO), optInitData={'enabled': g_clanCtrl.isAvailable()})) return options
def _addInviteClanInfo(self, options, userCMInfo): if g_lobbyContext.getServerSettings().clanProfile.isEnabled() and not userCMInfo.hasClan: profile = g_clanCtrl.getAccountProfile() if profile.isInClan() and profile.getMyClanPermissions().canHandleClanInvites(): options.append(self._makeItem(USER.SEND_CLAN_INVITE, MENU.contextmenu(USER.SEND_CLAN_INVITE), optInitData={'enabled': g_clanCtrl.isAvailable()})) return options