Merge branch 'singularity'
@@ -6,4 +6,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", ship.getModifiedItemAttr("eliteBonusReconShip2"), skill="Recon Ships")
|
||||
"energyNeutralizerAmount", ship.getModifiedItemAttr("eliteBonusReconShip2"), skill="Recon Ships")
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
# Skill: EM Shield Compensation
|
||||
type = "passive"
|
||||
def handler(fit, skill, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Amplifier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Resistance Amplifier",
|
||||
"emDamageResistanceBonus", skill.getModifiedItemAttr("hardeningBonus") * skill.level)
|
||||
@@ -5,6 +5,6 @@ def handler(fit, container, context):
|
||||
if "projected" in context and ((hasattr(container, "state") \
|
||||
and container.state >= State.ACTIVE) or hasattr(container, "amountActive")):
|
||||
multiplier = container.amountActive if hasattr(container, "amountActive") else 1
|
||||
amount = container.getModifiedItemAttr("energyDestabilizationAmount")
|
||||
amount = container.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
time = container.getModifiedItemAttr("duration")
|
||||
fit.addDrain(time, amount * multiplier, 0)
|
||||
|
||||
@@ -7,6 +7,6 @@ type = "active", "projected"
|
||||
def handler(fit, container, context):
|
||||
if "projected" in context and ((hasattr(container, "state") \
|
||||
and container.state >= State.ACTIVE) or hasattr(container, "amountActive")):
|
||||
amount = container.getModifiedItemAttr("energyDestabilizationAmount")
|
||||
amount = container.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
time = container.getModifiedItemAttr("duration")
|
||||
fit.addDrain(time, amount, 0)
|
||||
|
||||
@@ -7,6 +7,6 @@ type = "active", "projected"
|
||||
def handler(fit, container, context):
|
||||
if "projected" in context and ((hasattr(container, "state") \
|
||||
and container.state >= State.ACTIVE) or hasattr(container, "amountActive")):
|
||||
amount = container.getModifiedItemAttr("energyDestabilizationAmount")
|
||||
amount = container.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
time = container.getModifiedItemAttr("duration")
|
||||
fit.addDrain(time, amount, 0)
|
||||
|
||||
7
eos/effects/entityecmfalloff.py
Normal file
@@ -0,0 +1,7 @@
|
||||
type = "projected", "active"
|
||||
def handler(fit, module, context):
|
||||
if "projected" in context:
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType))/fit.scanStrength
|
||||
|
||||
fit.ecmProjectedStr *= strModifier
|
||||
12
eos/effects/entityenergyneutralizerfalloff.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# energyNeutralizerFalloff
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Energy Neutralizer (51 of 51)
|
||||
from eos.types import State
|
||||
type = "active", "projected"
|
||||
def handler(fit, container, context):
|
||||
if "projected" in context and ((hasattr(container, "state") \
|
||||
and container.state >= State.ACTIVE) or hasattr(container, "amountActive")):
|
||||
amount = container.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
time = container.getModifiedItemAttr("energyNeutralizerDuration")
|
||||
fit.addDrain(time, amount, 0)
|
||||
@@ -4,5 +4,5 @@
|
||||
# Skill: Explosive Shield Compensation
|
||||
type = "passive"
|
||||
def handler(fit, skill, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Amplifier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Resistance Amplifier",
|
||||
"explosiveDamageResistanceBonus", skill.getModifiedItemAttr("hardeningBonus") * skill.level)
|
||||
@@ -4,6 +4,6 @@
|
||||
# Skill: Kinetic Shield Compensation
|
||||
type = "passive"
|
||||
def handler(fit, skill, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Amplifier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Resistance Amplifier",
|
||||
"kineticDamageResistanceBonus",
|
||||
skill.getModifiedItemAttr("hardeningBonus") * skill.level)
|
||||
@@ -1,7 +1,7 @@
|
||||
# modifyShieldResonancePostPercent
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Shield Amplifier (88 of 88)
|
||||
# Modules from group: Shield Resistance Amplifier (88 of 88)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
for type in ("kinetic", "thermal", "explosive", "em"):
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
# Module: Networked Sensor Array
|
||||
type = "active"
|
||||
def handler(fit, src, context):
|
||||
fit.ship.increaseItemAttr("maxLockedTargets", src.getModifiedItemAttr("maxLockedTargetsBonus"))
|
||||
fit.ship.multiplyItemAttr("maxTargetRange", src.getModifiedItemAttr("maxTargetRangeMultiplier"), stackingPenalties=True, penaltyGroup="postMul")
|
||||
fit.ship.multiplyItemAttr("scanResolution", src.getModifiedItemAttr("scanResolutionMultiplier"), stackingPenalties=True)
|
||||
fit.ship.boostItemAttr("scanResolution", src.getModifiedItemAttr("scanResolutionBonus"), stackingPenalties=True)
|
||||
|
||||
for scanType in ('Magnetometric', 'Ladar', 'Gravimetric', 'Radar'):
|
||||
fit.ship.boostItemAttr("scan{}Strength".format(scanType),
|
||||
|
||||
@@ -44,14 +44,9 @@ def handler(fit, src, context):
|
||||
fit.ship.forceItemAttr("disallowAssistance", src.getModifiedItemAttr("disallowAssistance"))
|
||||
|
||||
# new in April 2016 release
|
||||
for scanType in ('Magnetometric', 'Ladar', 'Gravimetric', 'Radar'):
|
||||
fit.ship.boostItemAttr("scan{}Strength".format(scanType),
|
||||
src.getModifiedItemAttr("scan{}StrengthPercent".format(scanType)),
|
||||
stackingPenalties=True)
|
||||
|
||||
# missile ROF bonus
|
||||
for group in ("Missile Launcher XL Torpedo", "Missile Launcher Rapid Torpedo", "Missile Launcher XL Cruise"):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == group, "speed", src.getModifiedItemAttr("siegeLauncherROFBonus"), stackingPenalties=True)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == group, "speed", src.getModifiedItemAttr("siegeLauncherROFBonus"))
|
||||
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Torpedoes"), "maxVelocity", src.getModifiedItemAttr("siegeTorpedoVelocityBonus"), stackingPenalties=True)
|
||||
|
||||
|
||||
@@ -56,12 +56,6 @@ def handler(fit, src, context):
|
||||
fit.ship.forceItemAttr("disallowAssistance", src.getModifiedItemAttr("disallowAssistance"))
|
||||
|
||||
# new in April 2016 release
|
||||
|
||||
for scanType in ('Magnetometric', 'Ladar', 'Gravimetric', 'Radar'):
|
||||
fit.ship.boostItemAttr("scan{}Strength".format(scanType),
|
||||
src.getModifiedItemAttr("scan{}StrengthPercent".format(scanType)),
|
||||
stackingPenalties=True)
|
||||
|
||||
fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Drones"), "damageMultiplier", src.getModifiedItemAttr("droneDamageBonus"), stackingPenalties=True)
|
||||
|
||||
fit.ship.increaseItemAttr("warpScrambleStatus", src.getModifiedItemAttr("siegeModeWarpStatus"))
|
||||
|
||||
5
eos/effects/rigdrawbackreductionarmor.py
Normal file
@@ -0,0 +1,5 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Armor", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Resource Processing", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
5
eos/effects/rigdrawbackreductionastronautics.py
Normal file
@@ -0,0 +1,5 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Navigation", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Anchor", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
4
eos/effects/rigdrawbackreductiondrones.py
Normal file
@@ -0,0 +1,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Drones", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
6
eos/effects/rigdrawbackreductionelectronic.py
Normal file
@@ -0,0 +1,6 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Electronic Systems", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Scanning", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Targeting", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
4
eos/effects/rigdrawbackreductionenergyweapon.py
Normal file
@@ -0,0 +1,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Energy Weapon", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
4
eos/effects/rigdrawbackreductionhybrid.py
Normal file
@@ -0,0 +1,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Hybrid Weapon", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
4
eos/effects/rigdrawbackreductionlauncher.py
Normal file
@@ -0,0 +1,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Launcher", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
4
eos/effects/rigdrawbackreductionprojectile.py
Normal file
@@ -0,0 +1,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Projectile Weapon", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
4
eos/effects/rigdrawbackreductionshield.py
Normal file
@@ -0,0 +1,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Rig Shield", "drawback", src.getModifiedItemAttr("rigDrawbackBonus") * lvl)
|
||||
@@ -1,7 +1,7 @@
|
||||
# shieldCapacityBonusOnline
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Shield Amplifier (88 of 88)
|
||||
# Modules from group: Shield Resistance Amplifier (88 of 88)
|
||||
# Modules from group: Shield Extender (33 of 33)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
|
||||
3
eos/effects/shipbonusdreadnoughtm1webbonus.py
Normal file
@@ -0,0 +1,3 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "speedFactor", src.getModifiedItemAttr("shipBonusDreadnoughtM1"), skill="Minmatar Dreadnought")
|
||||
@@ -0,0 +1,3 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Burst Projector Operation"), "speedFactor", src.getModifiedItemAttr("shipBonusSupercarrierM1"), skill="Minmatar Carrier")
|
||||
3
eos/effects/shipbonustitanm1webbonus.py
Normal file
@@ -0,0 +1,3 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "speedFactor", src.getModifiedItemAttr("shipBonusTitanM1"), skill="Minmatar Titan")
|
||||
3
eos/effects/shipbonustitanrole3damagebonus.py
Normal file
@@ -0,0 +1,3 @@
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Hybrid Turret"), "damageMultiplier", src.getModifiedItemAttr("shipBonusRole3"))
|
||||
@@ -5,4 +5,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonusAB"), skill="Amarr Battleship")
|
||||
"energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAB"), skill="Amarr Battleship")
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonusAC"), skill="Amarr Cruiser")
|
||||
"energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAC"), skill="Amarr Cruiser")
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonusAF"), skill="Amarr Frigate")
|
||||
"energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAF"), skill="Amarr Frigate")
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonus2AF"), skill="Amarr Frigate")
|
||||
"energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonus2AF"), skill="Amarr Frigate")
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", ship.getModifiedItemAttr("rookieNeutDrain"))
|
||||
"energyNeutralizerAmount", ship.getModifiedItemAttr("rookieNeutDrain"))
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", module.getModifiedItemAttr("subsystemBonusAmarrElectronic"), skill="Amarr Electronic Systems")
|
||||
"energyNeutralizerAmount", module.getModifiedItemAttr("subsystemBonusAmarrElectronic"), skill="Amarr Electronic Systems")
|
||||
|
||||
@@ -6,5 +6,5 @@ runTime = "early"
|
||||
type = ("projected", "passive")
|
||||
def handler(fit, beacon, context):
|
||||
fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyDestabilizationAmount", beacon.getModifiedItemAttr("energyWarfareStrengthMultiplier"),
|
||||
"energyNeutralizerAmount", beacon.getModifiedItemAttr("energyWarfareStrengthMultiplier"),
|
||||
stackingPenalties=True, penaltyGroup="postMul")
|
||||
|
||||
@@ -6,5 +6,5 @@ runTime = "early"
|
||||
type = ("projected", "passive")
|
||||
def handler(fit, beacon, context):
|
||||
fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"),
|
||||
"energyDestabilizationAmount", beacon.getModifiedItemAttr("smartbombDamageMultiplier"),
|
||||
"energyNeutralizerAmount", beacon.getModifiedItemAttr("smartbombDamageMultiplier"),
|
||||
stackingPenalties=True, penaltyGroup="postMul")
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
# Skill: Thermal Shield Compensation
|
||||
type = "passive"
|
||||
def handler(fit, skill, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Amplifier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Shield Resistance Amplifier",
|
||||
"thermalDamageResistanceBonus", skill.getModifiedItemAttr("hardeningBonus") * skill.level)
|
||||
@@ -95,11 +95,10 @@ class FitDpsGraph(Graph):
|
||||
targetSigRad = explosionRadius if targetSigRad is None else targetSigRad
|
||||
explosionVelocity = mod.getModifiedChargeAttr("aoeVelocity")
|
||||
damageReductionFactor = mod.getModifiedChargeAttr("aoeDamageReductionFactor")
|
||||
damageReductionSensitivity = mod.getModifiedChargeAttr("aoeDamageReductionSensitivity")
|
||||
|
||||
sigRadiusFactor = targetSigRad / explosionRadius
|
||||
if targetVelocity:
|
||||
velocityFactor = (explosionVelocity / explosionRadius * targetSigRad / targetVelocity) ** (log(damageReductionFactor) / log(damageReductionSensitivity))
|
||||
velocityFactor = (explosionVelocity / explosionRadius * targetSigRad / targetVelocity) ** damageReductionFactor
|
||||
else:
|
||||
velocityFactor = 1
|
||||
|
||||
|
||||
@@ -168,10 +168,6 @@ class ResistancesViewFull(StatsView):
|
||||
self.showEffective = True
|
||||
wx.PostEvent(self.mainFrame, EffectiveHpToggled(effective=True))
|
||||
return
|
||||
elif fit is not None and fit.ID != self.activeFit and not self.showEffective:
|
||||
self.showEffective = True
|
||||
wx.PostEvent(self.mainFrame, EffectiveHpToggled(effective=True))
|
||||
return
|
||||
|
||||
self.stEHPs.SetLabel("EHP" if self.showEffective else "HP")
|
||||
self.activeFit = fit.ID if fit is not None else None
|
||||
|
||||
@@ -86,7 +86,7 @@ class Miscellanea(ViewColumn):
|
||||
info.append("{0}{1}".format(n, slot[0].upper()))
|
||||
return "+ "+", ".join(info), "Slot Modifiers"
|
||||
elif itemGroup == "Energy Neutralizer":
|
||||
neutAmount = stuff.getModifiedItemAttr("energyDestabilizationAmount")
|
||||
neutAmount = stuff.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
cycleTime = stuff.cycleTime
|
||||
if not neutAmount or not cycleTime:
|
||||
return "", None
|
||||
@@ -429,8 +429,8 @@ class Miscellanea(ViewColumn):
|
||||
tooltip = "{0} repaired per second".format(formatList(ttEntries)).capitalize()
|
||||
return text, tooltip
|
||||
elif itemGroup == "Energy Neutralizer Drone":
|
||||
neutAmount = stuff.getModifiedItemAttr("energyDestabilizationAmount")
|
||||
cycleTime = stuff.getModifiedItemAttr("duration")
|
||||
neutAmount = stuff.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
cycleTime = stuff.getModifiedItemAttr("energyNeutralizerDuration")
|
||||
if not neutAmount or not cycleTime:
|
||||
return "", None
|
||||
capPerSec = float(-neutAmount) * 1000 / cycleTime
|
||||
|
||||
@@ -98,7 +98,8 @@ class EntityEditor (wx.Panel):
|
||||
dlg.CenterOnParent()
|
||||
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
new = self.DoNew(dlg.GetValue().strip())
|
||||
# using dlg.textctrl.GetValue instead of simply dlg.GetValue because the proper way does not work in wxPython 2.8
|
||||
new = self.DoNew(dlg.txtctrl.GetValue().strip())
|
||||
self.refreshEntityList(new)
|
||||
wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED))
|
||||
else:
|
||||
@@ -114,7 +115,7 @@ class EntityEditor (wx.Panel):
|
||||
dlg.CenterOnParent()
|
||||
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
copy = self.DoCopy(active, dlg.GetValue().strip())
|
||||
copy = self.DoCopy(active, dlg.txtctrl.GetValue().strip())
|
||||
self.refreshEntityList(copy)
|
||||
wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED))
|
||||
|
||||
@@ -128,7 +129,7 @@ class EntityEditor (wx.Panel):
|
||||
dlg.CenterOnParent()
|
||||
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
self.DoRename(active, dlg.GetValue().strip())
|
||||
self.DoRename(active, dlg.txtctrl.GetValue().strip())
|
||||
self.refreshEntityList(active)
|
||||
wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED))
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ class CharacterTextValidor(BaseValidator):
|
||||
return CharacterTextValidor()
|
||||
|
||||
def Validate(self, win):
|
||||
profileEditor = win.Parent
|
||||
entityEditor = win.parent
|
||||
textCtrl = self.GetWindow()
|
||||
text = textCtrl.GetValue().strip()
|
||||
|
||||
try:
|
||||
if len(text) == 0:
|
||||
raise ValueError("You must supply a name for the Character!")
|
||||
elif text in [x.name for x in profileEditor.entityEditor.choices]:
|
||||
elif text in [x.name for x in entityEditor.choices]:
|
||||
raise ValueError("Character name already in use, please choose another.")
|
||||
|
||||
return True
|
||||
|
||||
172
gui/itemStats.py
@@ -150,6 +150,8 @@ class ItemStatsContainer ( wx.Panel ):
|
||||
|
||||
def __init__( self, parent, stuff, item, context = None):
|
||||
wx.Panel.__init__ ( self, parent )
|
||||
sMkt = service.Market.getInstance()
|
||||
|
||||
mainSizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
self.nbContainer = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
@@ -165,6 +167,11 @@ class ItemStatsContainer ( wx.Panel ):
|
||||
self.params = ItemParams(self.nbContainer, stuff, item, context)
|
||||
self.nbContainer.AddPage(self.params, "Attributes")
|
||||
|
||||
items = sMkt.getVariationsByItems([item])
|
||||
if len(items) > 1:
|
||||
self.compare = ItemCompare(self.nbContainer, stuff, item, items, context)
|
||||
self.nbContainer.AddPage(self.compare, "Compare")
|
||||
|
||||
self.reqs = ItemRequirements(self.nbContainer, stuff, item)
|
||||
self.nbContainer.AddPage(self.reqs, "Requirements")
|
||||
|
||||
@@ -385,9 +392,9 @@ class ItemParams (wx.Panel):
|
||||
|
||||
attrIcon = self.imageList.Add(icon)
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("07_15", "icons"))
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("7_15", "icons"))
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("07_15", "icons"))
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("7_15", "icons"))
|
||||
|
||||
|
||||
index = self.paramList.InsertImageStringItem(sys.maxint, attrName, attrIcon)
|
||||
@@ -459,6 +466,159 @@ class ItemParams (wx.Panel):
|
||||
else:
|
||||
return "%s %s" % (formatAmount(value, 3, 0),unitName)
|
||||
|
||||
class ItemCompare(wx.Panel):
|
||||
def __init__(self, parent, stuff, item, items, context=None):
|
||||
wx.Panel.__init__(self, parent)
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.paramList = AutoListCtrl(self, wx.ID_ANY,
|
||||
style= # wx.LC_HRULES |
|
||||
# wx.LC_NO_HEADER |
|
||||
wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES | wx.NO_BORDER)
|
||||
mainSizer.Add(self.paramList, 1, wx.ALL | wx.EXPAND, 0)
|
||||
self.SetSizer(mainSizer)
|
||||
|
||||
self.toggleView = 1
|
||||
self.stuff = stuff
|
||||
self.item = item
|
||||
self.items = sorted(items, key=lambda x: x.attributes['metaLevel'].value)
|
||||
self.attrs = {}
|
||||
|
||||
# get a dict of attrName: attrInfo of all unique attributes across all items
|
||||
for item in self.items:
|
||||
for attr in item.attributes.keys():
|
||||
if item.attributes[attr].info.displayName:
|
||||
self.attrs[attr] = item.attributes[attr].info
|
||||
|
||||
# Process attributes for items and find ones that differ
|
||||
for attr in self.attrs.keys():
|
||||
value = None
|
||||
|
||||
for item in self.items:
|
||||
# we can automatically break here if this item doesn't have the attribute,
|
||||
# as that means at least one item did
|
||||
if attr not in item.attributes:
|
||||
break
|
||||
|
||||
# this is the first attribute for the item set, set the initial value
|
||||
if value is None:
|
||||
value = item.attributes[attr].value
|
||||
continue
|
||||
|
||||
if attr not in item.attributes or item.attributes[attr].value != value:
|
||||
break
|
||||
else:
|
||||
# attribute values were all the same, delete
|
||||
del self.attrs[attr]
|
||||
|
||||
self.m_staticline = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
|
||||
bSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, u" ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.totalAttrsLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
|
||||
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, u"Toggle view mode", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
if stuff is not None:
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, u"Refresh", wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.BU_EXACTFIT)
|
||||
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshValues)
|
||||
|
||||
mainSizer.Add(bSizer, 0, wx.ALIGN_RIGHT)
|
||||
|
||||
self.PopulateList()
|
||||
|
||||
self.toggleViewBtn.Bind(wx.EVT_TOGGLEBUTTON, self.ToggleViewMode)
|
||||
|
||||
def UpdateList(self):
|
||||
self.Freeze()
|
||||
self.paramList.ClearAll()
|
||||
self.PopulateList()
|
||||
self.Thaw()
|
||||
self.paramList.resizeLastColumn(100)
|
||||
|
||||
def RefreshValues(self, event):
|
||||
self.UpdateList()
|
||||
event.Skip()
|
||||
|
||||
def ToggleViewMode(self, event):
|
||||
self.toggleView *= -1
|
||||
self.UpdateList()
|
||||
event.Skip()
|
||||
|
||||
def PopulateList(self):
|
||||
self.paramList.InsertColumn(0, "Item")
|
||||
self.paramList.SetColumnWidth(0, 200)
|
||||
|
||||
for i, attr in enumerate(self.attrs.keys()):
|
||||
name = self.attrs[attr].displayName if self.attrs[attr].displayName else attr
|
||||
self.paramList.InsertColumn(i+1, name)
|
||||
self.paramList.SetColumnWidth(i+1, 120)
|
||||
|
||||
for item in self.items:
|
||||
i = self.paramList.InsertStringItem(sys.maxint, item.name)
|
||||
for x, attr in enumerate(self.attrs.keys()):
|
||||
if attr in item.attributes:
|
||||
info = self.attrs[attr]
|
||||
value = item.attributes[attr].value
|
||||
if self.toggleView != 1:
|
||||
valueUnit = str(value)
|
||||
if info and info.unit:
|
||||
valueUnit = self.TranslateValueUnit(value, info.unit.displayName, info.unit.name)
|
||||
else:
|
||||
valueUnit = formatAmount(value, 3, 0, 0)
|
||||
|
||||
self.paramList.SetStringItem(i, x+1, valueUnit)
|
||||
|
||||
self.paramList.RefreshRows()
|
||||
self.Layout()
|
||||
|
||||
def TranslateValueUnit(self, value, unitName, unitDisplayName):
|
||||
def itemIDCallback():
|
||||
item = service.Market.getInstance().getItem(value)
|
||||
return "%s (%d)" % (item.name, value) if item is not None else str(value)
|
||||
|
||||
def groupIDCallback():
|
||||
group = service.Market.getInstance().getGroup(value)
|
||||
return "%s (%d)" % (group.name, value) if group is not None else str(value)
|
||||
|
||||
def attributeIDCallback():
|
||||
attribute = service.Attribute.getInstance().getAttributeInfo(value)
|
||||
return "%s (%d)" % (attribute.name.capitalize(), value)
|
||||
|
||||
trans = {"Inverse Absolute Percent": (lambda: (1 - value) * 100, unitName),
|
||||
"Inversed Modifier Percent": (lambda: (1 - value) * 100, unitName),
|
||||
"Modifier Percent": (
|
||||
lambda: ("%+.2f" if ((value - 1) * 100) % 1 else "%+d") % ((value - 1) * 100), unitName),
|
||||
"Volume": (lambda: value, u"m\u00B3"),
|
||||
"Sizeclass": (lambda: value, ""),
|
||||
"Absolute Percent": (lambda: (value * 100), unitName),
|
||||
"Milliseconds": (lambda: value / 1000.0, unitName),
|
||||
"typeID": (itemIDCallback, ""),
|
||||
"groupID": (groupIDCallback, ""),
|
||||
"attributeID": (attributeIDCallback, "")}
|
||||
|
||||
override = trans.get(unitDisplayName)
|
||||
if override is not None:
|
||||
|
||||
if type(override[0]()) == type(str()):
|
||||
fvalue = override[0]()
|
||||
else:
|
||||
v = override[0]()
|
||||
if isinstance(v, (int, float, long)):
|
||||
fvalue = formatAmount(v, 3, 0, 0)
|
||||
else:
|
||||
fvalue = v
|
||||
return "%s %s" % (fvalue, override[1])
|
||||
else:
|
||||
return "%s %s" % (formatAmount(value, 3, 0), unitName)
|
||||
|
||||
|
||||
###########################################################################
|
||||
## Class ItemRequirements
|
||||
###########################################################################
|
||||
@@ -798,9 +958,9 @@ class ItemAffectedBy (wx.Panel):
|
||||
icon = BitmapLoader.getBitmap("transparent16x16", "gui")
|
||||
attrIcon = self.imageList.Add(icon)
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("07_15", "icons"))
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("7_15", "icons"))
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("07_15", "icons"))
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("7_15", "icons"))
|
||||
|
||||
if self.showRealNames:
|
||||
display = attrName
|
||||
@@ -957,9 +1117,9 @@ class ItemAffectedBy (wx.Panel):
|
||||
|
||||
attrIcon = self.imageList.Add(icon)
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("07_15", "icons"))
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("7_15", "icons"))
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("07_15", "icons"))
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("7_15", "icons"))
|
||||
|
||||
if attrModifier == "s*":
|
||||
attrModifier = "*"
|
||||
|
||||
@@ -36,14 +36,14 @@ class DmgPatternTextValidor(BaseValidator):
|
||||
return DmgPatternTextValidor()
|
||||
|
||||
def Validate(self, win):
|
||||
profileEditor = win.Parent
|
||||
entityEditor = win.parent
|
||||
textCtrl = self.GetWindow()
|
||||
text = textCtrl.GetValue().strip()
|
||||
|
||||
try:
|
||||
if len(text) == 0:
|
||||
raise ValueError("You must supply a name for your Damage Profile!")
|
||||
elif text in [x.name for x in profileEditor.entityEditor.choices]:
|
||||
elif text in [x.name for x in entityEditor.choices]:
|
||||
raise ValueError("Damage Profile name already in use, please choose another.")
|
||||
|
||||
return True
|
||||
|
||||
@@ -33,14 +33,14 @@ class TargetResistsTextValidor(BaseValidator):
|
||||
return TargetResistsTextValidor()
|
||||
|
||||
def Validate(self, win):
|
||||
profileEditor = win.parent.Parent
|
||||
entityEditor = win.parent
|
||||
textCtrl = self.GetWindow()
|
||||
text = textCtrl.GetValue().strip()
|
||||
|
||||
try:
|
||||
if len(text) == 0:
|
||||
raise ValueError("You must supply a name for your Target Resist Profile!")
|
||||
elif text in [x.name for x in profileEditor.entityEditor.choices]:
|
||||
elif text in [x.name for x in entityEditor.choices]:
|
||||
raise ValueError("Target Resist Profile name already in use, please choose another.")
|
||||
|
||||
return True
|
||||
|
||||
@@ -36,14 +36,14 @@ class ImplantTextValidor(BaseValidator):
|
||||
return ImplantTextValidor()
|
||||
|
||||
def Validate(self, win):
|
||||
profileEditor = win.parent.Parent
|
||||
entityEditor = win.parent
|
||||
textCtrl = self.GetWindow()
|
||||
text = textCtrl.GetValue().strip()
|
||||
|
||||
try:
|
||||
if len(text) == 0:
|
||||
raise ValueError("You must supply a name for the Implant Set!")
|
||||
elif text in [x.name for x in profileEditor.entityEditor.choices]:
|
||||
elif text in [x.name for x in entityEditor.choices]:
|
||||
raise ValueError("Imlplant Set name already in use, please choose another.")
|
||||
|
||||
return True
|
||||
|
||||
|
Before Width: | Height: | Size: 647 B |
|
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 640 B |
|
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 841 B |
|
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 782 B |
|
Before Width: | Height: | Size: 750 B After Width: | Height: | Size: 750 B |
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 658 B |
|
Before Width: | Height: | Size: 675 B After Width: | Height: | Size: 675 B |
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 876 B |
|
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 581 B |
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
|
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 823 B |
|
Before Width: | Height: | Size: 941 B After Width: | Height: | Size: 941 B |
|
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 602 B |
|
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 692 B |
|
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
|
Before Width: | Height: | Size: 808 B After Width: | Height: | Size: 808 B |
|
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 809 B |
|
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
|
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 833 B |
|
Before Width: | Height: | Size: 825 B After Width: | Height: | Size: 825 B |
|
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 782 B |
|
Before Width: | Height: | Size: 868 B After Width: | Height: | Size: 868 B |
|
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 875 B |
|
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 875 B |
|
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 884 B |
|
Before Width: | Height: | Size: 868 B After Width: | Height: | Size: 868 B |
|
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 858 B |
|
Before Width: | Height: | Size: 907 B After Width: | Height: | Size: 907 B |
|
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 884 B |
|
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 796 B |
|
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 725 B |
|
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 832 B After Width: | Height: | Size: 832 B |
|
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
|
Before Width: | Height: | Size: 791 B After Width: | Height: | Size: 791 B |
|
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 847 B |
|
Before Width: | Height: | Size: 811 B After Width: | Height: | Size: 811 B |
|
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 804 B |
|
Before Width: | Height: | Size: 828 B After Width: | Height: | Size: 828 B |
|
Before Width: | Height: | Size: 842 B After Width: | Height: | Size: 842 B |
|
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 575 B |
|
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 672 B |
|
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
|
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 515 B |
|
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 657 B |
|
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 647 B |
|
Before Width: | Height: | Size: 617 B After Width: | Height: | Size: 617 B |
|
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 593 B |
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 619 B |
|
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |