当前位置: 首页>>代码示例>>Python>>正文


Python BugDll.isPresent方法代码示例

本文整理汇总了Python中BugDll.isPresent方法的典型用法代码示例。如果您正苦于以下问题:Python BugDll.isPresent方法的具体用法?Python BugDll.isPresent怎么用?Python BugDll.isPresent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BugDll的用法示例。


在下文中一共展示了BugDll.isPresent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: translate

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
	def translate(self):
		self.title = BugUtil.getPlainText(self.xmlKey + "_TEXT", self.title)
		self.tooltip = BugUtil.getPlainText(self.xmlKey + "_HOVER", self.tooltip)
		if self.isDll():
			if BugDll.isVersion(self.dll):
				self.tooltip = RE_DLL_ALL_TAGS.sub("", self.tooltip)
			else:
				if not BugDll.isPresent():
					dllText = BugUtil.getPlainText("TXT_KEY_BULL_REQUIRED")
				else:
					dllText = BugUtil.getPlainText("TXT_KEY_BULL_REQUIRED_NEWER")
				if self.tooltip.find("[DLL") >= 0:
					self.tooltip = RE_DLL_START_END_TAGS.sub("", self.tooltip)
					self.tooltip = RE_DLL_MSG_TAG.sub(dllText, self.tooltip)
				else:
					self.tooltip += "\n" + dllText
		elif self.tooltip.find("[DLL") >= 0:
			if not BugDll.isPresent():
				# no DLL, ignore all minimum versions and use standard error message
				self.tooltip = RE_DLL_START_END_TAGS.sub("", self.tooltip)
				self.tooltip = RE_DLL_MSG_TAG.sub(BugUtil.getPlainText("TXT_KEY_BULL_REQUIRED"), self.tooltip)
			else:
				dllText = BugUtil.getPlainText("TXT_KEY_BULL_REQUIRED_NEWER")
				def repl(matchobj):
					try:
						if BugDll.isVersion(int(matchobj.group(1))):
							return ""
						else:
							return RE_DLL_MSG_TAG.sub(dllText, matchobj.group(2))
					except:
						# invalid version
						return ""
				self.tooltip = RE_DLL_CAPTURE_VERSION_MESSAGE.sub(repl, self.tooltip)
		self.translated = True
开发者ID:AP-ML,项目名称:DTM,代码行数:36,代码来源:BugOptions.py

示例2: isWillingToTalk

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
def isWillingToTalk(playerOrID, toPlayerOrID):
	"""
	Returns True if <player> is willing to talk to <toPlayer>.
	
	- Every player is willing to talk to themselves
	- All human players are willing to talk
	- Uses BUG DLL if present, otherwise scans attitude hover text
	  for "Refuses to Talk!!!" in the current language
	
	Note: This function does not check if the two players can make contact.
	"""
	playerID, player = PlayerUtil.getPlayerAndID(playerOrID)
	toPlayerID = PlayerUtil.getPlayerID(toPlayerOrID)
	if playerID == toPlayerID or player.isHuman():
		# all players talk to themselves, and all humans talk
		return True
	if BugDll.isPresent():
		return player.AI_isWillingToTalk(toPlayerID)
	else:
		hover = AttitudeUtil.getAttitudeString(playerID, toPlayerID)
		if hover:
			return (hover.find(BugUtil.getPlainText("TXT_KEY_MISC_REFUSES_TO_TALK")) == -1)
		else:
			# haven't met yet
			return False
开发者ID:AP-ML,项目名称:DTM,代码行数:27,代码来源:DiplomacyUtil.py

示例3: isCancelable

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
	def isCancelable(self, eByPlayer, bIgnoreWaitingPeriod=False):
		if BugDll.isPresent():
			return self.deal.isCancelable(eByPlayer, bIgnoreWaitingPeriod)
		else:
			if self.isUncancelableVassalDeal(eByPlayer):
				return False
			return self.turnsToCancel(eByPlayer) <= 0
开发者ID:FinalFrontierPlus,项目名称:civ4ffplus,代码行数:9,代码来源:DealUtil.py

示例4: turnsToCancel

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
	def turnsToCancel(self, eByPlayer=-1):
		if BugDll.isPresent():
			return self.deal.turnsToCancel(eByPlayer)
		else:
			# this is exactly what CvDeal does
			return self.getInitialGameTurn() + gc.getDefineINT("PEACE_TREATY_LENGTH") - gc.getGame().getGameTurn()
开发者ID:FinalFrontierPlus,项目名称:civ4ffplus,代码行数:8,代码来源:DealUtil.py

示例5: getCannotCancelReason

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
	def getCannotCancelReason(self, eByPlayer):
		if BugDll.isPresent():
			return self.deal.getCannotCancelReason(eByPlayer)
		else:
			return ""
开发者ID:FinalFrontierPlus,项目名称:civ4ffplus,代码行数:7,代码来源:DealUtil.py

示例6: enforceDll

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
def enforceDll():
    if not BugDll.isPresent():
        raise MapFinderError("TXT_KEY_MAPFINDER_REQUIRES_BULL")
开发者ID:NikNaks,项目名称:Civ4-K-Mod,代码行数:5,代码来源:MapFinder.py


注:本文中的BugDll.isPresent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。