本文整理匯總了Python中gui.prb_control.context.PrbCtrlRequestCtx.getPrbType方法的典型用法代碼示例。如果您正苦於以下問題:Python PrbCtrlRequestCtx.getPrbType方法的具體用法?Python PrbCtrlRequestCtx.getPrbType怎麽用?Python PrbCtrlRequestCtx.getPrbType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gui.prb_control.context.PrbCtrlRequestCtx
的用法示例。
在下文中一共展示了PrbCtrlRequestCtx.getPrbType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _PrebattleDispatcher
# 需要導入模塊: from gui.prb_control.context import PrbCtrlRequestCtx [as 別名]
# 或者: from gui.prb_control.context.PrbCtrlRequestCtx import getPrbType [as 別名]
#.........這裏部分代碼省略.........
LOG_DEBUG('Request to join', ctx)
self.__requestCtx = ctx
entry.join(ctx, callback=callback)
else:
LOG_ERROR('Entry not found', ctx)
if callback:
callback(False)
else:
if callback:
callback(False)
yield lambda callback = None: callback
return
@async
def leave(self, ctx, callback = None):
if ctx.getRequestType() is not REQUEST_TYPE.LEAVE:
LOG_ERROR('Invalid context to leave prebattle/unit', ctx)
if callback:
callback(False)
return
elif self.__requestCtx.isProcessing():
LOG_ERROR('Request is processing', self.__requestCtx)
if callback:
callback(False)
return
else:
ctrlType = ctx.getCtrlType()
formation = self.__collection.getItem(ctx.getCtrlType())
if formation is not None:
if formation.hasLockedState():
if ctrlType == CTRL_ENTITY_TYPE.PREQUEUE:
entityType = formation.getQueueType()
else:
entityType = formation.getPrbType()
SystemMessages.pushI18nMessage('#system_messages:{0}'.format(rally_dialog_meta.makeI18nKey(ctrlType, entityType, 'leaveDisabled')), type=SystemMessages.SM_TYPE.Warning)
if callback:
callback(False)
return
LOG_DEBUG('Request to leave formation', ctx)
self.__requestCtx = ctx
formation.leave(ctx, callback=callback)
else:
LOG_ERROR('Functional not found', ctx)
if callback:
callback(False)
return
@async
@process
def unlock(self, funcExit, forced, callback = None):
state = self.getFunctionalState()
result = True
if state.hasModalEntity and (not state.isIntroMode or forced) and not (funcExit == FUNCTIONAL_EXIT.FALLOUT and state.isInFallout()):
factory = self.__factories.get(state.ctrlTypeID)
result = False
if factory:
ctx = factory.createLeaveCtx(funcExit)
if ctx:
meta = self.__collection.getItem(state.ctrlTypeID).getConfirmDialogMeta(funcExit)
if meta:
result = yield DialogsInterface.showDialog(meta)
else:
result = True
if result:
result = yield self.leave(ctx)
else: