本文整理汇总了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: