本文整理汇总了Python中service.damagePattern.DamagePattern类的典型用法代码示例。如果您正苦于以下问题:Python DamagePattern类的具体用法?Python DamagePattern怎么用?Python DamagePattern使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DamagePattern类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
pyfalog.debug("Initialize Fit class")
self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
self.targetResists = None
self.character = saveddata_Character.getAll5()
self.booster = False
self.dirtyFitIDs = set()
serviceFittingDefaultOptions = {
"useGlobalCharacter": False,
"useGlobalDamagePattern": False,
"defaultCharacter": self.character.ID,
"useGlobalForceReload": False,
"colorFitBySlot": False,
"rackSlots": True,
"rackLabels": True,
"compactSkills": True,
"showTooltip": True,
"showMarketShortcuts": False,
"enableGaugeAnimation": True,
"exportCharges": True,
"openFitInNew": False,
"priceSystem": "Jita",
"priceSource": "eve-marketdata.com",
"showShipBrowserTooltip": True,
"marketSearchDelay": 250
}
self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(
"pyfaServiceFittingOptions", serviceFittingDefaultOptions)
开发者ID:Sectoid,项目名称:Pyfa,代码行数:30,代码来源:fit.py
示例2: getText
def getText(self, itmContext, selection):
sDP = import_DamagePattern.getInstance()
sFit = Fit.getInstance()
fitID = self.mainFrame.getActiveFit()
self.fit = sFit.getFit(fitID)
self.patterns = sDP.getDamagePatternList()
self.patterns.sort(key=lambda p: (p.name not in ["Uniform", "Selected Ammo"], p.name))
self.patternIds = {}
self.subMenus = OrderedDict()
self.singles = []
# iterate and separate damage patterns based on "[Parent] Child"
for pattern in self.patterns:
start, end = pattern.name.find('['), pattern.name.find(']')
if start is not -1 and end is not -1:
currBase = pattern.name[start + 1:end]
# set helper attr
setattr(pattern, "_name", pattern.name[end + 1:].strip())
if currBase not in self.subMenus:
self.subMenus[currBase] = []
self.subMenus[currBase].append(pattern)
else:
self.singles.append(pattern)
# return list of names, with singles first followed by submenu names
self.m = map(lambda p: p.name, self.singles) + self.subMenus.keys()
return self.m
开发者ID:Ebag333,项目名称:Pyfa,代码行数:29,代码来源:damagePattern.py
示例3: __init__
def __init__(self):
self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
self.character = Character.getInstance().all5()
self.dirtyFitIDs = set()
serviceFittingDefaultOptions = {"useGlobalCharacter": False, "useGlobalDamagePattern": False, "defaultCharacter": self.character.ID, "useGlobalForceReload": False}
self.serviceFittingOptions = SettingsProvider.getInstance().getSettings("pyfaServiceFittingOptions", serviceFittingDefaultOptions)
开发者ID:MRACHINI,项目名称:Pyfa,代码行数:8,代码来源:fit.py
示例4: ValuesUpdated
def ValuesUpdated(self, event=None):
if self.block:
return
p = self.entityEditor.getActiveEntity()
total = sum([getattr(self, "%sEdit" % attr).GetValue() for attr in self.DAMAGE_TYPES])
for type_ in self.DAMAGE_TYPES:
editObj = getattr(self, "%sEdit" % type_)
percObj = getattr(self, "%sPerc" % type_)
setattr(p, "%sAmount" % type_, editObj.GetValue())
percObj.SetLabel("%.1f%%" % (float(editObj.GetValue()) * 100 / total if total > 0 else 0))
self.totSizer.Layout()
if event is not None:
event.Skip()
DamagePattern.getInstance().saveChanges(p)
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:18,代码来源:patternEditor.py
示例5: setAsPattern
def setAsPattern(self, fitID, ammo):
if fitID is None:
return
sDP = DamagePattern.getInstance()
dp = sDP.getDamagePattern("Selected Ammo")
if dp is None:
dp = eos.types.DamagePattern()
dp.name = "Selected Ammo"
fit = eos.db.getFit(fitID)
for attr in ("em", "thermal", "kinetic", "explosive"):
setattr(dp, "%sAmount" % attr, ammo.getAttribute("%sDamage" % attr))
fit.damagePattern = dp
self.recalc(fit)
开发者ID:MRACHINI,项目名称:Pyfa,代码行数:16,代码来源:fit.py
示例6: __init__
def __init__(self):
self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
self.character = Character.getInstance().all5()
self.booster = False
self.dirtyFitIDs = set()
serviceFittingDefaultOptions = {
"useGlobalCharacter": False,
"useGlobalDamagePattern": False,
"defaultCharacter": self.character.ID,
"useGlobalForceReload": False,
"colorFitBySlot": False,
"rackSlots": True,
"rackLabels": True,
"compactSkills": True}
self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(
"pyfaServiceFittingOptions", serviceFittingDefaultOptions)
开发者ID:SpeakerJunk,项目名称:Pyfa,代码行数:18,代码来源:fit.py
示例7: importPatterns
def importPatterns(self, event):
text = fromClipboard()
if text:
sDP = DamagePattern.getInstance()
try:
sDP.importPatterns(text)
self.stNotice.SetLabel("Patterns successfully imported from clipboard")
except ImportError as e:
pyfalog.error(e)
self.stNotice.SetLabel(str(e))
except Exception as e:
msg = "Could not import from clipboard: unknown errors"
pyfalog.warning(msg)
pyfalog.error(e)
self.stNotice.SetLabel(msg)
finally:
self.entityEditor.refreshEntityList()
else:
self.stNotice.SetLabel("Could not import from clipboard")
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:19,代码来源:patternEditor.py
示例8: DoDelete
def DoDelete(self, entity):
sDP = DamagePattern.getInstance()
sDP.deletePattern(entity)
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:3,代码来源:patternEditor.py
示例9: DoCopy
def DoCopy(self, entity, name):
sDP = DamagePattern.getInstance()
copy = sDP.copyPattern(entity)
sDP.renamePattern(copy, name)
return copy
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:5,代码来源:patternEditor.py
示例10: DoRename
def DoRename(self, entity, name):
sDP = DamagePattern.getInstance()
sDP.renamePattern(entity, name)
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:3,代码来源:patternEditor.py
示例11: DoNew
def DoNew(self, name):
sDP = DamagePattern.getInstance()
return sDP.newPattern(name)
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:3,代码来源:patternEditor.py
示例12: getEntitiesFromContext
def getEntitiesFromContext(self):
sDP = DamagePattern.getInstance()
choices = sorted(sDP.getDamagePatternList(), key=lambda p: p.name)
return [c for c in choices if c.name != "Selected Ammo"]
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:4,代码来源:patternEditor.py
示例13: exportPatterns
def exportPatterns(self, event):
sDP = DamagePattern.getInstance()
toClipboard(sDP.exportPatterns())
self.stNotice.SetLabel("Patterns exported to clipboard")
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:4,代码来源:patternEditor.py
注:本文中的service.damagePattern.DamagePattern类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论