Merge branch 'master' of evefit.org:pyfa

This commit is contained in:
HomeWorld
2010-10-28 22:32:24 +03:00
5 changed files with 13 additions and 7 deletions

2
gui/builtinContextMenus/ammoPattern.py Executable file → Normal file
View File

@@ -26,7 +26,7 @@ class AmmoPattern(ContextMenu):
return False
def getText(self, context, selection):
return "Set as damage pattern"
return "Set as Damage Pattern"
def activate(self, context, selection, i):
item = selection[0]

View File

@@ -15,7 +15,8 @@ class DamagePattern(ContextMenu):
def getText(self, context, selection):
sDP = service.DamagePattern.getInstance()
self.patterns = sDP.getDamagePatternList()
self.patterns.sort(key=lambda p: p.name)
self.patterns.sort( key=lambda p: (p.name in ["Selected Ammo",
"Uniform"], p.name) )
m = map(lambda p: p.name, self.patterns)
return m

View File

@@ -25,7 +25,7 @@ class ModuleAmmo(ViewColumn):
name = "Module Ammo"
def __init__(self, fittingView, params):
ViewColumn.__init__(self, fittingView)
self.columnText = "Ammo"
self.columnText = "Selected Ammo"
def getText(self, mod):
return "%s (%s)" % (mod.charge.name, mod.numCharges) if mod.charge is not None else ""

View File

@@ -28,7 +28,7 @@ import service
class DmgPatternEditorDlg (wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__ (self, parent, id = wx.ID_ANY, title = u"Damage Pattern Editor", size = wx.Size( 350,240 ))
wx.Dialog.__init__ (self, parent, id = wx.ID_ANY, title = u"Damage Pattern Editor", size = wx.Size( 400,240 ))
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
@@ -39,6 +39,11 @@ class DmgPatternEditorDlg (wx.Dialog):
cDP = service.DamagePattern.getInstance()
self.choices = cDP.getDamagePatternList()
# Remove "Uniform" and "Selected Ammo" Damage Patterns
for dp in self.choices:
if dp.name in ("Uniform", "Selected Ammo"):
self.choices.remove(dp)
# Sort the remaining list and continue on
self.choices.sort(key=lambda p: p.name)
self.ccDmgPattern = wx.Choice(self, choices=map(lambda p: p.name, self.choices))
self.ccDmgPattern.Bind(wx.EVT_CHOICE, self.patternChanged)
@@ -227,7 +232,7 @@ class DmgPatternEditorDlg (wx.Dialog):
def patternChanged(self, event=None):
p = self.getActivePattern()
if p.name == "Uniform":
if p.name == "Uniform" or p.name == "Selected Ammo":
self.restrict()
else:
self.unrestrict()

View File

@@ -345,10 +345,10 @@ class Fit(object):
try:
sDP = DamagePattern.getInstance()
dp = sDP.getDamagePattern("Ammo")
dp = sDP.getDamagePattern("Selected Ammo")
except:
dp = eos.types.DamagePattern()
dp.name = "Ammo"
dp.name = "Selected Ammo"
fit = eos.db.getFit(fitID)
for attr in ("em", "thermal", "kinetic", "explosive"):