예제 #1
0
 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}
예제 #2
0
 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}
예제 #3
0
 def _getCustomData(self):
     return {
         'canRoleCreateFortRest':
         self.fortCtrl.getPermissions().canCreate() and self._isMyClan,
         'canCreateFortLim':
         self.fortCtrl.getLimits().isCreationValid()[0] and self._isMyClan,
         'joinClanAvailable':
         not g_clanCache.isInClan and self._isMyClan,
         'clanSearchAvailable':
         g_clanCtrl.isEnabled()
     }
예제 #4
0
 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}
예제 #5
0
 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}
예제 #6
0
 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}
예제 #7
0
 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}
예제 #8
0
 def _getCustomData(self):
     return {'canRoleCreateFortRest': self.fortCtrl.getPermissions().canCreate() and self._isMyClan,
      'canCreateFortLim': self.fortCtrl.getLimits().isCreationValid()[0] and self._isMyClan,
      'joinClanAvailable': not g_clanCache.isInClan and self._isMyClan,
      'clanSearchAvailable': g_clanCtrl.isEnabled()}