Merge branch 'master' into copyRework

This commit is contained in:
Lucas Thode
2010-10-28 15:41:31 -05:00
8 changed files with 19 additions and 14 deletions

2
eos

Submodule eos updated: 5b7f8eaf71...fc317f1ba6

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

@@ -322,7 +322,7 @@ class HeaderPane (wx.Panel):
if self.inPopup:
return
search = self.search.GetValue()
if len(search) < 3 and len(search) >0:
if len(search) < 3:
if self.inSearch == True:
self.inSearch = False
if len(self.shipBrowser.browseHist) > 0:
@@ -1009,8 +1009,8 @@ class ShipItem(wx.Window):
mdc.DrawText(fformat %fittings if fittings >0 else fformat, textStart, ypos)
self.editPosX = rect.width - 20
self.editPosY = (rect.height - 16) / 2
self.editPosX = rect.width - self.newToggleBmp.GetWidth() -5
self.editPosY = (rect.height - self.newToggleBmp.GetHeight()) / 2
mdc.DrawBitmap(self.newToggleBmp, self.editPosX, self.editPosY, 0)
mdc.SetFont(wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL, False))

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"):

View File

@@ -18,14 +18,13 @@
#===============================================================================
import threading
import service
import eos.db
import eos.types
class PrefetchThread(threading.Thread):
def run(self):
# We're a daemon thread, as such, interpreter might get shut down while we do stuff
# Make sure we don't throw tracebacks to console
try:
eos.db.getItemsByCategory("Skill", eager=("effects", "attributes", "attributes.info.icon", "attributes.info.unit", "icon"))
eos.types.Character.setSkillList(eos.db.getItemsByCategory("Skill", eager=("effects", "attributes", "attributes.info.icon", "attributes.info.unit", "icon")))
except:
pass