本文整理汇总了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
示例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
示例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
示例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()
示例5: getCannotCancelReason
# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
def getCannotCancelReason(self, eByPlayer):
if BugDll.isPresent():
return self.deal.getCannotCancelReason(eByPlayer)
else:
return ""
示例6: enforceDll
# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import isPresent [as 别名]
def enforceDll():
if not BugDll.isPresent():
raise MapFinderError("TXT_KEY_MAPFINDER_REQUIRES_BULL")