コード例 #1
0
 def _populate(self):
     super(ClanSearchWindow, self)._populate()
     self._searchDP = _ClanSearchDataProvider()
     self._searchDP.setFlashObject(self.as_getDPS())
     self.startClanListening()
     self.__clanFinder.onListUpdated += self._onClansListUpdated
     self.__initControls()
     self._updateControlsState()
     self._cooldown.start()
     if not g_clanCtrl.getAccountProfile().isSynced():
         g_clanCtrl.getAccountProfile().resync()
     self.__clanFinder.setRecommended(True)
     self.__doSearch('')
コード例 #2
0
 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
コード例 #3
0
 def _populate(self):
     super(ClanSearchWindow, self)._populate()
     self._searchDP = _ClanSearchDataProvider()
     self._searchDP.setFlashObject(self.as_getDPS())
     self.startClanListening()
     self.__clanFinder.onListUpdated += self._onClansListUpdated
     self.__initControls()
     self._updateControlsState()
     self._cooldown.start()
     if not g_clanCtrl.getAccountProfile().isSynced():
         g_clanCtrl.getAccountProfile().resync()
     self.__clanFinder.setRecommended(True)
     self.__doSearch('')
コード例 #4
0
 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
コード例 #5
0
ファイル: profileprofilewindow.py プロジェクト: Difrex/wotsdk
 def userAddToClan(self):
     self.as_showWaitingS(WAITING.CLANS_INVITES_SEND, {})
     profile = g_clanCtrl.getAccountProfile()
     context = CreateInviteCtx(profile.getClanDbID(), [self.__databaseID])
     result = yield g_clanCtrl.sendRequest(context, allowDelay=True)
     showClanInviteSystemMsg(self.__userName, result.isSuccess(), result.getCode())
     self.__updateAddToClanBtn()
     self.as_hideWaitingS()
コード例 #6
0
 def userAddToClan(self):
     self.as_showWaitingS(WAITING.CLANS_INVITES_SEND, {})
     profile = g_clanCtrl.getAccountProfile()
     context = CreateInviteCtx(profile.getClanDbID(), [self.__databaseID])
     result = yield g_clanCtrl.sendRequest(context, allowDelay=True)
     showClanInviteSystemMsg(self.__userName, result.isSuccess(), result.getCode())
     self.__updateAddToClanBtn()
     self.as_hideWaitingS()
コード例 #7
0
ファイル: profilewindow.py プロジェクト: webiumsk/WOT0.10.0
 def userAddToClan(self):
     self.as_showWaitingS(WAITING.CLANS_INVITES_SEND, {})
     profile = g_clanCtrl.getAccountProfile()
     context = CreateInviteCtx(profile.getClanDbID(), [self.__databaseID])
     result = yield g_clanCtrl.sendRequest(context, allowDelay=True)
     if result.isSuccess():
         SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(profile.getClanName(), profile.getClanAbbrev()))
     self.as_hideWaitingS()
コード例 #8
0
 def sendClanInvite(self):
     profile = g_clanCtrl.getAccountProfile()
     context = CreateInviteCtx(profile.getClanDbID(), [self.databaseID])
     result = yield g_clanCtrl.sendRequest(context, allowDelay=True)
     if result.isSuccess():
         SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(profile.getClanName(), profile.getClanAbbrev()))
     else:
         SystemMessages.pushMessage(clans_fmts.getInvitesNotSentSysMsg([self.userName or '']), type=SystemMessages.SM_TYPE.Error)
コード例 #9
0
 def onClanProfileClick(self):
     if self.clansCtrl.isEnabled():
         clan = g_clanCtrl.getAccountProfile()
         shared_events.showClanProfileWindow(clan.getClanDbID(),
                                             clan.getClanAbbrev())
     else:
         LOG_ERROR(
             "Couldn't invoke Clan Profile Window. Functionality is Unavailable!"
         )
コード例 #10
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}
コード例 #11
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}
コード例 #12
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}
コード例 #13
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}
コード例 #14
0
ファイル: decorators.py プロジェクト: webiumsk/WOT-0.9.12
 def __isInClanEnterCooldown(self):
     profile = g_clanCtrl.getAccountProfile()
     return not profile.isInClan() and profile.isInClanEnterCooldown()
コード例 #15
0
def _maySeeFortUpgradeWindow():
    profile = g_clanCtrl.getAccountProfile()
    return profile.isInClan() and profile.getRole(
    ) == CLAN_MEMBER_FLAGS.RECRUIT
コード例 #16
0
def _maySeeFortUpgradeWindow():
    profile = g_clanCtrl.getAccountProfile()
    return profile.isInClan() and profile.getRole() == CLAN_MEMBER_FLAGS.RECRUIT
コード例 #17
0
 def onClanProfileClick(self):
     if self.clansCtrl.isEnabled():
         clan = g_clanCtrl.getAccountProfile()
         shared_events.showClanProfileWindow(clan.getClanDbID(), clan.getClanAbbrev())
     else:
         LOG_ERROR("Couldn't invoke Clan Profile Window. Functionality is Unavailable!")
コード例 #18
0
 def sendClanInvite(self):
     profile = g_clanCtrl.getAccountProfile()
     userName = self.userName
     context = CreateInviteCtx(profile.getClanDbID(), [self.databaseID])
     result = yield g_clanCtrl.sendRequest(context, allowDelay=True)
     showClanInviteSystemMsg(userName, result.isSuccess(), result.getCode())
コード例 #19
0
 def sendClanInvite(self):
     profile = g_clanCtrl.getAccountProfile()
     userName = self.userName
     context = CreateInviteCtx(profile.getClanDbID(), [self.databaseID])
     result = yield g_clanCtrl.sendRequest(context, allowDelay=True)
     showClanInviteSystemMsg(userName, result.isSuccess(), result.getCode())
コード例 #20
0
 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
コード例 #21
0
 def __isInClanEnterCooldown(self):
     profile = g_clanCtrl.getAccountProfile()
     return not profile.isInClan() and profile.isInClanEnterCooldown()