def canBeClosed(self, callback):
     meta = self.unitFunctional.getConfirmDialogMeta(FUNCTIONAL_EXIT.INTRO_UNIT)
     if meta:
         isConfirmed = yield DialogsInterface.showDialog(meta)
     else:
         isConfirmed = yield lambda callback: callback(True)
     if isConfirmed:
         isConfirmed = yield self.prbDispatcher.leave(unit_ctx.LeaveUnitCtx(waitingID='prebattle/leave', funcExit=FUNCTIONAL_EXIT.INTRO_UNIT))
     callback(isConfirmed)
 def canBeClosed(self, callback):
     flags = FUNCTIONAL_FLAG.SWITCH if self.unitFunctional.canSwitchToIntro(
     ) else FUNCTIONAL_FLAG.UNDEFINED
     ctx = unit_ctx.LeaveUnitCtx(
         waitingID='prebattle/leave',
         flags=flags,
         entityType=self.unitFunctional.getEntityType())
     meta = self.unitFunctional.getConfirmDialogMeta(ctx)
     if meta:
         isConfirmed = yield DialogsInterface.showDialog(meta)
     else:
         isConfirmed = yield lambda callback: callback(True)
     if isConfirmed:
         isConfirmed = yield self.prbDispatcher.leave(ctx)
     callback(isConfirmed)
 def onWindowClose(self):
     self.prbDispatcher.doLeaveAction(
         unit_ctx.LeaveUnitCtx(waitingID='prebattle/leave',
                               flags=FUNCTIONAL_FLAG.UNDEFINED))
Exemple #4
0
 def leaveSquad(self):
     self.prbDispatcher.doLeaveAction(
         unit_ctx.LeaveUnitCtx(waitingID='prebattle/leave',
                               funcExit=FUNCTIONAL_EXIT.NO_FUNC))