本文整理匯總了Python中gui.shared.utils.plugins.PluginsCollection.reset方法的典型用法代碼示例。如果您正苦於以下問題:Python PluginsCollection.reset方法的具體用法?Python PluginsCollection.reset怎麽用?Python PluginsCollection.reset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gui.shared.utils.plugins.PluginsCollection
的用法示例。
在下文中一共展示了PluginsCollection.reset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ConsumablesPanel
# 需要導入模塊: from gui.shared.utils.plugins import PluginsCollection [as 別名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import reset [as 別名]
#.........這裏部分代碼省略.........
quantity = item.getQuantity()
currentTime = item.getTimeRemaining()
maxTime = item.getTotalTime()
if item.isAvatar():
self.__flashObject.setItemTimeQuantityInSlot(self.__cds.index(intCD), quantity, currentTime, maxTime)
self.__updateOrderSlot(idx, item)
else:
self.__flashObject.setItemTimeQuantityInSlot(idx, quantity, currentTime, maxTime)
self.onPopUpClosed()
else:
LOG_ERROR('Equipment is not found in panel', intCD, self.__cds)
def __onEquipmentCooldownInPercent(self, intCD, percent):
if intCD in self.__cds:
self.__flashObject.setCoolDownPosAsPercent(self.__cds.index(intCD), percent)
def __addEquipmentSlot(self, intCD, item):
idx = self.__genNextIdx(EQUIPMENT_FULL_MASK, EQUIPMENT_START_IDX)
self.__cds[idx] = intCD
descriptor = item.getDescriptor()
iconPath = '../maps/icons/artefact/%s.png' % descriptor.icon[0]
toolTip = TOOLTIP_FORMAT.format(descriptor.userString, descriptor.description)
tag = item.getTag()
if tag:
bwKey, sfKey = self.__genKey(idx)
if item.isEntityRequired():
handler = partial(self.__handleEquipmentExpanded, intCD)
else:
handler = partial(self.__handleEquipmentPressed, intCD)
if item.getQuantity() > 0:
self.__keys[bwKey] = handler
else:
bwKey, sfKey = (None, None)
self.__flashObject.addEquipmentSlot(idx, bwKey, sfKey, tag, item.getQuantity(), item.getTimeRemaining(), iconPath, toolTip)
return None
def __addOrderSlot(self, intCD, item):
idx = self.__genNextIdx(ORDERS_FULL_MASK, ORDERS_START_IDX)
self.__cds[idx] = intCD
descriptor = item.getDescriptor()
iconPath = '../maps/icons/artefact/%s.png' % descriptor.icon[0]
toolTip = TOOLTIP_FORMAT.format(descriptor.userString, descriptor.description)
bwKey, sfKey = self.__genKey(idx)
self.__keys[bwKey] = partial(self.__handleEquipmentPressed, intCD)
maxTime = item.getTotalTime()
self.__flashObject.addOrderSlot(idx, bwKey, sfKey, item.getQuantity(), iconPath, toolTip, item.getStage() in (EQUIPMENT_STAGES.READY, EQUIPMENT_STAGES.PREPARING), item.isQuantityUsed(), item.getTimeRemaining(), maxTime)
self.__updateOrderSlot(idx, item)
def __updateOrderSlot(self, idx, item):
if item.getStage() == EQUIPMENT_STAGES.READY:
self.__flashObject.setOrderAvailable(idx, True)
elif item.getStage() == EQUIPMENT_STAGES.PREPARING:
self.__currentOrderIdx = idx
self.__flashObject.setOrderActivated(idx)
else:
self.__flashObject.setOrderAvailable(idx, False)
if item.getStage() != EQUIPMENT_STAGES.PREPARING and self.__currentOrderIdx == idx:
self.__currentOrderIdx = -1
self.__flashObject.setOrderActivated(self.__currentOrderIdx)
def __onOptionalDeviceAdded(self, intCD, descriptor, isOn):
idx = self.__genNextIdx(OPT_DEVICE_FULL_MASK, OPT_DEVICE_START_IDX)
self.__cds[idx] = intCD
iconPath = descriptor.icon[0]
toolTip = TOOLTIP_FORMAT.format(descriptor.userString, descriptor.description)
self.__flashObject.addOptionalDeviceSlot(idx, -1 if isOn else 0, iconPath, toolTip)
def __onOptionalDeviceUpdated(self, intCD, isOn):
if intCD in self.__cds:
self.__flashObject.setCoolDownTime(self.__cds.index(intCD), -1 if isOn else 0)
else:
LOG_ERROR('Optional device is not found in panel', intCD, self.__cds)
def __onPostMortemSwitched(self):
self.__flashObject.switchToPosmortem()
def __onRespawnBaseMoving(self):
self.__cds = [None] * PANEL_MAX_LENGTH
self.__mask = 0
self.__keys.clear()
self.__currentOrderIdx = -1
self.__flashObject.reset()
self.__plugins.reset()
return
def __onVehicleStateUpdated(self, state, value):
if state != VEHICLE_VIEW_STATE.DEVICES:
return
deviceName, _, actualState = value
if deviceName in VEHICLE_DEVICE_IN_COMPLEX_ITEM:
itemName = VEHICLE_DEVICE_IN_COMPLEX_ITEM[deviceName]
else:
itemName = deviceName
idx = int(self.__flashObject.updateEntityState(itemName, actualState))
if idx and idx < len(self.__cds):
intCD = self.__cds[idx]
item = g_sessionProvider.getEquipmentsCtrl().getEquipment(intCD)
if item and item.isEntityRequired():
bwKey, _ = self.__genKey(idx)
self.__keys[bwKey] = partial(self.__handleEquipmentPressed, self.__cds[idx], deviceName)